/* ═══════════════════════════════════════════════════════════
   Lumin — Design System & Global Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    /* Color palette */
    --color-white:        #FFFFFF;
    --color-bg:           #FFFFFF;
    --color-bg-secondary: #F8F9FA;
    --color-navy:         #0A1F44;
    --color-slate:        #475569;
    --color-blue:         #00A3FF;
    --color-blue-soft:    rgba(0, 163, 255, 0.12);
    --color-glass:        rgba(255, 255, 255, 0.72);
    --color-glass-border: rgba(10, 31, 68, 0.06);
    --color-glow:         #F0F4F8;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* Sizing */
    --nav-height: 64px;

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto; /* GSAP controls scroll */
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-slate);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 0;
}

body.loaded {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

a {
    text-decoration: none;
    color: inherit;
}

ul { list-style: none; }

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 40px;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(10, 31, 68, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    pointer-events: none;
}

.nav--static {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.nav--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 60px;
    position: relative;
    overflow: visible;
}

.nav__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
    flex-shrink: 0;
}

.nav__logo-img {
    height: 52px;
    width: auto;
    display: block;
}

.nav__links {
    display: flex;
    gap: 36px;
    flex: 1;
    justify-content: center;
}

.nav__links a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-slate);
    letter-spacing: 0.01em;
    transition: color 0.3s var(--ease-out);
    position: relative;
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-blue);
    transition: width 0.3s var(--ease-out);
}

.nav__links a:hover,
.nav__links a.active {
    color: var(--color-navy);
}

.nav__links a.active {
    font-weight: 800;
}

.nav__links a:hover::after,
.nav__links a.active::after {
    width: 100%;
}

.nav__cta {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--color-blue), #0077CC);
    color: var(--color-white);
    letter-spacing: 0.01em;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    box-shadow: 0 2px 12px rgba(0, 163, 255, 0.2);
    margin-left: auto;
}

.nav__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(0, 163, 255, 0.35);
}

.nav__cta--mobile {
    display: none;
}

/* ── Hamburger Toggle ──────────────────────────────────── */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    position: relative;
}

.nav__toggle:focus {
    outline: none;
}

.nav__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-navy);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
    transform-origin: center;
}

.nav__toggle.active .nav__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active .nav__toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav__toggle.active .nav__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════════
   CANVAS
   ═══════════════════════════════════════════════════════════ */
#hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    background: var(--color-bg);
    will-change: transform;
    transform: translateZ(0);
}

/* ═══════════════════════════════════════════════════════════
   SCROLL SPACER
   ═══════════════════════════════════════════════════════════ */
#scroll-spacer {
    position: relative;
    width: 100%;
    height: 500vh;
    z-index: 0;
}

/* Reduce scroll distance on mobile for better performance */
@media (max-width: 768px) {
    #scroll-spacer {
        height: 400vh;
    }
}

/* Ensure footer appears after scroll content */
body {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════
   TEXT OVERLAYS
   ═══════════════════════════════════════════════════════════ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    will-change: opacity;
    transform: translateZ(0);
}

.overlay__glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-glow) 0%, transparent 70%);
    opacity: 0.7;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}

.overlay--hero .overlay__glow {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
}

.overlay__glow--left {
    top: 50%;
    left: -5%;
    transform: translateY(-50%);
}

.overlay__glow--right {
    top: 50%;
    right: -5%;
    left: auto;
    transform: translateY(-50%);
}

.overlay--cta .overlay__glow {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 900px;
}

.overlay__content {
    max-width: 560px;
    padding: 0 60px;
}

.overlay__content--center {
    margin: 0 auto;
    text-align: center;
    max-width: 700px;
}

.overlay__content--left {
    margin-left: 8%;
}

.overlay__content--right {
    margin-left: auto;
    margin-right: 8%;
}

/* ── Eyebrow ────────────────────────────────────────────── */
.overlay__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-blue);
    margin-bottom: 16px;
}

/* ── Headlines ──────────────────────────────────────────── */
.overlay__headline {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--color-navy);
    margin-bottom: 20px;
}

.overlay__headline--hero {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.0;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--color-navy) 60%, var(--color-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay__headline--cta {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 32px;
}

/* ── Subheadline ────────────────────────────────────────── */
.overlay__subheadline {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 500;
    color: var(--color-navy);
    opacity: 0.8;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

/* ── Body ───────────────────────────────────────────────── */
.overlay__body {
    font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
    font-weight: 400;
    color: var(--color-slate);
    line-height: 1.7;
    max-width: 480px;
}

.overlay__content--center .overlay__body {
    margin: 0 auto;
    max-width: 520px;
}

/* ── Actions ────────────────────────────────────────────── */
.overlay__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: all;
}

/* ── Flashcards ─────────────────────────────────────────── */
.flashcard {
    display: block;
    background: var(--color-white);
    border-radius: 12px;
    padding: 32px;
    max-width: 100%;
    text-decoration: none;
    box-shadow: 
        0 4px 20px rgba(10, 31, 68, 0.06),
        0 0 0 1px var(--color-glass-border);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    pointer-events: all;
}

.flashcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-blue), #0077CC);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s var(--ease-out);
}

.flashcard:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 32px rgba(10, 31, 68, 0.1),
        0 0 0 1px var(--color-blue);
}

.flashcard:hover::before {
    transform: scaleY(1);
}

.flashcard .overlay__eyebrow {
    margin-bottom: 12px;
}

.flashcard .overlay__headline {
    margin-bottom: 12px;
    color: var(--color-navy);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

.flashcard .overlay__body {
    color: var(--color-slate);
    margin-bottom: 0;
    padding-right: 40px;
}

.flashcard__arrow {
    position: absolute;
    bottom: 28px;
    right: 32px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-blue);
    opacity: 0.6;
    transform: translateX(0);
    transition: all 0.4s var(--ease-out);
}

.flashcard:hover .flashcard__arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    transition: all 0.35s var(--ease-out);
}

.btn--primary {
    font-size: 1rem;
    padding: 16px 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-blue), #0077CC);
    color: var(--color-white);
    box-shadow:
        0 4px 20px rgba(0, 163, 255, 0.3),
        0 0 0 0 rgba(0, 163, 255, 0);
    letter-spacing: 0.01em;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(0, 163, 255, 0.4),
        0 0 0 4px rgba(0, 163, 255, 0.08);
}

.btn--ghost {
    font-size: 0.9375rem;
    padding: 8px 4px;
    color: var(--color-slate);
    background: none;
    border-bottom: 1px solid transparent;
}

.btn--ghost:hover {
    color: var(--color-blue);
    border-bottom-color: var(--color-blue);
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════ */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s var(--ease-out);
}

.loader--hidden {
    opacity: 0;
    pointer-events: none;
}

.loader__logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--color-navy);
    margin-bottom: 32px;
}

.loader__bar-track {
    width: 200px;
    height: 3px;
    background: var(--color-bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.loader__bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-blue), #0077CC);
    border-radius: 2px;
    transition: width 0.15s linear;
}

.loader__percent {
    margin-top: 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-slate);
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
    position: relative;
    z-index: 100;
    background: var(--color-navy);
    color: var(--color-white);
    padding: 60px 40px 40px;
    margin-top: 80px;
}

.footer__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.footer__content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 48px;
}

.footer__brand {
    display: flex;
    flex-direction: column;
}

.footer__logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 16px;
}

.footer__tagline {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 300px;
}

.footer__section-title {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 20px;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer__link {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s var(--ease-out);
}

.footer__link:hover {
    color: var(--color-white);
}

.footer__bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer__copyright {
    display: flex;
    gap: 4px;
}

.footer__social {
    display: flex;
    gap: 20px;
}

.footer__social-link {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s var(--ease-out);
}

.footer__social-link:hover {
    color: var(--color-white);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav__inner {
        gap: 40px;
    }
    
    .nav__links {
        gap: 24px;
    }
    
    .nav__links a {
        font-size: 0.75rem;
    }
}

@media (max-width: 900px) {
    .nav__toggle { 
        display: flex;
        order: 3;
    }
    
    .nav {
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    
    .nav__inner {
        gap: 12px;
        justify-content: space-between;
        flex-wrap: nowrap;
        padding: 0 4px 0 4px;
    }
    
    .nav__brand {
        margin-right: 0;
        order: 1;
    }
    
    .nav__cta--desktop {
        display: none;
        order: 2;
    }

    .nav__links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--color-glass-border);
        padding: 16px 24px 24px;
        gap: 0;
        box-shadow: 0 12px 32px rgba(10, 31, 68, 0.08);
        order: 4;
    }

    .nav__links.nav__links--open {
        display: flex;
    }

    .nav__links li {
        width: 100%;
    }

    .nav__links a {
        display: block;
        padding: 14px 0;
        font-size: 0.9375rem;
        border-bottom: 1px solid rgba(10, 31, 68, 0.06);
    }

    .nav__links li:last-child a {
        border-bottom: none;
        padding: 14px 24px;
        margin-top: 12px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--color-blue), #0077CC);
        color: var(--color-white);
        box-shadow: 0 2px 12px rgba(0, 163, 255, 0.2);
        text-align: center;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .nav__cta--desktop {
        display: none;
    }

    .nav__cta--mobile {
        display: block;
    }

    .nav { 
        padding: 0 16px 0 4px;
    }
    
    .nav__inner {
        padding: 0 0 0 0;
    }
    
    .nav__logo-img {
        height: 44px;
    }

    .overlay__content {
        padding: 0 28px;
        max-width: 100%;
    }

    .overlay__content--left,
    .overlay__content--right {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .overlay__body { max-width: 100%; }

    .overlay__glow--left,
    .overlay__glow--right {
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
    }
    
    .overlay__actions {
        width: 100%;
    }

    /* Scale down glow on mobile */
    .overlay__glow {
        width: 400px;
        height: 400px;
    }

    .overlay--hero .overlay__glow {
        width: 500px;
        height: 500px;
    }

    .overlay--cta .overlay__glow {
        width: 600px;
        height: 600px;
    }
    
    /* Footer responsive */
    .footer__content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    :root {
        --nav-height: 56px;
    }
    
    .nav {
        padding: 0 12px 0 4px;
        background: rgba(255, 255, 255, 0.7);
    }
    
    .nav__inner {
        padding: 0 2px 0 0;
    }
    
    .nav__logo-img {
        height: 38px;
    }
    
    .overlay__content {
        padding: 0 20px;
    }
    
    .overlay__headline {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
    }
    
    .overlay__headline--hero {
        font-size: clamp(2.25rem, 10vw, 3.5rem);
    }
    
    .overlay__subheadline {
        font-size: 1.125rem;
    }
    
    .overlay__body {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
    
    .btn--primary {
        padding: 14px 28px;
        font-size: 0.9375rem;
        width: 100%;
    }
    
    .btn--ghost {
        font-size: 0.875rem;
        width: 100%;
        text-align: center;
    }
    
    .flashcard {
        padding: 24px;
        padding-bottom: 60px;
    }
    
    .flashcard .overlay__body {
        padding-right: 0;
    }
    
    .flashcard__arrow {
        bottom: 20px;
        right: 24px;
        font-size: 1.25rem;
    }

    .overlay__glow {
        width: 300px;
        height: 300px;
    }

    .overlay--hero .overlay__glow {
        width: 400px;
        height: 400px;
    }

    .overlay__actions {
        gap: 12px;
    }
    
    /* Footer responsive */
    .footer {
        padding: 40px 20px 32px;
        margin-top: 60px;
    }
    
    .footer__content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer__bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Navigation fixes for very small screens */
    .nav {
        padding: 0 8px 0 2px;
    }
    
    .nav__inner {
        padding: 0;
        gap: 8px;
    }
    
    .nav__logo-img {
        height: 34px;
    }
    
    .nav__toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
        flex-shrink: 0;
    }
    
    .nav__toggle-bar {
        width: 20px;
        height: 2px;
    }
    
    /* Overlay and content adjustments */
    .overlay__headline {
        font-size: 1.75rem;
    }
    
    .overlay__headline--hero {
        font-size: 2.25rem;
    }

    .overlay__content {
        padding: 0 16px;
    }

    .flashcard {
        padding: 20px;
        padding-bottom: 56px;
    }

    .flashcard .overlay__headline {
        font-size: 1.5rem;
    }
}
