/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto Slab", serif;
    background: radial-gradient(ellipse at center, #34495e 0%, #2c3e50 50%, #1a252f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 3D Scene Container */
.scene {
    perspective: 1200px;
    perspective-origin: center center;
}

/* Main Wrap It Up Box Container */
.wrap-it-up-box {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-10deg) rotateY(-25deg) scale(var(--box-scale));
    animation: gentleFloat 8s ease-in-out infinite;
}

/* Gentle floating animation */
@keyframes gentleFloat {
    0%, 100% { transform: rotateX(-15deg) rotateY(25deg) translateY(0px) scale(var(--box-scale)); }
    50% { transform: rotateX(-15deg) rotateY(25deg) translateY(-8px) scale(var(--box-scale)); }
}

/* Box dimensions */
:root {
    --box-width: 400px;
    --box-height: 250px;
    --box-depth: 200px;
    --btn-d: 120px;  /* diameter */
    --btn-h: 18px;   /* extrusion height */

    --box-scale: 1;
}

/* Front Face of the Box */
.box-front {
    width: var(--box-width);
    height: var(--box-height);
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    border: 3px solid #ced4da;
    border-radius: 12px;
    display: flex;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 15px 40px rgba(0, 0, 0, 0.3);
}


/* Right Side Face */
.box-right {
    position: absolute;
    width: var(--box-depth);
    height: var(--box-height);
    background: linear-gradient(145deg, #dee2e6 0%, #ced4da 50%, #adb5bd 100%);
    border: 3px solid #adb5bd;
    border-radius: 0 12px 12px 0;
    transform-origin: left;
    transform: rotateY(90deg);
    left: var(--box-width);
    top: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Left Side Face */
.box-left {
    position: absolute;
    width: var(--box-depth);
    height: var(--box-height);
    background: linear-gradient(145deg, #ced4da 0%, #adb5bd 50%, #95a5a6 100%);
    border: 3px solid #95a5a6;
    border-radius: 12px 0 0 12px;
    transform-origin: right;
    transform: rotateY(-90deg);
    right: var(--box-width);
    top: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Speaker Section (Left side of front face) */
.speaker-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.speaker {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, #2c3e50 0%, #1a252f 70%);
    border-radius: 50%;
    border: 4px solid #34495e;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 -2px 4px rgba(255, 255, 255, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Speaker Grille Pattern */
.speaker-grille {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-image: 
        radial-gradient(circle at 25% 25%, transparent 2px, #1a252f 3px),
        radial-gradient(circle at 75% 25%, transparent 2px, #1a252f 3px),
        radial-gradient(circle at 25% 75%, transparent 2px, #1a252f 3px),
        radial-gradient(circle at 75% 75%, transparent 2px, #1a252f 3px),
        radial-gradient(circle at 50% 50%, transparent 3px, #1a252f 4px);
    background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 15px 15px;
    background-position: 0 0, 0 0, 0 0, 0 0, 7px 7px;
}

/* Text Section (Right side of front face) */
.text-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.text-panel {
    width: 160px;
    height: 160px;
    background: linear-gradient(145deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    border: 3px inset #dee2e6;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 -2px 4px rgba(255, 255, 255, 0.4);
}

.wrap-text {
    font-size: 32px;
    font-weight: bold;
    color: #495057;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.8),
        0 0 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}


/* TOP FACE — make it use the vars and sit exactly on the front's top edge */
.box-top {
  position: absolute;
  width: var(--box-width);       /* was 400px */
  height: var(--box-depth);      /* was 200px */
  top: calc(-1 * var(--box-depth));  /* was -var(--box-height) */
  left: 0;
  z-index: 20;
  transform-origin: bottom;
  transform: rotateX(90deg) translateZ(1px); /* tiny nudge to avoid z-fighting */
  background: linear-gradient(135deg, #f1f3f4, #e9ecef);
  border: 2px solid #ced4da;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

.red-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(14px);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff5b5b, #cc0000 80%);
  border: 3px solid #7a0000;
  box-shadow:
    inset -6px -6px 12px rgba(0,0,0,0.4),   /* inner shadow (depth) */
    inset 6px 6px 12px rgba(255,255,255,0.3), /* inner highlight */
    0 6px 12px rgba(0,0,0,0.6);              /* outer shadow (lift) */
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* pressed state */
.red-button:active {
  transform: translate(-50%, -50%) translateZ(10px);
  box-shadow:
    inset -3px -3px 6px rgba(0,0,0,0.5),
    inset 3px 3px 6px rgba(255,255,255,0.2),
    0 2px 4px rgba(0,0,0,0.5);
}

.red-button:active .button-top,
.red-button.pressed .button-top {
  transform: translateZ(calc(var(--btn-h) - 4px));
}

/* Button cylinder base (metallic collar) */
.red-button::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, #bdc3c7, #95a5a6);
    border: 2px solid #7f8c8d;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Button top (red dome) */
.button-top {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 30%, #ff6b6b, #e74c3c, #c0392b);
    border: 3px solid #a93226;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

/* Button highlight for 3D effect */
.button-top::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 50%;
    z-index: 3;
}

.red-button:hover {
    transform: translate(-50%, -50%) translateZ(18px) scale(1.05);
}

.red-button:hover .button-top {
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.4);
}

.red-button:active, .red-button.pressed {
    transform: translate(-50%, -50%) translateZ(12px) scale(0.95);
}

.red-button:active .button-top, .red-button.pressed .button-top {
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Flashing Text Animation (1 second cycle) */
.wrap-text.flash {
    animation: flashText 1s linear infinite;
}

@keyframes flashText {
    0%, 50% { 
        color: #e74c3c; 
        text-shadow: 
            0 0 10px #e74c3c, 
            0 0 20px #e74c3c,
            1px 1px 2px rgba(255, 255, 255, 0.8);
    }
    51%, 100% { 
        color: #495057; 
        text-shadow: 
            1px 1px 2px rgba(255, 255, 255, 0.8),
            0 0 1px rgba(0, 0, 0, 0.1);
    }
}

/* Screen shake effect during activation */
.scene.shake {
    animation: screenShake 0.1s linear infinite;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --box-width: 350px;
        --box-height: 220px;
        --box-depth: 160px;
    }
    
    .speaker {
        width: 120px;
        height: 120px;
    }
    
    .speaker-grille {
        width: 85px;
        height: 85px;
    }
    
    .text-panel {
        width: 140px;
        height: 140px;
    }
    
    .wrap-text {
        font-size: 28px;
    }
    
    .red-button {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    :root {
        --box-width: 300px;
        --box-height: 180px;
        --box-depth: 140px;
    }
    
    .speaker {
        width: 100px;
        height: 100px;
    }
    
    .speaker-grille {
        width: 70px;
        height: 70px;
    }
    
    .text-panel {
        width: 120px;
        height: 120px;
    }
    
    .wrap-text {
        font-size: 24px;
    }
    
    .red-button {
        width: 50px;
        height: 50px;
    }
    
    .speaker-section, .text-section {
        padding: 20px;
    }
}

/* Focus styles for accessibility */
.red-button:focus {
    outline: 3px solid #74b9ff;
    outline-offset: 3px;
}

/* Uniformly scale the whole box on larger viewports (no stretching) */
@media (min-width: 1024px) {
  :root { --box-scale: 1.2; }
}
@media (min-width: 1440px) {
  :root { --box-scale: 1.5; }
}

/* Footer Styles */
.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.7);
  color: #f1f1f1;
  text-align: center;
  padding: 16px 10px;
  z-index: 9999;
}

.footer-icons {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.footer-icons a,
.footer-icons button {
  color: #f1f1f1;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.footer-icons a:hover,
.footer-icons button:hover {
  color: #e74c3c;
}

.footer-icons svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

.footer-credit {
  font-size: 13px;
  opacity: 0.8;
}

/* About Section */
.about-section {
  max-width: 800px;
  margin: 80px auto;
  padding: 40px 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #f1f1f1;
  text-align: center;
  line-height: 1.6;
}

.about-section h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: #e74c3c;
}

.about-section p {
  font-size: 18px;
  margin-bottom: 12px;
}


/* --- About Modal (non-intrusive overlay) --- */
.about-link {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  color: #f1f1f1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.about-link:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }


.about-modal {
  border: none;
  padding: 0;
  background: transparent;
}
.about-modal::backdrop {
  background: rgba(0,0,0,0.55);
}

.about-card {
  width: min(720px, 92vw);
  max-height: min(80vh, 800px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  color: #f1f1f1;
}

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.about-header h2 {
  margin: 0;
  font-size: 22px;
  color: #e74c3c;
}
.about-close {
  appearance: none;
  background: transparent;
  border: none;
  color: #f1f1f1;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.about-close:hover { color: #ffffff; }

.about-body {
  padding: 20px;
  line-height: 1.6;
  font-size: 16px;
}
.about-body p { margin-bottom: 12px; }

.video-link {
  color: #e74c3c;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(231, 76, 60, 0.3);
  transition: border-bottom-color 0.2s ease;
}
.video-link:hover {
  border-bottom-color: #e74c3c;
}



/* Center the modal */
.about-modal {
  border: none;
  padding: 0;
  background: transparent;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
