/* CSS Variables & Design Tokens */
:root {
    --bg-color: #030712;
    --card-bg: rgba(7, 12, 27, 0.45);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-glow-cyan: rgba(14, 165, 233, 0.15);
    --card-glow-purple: rgba(139, 92, 246, 0.15);
    
    --color-primary: #0ea5e9;    /* Electric Blue */
    --color-accent: #00f2fe;     /* Aqua Neon */
    --color-purple: #8b5cf6;     /* Violet */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.25s ease;
}

/* Reset and Core Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    width: 100%;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Loading Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.spinner {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.spinner circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 4px;
}

.progress-ring {
    stroke: var(--color-primary);
    stroke-width: 5px;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.1s ease;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.6));
}

.loader-logo-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
    animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.loader-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-status {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.loader-bar-container {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 10px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

/* Background Canvas & Pinning */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
}

#scroll-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(3, 7, 18, 0.1) 0%, rgba(3, 7, 18, 0.8) 100%),
                linear-gradient(to bottom, rgba(3, 7, 18, 0.65) 0%, transparent 20%, transparent 80%, rgba(3, 7, 18, 0.85) 100%);
    pointer-events: none;
    z-index: 2;
}

/* HUD Header Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 22px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(3, 7, 18, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition-smooth);
}

.navbar.hidden-hud {
    transform: translateY(-100%);
    opacity: 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active-link {
    color: var(--text-main);
}

.nav-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1), width 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
    border-radius: 2px;
}

/* Mouse Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    right: 40px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.scroll-indicator.hidden-hud {
    opacity: 0;
}

.scroll-text {
    font-size: 0.72rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-muted);
}

.mouse-icon {
    width: 22px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
    opacity: 0.6;
}

.mouse-wheel {
    width: 4px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouseWheel 1.8s infinite ease-in-out;
}

@keyframes scrollMouseWheel {
    0% { top: 6px; opacity: 1; }
    50% { top: 18px; opacity: 0; }
    100% { top: 6px; opacity: 1; }
}

/* Storyline Overlay Layout (Scrollable Overlay) */
.storyline-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none; /* Let pointer events fall through to canvas/scroller */
}

.story-section {
    position: absolute;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    box-sizing: border-box;
}

/* Absolute vertical timeline placements matching video milestones */
#story-hero {
    top: 0;
}

#story-nest {
    top: 360vh;
}

#story-finder {
    top: 780vh;
}

#story-timetable {
    top: 1200vh;
}

#story-clubs {
    top: 1620vh;
}

#story-messages {
    top: 2040vh;
}

#story-hangouts {
    top: 2460vh;
}

#story-events {
    top: 2880vh;
}

#story-pulse {
    top: 3300vh;
}

#story-cta {
    top: 3520vh;
}

/* Inner card layouts */
.section-content {
    width: 100%;
    max-width: 580px;
    pointer-events: auto; /* Re-enable pointer events inside content cards */
}

/* Staggered Content Reveals inside active sections */
.glass-card > *, .text-center > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-section.active .glass-card > *, .story-section.active .text-center > * {
    opacity: 1;
    transform: translateY(0);
}

.story-section.active .glass-card > *:nth-child(1), .story-section.active .text-center > *:nth-child(1) { transition-delay: 0.15s; }
.story-section.active .glass-card > *:nth-child(2), .story-section.active .text-center > *:nth-child(2) { transition-delay: 0.3s; }
.story-section.active .glass-card > *:nth-child(3), .story-section.active .text-center > *:nth-child(3) { transition-delay: 0.45s; }
.story-section.active .glass-card > *:nth-child(4), .story-section.active .text-center > *:nth-child(4) { transition-delay: 0.6s; }
.story-section.active .glass-card > *:nth-child(5), .story-section.active .text-center > *:nth-child(5) { transition-delay: 0.75s; }

/* Text alignments */
.text-center {
    margin: 0 auto;
    text-align: center;
    max-width: 780px;
}

.left-align {
    margin-right: auto;
}

.right-align {
    margin-left: auto;
}

/* Story elements typography */
.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 30px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.18);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.story-title {
    font-family: var(--font-heading);
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-main) 40%, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.story-desc {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 300;
}

/* Glassmorphic Cards (Transparent Minimalist Style) */
.glass-card {
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
    transition: var(--transition-smooth);
}

.left-align .glass-card {
    border-left: 2px solid var(--color-primary);
    padding-left: 32px;
}

.right-align .glass-card {
    border-right: 2px solid var(--color-accent);
    padding-right: 32px;
    text-align: right;
}

/* Local gradients to improve text readability without blurring frames */
.story-section:has(.left-align) {
    background: linear-gradient(to right, rgba(3, 7, 18, 0.75) 0%, rgba(3, 7, 18, 0.35) 35%, transparent 70%);
}

.story-section:has(.right-align) {
    background: linear-gradient(to left, rgba(3, 7, 18, 0.75) 0%, rgba(3, 7, 18, 0.35) 35%, transparent 70%);
}

.story-section:has(.text-center) {
    background: radial-gradient(circle at center, rgba(3, 7, 18, 0.3) 0%, rgba(3, 7, 18, 0.75) 100%);
}

/* Color glow effect on card hover */
.glass-card::before {
    display: none;
}

.glass-card:hover {
    transform: translateY(-2px);
}

/* Card Number */
.card-num {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: block;
}

.right-align .card-num {
    color: var(--color-accent);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.2;
}

.accent-text {
    background: linear-gradient(90deg, var(--text-main) 30%, var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-desc {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Tags styles */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 24px;
}

.tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 30px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.glass-card:hover .tag {
    border-color: rgba(14, 165, 233, 0.15);
    color: var(--color-primary);
}

/* CTA Card customization */
.cta-card {
    max-width: 620px;
    margin: 0 auto;
    background: rgba(7, 12, 27, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 45px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cta-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(90deg, var(--text-main) 40%, var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.55;
}

/* Registration Form styles */
.cta-form {
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    padding: 5px;
    transition: var(--transition-fast);
}

.input-group:focus-within {
    border-color: var(--color-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.input-group input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.input-group input::placeholder {
    color: var(--text-dark);
}

.submit-btn {
    background: linear-gradient(135deg, var(--color-purple), var(--color-primary));
    color: var(--text-main);
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.submit-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
    filter: brightness(1.08);
}

.arrow-icon {
    transition: transform 0.2s ease;
}

.submit-btn:hover .arrow-icon {
    transform: translateX(3px);
}

.form-message {
    font-size: 0.88rem;
    margin-top: 10px;
    min-height: 20px;
}

.form-message.success {
    color: #10b981;
}

.form-message.error {
    color: #ef4444;
}

/* Scroll spacer timeline slider */
.scroll-spacer {
    height: 3600vh;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Responsive styles */
.hamburger-btn {
    display: none;
}

@media (max-width: 1024px) {
    .story-title {
        font-size: 3rem;
    }
    .card-title {
        font-size: 1.8rem;
    }
    .nav-links {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Hide the navbar by default when hidden-hud is active, except when menu is open */
    .navbar.hidden-hud:not(.nav-open) {
        transform: translateY(-100%);
        opacity: 0;
    }

    /* Hamburger Menu Button */
    .hamburger-btn {
        display: flex;
        background: none;
        border: none;
        cursor: pointer;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        padding: 0;
        z-index: 120;
    }

    .hamburger-bar {
        width: 100%;
        height: 2px;
        background-color: var(--text-main);
        border-radius: 2px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.3s ease;
    }

    .navbar.nav-open .hamburger-btn .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .navbar.nav-open .hamburger-btn .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .navbar.nav-open .hamburger-btn .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Nav Drawer overlay */
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(3, 7, 18, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        z-index: 110;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 40px;
    }

    .navbar.nav-open .nav-links {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.25rem;
        font-weight: 600;
        letter-spacing: 1px;
        padding: 8px 0;
    }

    .nav-indicator {
        display: none;
    }

    .navbar {
        padding: 16px 5%;
    }

    /* Floating Bottom Sheet Feature Cards for Mobile */
    .story-section {
        padding: 0 4%;
        box-sizing: border-box;
    }

    .story-section:not(#story-hero):not(#story-cta) {
        align-items: flex-end;
        padding-bottom: 50px;
    }

    .story-section:not(#story-hero):not(#story-cta) .section-content {
        max-width: 100%;
        width: 100%;
    }

    .story-section:not(#story-hero):not(#story-cta) .glass-card {
        background: rgba(7, 12, 27, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 20px;
        padding: 24px 20px;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5),
                    inset 0 1px 0 rgba(255, 255, 255, 0.05);
        text-align: left;
        margin: 0;
        width: 100%;
    }

    /* Vertical linear gradients for feature readability on mobile */
    .story-section:has(.left-align),
    .story-section:has(.right-align) {
        background: linear-gradient(to top, rgba(3, 7, 18, 0.95) 0%, rgba(3, 7, 18, 0.45) 60%, transparent 100%) !important;
    }

    .left-align .glass-card,
    .right-align .glass-card {
        border-left: none;
        border-right: none;
        padding-left: 0;
        padding-right: 0;
    }

    .story-title {
        font-size: 2.1rem;
    }

    .cta-card {
        padding: 24px;
        border-radius: 20px;
        margin: 0 10px;
        width: calc(100% - 20px);
    }

    .cta-title {
        font-size: 1.8rem;
    }

    .scroll-indicator {
        right: 20px;
        bottom: 20px;
        transform: scale(0.85);
    }

    .input-group {
        flex-direction: column;
        background: none;
        border: none;
        padding: 0;
        gap: 12px;
    }

    .input-group input {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 30px;
        padding: 12px 18px;
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .story-title {
        font-size: 1.75rem;
        letter-spacing: -0.5px;
    }
    
    .card-title {
        font-size: 1.35rem;
    }
    
    .card-desc {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .loader-title {
        font-size: 1.8rem;
    }
}

/* Footer & Signup Disclaimer Styles */
.footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    pointer-events: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-primary);
}

.footer-sep {
    color: rgba(255, 255, 255, 0.08);
}

.form-disclaimer {
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-top: 14px;
    font-family: var(--font-body);
}

.form-disclaimer a {
    color: var(--text-muted);
    text-decoration: underline;
    transition: var(--transition-fast);
}

.form-disclaimer a:hover {
    color: var(--color-purple);
}

@media (max-width: 768px) {
    .footer {
        bottom: 12px;
    }
    .footer-content {
        font-size: 0.72rem;
        gap: 6px;
        padding: 0 16px;
        text-align: center;
    }
    .footer-links {
        gap: 8px;
    }
}
