/* =========================================================================
   EVidey — marketing site design system
   Tokens transcribed from the app's theme/ module (palette.ts, tokens.ts,
   typography.ts, elevation.ts, motion.ts) so the site and the app are the
   same product. Legacy custom-property names (--bg-card, --font-display,
   --text-primary, --font-body, --text-secondary, --accent-green) are kept
   as aliases because privacy.html's Termly-generated policy block reads
   them directly — do not rename those five without updating that file.
   ========================================================================= */

@font-face { font-family: 'Geist'; font-weight: 400; font-style: normal; src: url('../assets/fonts/Geist-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geist'; font-weight: 500; font-style: normal; src: url('../assets/fonts/Geist-Medium.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geist'; font-weight: 600; font-style: normal; src: url('../assets/fonts/Geist-SemiBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geist'; font-weight: 700; font-style: normal; src: url('../assets/fonts/Geist-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-style: normal; src: url('../assets/fonts/GeistMono-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geist Mono'; font-weight: 500; font-style: normal; src: url('../assets/fonts/GeistMono-Medium.ttf') format('truetype'); font-display: swap; }

:root {
    /* ---- Color — light (default). Warm-neutral, zero blue. ---- */
    --bg: #FAFAF9;
    --bg-dark: #FAFAF9;              /* legacy alias */
    --surface: #FFFFFF;
    --bg-card: #FFFFFF;              /* legacy alias — read by privacy.html */
    --surface-sunken: #F2F2EF;
    --text-primary: #1A1A18;
    --text-secondary: #6B6B66;
    --text-tertiary: #9E9E98;
    --sep: rgba(0,0,0,.08);
    --sep-strong: rgba(0,0,0,.14);

    --accent-green: #0B7A4B;
    --accent-green-pressed: #096540;
    --on-accent: #FFFFFF;
    --accent-amber: #B45309;
    --accent-red: #C0322C;
    --accent-soft: rgba(11,122,75,.08);
    --accent-softer: rgba(11,122,75,.04);
    --accent-border: rgba(11,122,75,.22);

    --shadow-rgb: 15,26,20;

    /* ---- Type — Geist + Geist Mono ---- */
    --font-display: 'Geist', system-ui, sans-serif;  /* legacy alias */
    --font-body: 'Geist', system-ui, sans-serif;      /* legacy alias */
    --font-mono: 'Geist Mono', ui-monospace, monospace;

    /* ---- Spacing — theme/tokens.ts space[0..8] ---- */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
    --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px; --sp-10: 80px;

    /* ---- Radius — theme/tokens.ts radius ---- */
    --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

    /* ---- Motion — see skills/animate + skills/apple.md ---- */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    --dur-press: 160ms;
    --dur-fast: 200ms;
    --dur-base: 300ms;
    --dur-slow: 500ms;

    --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B0B0A;
        --bg-dark: #0B0B0A;
        --surface: #161615;
        --bg-card: #161615;
        --surface-sunken: #111110;
        --text-primary: #F5F5F3;
        --text-secondary: #A1A19B;
        --text-tertiary: #6E6E68;
        --sep: rgba(255,255,255,.09);
        --sep-strong: rgba(255,255,255,.16);

        --accent-green: #3ADE8C;
        --accent-green-pressed: #31C67B;
        --on-accent: #06251A;
        --accent-amber: #F2B544;
        --accent-red: #FF6B60;
        --accent-soft: rgba(58,222,140,.12);
        --accent-softer: rgba(58,222,140,.06);
        --accent-border: rgba(58,222,140,.28);
    }
}
:root[data-theme="dark"] {
    --bg: #0B0B0A;
    --bg-dark: #0B0B0A;
    --surface: #161615;
    --bg-card: #161615;
    --surface-sunken: #111110;
    --text-primary: #F5F5F3;
    --text-secondary: #A1A19B;
    --text-tertiary: #6E6E68;
    --sep: rgba(255,255,255,.09);
    --sep-strong: rgba(255,255,255,.16);

    --accent-green: #3ADE8C;
    --accent-green-pressed: #31C67B;
    --on-accent: #06251A;
    --accent-amber: #F2B544;
    --accent-red: #FF6B60;
    --accent-soft: rgba(58,222,140,.12);
    --accent-softer: rgba(58,222,140,.06);
    --accent-border: rgba(58,222,140,.28);
}

/* =========================================================================
   Reset & base
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-primary); font-weight: 700; text-wrap: balance; }

h1 { font-size: clamp(2.5rem, 3.2vw + 1.8rem, 4.75rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: var(--sp-5); }
h2 { font-size: clamp(2rem, 1.6vw + 1.6rem, 3rem); line-height: 1.1; letter-spacing: -0.025em; margin-bottom: var(--sp-3); }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--sp-2); }
p { color: var(--text-secondary); font-size: 1.0625rem; text-wrap: pretty; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-green);
    margin-bottom: var(--sp-4);
}
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); flex: none; }

.text-gradient {
    background: linear-gradient(100deg, var(--accent-green) 10%, #4FBF8F 60%, var(--accent-green) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

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

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================================================
   Layout
   ========================================================================= */
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-6); position: relative; z-index: 2; }

.section { padding: var(--sp-10) 0; position: relative; }

#home, #how-it-works, #features, #showcase, #download { scroll-margin-top: var(--nav-h); }
.bg-slate { background-color: var(--surface-sunken); }

.section-subtitle { max-width: 560px; margin: 0 auto var(--sp-8) auto; font-size: 1.125rem; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    font-family: var(--font-body); font-weight: 600; font-size: 1rem;
    text-decoration: none; border-radius: var(--r-md);
    border: none; cursor: pointer;
    transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background-color: var(--accent-green);
    color: var(--on-accent);
    padding: 0.95rem 1.75rem;
    box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.08), 0 8px 20px color-mix(in srgb, var(--accent-green) 22%, transparent);
}
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover { background-color: var(--accent-green-pressed); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.1), 0 10px 26px color-mix(in srgb, var(--accent-green) 30%, transparent); }
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--sep-strong);
    padding: 0.95rem 1.75rem;
}
@media (hover: hover) and (pointer: fine) {
    .btn-secondary:hover { border-color: var(--accent-green); color: var(--accent-green); }
}

.btn-small { padding: 0.55rem 1.15rem; font-size: 0.875rem; }
.btn-large { padding: 1.05rem 2.1rem; font-size: 1.0625rem; }

/* =========================================================================
   Navbar — translucent material, per apple.md §12
   ========================================================================= */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.navbar[data-scrolled="true"] { border-bottom-color: var(--sep); }

.nav-container {
    max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-6); height: 100%;
    display: flex; justify-content: space-between; align-items: center; gap: var(--sp-5);
}

.logo { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 0.55rem; color: var(--text-primary); text-decoration: none; letter-spacing: -0.01em; }
.logo-mark {
    width: 28px; height: 28px; border-radius: 8px; background: var(--accent-green);
    display: flex; align-items: center; justify-content: center; flex: none;
}
.logo-mark svg { width: 15px; height: 15px; }

.nav-links { display: flex; gap: var(--sp-7); align-items: center; }

.nav-links a:not(.btn) {
    color: var(--text-secondary); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
    transition: color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .nav-links a:not(.btn):hover { color: var(--text-primary); }
}

.theme-toggle {
    width: 34px; height: 34px; border-radius: var(--r-full); border: 1px solid var(--sep-strong);
    background: var(--surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex: none; transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

@media (max-width: 820px) {
    .nav-links a:not(.btn) { display: none; }
    .nav-links { gap: var(--sp-4); }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
    position: relative;
    padding-top: calc(var(--nav-h) + var(--sp-9));
    padding-bottom: var(--sp-9);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-9);
    align-items: center;
}
@media (min-width: 960px) {
    .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-8); }
}

.hero-text p { font-size: 1.1875rem; max-width: 46ch; margin-bottom: var(--sp-7); }

.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.hero-cta-note { font-size: 0.8125rem; color: var(--text-tertiary); display: block; margin-top: var(--sp-3); }
.hero-cta-link {
    text-decoration: none; font-weight: 500; width: fit-content;
    transition: color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .hero-cta-link:hover { color: var(--accent-green); }
}

/* A visible-but-inert button — communicates a state, not an action */
.btn-disabled {
    cursor: default;
    border-style: dashed;
    color: var(--text-tertiary);
}
@media (hover: hover) and (pointer: fine) {
    .btn-disabled:hover { border-color: var(--sep-strong); color: var(--text-tertiary); }
}

.cta-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-4); }

/* Feature chip strip beneath the hero copy */
.spec-strip { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.spec-chip {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    border: 1px solid var(--sep); border-radius: var(--r-full);
    padding: 0.5rem 0.9rem 0.5rem 0.6rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary);
}
.spec-chip svg { width: 15px; height: 15px; color: var(--accent-green); flex: none; }

/* Hero visual: phone mockup + route motif */
.hero-visual { position: relative; display: flex; justify-content: center; }

.route-motif {
    position: absolute;
    inset: -8% -12%;
    z-index: 0;
    pointer-events: none;
}
.route-motif svg { width: 100%; height: 100%; overflow: visible; }
.route-motif .route-dash {
    fill: none; stroke: var(--sep-strong); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 10;
}
.route-motif .route-line {
    fill: none; stroke: var(--accent-green); stroke-width: 2.5; stroke-linecap: round;
    stroke-dasharray: var(--route-len, 600); stroke-dashoffset: var(--route-len, 600);
}
.route-motif[data-drawn="true"] .route-line {
    transition: stroke-dashoffset 1.4s var(--ease-in-out);
    stroke-dashoffset: 0;
}
.route-motif .route-pin { opacity: 0; transform: scale(0.5); transform-box: fill-box; transform-origin: center; }
.route-motif .route-pin:nth-of-type(1) { --pin-delay: 0.25s; }
.route-motif .route-pin:nth-of-type(2) { --pin-delay: 0.85s; }
.route-motif .route-pin:nth-of-type(3) { --pin-delay: 1.5s; }
.route-motif[data-drawn="true"] .route-pin {
    transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
    transition-delay: var(--pin-delay, 0.6s);
    opacity: 1; transform: scale(1);
}

.phone-mockup {
    position: relative; z-index: 1;
    width: min(280px, 72vw); aspect-ratio: 280 / 580;
    border: 10px solid var(--text-primary);
    border-radius: 42px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(var(--shadow-rgb), 0.35), 0 0 0 1px var(--sep);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .phone-mockup { border-color: #3A3A36; }
}
:root[data-theme="dark"] .phone-mockup { border-color: #3A3A36; }

.phone-screen-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =========================================================================
   How it works
   ========================================================================= */
.steps-grid { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-8); }

.step-card {
    display: grid; grid-template-columns: auto 1fr; gap: var(--sp-6); align-items: flex-start;
    background: var(--surface); padding: var(--sp-6); border-radius: var(--r-lg);
    border: 1px solid var(--sep);
    transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .step-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(var(--shadow-rgb), 0.18); }
}
/* Shadows read as nearly invisible against a near-black page — dark mode gets
   its lift from the border and surface alone, same reasoning as the app's
   own elevation recipe (theme/elevation.ts). */
@media (hover: hover) and (pointer: fine) and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .step-card:hover { box-shadow: none; background: var(--surface-sunken); }
}
:root[data-theme="dark"] .step-card:hover { box-shadow: none; background: var(--surface-sunken); }

.step-number { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; color: var(--text-tertiary); line-height: 1; padding-top: 0.15rem; }
.step-content h3 { margin-bottom: var(--sp-1); }
.step-content p { font-size: 1rem; }

/* =========================================================================
   Features
   ========================================================================= */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-5); margin-top: var(--sp-8); }

.feature-card {
    background: var(--surface); padding: var(--sp-7) var(--sp-6); border-radius: var(--r-lg);
    border: 1px solid var(--sep);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px -16px rgba(var(--shadow-rgb), 0.22); border-color: var(--accent-border); }
}
@media (hover: hover) and (pointer: fine) and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .feature-card:hover { box-shadow: none; background: var(--surface-sunken); }
}
:root[data-theme="dark"] .feature-card:hover { box-shadow: none; background: var(--surface-sunken); }

.feature-icon {
    width: 46px; height: 46px; border-radius: var(--r-md); background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-5);
}
.feature-icon svg { width: 22px; height: 22px; color: var(--accent-green); }
.feature-card p { font-size: 0.975rem; }

/* =========================================================================
   Showcase — large media block
   ========================================================================= */
.showcase { display: grid; grid-template-columns: 1fr; gap: var(--sp-8); align-items: center; }
@media (min-width: 900px) { .showcase { grid-template-columns: 0.85fr 1.15fr; } }

/* Sized to match .phone-mockup exactly, not stretched to fill the column —
   a soft backdrop panel grounds it without inflating the device itself. */
.showcase-frame {
    display: flex; justify-content: center; align-items: center;
    padding: var(--sp-8) var(--sp-6);
    border-radius: var(--r-xl); border: 1px solid var(--sep);
    background: var(--surface-sunken);
}

.showcase-copy p { font-size: 1.0625rem; margin-bottom: var(--sp-5); max-width: 42ch; }
.showcase-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-6); }
.showcase-list li { list-style: none; display: flex; gap: var(--sp-3); align-items: flex-start; font-size: 0.975rem; color: var(--text-secondary); }
.showcase-list svg { width: 18px; height: 18px; color: var(--accent-green); flex: none; margin-top: 0.15rem; }

/* =========================================================================
   CTA & footer
   ========================================================================= */
.cta-box {
    background: linear-gradient(160deg, var(--surface) 0%, var(--accent-softer) 100%);
    border: 1px solid var(--accent-border);
    border-radius: var(--r-xl);
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
}
.cta-box h2 { margin-bottom: var(--sp-3); }
.cta-box p { margin: 0 auto var(--sp-7) auto; max-width: 46ch; }
.cta-box .hero-cta-note { margin: var(--sp-4) auto 0 auto; }

.footer { border-top: 1px solid var(--sep); padding: var(--sp-9) 0 var(--sp-6) 0; background: var(--bg); }

.footer-content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-8); margin-bottom: var(--sp-9); }

.footer-brand p { margin-top: var(--sp-3); max-width: 260px; font-size: 0.9375rem; }
.footer-links { display: flex; gap: var(--sp-9); flex-wrap: wrap; }
.link-group { display: flex; flex-direction: column; gap: var(--sp-3); }
.link-group h4 { font-family: var(--font-body); color: var(--text-primary); font-size: 0.875rem; font-weight: 600; }
.link-group a { color: var(--text-secondary); text-decoration: none; font-size: 0.9375rem; transition: color var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
    .link-group a:hover { color: var(--accent-green); }
}
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); font-size: 0.8125rem; color: var(--text-tertiary); border-top: 1px solid var(--sep); padding-top: var(--sp-6); }

/* =========================================================================
   Reveal on scroll — fade + rise, per animate skill (marketing tier)
   ========================================================================= */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal-on-scroll.is-revealed { opacity: 1; transform: translateY(0); }

.delay-1 { transition-delay: 60ms; }
.delay-2 { transition-delay: 120ms; }
.delay-3 { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, ::before, ::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
    .reveal-on-scroll { opacity: 1; transform: none; }
    .route-motif[data-drawn="true"] .route-line { stroke-dashoffset: 0; transition: none; }
    .route-motif[data-drawn="true"] .route-pin { opacity: 1; transform: none; transition: none; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 640px) {
    .container { padding: 0 var(--sp-5); }
    .section { padding: var(--sp-9) 0; }
    .hero { padding-top: calc(var(--nav-h) + var(--sp-8)); padding-bottom: var(--sp-8); }
    .step-card { grid-template-columns: 1fr; gap: var(--sp-3); }
    .footer-content { gap: var(--sp-7); }
    .footer-links { gap: var(--sp-7); }
}
