/* tokens.css — Simple Fusion Reactor v5 (W1-A; PLAN_v5 §3.11). Light only. Derived from the OpenStar /
   Isotope Viewer design system tokens (tom-s-dervied-design-system-28b815dc).
   Isotope-only palettes (decay modes, reactions, scrim, palette shadow) omitted.
   v5 contrast rules (A13, UI_REVIEW CH-3 as corrected by use-verify USE-5): every text colour ≥ 4.5:1 on white,
   paper and the surfaces — subtle ink and chart ticks are #666666 (4.77 on surface-3; #6B6B6B fails there at 4.43),
   text coral is --sfr-coral-text #D40004 (5.52 on white); --iv-coral-deep stays for graphics and the focus ring only,
   and --iv-ink-faint is never a text colour on a light surface. */

/* ---- fonts (files in ../fonts/ — this stylesheet lives in css/). Inter (SIL Open Font License 1.1, fonts/LICENSE-Inter.txt)
   in the two weights the page uses; the mono role falls to the system monospace stack. ---- */
@font-face{font-family:"Inter";src:url("../fonts/Inter-Light.woff2") format("woff2");font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/Inter-LightItalic.woff2") format("woff2");font-weight:300;font-style:italic;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/Inter-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/Inter-Italic.woff2") format("woff2");font-weight:400;font-style:italic;font-display:swap}

:root{
  color-scheme:light;

  /* ---- surfaces — warm paper stack ---- */
  --iv-paper:#FBFAF6;
  --iv-surface:#FFFFFF;
  --iv-surface-2:#F4F2EC;
  --iv-surface-3:#ECEAE3;
  --iv-surface-hover:#F1EFE9;

  /* ---- ink ---- */
  --iv-ink:#0A0A0A;
  --iv-ink-hover:#1A1A1A;
  --iv-ink-muted:#5D5D5D;
  --iv-ink-subtle:#666666;            /* v5: was #8A8A8A (3.44:1 on white) */
  --iv-ink-faint:#B4B4B4;
  --iv-ink-inverse:#FFFFFF;

  /* ---- lines: 8 / 16 / 40 / 100 % ---- */
  --iv-hairline:rgba(0,0,0,0.08);
  --iv-hairline-2:rgba(0,0,0,0.16);
  --iv-rule:rgba(0,0,0,0.40);
  --iv-border:#000000;
  /* extra darknesses the canvas uses */
  --iv-hairline-12:rgba(0,0,0,0.12);   /* throttle detents */
  --iv-rule-35:rgba(0,0,0,0.35);       /* scale-bar border, "this machine" dotted line, legend squares */
  --iv-leader:rgba(0,0,0,0.45);        /* callout leaders + dots */
  --iv-rule-55:rgba(0,0,0,0.55);       /* β₀ contours, cutaway axis */

  /* ---- accent — coral is the only highlight ---- */
  --iv-coral:#FF8181;
  --iv-coral-deep:#FF2A2A;
  --iv-coral-soft:#FFE5E8;
  --iv-coral-wash:rgba(255,129,129,0.04);

  /* ---- v5 colour roles (A13, D7): coral text, alarm levels, targets, focus ---- */
  --sfr-coral-text:#D40004;            /* coral for TEXT (5.52 white · 5.29 paper); graphics keep --iv-coral-deep */
  --sfr-alarm:#9E1B32;                 /* alarm level (densityLost, pileUp, valve) */
  --sfr-warn:#8A5300;                  /* warn level (top, softFailed, puff limits) */
  --sfr-info:#666666;                  /* info level (belowNmin, offMap, softLow) */
  --sfr-target:#1F5FA8;                /* targets the operator sets: the n* line, the P* handle */
  --sfr-focus:var(--iv-coral-deep);    /* the 2-px keyboard focus ring (non-text: 3.74 on white, 5.30 on ink) */

  /* ---- data ramp (black → sand); temperature/Q ramp = 7,6,5,4,2 ---- */
  --iv-ramp-0:#000000;--iv-ramp-1:#3D1A1A;--iv-ramp-2:#7A1F1F;--iv-ramp-3:#D40004;
  --iv-ramp-4:#FF2A2A;--iv-ramp-5:#FF8181;--iv-ramp-6:#FFCCD8;--iv-ramp-7:#F3D593;
  --sfr-ramp-cold:#FBF3DD;             /* cutaway cold end */
  --sfr-ramp-t3:#F7C4A8;--sfr-ramp-t6:#FF5A5A;--sfr-ramp-t8:#B92424;  /* cutaway intermediates */
  /* the v5 monotone-L* ramp (ramps.js RAMPS.temperature, five equal stops): the face-scale bars key the T and α faces
     the cutaway draws with that ramp (v4's #FF8181 60 % / #FF2A2A 82 % stops no longer matched them) */
  --sfr-grad-temp:linear-gradient(90deg,#FBF3DD,#F3D593 25%,#FF8181 50%,#E0453A 75%,#7A1F1F);
  --sfr-grad-pressure:linear-gradient(90deg,rgba(0,0,0,0.04),rgba(0,0,0,0.3) 50%,#0A0A0A);
  --sfr-series-q:#0A0A0A;
  --sfr-series-pfus:#FF8181;

  /* ---- chart chrome ---- */
  --chart-frame:rgba(0,0,0,0.16);
  --chart-grid:rgba(0,0,0,0.05);
  --chart-well:rgba(0,0,0,0.025);
  --chart-axis:#0A0A0A;
  --chart-tick:#666666;               /* v5: was #8A8A8A */
  --chart-title:#5D5D5D;

  /* ---- semantic aliases (colour only; --text-body is a SIZE below, never a colour) ---- */
  --bg-app:var(--iv-paper);--bg-card:var(--iv-surface);--bg-sunken:var(--iv-surface-2);--bg-chrome:var(--iv-surface-3);
  --text-muted:var(--iv-ink-muted);--text-subtle:var(--iv-ink-subtle);--text-faint:var(--iv-ink-faint);--text-accent:var(--sfr-coral-text);
  --border-hairline:var(--iv-hairline);--border-strong:var(--iv-hairline-2);--border-control:var(--iv-rule);--border-ink:var(--iv-border);
  --accent:var(--iv-coral);--accent-deep:var(--iv-coral-deep);--accent-soft:var(--iv-coral-soft);

  /* ---- type ---- */
  --os-font-sans:"Inter",-apple-system,system-ui,sans-serif;
  --os-font-mono:ui-monospace,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  --font-sans:var(--os-font-sans);--font-mono:var(--os-font-mono);
  --weight-light:300;--weight-regular:400;
  --text-h1:32px;--text-h2:22px;--text-plate:20px;--text-pane:15px;
  --text-body:13.5px;--text-body-sm:12.5px;
  --text-mono:12px;--text-mono-11:11px;--text-mono-sm:10.5px;--text-mono-xs:9.5px;--text-eyebrow:10px;--text-axis:10px;
  --text-min:9.5px;                    /* v5 floor: no text below it (UI_REVIEW §4.1) */
  --text-tick:10px;                    /* v5 floor for SVG tick text */
  --lh-h1:1.1;--lh-h2:1.2;--lh-body:1.55;--lh-tooltip:1.45;
  --track-h1:-0.012em;--track-h2:-0.005em;--track-mono:0.02em;--track-mono-sm:0.04em;
  --track-label:0.14em;--track-tab:0.18em;--track-eyebrow:0.22em;--track-axis:0.30em;

  /* ---- spacing ---- */
  --space-1:2px;--space-2:4px;--space-3:6px;--space-4:8px;--space-5:10px;--space-6:12px;--space-7:14px;
  --space-8:16px;--space-9:18px;--space-10:20px;--space-11:22px;--space-12:24px;--space-14:32px;--space-16:36px;

  /* ---- chrome dimensions ---- */
  --size-frame-w:1280px;--size-frame-h:800px;
  --size-titlebar:40px;--size-statusbar:24px;--size-colhead:44px;
  --size-rail-sfr:240px;--size-plate:280px;--size-strip:180px;
  --size-iconbtn:24px;--size-kbd:18px;
  --size-hit:24px;                     /* v5: the minimum pointer target (WCAG 2.5.8) */
  --size-lever-w:52px;--size-lever-h:110px;--size-scan-h:300px;
  --pad-rail:16px;--pad-centre:14px 20px 12px;--pad-card-chart:10px 12px 8px;--pad-strip:12px 14px;--pad-plate-x:18px;

  /* ---- radii, borders, shadow, motion ---- */
  --radius-control:1px;--radius-kbd:2px;--radius-full:999px;
  --border-w:1px;--border-accent-w:3px;
  --shadow-none:none;
  --dur-fast:90ms;--ease-standard:ease;

  /* ---- patterns ---- */
  --pattern-hatch:repeating-linear-gradient(135deg,transparent 0 4px,rgba(0,0,0,0.06) 4px 5px);
  --pattern-fog:repeating-linear-gradient(135deg,transparent 0 6px,rgba(0,0,0,0.07) 6px 7px);
}

/* ---- base reset (from tokens/base.css) ---- */
html,body{margin:0;background:var(--iv-surface-3);color:var(--iv-ink);font-family:var(--os-font-sans);font-weight:300;-webkit-font-smoothing:antialiased}
html,body{height:100%;overflow:hidden}
body.is-scroll{overflow:auto}         /* v5 (CH-10 S): below the 0.6 scale floor the stage scrolls instead of shrinking */
*,*::before,*::after{box-sizing:border-box}
a{color:var(--iv-ink);text-decoration:underline;text-decoration-color:var(--iv-rule)}
a:hover{color:var(--sfr-coral-text);text-decoration-color:var(--sfr-coral-text)}
button,input,select{font:inherit;color:inherit}

/* ---- text utilities (.iv-* names kept so canvas markup ports verbatim) ---- */
.iv-tab-num,.iv-mono,.iv-mono-sm,.iv-mono-xs,.iv-eyebrow,.mono{font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
.iv-eyebrow{font-family:var(--os-font-mono);font-weight:400;font-size:10px;letter-spacing:0.22em;text-transform:uppercase;color:var(--iv-ink-muted)}
.iv-eyebrow-coral{color:var(--sfr-coral-text)}
.iv-h1{font-family:var(--os-font-sans);font-weight:300;font-size:32px;line-height:1.1;letter-spacing:-0.012em;margin:0;color:var(--iv-ink)}
.iv-h2{font-family:var(--os-font-sans);font-weight:300;font-size:22px;line-height:1.2;letter-spacing:-0.005em;margin:0;color:var(--iv-ink)}
.iv-italic,.q{font-family:var(--os-font-sans);font-weight:300;font-style:italic;color:var(--sfr-coral-text)}
.iv-body{font-family:var(--os-font-sans);font-weight:300;font-size:13.5px;line-height:1.55;color:var(--iv-ink)}
.iv-mono,.mono{font-family:var(--os-font-mono);font-weight:400;font-size:12px;letter-spacing:0.02em;color:var(--iv-ink)}
.iv-mono-sm{font-family:var(--os-font-mono);font-weight:400;font-size:10.5px;letter-spacing:0.04em;color:var(--iv-ink-muted)}
.iv-mono-xs{font-family:var(--os-font-mono);font-weight:400;font-size:9.5px;letter-spacing:0.14em;text-transform:uppercase;color:var(--iv-ink-muted)}
.iv-scroll{overflow:auto;scrollbar-width:thin}
.iv-scroll::-webkit-scrollbar{width:10px;height:10px}
.iv-scroll::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.18);border-radius:999px}
.iv-scroll::-webkit-scrollbar-track{background:transparent}
