/* ============================================================
   AndBe Marketing Website — style.css
   Design tokens from iOS DesignSystem/Tokens/Colors.swift
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
    /* Gradient background */
    --gradient-top: #1A0830;
    --gradient-bottom: #3D1260;

    /* Brand */
    --brand-purple: #9466ED;
    --brand-purple-light: #AD85F2;
    --brand-purple-dark: #7A4DD4;

    /* Backgrounds */
    --bg-main: #1C1C1E;
    --bg-card: #272626;

    /* Text */
    --text-primary: #FAFAFC;
    --text-secondary: #AEAEB2;
    --text-tertiary: #78787C;

    /* Accents */
    --success: #20B73B;
    --error: #FA454A;
    --gold: #FFD700;

    /* Glass effect */
    --glass-bg: rgba(39, 38, 38, 0.85);
    --glass-border: rgba(148, 102, 237, 0.15);
    --glass-blur: 0px;

    /* Typography */
    --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;
    --space-5xl: 96px;

    /* Container */
    --container-max: 1100px;
    --container-pad: 24px;
}


/* --- RESET & GLOBAL --- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: linear-gradient(135deg, var(--gradient-top) 0%, var(--gradient-bottom) 50%, #1C1040 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

a {
    color: var(--brand-purple-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text-primary);
}

img {
    display: block;
    max-width: 100%;
}


/* --- PARTICLE CANVAS --- */

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* --- FLOATING BADGE DECORATIONS (starfield zoom) --- */

.floating-badges {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.floating-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    opacity: 0;
    animation: badge-zoom linear infinite;
}

/* 8 badges fan out from center on 8 compass headings, alternating spin direction */
.fb-1 { --tx:  55vw; --ty:   0vh; --spin: 1;  animation-duration: 20s; animation-delay:   0s; }  /* → E  CW */
.fb-2 { --tx:  40vw; --ty: -40vh; --spin: -1; animation-duration: 25s; animation-delay:  -3s; }  /* ↗ NE CCW */
.fb-3 { --tx:   0vw; --ty: -55vh; --spin: 1;  animation-duration: 18s; animation-delay:  -8s; }  /* ↑ N  CW */
.fb-4 { --tx: -40vw; --ty: -40vh; --spin: -1; animation-duration: 23s; animation-delay: -13s; }  /* ↖ NW CCW */
.fb-5 { --tx: -55vw; --ty:   0vh; --spin: 1;  animation-duration: 21s; animation-delay:  -5s; }  /* ← W  CW */
.fb-6 { --tx: -40vw; --ty:  40vh; --spin: -1; animation-duration: 26s; animation-delay: -17s; }  /* ↙ SW CCW */
.fb-7 { --tx:   0vw; --ty:  55vh; --spin: 1;  animation-duration: 19s; animation-delay: -11s; }  /* ↓ S  CW */
.fb-8 { --tx:  40vw; --ty:  40vh; --spin: -1; animation-duration: 24s; animation-delay: -20s; }  /* ↘ SE CCW */

/* Hide extras on mobile */
.fb-5, .fb-6, .fb-7, .fb-8 {
    display: none;
}

@keyframes badge-zoom {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(calc(1080deg * var(--spin))) scale(0.15);
        opacity: 0;
    }
    10% {
        transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.1), calc(var(--ty) * 0.1)) rotate(calc(720deg * var(--spin))) scale(0.3);
        opacity: 0.2;
    }
    30% {
        transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.3), calc(var(--ty) * 0.3)) rotate(calc(270deg * var(--spin))) scale(0.6);
    }
    50% {
        transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.5), calc(var(--ty) * 0.5)) rotate(calc(90deg * var(--spin))) scale(1.0);
        opacity: 0.45;
    }
    70% {
        transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.7), calc(var(--ty) * 0.7)) rotate(calc(20deg * var(--spin))) scale(1.5);
    }
    85% {
        transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.85), calc(var(--ty) * 0.85)) rotate(calc(5deg * var(--spin))) scale(1.9);
        opacity: 0.25;
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(0deg) scale(2.4);
        opacity: 0;
    }
}


/* --- SECTION CONTAINER --- */

.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    position: relative;
    z-index: 2;
}


/* --- GLASS CARD --- */

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: var(--space-xl);
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(148, 102, 237, 0.3);
}


/* --- TYPOGRAPHY --- */

.section-title {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 580px;
    margin: var(--space-lg) auto 0;
    line-height: 1.65;
    text-align: center;
}


/* --- SCROLL REVEAL --- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
   SECTION 1: HERO
   ============================================================ */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 2;
    padding: var(--space-4xl) var(--container-pad) var(--space-3xl);
    text-align: center;
}

.hero-top {
    max-width: 640px;
}

.hero-logo {
    height: 138px;
    margin: 0 auto var(--space-xl);
    transform: rotate(0deg);
}

/* Phone front and center in hero */
.hero-phone {
    margin-top: var(--space-3xl);
    display: flex;
    justify-content: center;
}

.hero-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--brand-purple-light);
    margin-bottom: var(--space-lg);
}

.hero-headline {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-xl);
}

.hero-subtext {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: var(--space-3xl);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.3;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    transform: rotate(45deg);
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.3; }
    50%      { transform: rotate(45deg) translateY(8px); opacity: 0.6; }
}


/* ============================================================
   SECTION 2: FOUNDING MEMBER
   ============================================================ */

.founding {
    padding: var(--space-5xl) 0;
    position: relative;
    z-index: 2;
    text-align: center;
}

.founding-badge-glow {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-xl);
}

.founding-badge-glow::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.founding-badge-img {
    width: 140px;
    height: 140px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.15));
}

/* Spots counter */
.spots-counter {
    margin: var(--space-3xl) auto;
    text-align: center;
}

.spots-number {
    display: inline-block;
}

.spots-value {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.spots-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    font-weight: 500;
}

/* Benefits */
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
    text-align: left;
}

.benefit-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.benefit-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.benefit-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--brand-purple-light);
}

.benefit-icon svg {
    display: block;
}

.benefit-icon-img {
    width: 35px;
    height: 35px;
    margin-bottom: var(--space-md);
}


/* ============================================================
   SECTION 3: APP SHOWCASE
   ============================================================ */

.showcase {
    padding: var(--space-5xl) 0;
    position: relative;
    z-index: 2;
}

/* iPhone mockup */
.iphone-wrapper {
    position: relative;
    display: inline-block;
}

.iphone-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(148, 102, 237, 0.1) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.iphone-frame {
    width: 260px;
    background: #000;
    border-radius: 36px;
    padding: 10px;
    position: relative;
    box-shadow: 0 0 0 2px #444, 0 12px 32px rgba(0, 0, 0, 0.4);
    animation: phone-float 6s ease-in-out infinite;
    overflow: hidden;
}

.iphone-notch {
    width: 100px;
    height: 24px;
    background: #000;
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.iphone-screen {
    width: 100%;
    border-radius: 26px;
    display: block;
    margin-top: -12px;
}

.iphone-home-indicator {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 8px auto 4px;
}

@keyframes phone-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

/* Badge marquee */
.badge-marquee {
    overflow: hidden;
    margin-top: var(--space-4xl);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.badge-track {
    display: flex;
    gap: var(--space-xl);
    animation: marquee-scroll 50s linear infinite;
    width: max-content;
}

.marquee-badge {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* ============================================================
   SECTION 4: HOW IT WORKS
   ============================================================ */

.how-it-works {
    padding: var(--space-5xl) 0;
    position: relative;
    z-index: 2;
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
}

.step {
    position: relative;
}

.step-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-purple);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.step-teachers {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.step-teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    object-fit: cover;
    transition: transform 0.2s ease;
}

.step-teacher-avatar:hover {
    transform: scale(1.1);
}

.step-cta {
    display: inline-block;
    width: auto;
    margin-top: var(--space-lg);
    padding: 10px 24px;
    font-size: 14px;
    text-align: center;
    color: var(--text-primary);
    text-decoration: none;
}


/* ============================================================
   SECTION 5: STATS STRIP
   ============================================================ */

.stats-strip {
    padding: var(--space-4xl) 0;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(148, 102, 237, 0.1);
    border-bottom: 1px solid rgba(148, 102, 237, 0.1);
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3xl);
}

.stat {
    text-align: center;
    min-width: 120px;
}

/* Keep number + suffix on same line */
.stat .stat-number {
    display: inline;
}

.stat-number {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
}

.stat-number-plus {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-number-dollar {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
}

.stat-number-dollar .stat-number {
    display: inline;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: var(--space-sm);
    display: block;
}


/* ============================================================
   SECTION 6: FINAL CTA
   ============================================================ */

.final-cta {
    padding: var(--space-5xl) 0;
    position: relative;
    z-index: 2;
    text-align: center;
}


/* ============================================================
   CONTACT MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    max-width: 420px;
    width: 100%;
    padding: var(--space-2xl);
    position: relative;
    background: linear-gradient(135deg, rgba(39, 38, 38, 0.95), rgba(53, 10, 73, 0.4));
    border: 1px solid rgba(148, 102, 237, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.modal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.input-contact {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-contact::placeholder {
    color: var(--text-tertiary);
}

.input-contact:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(148, 102, 237, 0.15);
}

.input-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.contact-submit {
    margin-top: var(--space-sm);
}

.contact-success {
    text-align: center;
    padding: var(--space-lg) 0;
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    padding: var(--space-4xl) 0 var(--space-2xl);
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    height: 28px;
    margin: 0 auto var(--space-md);
    opacity: 0.6;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xl);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.6;
}


/* ============================================================
   FORMS
   ============================================================ */

.waitlist-form {
    max-width: 432px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.input-email {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-email::placeholder {
    color: var(--text-tertiary);
}

.input-email:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(148, 102, 237, 0.15);
}

.final-form {
    max-width: 432px;
    margin-top: var(--space-3xl);
}

.btn-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--success), #18942E);
    color: var(--text-primary);
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    position: relative;
}

.btn-cta:hover {
    box-shadow: 0 4px 16px rgba(32, 183, 59, 0.3);
    transform: translateY(-1px);
}

.btn-cta:active {
    transform: translateY(0);
}

.btn-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-md);
    text-align: center;
}

.form-success {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: rgba(32, 183, 59, 0.1);
    border: 1px solid rgba(32, 183, 59, 0.3);
    border-radius: 12px;
}

.form-success .success-text {
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-error {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: rgba(250, 69, 74, 0.1);
    border: 1px solid rgba(250, 69, 74, 0.3);
    border-radius: 12px;
}

.form-error .error-text {
    color: var(--error);
    font-weight: 500;
    font-size: 0.9rem;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (min-width: 600px) {
    .form-row {
        flex-direction: row;
    }

    .input-email {
        flex: 1;
    }

    .btn-cta {
        width: auto;
        white-space: nowrap;
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fb-5, .fb-6 {
        display: block;
    }

    .marquee-badge {
        width: 64px;
        height: 64px;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .fb-7, .fb-8 {
        display: block;
    }

    .iphone-frame {
        width: 280px;
    }

    .step-teacher-avatar {
        width: 56px;
        height: 56px;
    }

    .stats-row {
        flex-wrap: nowrap;
    }
}


/* ============================================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .floating-badge,
    .iphone-frame,
    .badge-track,
    .scroll-arrow {
        animation: none !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    #particles {
        display: none;
    }

    html {
        scroll-behavior: auto;
    }
}
