/* Katalyst design tokens (Prompt 16 onward; the colour law of Prompt 23). Loaded first on every page, before home.css.
   THE COLOUR LAW, a 60 : 30 : 10 budget and nothing else:
     60  the navy family: navy #071B53 (the base), deeper navy #040F33 (gradient depth) and azure #6CC4FE (navy's light
         tint: lines, glows, data and the "AI working" state). Azure belongs to the 60; it is not a fourth colour.
     30  the neutrals: white #FFFFFF and ice white #F3F8FD (light sections, text and surfaces).
     10  pale lime #E3FB99: about 5% of a screen, 10% at most and only on a screen with a primary button. Prompt 26: only for
         primary buttons, resolved states and ticks, the waiting meter's resolved segments and the hero arc's faint rim.
         Never on or behind text (a primary button's own label excepted). Accent words on light are navy-to-azure
         gradient text (#071B53 to #2E8FD6); on dark, azure.
   MEANINGS: waiting or a problem = neutral grey with a dashed outline (stalled); AI working = azure; resolved = lime.
   Text on light: headlines navy, body #42506E. On dark: headlines #FFFFFF, body #E2EAF8. Waiting grey: #8A97B5 on dark,
   #8A93A6 on light. Hairlines: #E3EAF3 on light, white at 10% on dark. Lime and azure are never text on white.
   Dark sections: the hero, the bridge, the film, the final call and the footer (navy into #040F33). Light sections
   alternate white and ice white. Dark theme: the light sections become #0B1F55 and #0E2563. No grids anywhere: dark
   sections carry soft concentric arcs of navy-to-azure light and the grain. */

/* ---------- fonts: Geist and Geist Mono (self-hosted, latin, variable; OFL in fonts/OFL-geist.txt) ----------
   The fallbacks are size-adjusted to Geist's measured metrics (headless Chrome, 2026-11-17: Geist 400 is 3.2% wider than
   Arial, Geist 600 0.3% wider than Arial Bold; ascent 1.005, descent 0.295 em; Geist Mono matches Courier New's advance),
   so nothing moves when the web font arrives. */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Fallback"; font-weight: 100 549;
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 103.2%; ascent-override: 97.4%; descent-override: 28.6%; line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Fallback"; font-weight: 550 900;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold");
  size-adjust: 100.3%; ascent-override: 100.2%; descent-override: 29.4%; line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("CourierNewPSMT");
  size-adjust: 100%; ascent-override: 100.5%; descent-override: 29.5%; line-gap-override: 0%;
}

/* ---------- fixed values (every surface, both themes) ---------- */
:root {
  --f-sans: "Geist", "Geist Fallback", system-ui, sans-serif;
  --f-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;

  /* the palette (the only colours on the site) */
  --navy: #071B53;
  --navy-deep: #040F33;
  --navy-film: #0A2668;      /* the film's lighter navy, the far end of its gradient */
  --azure: #6CC4FE;
  --azure-rgb: 108, 196, 254;
  --white: #FFFFFF;
  --ice: #F3F8FD;
  --lime: #E3FB99;
  --lime-rgb: 227, 251, 153;
  --wait-d: #8A97B5;         /* waiting grey on dark */
  --wait-l: #8A93A6;         /* waiting grey on light (outlines and large marks; small text uses --ink-2) */

  /* type scale */
  --fs-h1: clamp(48px, 6vw, 88px);
  --fs-h2: clamp(34px, 4vw, 56px);
  --fs-big: clamp(56px, 6vw, 88px);
  --fs-body: 18px;
  --fs-sub: 20px;
  --measure: 28em;           /* about 60 characters of Geist */

  /* spacing: layout uses only 8, 16, 24, 32, 48, 64, 80, 96 (4 and 12 inside small components) */
  --pad-sec: 80px;           /* every section, top and bottom: 80 desktop, 64 at 1024 and below, 48 on phones */
  --hero-top: 96px;
  --g-label: 16px;
  --g-sub: 24px;
  --g-content: 48px;
  --g-actions: 48px;
  --nav-h: 72px;
  --land: 32px;

  /* one corner scale (Prompt 23): 6 (chips inside cards), 12 (small cards, popovers), 20 (cards), 24 (panels), 999 (pills) */
  --r-xs: 6px;
  --r-sm: 12px;
  --r-card: 20px;
  --r-panel: 24px;
  --maxw: 1200px;
  --side: clamp(20px, 5vw, 80px);   /* Prompt 29: the side margin */
  --cols: 12; --gutter: 24px;

  /* the primary button (Prompt 23): a lime pill with navy text; a soft lime glow on dark, a subtle shadow on light */
  --btn: #E3FB99;
  --btn-ink: #071B53;
  --btn-hover: #EBFDB3;
  --ease: cubic-bezier(.22, 1, .36, 1);           /* the one easing family: entrances 600 to 900ms, interactions 200ms */
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}
@media (max-width: 1024px) { :root { --pad-sec: 64px; } }
@media (max-width: 599.98px) { :root { --pad-sec: 48px; --hero-top: 64px; } }

/* ---------- LIGHT: ice white (.on-beige; the class name is kept) and white (.on-white) ---------- */
:root, .on-beige {
  --bg: #F3F8FD;
  --surface: #FFFFFF;        /* cards on ice are white */
  --surface-2: #F3F8FD;
  --ink: #071B53;            /* headlines: 15.2:1 on ice */
  --ink-2: #42506E;          /* body: 7.6:1 on ice, 8.1:1 on white */
  --muted: #5A6680;          /* Prompt 27: mono labels and muted text on light, 5.9:1 on white */
  --acc-c: #071B53;
  --line: #E3EAF3;
  --line-2: #E3EAF3;
  --tick: #CBD5E3;
  --ring: #8A93A6;
  --signal: #071B53;         /* links and focus rings on light: navy (azure is never text on white) */
  --signal-soft: #E8F5FF;
  --on-signal: #FFFFFF;
  --ai: #6CC4FE;             /* AI marks (fills, rules, dots; never text on white) */
  --amber: #8A93A6;          /* legacy name: the waiting grey */
  --flag: #42506E;
  --flag-soft: #EEF2F8;
  --badge: #E8F5FF;
  --badge-ink: #42506E;
  --fill-2: #EAF0F7;
  --shadow: 0 1px 2px rgba(7, 27, 83, .04), 0 12px 32px rgba(7, 27, 83, .06);
  --card-edge: rgba(7, 27, 83, .07);
  --hdr-bg: rgba(243, 248, 253, .94);
  color-scheme: light;
}
.on-white {
  --bg: #FFFFFF;
  --surface: #F3F8FD;        /* cards on white */
  --surface-2: #FFFFFF;
  --line: #E3EAF3;
  --line-2: #E3EAF3;
}
[data-theme="dark"], [data-theme="dark"] .on-beige {
  --bg: #0B1F55;
  --surface: #12306F;
  --surface-2: #0F2A67;
  --ink: #FFFFFF;
  --ink-2: #E2EAF8;
  --muted: #C4CDE3;
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .15);
  --tick: rgba(255, 255, 255, .16);
  --ring: rgba(255, 255, 255, .32);
  --signal: #6CC4FE;
  --signal-soft: rgba(108, 196, 254, .14);
  --on-signal: #071B53;
  --ai: #6CC4FE;
  --amber: #8A97B5;
  --flag: #C4CDE3;
  --flag-soft: rgba(138, 151, 181, .12);
  --badge: rgba(108, 196, 254, .14);
  --badge-ink: #E2EAF8;
  --fill-2: #163476;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px rgba(2, 8, 30, .3);
  --card-edge: rgba(255, 255, 255, .08);
  --hdr-bg: rgba(11, 31, 85, .94);
  color-scheme: dark;
}
[data-theme="dark"] .on-white {
  --bg: #0E2563;
  --surface: #11306E;
  --surface-2: #0D2763;
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .14);
}

/* ---------- DARK: the hero, the bridge, the film, the final call and the footer (the same in both themes); also the
   header over them ---------- */
.on-ink, [data-theme="dark"] .on-ink, .hdr[data-on="ink"] {
  --bg: #071B53;
  --surface: #0B2461;
  --surface-2: #06184C;
  --ink: #FFFFFF;
  --ink-2: #E2EAF8;          /* 10.9:1 on navy */
  --muted: #C4CDE3;          /* 7.6:1 on navy */
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .14);
  --tick: rgba(255, 255, 255, .16);
  --ring: rgba(255, 255, 255, .32);
  --signal: #6CC4FE;
  --signal-soft: rgba(108, 196, 254, .14);
  --on-signal: #071B53;
  --ai: #6CC4FE;
  --amber: #8A97B5;
  --flag: #C4CDE3;
  --flag-soft: rgba(138, 151, 181, .12);
  --badge: rgba(108, 196, 254, .14);
  --badge-ink: #E2EAF8;
  --fill-2: #0E2969;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px rgba(2, 8, 30, .35);
  --card-edge: rgba(255, 255, 255, .08);
  --hdr-bg: rgba(7, 27, 83, .92);   /* opaque enough that a light section never greys it */
  color-scheme: dark;
}

/* every surface paints its own background and text; the dark ones deepen from navy into #040F33 */
.on-ink, .on-beige, .on-white { background-color: var(--bg); color: var(--ink); }
.on-ink { background-image: linear-gradient(180deg, #071B53 0%, #061748 60%, #040F33 100%); }
::selection { background: rgba(108, 196, 254, .3); color: inherit; }

/* ---------- grain: a fine noise tile (img/grain.png, 128px grayscale, 14 KB) over the dark sections, so no gradient bands ---------- */
.on-ink { position: relative; isolation: isolate; }
.on-ink::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .015;
  background-image: url("../img/grain.png"); background-size: 128px 128px;
}
.on-ink > .wrap { position: relative; z-index: 1; }

/* ---------- the light (Prompt 23, it replaces the blue-cyan glow): large concentric arcs of navy-to-azure light at a
   very low opacity, centred off the top right, with one soft azure pool; drifting very slowly (transform only; still
   under reduced motion). The hero's largest arc carries a faint lime rim (.glow--hero). ---------- */
.glow { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.glow i { position: absolute; display: block; border-radius: 50%; }
.glow i:nth-child(1) {                  /* the soft pool */
  width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px; right: -18vw; top: -30vw; filter: blur(70px);
  background: radial-gradient(closest-side, rgba(108, 196, 254, .28), rgba(108, 196, 254, .08) 55%, rgba(108, 196, 254, 0));
}
.glow i:nth-child(2) {                  /* the arcs: three thin concentric rings, soft-edged */
  width: 1500px; height: 1500px; right: -560px; top: -760px; filter: blur(.6px);
  background: radial-gradient(closest-side, rgba(108, 196, 254, 0) calc(100% - 4px), rgba(108, 196, 254, .14) calc(100% - 2px), rgba(108, 196, 254, 0) 100%);
}
.glow i:nth-child(2)::before, .glow i:nth-child(2)::after { content: ""; position: absolute; border-radius: 50%; }
.glow i:nth-child(2)::before { inset: 170px; background: radial-gradient(closest-side, rgba(108, 196, 254, 0) calc(100% - 4px), rgba(108, 196, 254, .11) calc(100% - 2px), rgba(108, 196, 254, 0) 100%); }
.glow i:nth-child(2)::after { inset: 330px; background: radial-gradient(closest-side, rgba(108, 196, 254, 0) calc(100% - 4px), rgba(108, 196, 254, .09) calc(100% - 2px), rgba(108, 196, 254, 0) 100%); }
.glow i:nth-child(3) { display: none; }   /* Prompt 27: one light pool per section (the counter-pool is gone) */
.glow i:nth-child(3) {                  /* a soft counter-pool, low left */
  width: 52vw; height: 52vw; max-width: 820px; max-height: 820px; left: -22vw; bottom: -32vw; filter: blur(70px);
  background: radial-gradient(closest-side, rgba(108, 196, 254, .12), rgba(108, 196, 254, 0));
}
.glow--hero i:nth-child(2) { background: radial-gradient(closest-side, rgba(227, 251, 153, 0) calc(100% - 4px), rgba(227, 251, 153, .2) calc(100% - 2px), rgba(227, 251, 153, 0) 100%); }
.glow--center i:nth-child(1) { right: auto; left: 50%; margin-left: -35vw; top: -36vw; }
.glow--center i:nth-child(2) { right: auto; left: 50%; margin-left: -750px; top: -980px; }
@media (prefers-reduced-motion: no-preference) {
  /* Prompt 28: the light holds still (no idle drift beside the signature moments) */
}
@keyframes glow-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-4vw, 3vw, 0) scale(1.06); } }
@keyframes glow-arc { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-24px, 18px, 0); } }
@keyframes glow-c { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(3vw, -4vw, 0); } }
@media (max-width: 899.98px) {
  .glow i:nth-child(1) { width: 130vw; height: 130vw; right: -60vw; top: -50vw; filter: blur(50px); }
  .glow i:nth-child(2) { width: 900px; height: 900px; right: -520px; top: -420px; }
  .glow i:nth-child(2)::before { inset: 110px; }
  .glow i:nth-child(2)::after { inset: 210px; }
}

/* ---------- the light gradient panel (the What we build tiles): ice white into white with a faint azure wash and a
   small lime corner highlight; white cards and navy text inside. Dark theme: navy with the same wash. ---------- */
.panel-grad {
  --surface: #FFFFFF;
  --surface-2: #F3F8FD;
  --ink: #071B53;
  --ink-2: #42506E;
  --muted: #42506E;
  --line: rgba(7, 27, 83, .08);
  --line-2: rgba(7, 27, 83, .14);
  --tick: rgba(7, 27, 83, .16);
  --ring: rgba(7, 27, 83, .3);
  --signal: #071B53;
  --signal-soft: #E8F5FF;
  --on-signal: #FFFFFF;
  --ai: #6CC4FE;
  --amber: #8A93A6;
  --flag: #42506E;
  --flag-soft: #EEF2F8;
  --fill-2: #EAF0F7;
  --ss-shadow: 0 1px 2px rgba(7, 27, 83, .05), 0 10px 24px -14px rgba(7, 27, 83, .22);
  --hx: 100%; --hy: 0%;
  position: relative; isolation: isolate; color: var(--ink); border-radius: var(--r-panel);
  background:
    radial-gradient(22% 26% at var(--hx) var(--hy), rgba(108, 196, 254, .16), rgba(108, 196, 254, 0) 100%),
    radial-gradient(80% 90% at 0% 100%, rgba(108, 196, 254, .14), rgba(108, 196, 254, 0) 70%),
    linear-gradient(160deg, #F3F8FD 0%, #FFFFFF 100%);
  box-shadow: inset 0 0 0 1px rgba(7, 27, 83, .06);
  color-scheme: light;
}
.panel-grad::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: .015;
  background-image: url("../img/grain.png"); background-size: 128px 128px;
}
[data-theme="dark"] .panel-grad {
  --surface: #12306F;
  --surface-2: #0F2A67;
  --ink: #FFFFFF;
  --ink-2: #E2EAF8;
  --muted: #C4CDE3;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .15);
  --tick: rgba(255, 255, 255, .16);
  --ring: rgba(255, 255, 255, .32);
  --signal: #6CC4FE;
  --signal-soft: rgba(108, 196, 254, .16);
  --on-signal: #071B53;
  --amber: #8A97B5;
  --flag: #C4CDE3;
  --flag-soft: rgba(138, 151, 181, .12);
  --fill-2: #173677;
  --ss-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 28px -16px rgba(2, 8, 30, .55);
  background:
    radial-gradient(22% 26% at var(--hx) var(--hy), rgba(108, 196, 254, .1), rgba(108, 196, 254, 0) 100%),
    radial-gradient(80% 90% at 0% 100%, rgba(108, 196, 254, .14), rgba(108, 196, 254, 0) 70%),
    linear-gradient(160deg, #0E2969 0%, #0B2461 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  color-scheme: dark;
}
[data-theme="dark"] .panel-grad::before { opacity: .015; }

/* ---------- type ---------- */
/* the accent word or phrase in a headline (Prompt 26): on light sections, static gradient text from navy #071B53 to a
   deeper azure #2E8FD6, left to right (3.3:1 at its azure end on ice white, large text only); on dark, azure #6CC4FE.
   No highlighter: lime is never on or behind text. */
.acc {
  font: inherit; font-style: normal; letter-spacing: inherit; color: #071B53;
  background-image: linear-gradient(90deg, #071B53, #2E8FD6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.on-ink .acc, [data-theme="dark"] .acc, .film-frame.is-dusk .acc { color: #6CC4FE; -webkit-text-fill-color: #6CC4FE; background: none; }
.lbl {                                         /* labels, week markers, sources, badges, sheet numbers, number captions */
  font-family: var(--f-mono); font-size: 12px; font-weight: 500; line-height: 1.6;
  letter-spacing: .08em; text-transform: uppercase;
}
.big-n { font-size: var(--fs-big); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
em, i, cite, address { font-style: normal; }

/* ---------- navigation ----------
   Other pages and the wordmark from another page: a 250ms crossfade with the View Transitions API (a plain load where the
   browser has none). In-page jumps: a veil in the target section's background (js/site.js), under the header. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.nav-veil { position: fixed; inset: 0; z-index: 45; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.nav-veil.is-on { opacity: 1; transition-duration: .15s; }

/* ---------- Prompt 27: crispness. Body text on dark at weight 450 (headings and labels keep their own weights) ---------- */
.on-ink, html[data-theme="dark"] body, .film-frame.is-dusk { font-weight: 450; }

/* ---------- Prompt 28: the button rule. Primary buttons are lime with navy text on dark (the dark sections, the header
   over them, the whole dark theme, the dark film) and navy #071B53 with white text on light (the light sections, the
   header over them, the light panels, the light film), where hover adds a 2px lime ring ---------- */
:root, .on-beige, .on-white, .hdr, .panel-grad, .film-frame.is-light { --btn: #071B53; --btn-ink: #FFFFFF; --btn-hover: #0A2668; }
.on-ink, .hdr[data-on="ink"], [data-theme="dark"], [data-theme="dark"] .on-beige, [data-theme="dark"] .on-white, [data-theme="dark"] .hdr, [data-theme="dark"] .panel-grad, .film-frame.is-dusk { --btn: #E3FB99; --btn-ink: #071B53; --btn-hover: #EBFDB3; }
html:not([data-theme="dark"]) :is(.on-beige, .on-white, .hdr:not([data-on="ink"]), .panel-grad, .film-frame.is-light) .btn--solid:hover::after { box-shadow: 0 0 0 2px #E3FB99, 0 8px 18px -10px rgba(7, 27, 83, .4); }
