/* ==========================================================================
   Design tokens — the single source of truth for color, type, space.
   Stage 2 (the authenticated app) should import this file unchanged.
   ========================================================================== */

:root {
  /* --- Color: warm neutral base ------------------------------------- */
  --color-bg:              #f8f6f1;
  --color-bg-elevated:     #ffffff;
  --color-bg-muted:        #f1eee7;
  --color-bg-inverse:      #1b1d22;

  --color-border:          #e3dfd5;
  --color-border-strong:   #c9c3b6;

  --color-ink:             #1b1d22;
  --color-ink-muted:       #575b64;
  --color-ink-subtle:      #7d818b;
  --color-ink-inverse:     #f8f6f1;

  /* --- Color: one accent, used for evidence / verification cues ------ */
  --color-accent:          #1e4fd6;
  --color-accent-strong:   #163ba6;
  --color-accent-soft:     #e7edfb;
  --color-accent-ink:      #12307f;

  /* Reserved for future chip states (Stage 2). Kept neutral on purpose. */
  --color-state-neutral:   #6b6f78;
  --color-state-neutral-soft: #eceae4;

  /* --- Color: dark surface set (hero, page heroes, CTA band) ---------- */
  --color-dark-bg:          #0e1015;
  --color-dark-surface:     #161920;
  --color-dark-border:      rgba(242, 240, 234, 0.12);
  --color-dark-ink:         #f2f0ea;
  --color-dark-ink-muted:   #a9abb2;
  --color-dark-ink-subtle:  #7d8089;
  --color-dark-accent:      #5b8cff;
  --color-dark-accent-soft: rgba(91, 140, 255, 0.14);
  --color-dark-accent-ink:  #bcd0ff;
  --color-dark-glow:        rgba(91, 140, 255, 0.22);

  /* --- Typography ----------------------------------------------------- */
  --font-heading: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.0625rem;
  --text-lg:   1.1875rem;
  --text-xl:   1.375rem;
  --text-2xl:  clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  --text-3xl:  clamp(1.875rem, 1.4rem + 1.8vw, 2.5rem);
  --text-4xl:  clamp(2.25rem, 1.5rem + 3vw, 3.5rem);

  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;

  --tracking-tight: -0.03em;
  --tracking-wide:  0.08em;

  /* --- Spacing (4px base) -------------------------------------------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --section-gap: clamp(var(--space-16), 8vw, var(--space-24));

  /* --- Shape & depth -------------------------------------------------- */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(27, 29, 34, 0.05);
  --shadow-md: 0 4px 16px rgba(27, 29, 34, 0.07);

  /* --- Layout --------------------------------------------------------- */
  --container-max: 1120px;
  --container-narrow: 720px;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* --- Motion --------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
}

/* --------------------------------------------------------------------------
   Dark theme scope. Any element with .theme-dark re-maps the semantic tokens,
   so components (chips, buttons, eyebrows, nav) restyle without extra CSS.
   -------------------------------------------------------------------------- */
.theme-dark {
  --color-bg:            var(--color-dark-bg);
  --color-bg-elevated:   var(--color-dark-surface);
  --color-bg-muted:      var(--color-dark-surface);
  --color-border:        var(--color-dark-border);
  --color-border-strong: rgba(242, 240, 234, 0.24);
  --color-ink:           var(--color-dark-ink);
  --color-ink-muted:     var(--color-dark-ink-muted);
  --color-ink-subtle:    var(--color-dark-ink-subtle);
  --color-ink-inverse:   var(--color-dark-bg);
  --color-accent:        var(--color-dark-accent);
  --color-accent-strong: #7da3ff;
  --color-accent-soft:   var(--color-dark-accent-soft);
  --color-accent-ink:    var(--color-dark-accent-ink);
  --color-state-neutral: var(--color-dark-ink-muted);
  --color-state-neutral-soft: rgba(242, 240, 234, 0.06);
  --shadow-sm: none;
  --shadow-md: none;
  background: var(--color-bg);
  color: var(--color-ink);
  color-scheme: dark;
}

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