/* ─────────────────────────────────────────────────────────────────────────
   Orcrist — design tokens.

   THE single source of truth for colour, type, space, radii, shadow and
   motion. Every other stylesheet consumes these; no other file may define a
   literal hex value. Both index.html and contouroai.html load this first, so
   the two pages can no longer drift apart.

   Palette: "cool mist + soft indigo" — low-saturation blue-grey grounds with
   an indigo ink. Nothing is pure white or pure black; surfaces sit a shade
   off, which is what stops the page reading as a stack of flat slabs.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* ── Colour ──────────────────────────────────────────────────────────
     Base tones are stored as raw "R G B" triplets so any of them can be
     used at partial strength via rgb(var(--x) / <alpha>). Almost every
     border and shadow on the site is a low-alpha ink rather than a
     dedicated grey — that is what gives the layering its softness. */
  --ink-rgb: 27 42 74; /* #1b2a4a — headings, primary text */
  --brand-rgb: 58 90 140; /* #3a5a8c — soft indigo, primary action */
  --accent-rgb: 125 148 184; /* #7d94b8 — dusty blue, secondary accent */
  --mist-rgb: 246 248 251; /* #f6f8fb — page ground */

  --ink: rgb(var(--ink-rgb));
  --brand: rgb(var(--brand-rgb));
  --brand-strong: #2f4a75;
  --accent: rgb(var(--accent-rgb));

  --bg: rgb(var(--mist-rgb));
  --bg-tint: #f1f5fa; /* alternate band, barely distinguishable */
  --bg-deep: #eef2f8; /* third ground, for proof/FAQ bands */
  --surface: #ffffff;
  --surface-soft: #fbfcfe;

  --text: var(--ink);
  --text-soft: #56657f;
  --muted: #8395ad;

  /* Hairlines. Alfaaz separates sections with 6–8% borders rather than
     background swaps; these are the equivalents. */
  --border: rgb(var(--ink-rgb) / 0.1);
  --border-soft: rgb(var(--ink-rgb) / 0.06);
  --border-strong: rgb(var(--ink-rgb) / 0.16);

  /* Footer / dark surfaces */
  --dark: #16233c;
  --dark-soft: #1d2c48;

  /* Semantic */
  --positive: #3f7d6e;
  --negative: #93a1b5;

  /* ── Typography ──────────────────────────────────────────────────────
     A single 1.2-ish scale. Headings run larger and looser than before —
     the old page topped out at 3.5rem with tight leading; calm pages get
     their calm from generous size and generous line-height, not from
     shrinking. */
  --font-sans:
    Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display:
    "Space Grotesk", Inter, system-ui, sans-serif;

  --step--1: 0.86rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.45rem);
  --step-3: clamp(1.5rem, 1.28rem + 1vw, 1.9rem);
  --step-4: clamp(1.9rem, 1.5rem + 1.8vw, 2.6rem);
  --step-5: clamp(2.4rem, 1.7rem + 3.2vw, 3.9rem);

  --leading-tight: 1.14;
  --leading-snug: 1.32;
  --leading-body: 1.68;

  /* Eyebrow: small and widely tracked, so it reads as a label rather than
     as small text. */
  --eyebrow-size: 0.68rem;
  --eyebrow-track: 0.22em;

  /* ── Space ───────────────────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --section-y: clamp(4rem, 3rem + 4vw, 7rem);
  --maxw: 1120px;
  --maxw-prose: 62ch;
  --gutter: clamp(1.25rem, 0.9rem + 1.6vw, 2rem);

  /* ── Radii ───────────────────────────────────────────────────────────
     Varied by element scale rather than one global value — small controls
     stay tight, large panels go generous. */
  --radius-sm: 0.6rem;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --radius-xl: 1.85rem;
  --radius-pill: 999px;

  /* ── Shadow ──────────────────────────────────────────────────────────
     Long, soft, ink-tinted, with heavy negative spread so the shadow pools
     beneath a floating object instead of haloing its border. */
  --shadow-sm: 0 2px 6px -3px rgb(var(--ink-rgb) / 0.16);
  --shadow-md: 0 14px 36px -24px rgb(var(--ink-rgb) / 0.3);
  --shadow-lg: 0 24px 70px -46px rgb(var(--ink-rgb) / 0.34);
  --shadow-xl: 0 34px 90px -52px rgb(var(--ink-rgb) / 0.4);

  /* ── Motion ──────────────────────────────────────────────────────────
     Named durations and easings so timing is consistent across components
     and tunable in one place. --delay is read per-instance off inline
     style, replacing the old fixed data-delay="1..4" ladder. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.18s;
  --dur-mid: 0.32s;
  --dur-slow: 0.7s;
  --delay: 0s;
}

/* ── Dark mode ──────────────────────────────────────────────────────────
   Only the tokens change; no component rule below is theme-aware. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink-rgb: 226 234 245;
    --brand-rgb: 138 168 214;
    --accent-rgb: 122 146 184;
    --mist-rgb: 12 18 30;

    --brand-strong: #a9c2e6;

    --bg: rgb(var(--mist-rgb));
    --bg-tint: #101a2b;
    --bg-deep: #131f33;
    --surface: #16233a;
    --surface-soft: #1a2843;

    --text: rgb(var(--ink-rgb));
    --text-soft: #a3b3ca;
    --muted: #7e8ea8;

    --border: rgb(var(--ink-rgb) / 0.14);
    --border-soft: rgb(var(--ink-rgb) / 0.08);
    --border-strong: rgb(var(--ink-rgb) / 0.22);

    --dark: #0c1220;
    --dark-soft: #131d30;

    --positive: #7fb8a6;
    --negative: #6f8098;

    --shadow-sm: 0 2px 6px -3px rgb(0 0 0 / 0.5);
    --shadow-md: 0 14px 36px -24px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 24px 70px -46px rgb(0 0 0 / 0.8);
    --shadow-xl: 0 34px 90px -52px rgb(0 0 0 / 0.85);
  }
}
