/* ============================================
   GLOBAL - Disable double-tap zoom
   ============================================ */
button,
a,
.nav-toggle,
.duck-3d-toggle,
.carousel-dot {
    touch-action: manipulation;
}

/* ============================================
   MOBILE MENU
   ============================================ */
/* Hide mobile menu on desktop */
@media (min-width: 769px) {
    .nav-toggle {
        display: none;
    }
}

/* Show mobile menu elements on mobile */
@media (max-width: 768px) {
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8); /* Semi-transparent dark overlay */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 998;
        pointer-events: none;
        backdrop-filter: blur(5px);
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh !important; /* Full viewport height */
        min-height: 100vh !important; /* Ensure minimum full height */
        background: #000000 !important; /* Solid black background */
        display: flex;
        flex-direction: column;
        padding: 80px 40px;
        gap: 30px;
        transition: right 0.3s ease;
        z-index: 999;
        list-style: none;
        pointer-events: none;
        overflow-y: auto; /* Allow scrolling if content is too tall */
    }

    .nav-links.active {
        right: 0;
        pointer-events: auto;
    }

    .nav-links li a {
        color: #fff;
        font-size: 1.5rem;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }

    .nav-links li a:hover {
        color: #da2668;
    }

    .nav-toggle {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 10002 !important; /* Above EVERYTHING */
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        padding: 8px 0;
        pointer-events: auto !important; /* ALWAYS clickable */
    }

    .nav-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: #fff;
        transition: all 0.3s ease;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
}

/* ============================================
   HERO SECTION WITH 4D CAROUSEL
   ============================================ */

/* 3D Interaction Toggle Button */
.duck-3d-toggle {
    position: absolute;
    bottom: 80px; /* Above the carousel navigation */
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    background: rgba(218, 38, 104, 0.1);
    border: 2px solid rgba(218, 38, 104, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    pointer-events: all;
}

.duck-3d-toggle:hover {
    background: rgba(218, 38, 104, 0.2);
    border-color: rgba(218, 38, 104, 0.6);
    transform: translateX(-50%) translateY(-2px);
}

.duck-3d-toggle.active {
    background: rgba(218, 38, 104, 0.3);
    border-color: #da2668;
    box-shadow: 0 0 20px rgba(218, 38, 104, 0.5);
}

.duck-3d-toggle .toggle-icon {
    width: 24px;
    height: 24px;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.duck-3d-toggle.active .toggle-icon {
    transform: rotate(180deg);
    color: #da2668;
}

.duck-3d-toggle .toggle-icon-path {
    stroke: currentColor;
}

.duck-3d-toggle .toggle-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.duck-3d-toggle.active .toggle-label {
    color: #da2668;
}

@media (max-width: 768px) {
    .duck-3d-toggle {
        bottom: 60px;
        padding: 10px 16px;
    }
    
    .duck-3d-toggle .toggle-icon {
        width: 20px;
        height: 20px;
    }
    
    .duck-3d-toggle .toggle-label {
        font-size: 0.8rem;
    }
}

/* 3D Instructions Popup */
.duck-3d-instructions {
    position: absolute;
    bottom: 140px; /* Above the 3D toggle button */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 140;
    background: rgba(10, 10, 15, 0.95);
    border: 2px solid rgba(218, 38, 104, 0.4);
    border-radius: 16px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(218, 38, 104, 0.3);
}

.duck-3d-instructions.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.instruction-icon {
    width: 40px;
    height: 40px;
    color: #da2668;
    flex-shrink: 0;
}

.instruction-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
}

/* Show/hide desktop vs mobile instructions */
.instruction-mobile,
.zoom-mobile {
    display: none;
}

@media (max-width: 768px) {
    .duck-3d-instructions {
        bottom: 110px;
        padding: 15px 20px;
    }
    
    .instruction-item {
        gap: 12px;
    }
    
    .instruction-icon {
        width: 32px;
        height: 32px;
    }
    
    .instruction-text {
        font-size: 0.9rem;
    }
    
    /* Swap desktop/mobile instructions */
    .instruction-desktop,
    .zoom-desktop {
        display: none;
    }
    
    .instruction-mobile,
    .zoom-mobile {
        display: block;
    }
}

/* ============================================
   WHY THE DUCK BUTTON & PANEL
   ============================================ */

/* Why the Duck Button */
.why-duck-button {
    position: absolute;
    bottom: 20px; /* Bottom right corner */
    right: 20px;
    z-index: 150;
    background: transparent;
    border: 2px solid rgba(218, 38, 104, 0.5);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(218, 38, 104, 0.8);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.why-duck-button .duck-icon {
    display: none; /* Hide icon on desktop */
}


.why-duck-button:hover {
    background: rgba(218, 38, 104, 0.1);
    border-color: rgba(218, 38, 104, 0.8);
    color: #da2668;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .why-duck-button {
        bottom: 1rem; /* Aligned with carousel dots */
        right: 15px;
        padding: 8px;
        gap: 4px;
        border-radius: 8px; /* Square with rounded corners (not circle) */
        min-width: auto;
        min-height: auto;
        justify-content: center;
    }
    
    /* Hide text on mobile, show only icon and ? */
    .why-duck-button .duck-text {
        display: none;
    }
    
    /* Show icon on mobile */
    .why-duck-button .duck-icon {
        display: block;
        width: 16px;
        height: 16px;
        filter: invert(45%) sepia(96%) saturate(2219%) hue-rotate(313deg) brightness(91%) contrast(94%); /* Pink color filter */
    }
    
}

/* Why the Duck Info Panel - Rendered in 3D Space */
.why-duck-panel {
    width: 500px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 12px;
    border: 2px solid rgba(218, 38, 104, 0.4);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    /* Will be controlled by Three.js visibility */
}

.why-duck-panel.active {
    /* Not needed - visibility controlled by Three.js */
}

.why-duck-panel .close-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: transparent;
    border: 2px solid rgba(218, 38, 104, 0.4);
    border-radius: 50%;
    color: #da2668;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: auto; /* Always clickable */
}

.why-duck-panel .close-panel:hover {
    background: rgba(218, 38, 104, 0.3);
    border-color: #da2668;
    transform: rotate(90deg);
}

.why-duck-panel h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.why-duck-panel p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 15px 0;
}

.why-duck-panel .wiki-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    background: rgba(218, 38, 104, 0.15);
    border: 2px solid rgba(218, 38, 104, 0.4);
    border-radius: 8px;
    color: #da2668;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: auto; /* Always clickable */
}

.why-duck-panel .wiki-link:hover {
    background: rgba(218, 38, 104, 0.25);
    border-color: #da2668;
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .why-duck-panel {
        width: 400px;
        padding: 30px 25px;
    }
    
    .why-duck-panel h3 {
        font-size: 1.2rem;
    }
    
    .why-duck-panel p {
        font-size: 0.75rem;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: #0a0a0f;
    overflow: hidden;
}

/* Canvas Container - Where Three.js will render */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Start disabled - allow page scroll */
    touch-action: auto; /* Allow touch scrolling by default */
}

#hero-canvas.active {
    pointer-events: auto; /* Enable when 3D mode is active */
    touch-action: none; /* Disable touch scrolling for 3D interaction */
}

/* Slide Content Overlays - CENTERED */
.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.slide-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slide-text.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.slide-superscript {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #da2668;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.slide-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.1em;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    line-height: 1.1;
}

.slide-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    margin: 0 0 1.5rem 0;
}

/* CTA Button in Hero Slides */
.slide-text .cta-primary {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #da2668 0%, #ff6b6b 100%);
    color: white;
    padding: 16px 45px;
    border: none;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 40px rgba(218, 38, 104, 0.3);
    text-decoration: none;
    display: inline-block;
    margin-top: 0.5rem;
    white-space: nowrap; /* Prevent text wrapping on all screens */
    overflow: visible; /* Ensure button can expand */
}

.slide-text .cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(218, 38, 104, 0.5);
}

/* Carousel Navigation - BOTTOM OF HERO SECTION, CLICKABLE */
.hero-section .carousel-nav {
    position: absolute !important; /* Positioned relative to hero section */
    bottom: 2rem !important; /* Bottom of hero */
    top: auto !important; /* Override any top positioning */
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100; /* Above everything */
    pointer-events: all; /* CLICKABLE - doesn't block 3D interaction */
    /* Remove any background/border styling from other carousel-nav styles */
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.hero-section .carousel-dots {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    pointer-events: all; /* Ensure dots are clickable */
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dot:hover {
    border-color: #da2668;
    transform: scale(1.2);
}

.dot.active {
    background: #da2668;
    border-color: #da2668;
    width: 32px;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .slide-title {
        font-size: 2.5rem;
    }
    
    .slide-description {
        font-size: 1rem;
        height: 2.4em; /* Fixed height for exactly 2 lines (prevents growing) */
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden; /* Hide any overflow if text is too long */
    }
    
    .slide-superscript {
        font-size: 1rem;
    }
    
    /* Make CTA button smaller and FORCE single line on mobile */
    .slide-text .cta-primary {
        font-size: 10px !important;
        padding: 10px 20px !important;
        white-space: nowrap !important; /* FORCE single line */
        letter-spacing: 0.3px !important;
        min-width: max-content !important; /* Ensure button doesn't shrink */
        width: auto !important;
    }
}

/* Extra small screens - further reduce button size if needed */
@media (max-width: 480px) {
    .slide-text .cta-primary {
        font-size: 9px !important;
        padding: 8px 16px !important;
    }
}

