/* ═══════════════════════════════════════════════════════════════
   OYT PUBLIC TOKENS — "LAMPLIGHT", pinned.

   The palette for the PUBLIC MARKETING SURFACE. The workbench at
   dusk: espresso-warm darks, elevation by LIGHT (a thin top-light and
   one settling shadow — not drawn borders), and the One Lamp rule —
   gold appears as a fill exactly once per screen, the primary action,
   and that fill emits. Everything else rests.

   WHY THIS FILE EXISTS, AND WHY IT IS A COPY
   ------------------------------------------
   oyt-tokens.css is the APP's palette. oyt-design.css @imports it, so
   whatever it says is what every signed-in screen wears. The public
   pages linked it too, which was right while both surfaces wanted the
   same colours — and is wrong now that they do not: the app is moving
   to the dark "Lamplight Bench" scheme (a dark bench under light
   cards), while the marketing pages go back to the all-dark original.
   Two surfaces, two palettes, decided deliberately.

   This file therefore declares the WHOLE token set standing alone. It
   does not @import oyt-tokens.css and does not inherit one value from
   it, so a retheme of the app cannot reach the homepage — which is the
   entire point. The cost of standing alone is that it can fall behind:
   a token added to the app palette would resolve to nothing here and
   render a public page unstyled. tests/public-page-tokens.test.js
   closes that by asserting NAME PARITY in both directions — add a
   token there and CI fails until this file gives it a value. The
   parity is on names; the values are meant to differ, and do.

   ORDER MATTERS: link this BEFORE a page's own <style> block, so a
   page can still override a token deliberately.

   CONTRAST, measured rather than asserted
   ---------------------------------------
   Every ink here clears WCAG AA 4.5:1 on every surface it lands on.
   Two steps are NOT the values that originally shipped: --t3 and --t4
   never cleared the floor (they ran 4.48→3.40 and 2.52→1.92 across
   this ramp — 12 failing pairs on the homepage alone). They are
   re-solved here at the theme gallery's ladder targets (5.5 and 4.62)
   on the original ink hue, so the identity is the original's and only
   the lightness moves. Worst pairing in the whole ink matrix is --t4
   on --s2 at 4.62:1. See the note above each.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ── Iron: the shop floor and the plates set into it. Verbatim the
       hexes that shipped as design system v2.0. ── */
    --bg: #141210;
    --s1: #1c1916;
    --s2: #242019;
    --s3: #2a251d;
    --s4: #302a20;

    /* ── The ink ladder. --t1/--t2 are the originals untouched: they
       carry the identity and they already clear the floor everywhere
       (worst 12.18:1 and 6.11:1, both on --s4).

       --t3 and --t4 are the two steps the original never got right. A
       near-black canvas with a lifted surface ramp leaves little room
       below --t2, and the shipped values took it too far: --t3 read
       3.88:1 on --s2 and --t4 read 2.19:1 on --s1 — below even the 3:1
       floor for non-text. Both are re-solved with the theme gallery's
       own solver (_theme-gallery-src/contrast.mjs `tune`) at the
       Lamplight Bench ladder targets, 5.5 and 4.62, against the
       surfaces public pages actually paint text on. Hue and saturation
       are the ORIGINALS' — hsl(38,11%) and hsl(41,14%) — so only the
       lightness moved: #857b6a → #9f9687 and #5c5546 → #938870.

       Not taken: Lamplight Bench's canvas ladder verbatim. Its inks
       were gated against --bg and --chrome only, so its --t4 (#877f73)
       lands at 4.10:1 on --s2 and would ship a failure of its own; its
       --t1 (#d2d1ce) also drops the warm cream for a neutral grey and
       buys no contrast doing it. ── */
    --t1: #f2ede4;
    --t2: #b3a996;
    --t3: #9f9687;
    --t4: #938870;

    --border: rgba(242,237,228,0.07);
    --border-hover: rgba(242,237,228,0.14);
    --divider: #2e2820;

    /* ── Heat. The gold is the identity; it is never retuned. ── */
    --a: #f5c542;
    --a-bright: #f8cf5e;
    --a-deep: #eab52e;
    --a-edge: #c99e2c;
    --a-dim: rgba(245,197,66,0.10);
    --a-glow: rgba(245,197,66,0.16);

    /* One focus treatment for every control, restated in gold. The
       alpha is a measurement, not a taste: WCAG 1.4.11 asks 3:1 of a
       non-text indicator, and gold at 0.45 gives 2.99:1 on --s4. 0.55
       is the first step with real margin — worst case 3.72:1 on --s4,
       4.20:1 on --bg. (The light palette solved the same constraint at
       0.75 because slate-blue on white is a much weaker edge.) */
    --focus-border: rgba(245,197,66,0.55);
    --focus-ring: 0 0 0 3px var(--a-dim), 0 0 12px rgba(245,197,66,0.14);
    --accent: var(--a);
    --gold: var(--a);

    /* ── Functional colour only: red = genuinely overdue, green = done,
       gold = act. Each clears 4.5:1 on its own dim tint. ── */
    --g: #4fae6e;
    --g-dim: rgba(79,174,110,0.10);
    --amber: #d9a62e;
    --amber-dim: rgba(217,166,46,0.10);
    --red: #e5604c;
    --red-dim: rgba(229,96,76,0.10);

    /* ── Geometry: the SYSTEM scale, identical to oyt-tokens.css. The
       homepage's art direction is squarer than this (a machined plate,
       not a rounded card), but that is one page's display geometry and
       it stays page-local — the other twelve public pages have always
       been on 16/10/20 and must not be moved by a palette restore. ── */
    --radius-xs: 8px;     /* icon buttons, menu items, small chips */
    --radius-sm: 10px;    /* controls: inputs, buttons, tabs, tiles */
    --radius: 16px;       /* cards, panels, tab-strip containers */
    --radius-lg: 20px;    /* modals */
    --radius-pill: 999px; /* capsules: badges, role chips, pill buttons */

    /* ── Motion: three durations and ONE curve. Anything that moves picks a
       duration by distance travelled, never by taste. ── */
    --dur-1: 120ms;   /* micro feedback — hover tint, icon colour, focus ring */
    --dur-2: 180ms;   /* component state — card lift, tab switch, chevron */
    --dur-3: 240ms;   /* travel — drawer slide, entrance fades, overlays */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Type scale: 1px steps through the UI range (10–16), 2px through the
       display range (18–28). Nothing in this file sits between the steps.
       The one exception is the literal 16px on form controls — that is the
       iOS focus-zoom floor, a device constraint rather than a type choice,
       so it must not follow a token that someone could later retune. ── */
    --fs-2xs: 10px;   /* nav group label, tab-bar label */
    --fs-xs:  11px;   /* badges, chips, meta */
    --fs-sm:  12px;   /* breadcrumb, stat sub, small buttons */
    --fs-md:  13px;   /* the workhorse — nav rows, controls, table text */
    --fs-lg:  14px;   /* body copy and buttons */
    --fs-xl:  15px;   /* section labels, tool names */
    --fs-2xl: 16px;   /* dialog titles */
    --fs-3xl: 18px;
    --fs-4xl: 20px;
    --fs-5xl: 22px;
    --fs-6xl: 24px;
    --fs-7xl: 26px;   /* page title */
    --fs-8xl: 28px;   /* stat value */

    /* ── Elevation by light — the whole depth story. A thin inset
       top-light says "this face catches the lamp"; one settling shadow
       says "this sits above the floor". No drawn borders. ── */
    --toplight: inset 0 1px 0 rgba(255,255,255,0.045);
    --settle: 0 10px 28px rgba(10,7,4,0.45);
    --lamp: 0 0 0 1px rgba(245,197,66,0.22), 0 4px 18px rgba(245,197,66,0.16);
    --wash-gold: radial-gradient(closest-side, rgba(245,197,66,0.055), transparent);
    --wash-green: radial-gradient(closest-side, rgba(79,174,110,0.05), transparent);
    --wash-red: radial-gradient(closest-side, rgba(229,96,76,0.05), transparent);
    --lamp-hover: 0 0 0 1px rgba(245,197,66,0.30), 0 4px 22px rgba(245,197,66,0.22);
    --lamp-fill: linear-gradient(180deg, var(--a-bright), var(--a-deep));
    /* The label on the one gold fill. 11.58:1 at the gradient's lightest
       stop, 9.17:1 at its darkest. */
    --lamp-ink: #201a0e;
    --chrome: #171411;   /* nav bar / tab bar plate */

    /* Boot-consumed aliases. oyt-boot.js is intentionally
       untouched; its injected chrome reads var(--card) for the sidebar,
       topbar and quick menu, and var(--text)/--text-secondary/--muted/
       --danger for their contents (each with a DARK hardcoded fallback).
       No public page loads boot today, but the names are part of the
       token contract and are aliased, never hand-synced. */
    --card: var(--s1);
    --text: var(--t1);
    --text-secondary: var(--t2);
    --muted: var(--t3);
    --danger: var(--red);

    --font: 'Hanken Grotesk', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
    --sidebar-w: 240px;
}
