/* =========================================================================
   autoekthesi — design tokens
   Direction: "showroom at night". Warm paper + asphalt ink, one signal-red
   accent (tail-light). Geologica for display, Manrope for body, Google Sans
   for small accent labels / numerals.
   ========================================================================= */

:root {
  color-scheme: light dark;

  /* ---- Type families ---- */
  --font-display: "Geologica", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Google Sans", "Manrope", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Fluid type scale (360px → 1440px) ---- */
  --fs-xs: 0.8125rem;                                  /* 13 */
  --fs-sm: 0.875rem;                                   /* 14 */
  --fs-base: 1rem;                                     /* 16 */
  --fs-md: 1.125rem;                                   /* 18 */
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);     /* 20 → 24 */
  --fs-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);        /* 24 → 32 */
  --fs-2xl: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);     /* 30 → 48 */
  --fs-3xl: clamp(2.25rem, 1.3rem + 4vw, 4.5rem);      /* 36 → 72 */
  --fs-hero: clamp(2.5rem, 1.4rem + 4.4vw, 5rem);      /* 40 → 80 */

  --lh-tight: 1.04;
  --lh-snug: 1.2;
  --lh-body: 1.6;
  --tracking-tight: -0.035em;
  --tracking-display: -0.045em;
  --tracking-caps: 0.12em;

  /* ---- Spacing (4px grid) ---- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --section-y: clamp(4rem, 2.5rem + 6vw, 8rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --container: 76rem;
  --container-narrow: 48rem;

  /* ---- Radius ---- */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* ---- Motion ---- */
  --dur-fast: 150ms;
  --dur: 220ms;
  --dur-slow: 420ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Z-index scale ---- */
  --z-base: 1;
  --z-sticky: 20;
  --z-header: 30;
  --z-dropdown: 40;
  --z-overlay: 50;
  --z-toast: 60;

  /* ---- Brand constants (same in both modes) ---- */
  --brand-red: #D42E22;          /* white text on it: 4.98:1 */
  --brand-red-hover: #B8241A;
  --brand-red-press: #9E1E15;

  /* Always-dark "ink" surfaces (hero, CTA band, footer) */
  --ink-bg: #0A0C0F;
  --ink-bg-2: #14181E;
  --ink-bg-3: #1C2129;
  --ink-line: rgba(255, 255, 255, 0.10);
  --ink-line-strong: rgba(255, 255, 255, 0.18);
  --ink-text: #F2F1ED;
  --ink-muted: #A8AEB8;          /* 7.98:1 on ink-bg-2 */
  --ink-accent-text: #FF7A6E;

  /* ---- Light theme (default) ---- */
  --bg: #F4F3EF;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #ECEAE4;
  --surface-3: #E2DFD7;
  --text: #121418;
  --text-muted: #555B64;         /* 6.17:1 on bg */
  --text-subtle: #6B7079;
  --line: #DAD7CF;
  --line-strong: #C3BFB5;
  --accent: var(--brand-red);
  --accent-hover: var(--brand-red-hover);
  --accent-ink: #FFFFFF;
  --accent-text: #B3221A;        /* links on light: 5.98:1 */
  --accent-soft: rgba(212, 46, 34, 0.09);
  --accent-ring: rgba(212, 46, 34, 0.35);
  --focus: #1D5BD8;

  --ok: #157347;
  --ok-soft: rgba(21, 115, 71, 0.11);
  --warn: #8A5A00;
  --warn-soft: rgba(201, 138, 0, 0.14);
  --danger: #B42318;
  --danger-soft: rgba(180, 35, 24, 0.10);
  --info: #1D4ED8;
  --info-soft: rgba(29, 78, 216, 0.10);
  --neutral-soft: rgba(18, 20, 24, 0.07);

  --shadow-sm: 0 1px 2px rgba(18, 20, 24, 0.06);
  --shadow-md: 0 4px 12px -4px rgba(18, 20, 24, 0.14);
  --shadow-lg: 0 16px 40px -16px rgba(18, 20, 24, 0.28);
  --overlay: rgba(10, 12, 15, 0.55);
}

/* ---- Dark theme ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D10;
    --bg-elev: #12151A;
    --surface: #12151A;
    --surface-2: #1A1E25;
    --surface-3: #232831;
    --text: #EDECE8;
    --text-muted: #A3A8B1;       /* 7.0:1 on surface-2 */
    --text-subtle: #8A9099;
    --line: #262B34;
    --line-strong: #363C47;
    --accent-text: #FF7A6E;
    --accent-soft: rgba(255, 90, 75, 0.12);
    --accent-ring: rgba(255, 110, 95, 0.45);
    --focus: #7AA7FF;
    --ok: #4ADE80;
    --ok-soft: rgba(74, 222, 128, 0.12);
    --warn: #FBBF24;
    --warn-soft: rgba(251, 191, 36, 0.13);
    --danger: #FF8A80;
    --danger-soft: rgba(255, 138, 128, 0.12);
    --info: #93B4FF;
    --info-soft: rgba(147, 180, 255, 0.12);
    --neutral-soft: rgba(255, 255, 255, 0.07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
    --overlay: rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #0B0D10;
  --bg-elev: #12151A;
  --surface: #12151A;
  --surface-2: #1A1E25;
  --surface-3: #232831;
  --text: #EDECE8;
  --text-muted: #A3A8B1;
  --text-subtle: #8A9099;
  --line: #262B34;
  --line-strong: #363C47;
  --accent-text: #FF7A6E;
  --accent-soft: rgba(255, 90, 75, 0.12);
  --accent-ring: rgba(255, 110, 95, 0.45);
  --focus: #7AA7FF;
  --ok: #4ADE80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --danger: #FF8A80;
  --danger-soft: rgba(255, 138, 128, 0.12);
  --info: #93B4FF;
  --info-soft: rgba(147, 180, 255, 0.12);
  --neutral-soft: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
  --overlay: rgba(0, 0, 0, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
