/*
 * tokens.css: the HAFR design tokens for the "Cutaway" direction.
 *
 * The only file in which a colour exists. Every other stylesheet reads these
 * custom properties; components never write a hex value, an rgb() or a
 * system colour of their own.
 *
 * Canonical copy: workstreams/01-design-system/tokens.css. The website ships
 * a byte-identical copy at platform/public/assets/css/tokens.css (see the
 * design-system README). Edit this file, then copy it; never edit the copy.
 * Spec, rationale and every measured contrast pair:
 * knowledge/50-design-system/Design System Spec.md.
 *
 * Custom properties only. Selectors exist to scope values, never to style:
 *   1. Fixed tokens         :root, the same in every theme and surface
 *   2. Paper (light)         :root and [data-surface="paper"]; the default
 *   3. Night (dark)          prefers-color-scheme: dark unless data-theme="light";
 *                            data-theme="dark"; [data-surface="night"]
 *   4. Instrument            [data-surface="instrument"]: always dark, both themes
 *   5. Language              English on :root and [lang|="en"];
 *                            Arabic on :root[lang="ar"] and [lang|="ar"]
 *   6. Direction             --hf-dir and the reading-end hot spot
 *   7. Responsive grid       columns, gutters and margins per breakpoint
 *   8. Derived tokens        composites, re-declared wherever their inputs change
 *   9. Platform aliases      the placeholder's names, until the area files migrate
 *  10. Preferences           motion, contrast, transparency, forced colours, print
 *
 * Why derived tokens are re-declared on scopes: a custom property that uses
 * var() is resolved on the element that declares it. "--hf-border" declared
 * only on :root would carry the paper line colour into an instrument section.
 * Re-declaring the composites on [data-surface] and [dir] keeps them right.
 *
 * Contrast is measured (WCAG 2.x), never eyeballed. Every text token is at
 * least 4.5:1 on every surface it is allowed on; the lowest pairs are paper
 * text-3 on well 4.54, night text-3 on well 4.58 and instrument text-3 on
 * row-hover 4.51. Control borders are at least 3:1 on ground, surface and band.
 */

/* 1. Fixed tokens ------------------------------------------------------- */

:root {
  /* The seal: the one amber brand object. #E9A22F in every theme and on
     every surface. 1.99:1 on paper (a logo and a full stop, exempt from text
     contrast, so it carries an edge there); 9.24:1 on night. Never text,
     never a fill for buttons, icons, focus or selection. */
  --hf-color-seal: #E9A22F;
  --hf-color-seal-hi: #F2B648;
  --hf-color-seal-lo: #E0921C;

  /* Lustre: light from inside the cut. Champagne, sea glass, silver, shell,
     with violet and rose removed. The *-12, *-23, *-34 and *-41 stops are
     OKLab midpoints, precomputed so plain sRGB gradients never pass through
     violet. Never text; never behind text above 40% on paper. */
  --hf-color-lustre-1: #F3DFB7;
  --hf-color-lustre-12: #DAE3CD;
  --hf-color-lustre-2: #BFE6E1;
  --hf-color-lustre-23: #D2E6E6;
  --hf-color-lustre-3: #E4E6EC;
  --hf-color-lustre-34: #ECDDD8;
  --hf-color-lustre-4: #F4D3C4;
  --hf-color-lustre-41: #F4D9BE;

  /* Instrument palette: the always-dark surfaces set into the page
     (console, sovereignty map, standards band, the hero after the dive). */
  --hf-color-inst-ground: #05070A;
  --hf-color-inst-hot: #0D1822;
  --hf-color-inst-mid: #080C11;
  --hf-color-inst-panel: #0B1016;
  --hf-color-inst-row: #111821;
  --hf-color-inst-row-hover: #18212C;
  --hf-color-inst-text-1: #E9EEF4;
  --hf-color-inst-text-2: #A3ADBA;
  --hf-color-inst-text-3: #7D8895;
  --hf-color-inst-line: #1C2530;
  --hf-color-inst-tick: #3A4654;

  /* The core: the ground the hero passes through on its way to the map. */
  --hf-color-core: #120E08;

  /* Sovereignty map (instrument only). Fences mean protection: never red,
     never amber. Neighbours are one unlabelled silhouette. */
  --hf-color-map-land: #8FA3B8;
  --hf-color-map-land-hot: #DCE6F0;
  --hf-color-map-fence: #48DDB1;
  --hf-color-map-fence-hot: #C8F7E8;
  --hf-color-map-context: #2A3440;
  --hf-color-map-packet: #FFFFFF;
  --hf-color-map-packet-trail: #8EB0FF;

  /* Data visualisation ramps (one hue each, light to dark). Sea is the
     sequential hue; sea and rose are the diverging arms. Categorical slots
     and the diverging set are chosen per theme below. */
  --hf-color-sea-100: #D2F2F9;
  --hf-color-sea-200: #A4DCE8;
  --hf-color-sea-300: #69C4D6;
  --hf-color-sea-400: #22A7BC;
  --hf-color-sea-500: #00879B;
  --hf-color-sea-600: #006776;
  --hf-color-sea-700: #004955;
  --hf-color-rose-100: #FEE3E9;
  --hf-color-rose-200: #F4C1CC;
  --hf-color-rose-300: #EA99AD;
  --hf-color-rose-400: #DA6D8B;
  --hf-color-rose-500: #BC4A6D;
  --hf-color-rose-600: #973052;
  --hf-color-rose-700: #6C2039;

  /* Glows used only on night and instrument surfaces. */
  --hf-glow-fence: 0 0 20px rgb(72 221 177 / 0.35);
  --hf-glow-info: 0 0 20px rgb(142 176 255 / 0.35);
  --hf-glow-danger: 0 0 20px rgb(255 123 108 / 0.35);

  /* Textures. Grain kills gradient banding and gives glass a material; the
     dot grid is the instrument's texture; the halftone pitch (7 px) matches
     the GCC dot lattice in workstreams/01-design-system/geo. */
  --hf-texture-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hf-texture-noise-size: 160px;
  --hf-texture-dots: radial-gradient(rgb(233 238 244 / 0.05) 1px, transparent 1.4px);
  --hf-texture-dots-size: 12px;
  --hf-texture-halftone: radial-gradient(currentColor 1px, transparent 1.5px);
  --hf-texture-halftone-size: 7px;
  /* An opaque layer for masks (mask-composite), so no stylesheet writes a colour for it. */
  --hf-mask-solid: linear-gradient(#000 0 0);

  /* Type: one stack per role serves both scripts. Each face claims only its
     own script through unicode-range (base.css), so Latin falls to Geist and
     Arabic to Alexandria; the accent to Instrument Serif or Amiri. */
  --hf-font-sans: "HF Geist", "HF Alexandria", "HF Geist Fallback", system-ui, -apple-system, "Segoe UI", "Geeza Pro", Tahoma, sans-serif;
  --hf-font-accent: "HF Instrument Serif", "HF Amiri", "HF Alexandria", "HF Serif Fallback", Georgia, serif;
  --hf-font-mono: "HF Geist Mono", "HF Alexandria", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Only for the «العربية» switch on English pages, so an English page view
     never downloads Alexandria (Website Spec S-08). */
  --hf-font-arabic-system: "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;

  /* Fluid scale, linear from a 375 px to a 1440 px viewport, then fixed.
     Every max/min ratio is 2.5 or less, so text still doubles at 200% zoom.
     caption 12-13 · small 14-15 · body 16-18 · title 18-21 · lead 19-24 ·
     heading 24-36 · display-s 28-44 · display-m 32-64 · display-l 40-88 ·
     display-xl 48-120 · display-xxl 72-176 (px). Arabic overrides the five
     reading sizes in section 5. */
  --hf-fs-display-xxl: clamp(4.5rem, 2.2113rem + 9.7653vw, 11rem);
  --hf-fs-display-xl: clamp(3rem, 1.4155rem + 6.7606vw, 7.5rem);
  --hf-fs-display-l: clamp(2.5rem, 1.4437rem + 4.507vw, 5.5rem);
  --hf-fs-display-m: clamp(2rem, 1.2958rem + 3.0047vw, 4rem);
  --hf-fs-display-s: clamp(1.75rem, 1.3979rem + 1.5023vw, 2.75rem);
  --hf-fs-heading: clamp(1.5rem, 1.2359rem + 1.1268vw, 2.25rem);
  --hf-fs-console: clamp(0.7813rem, 0.7482rem + 0.1408vw, 0.875rem);
  --hf-console-ar-scale: 1.07;

  /* Space: a 4 px base. 1-8 keep the platform's existing values. */
  --hf-space-px: 1px;
  --hf-space-half: 0.125rem;
  --hf-space-1: 0.25rem;
  --hf-space-2: 0.5rem;
  --hf-space-3: 0.75rem;
  --hf-space-4: 1rem;
  --hf-space-5: 1.5rem;
  --hf-space-6: 2rem;
  --hf-space-7: 3rem;
  --hf-space-8: 4rem;
  --hf-space-9: 6rem;
  --hf-space-10: 8rem;
  --hf-space-11: 12rem;
  --hf-section: clamp(6rem, 4.2394rem + 7.5117vw, 11rem);
  --hf-block: clamp(3rem, 1.9437rem + 4.507vw, 6rem);

  /* Sizes. --hf-target is the touch-target floor for anything interactive. */
  --hf-target: 44px;
  --hf-size-control-sm: 36px;
  --hf-size-control: 44px;
  --hf-size-control-lg: 52px;
  --hf-size-orb: 36px;
  --hf-size-nav: 64px;
  --hf-size-nav-compact: 52px;
  --hf-size-dock: 56px;
  --hf-size-dock-max: 420px;
  --hf-size-ruler: 44px;
  --hf-size-dot: 0.5em;
  --hf-size-seal-stop: 0.14em;
  --hf-size-eyebrow-mark: 0.55em;
  --hf-size-nav-marker: 6px;
  --hf-size-tick: 10px;
  --hf-size-tick-active: 18px;
  --hf-size-tick-offset: 6px;
  --hf-size-capsule-pad: 4px;

  /* Icons: Material Symbols Outlined, weight 400, drawn on a 24 px grid. */
  --hf-icon-xs: 16px;
  --hf-icon-sm: 20px;
  --hf-icon-md: 24px;
  --hf-icon-lg: 32px;
  --hf-icon-xl: 48px;

  /* Layout. Media queries cannot read var(): the --hf-bp-* and --hf-cq-*
     values mirror the literals used in @media and @container, for scripts
     and for documentation. Change both together. */
  --hf-container: 85rem;
  --hf-container-form: 36rem;
  --hf-bp-sm: 30rem;
  --hf-bp-md: 48rem;
  --hf-bp-lg: 64rem;
  --hf-bp-xl: 90rem;
  --hf-bp-pin-height: 42.5rem;
  --hf-cq-compact: 26.25rem;
  --hf-cq-console-stack: 55rem;

  /* Shape */
  --hf-radius-xs: 4px;
  --hf-radius-sm: 8px;
  --hf-radius-md: 14px;
  --hf-radius-lg: 22px;
  --hf-radius-xl: 32px;
  --hf-radius-pill: 999px;
  --hf-radius-seal: 8%;
  --hf-border-width: 1px;
  --hf-border-width-strong: 2px;
  --hf-focus-width: 2px;
  --hf-focus-offset: 3px;

  /* Blur */
  --hf-blur-reveal: 6px;
  --hf-blur-preview: 12px;
  --hf-blur-glow: 40px;

  /* Layers. The page's one WebGL canvas sits under the content. */
  --hf-z-below: -1;
  --hf-z-canvas: 0;
  --hf-z-content: 1;
  --hf-z-raised: 2;
  --hf-z-sticky: 10;
  --hf-z-ruler: 40;
  --hf-z-nav: 50;
  --hf-z-dock: 60;
  --hf-z-menu: 70;
  --hf-z-toast: 80;
  --hf-z-dialog: 90;
  --hf-z-skip: 100;

  /* Motion. Motion is evidence: something moves because something happened.
     One overshoot in the system, for the seal only: the hf-stamp keyframes
     (--hf-scale-stamp-from, then --hf-scale-stamp-peak at 60%, then 1, each
     segment on --hf-ease-out; Design System Spec 9.28). --hf-ease-stamp is the
     single-tween equivalent for code that cannot use keyframes; never apply it
     on top of the keyframes, or the overshoot doubles. */
  --hf-dur-1: 90ms;
  --hf-dur-2: 160ms;
  --hf-dur-3: 240ms;
  --hf-dur-4: 420ms;
  --hf-dur-5: 720ms;
  --hf-dur-6: 1200ms;
  --hf-dur-reduced: 120ms;
  /* Signature moments: the seal's stamp, a log row's scan sweep, the capsule closing. */
  --hf-dur-stamp: 360ms;
  --hf-dur-scan: 600ms;
  --hf-dur-capsule: 480ms;
  --hf-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hf-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --hf-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --hf-ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --hf-ease-sink: cubic-bezier(0.5, 0, 0.75, 0);
  --hf-ease-stamp: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hf-ease-machine: steps(1, end);
  --hf-stagger: 40ms;
  --hf-blink: 530ms;
  --hf-pulse: 1.6s;
  --hf-loop-lustre: 14s;
  --hf-loop-breath: 7s;
  --hf-loop-run: 6s;
  --hf-probe-first: 3.5s;
  --hf-probe-gap: 10s;
  --hf-chapter-autoplay: 3.5s;
  --hf-pin-length: 240vh;
  --hf-chapter-span: 60vh;
  --hf-chapter-hold: 0.4;
  --hf-nav-compact-after: 64px;
  --hf-light-angle: 200deg;

  /* Motion amounts. Section 10 sets them to rest under reduced motion or
     Pause, so components need no media query of their own. */
  --hf-motion: 1;
  --hf-play-state: running;
  --hf-scroll-behavior: smooth;
  --hf-reveal-from: 0;
  --hf-move-lift: 2px;
  --hf-move-rise: 12px;
  --hf-move-hero: 40px;
  --hf-move-page-out: 6vh;
  --hf-move-page-in: 8vh;
  --hf-move-arrow: 3px;
  --hf-move-dock: 16px;
  --hf-scale-press: 0.98;
  --hf-scale-stamp-from: 0.6;
  --hf-scale-stamp-peak: 1.08;
  --hf-scale-seal-pulse: 1.12;
}

/* 2. Paper: the light theme, the default --------------------------------- */

:root,
[data-surface="paper"] {
  --hf-scheme: light;

  --hf-color-ground: #F5F5F1;
  --hf-color-surface: #FFFFFF;
  --hf-color-band: #ECEDE8;
  --hf-color-well: #E2E4DE;

  /* Text 17.80 · 7.95 · 5.33 on ground; 15.18 · 6.78 · 4.54 on well. */
  --hf-color-text-1: #0B0D10;
  --hf-color-text-2: #454C55;
  --hf-color-text-3: #5E666F;
  --hf-color-text-disabled: #8C929A;

  /* line and line-2 are decorative hairlines; line-input is the control
     border (3.23 ground, 3.53 surface, 3.00 band; never on a well). */
  --hf-color-line: #E0E2DB;
  --hf-color-line-2: #C6CAC2;
  --hf-color-line-input: #828992;

  /* The ink pill and anything inverted. on-inverse on inverse 17.80. */
  --hf-color-inverse: #0B0D10;
  --hf-color-inverse-hover: #22272E;
  --hf-color-on-inverse: #F5F5F1;

  --hf-color-focus: #2546C4;
  --hf-color-selection: #DCE1F6;
  --hf-color-on-selection: #0B0D10;
  --hf-color-overlay: rgb(11 13 16 / 0.32);
  --hf-color-skeleton: #E2E4DE;
  /* The seal's 1 px inner edge, paper only, so the square never dissolves. */
  --hf-color-seal-edge: rgb(168 106 10 / 0.45);

  /* Status: a round dot plus a word, never colour alone, never decoration.
     info = in-country and routing; success = pass and redacted;
     warning = held, flagged and awaiting a human; danger = blocked, denied
     and errors. Ink is text-safe on ground, surface, band and well (lowest
     4.58) and on its own tint (lowest 5.09). On paper the dot uses the ink;
     bright exists for dark surfaces only. */
  --hf-color-info: #2546C4;
  --hf-color-info-tint: #EBEEFA;
  --hf-color-info-line: #B9C4EC;
  --hf-color-info-bright: #2546C4;
  --hf-color-success: #0A7350;
  --hf-color-success-tint: #E7F1EE;
  --hf-color-success-line: #B1D2C7;
  --hf-color-success-bright: #0A7350;
  --hf-color-warning: #875700;
  --hf-color-warning-tint: #F1EBE0;
  --hf-color-warning-line: #D9C9AD;
  --hf-color-warning-bright: #875700;
  --hf-color-danger: #B4271C;
  --hf-color-danger-tint: #F8ECEB;
  --hf-color-danger-line: #E7BAB6;
  --hf-color-danger-bright: #B4271C;

  /* The probe's streak. On paper it is decoration (2.49:1); the log line
     carries the meaning. */
  --hf-color-flare: #F2796D;

  /* Data visualisation, light: validated as a set (OKLCH band, chroma floor,
     CVD all-pairs worst 12.0 deutan, normal-vision worst 20.6, all >= 3:1 on
     ground and surface). At most three series; fold the rest into "Other". */
  --hf-color-viz-1: #0097B1;
  --hf-color-viz-2: #8F204F;
  --hf-color-viz-3: #6E6E00;
  --hf-color-viz-muted: #B3B8BE;
  --hf-color-viz-div-n3: var(--hf-color-rose-700);
  --hf-color-viz-div-n2: var(--hf-color-rose-500);
  --hf-color-viz-div-n1: var(--hf-color-rose-300);
  --hf-color-viz-div-0: #E2E4DE;
  --hf-color-viz-div-p1: var(--hf-color-sea-300);
  --hf-color-viz-div-p2: var(--hf-color-sea-500);
  --hf-color-viz-div-p3: var(--hf-color-sea-700);

  /* Engraved type (the footer band): debossed into the paper. Decorative and
     aria-hidden, so exempt from text contrast. */
  --hf-color-engrave: #EAEAE5;
  --hf-engrave-shadow: 0 -1px 0 rgb(11 13 16 / 0.12), 0 1px 0 rgb(255 255 255 / 0.9);

  /* Lustre strength and the glow's alpha per stop (strength 0.6 on paper). */
  --hf-lustre-strength: 0.6;
  --hf-lustre-glow-1: 0.36;
  --hf-lustre-glow-2: 0.3;
  --hf-lustre-glow-3: 0.25;

  /* Elevation: e1 cards, e2 glass, console and menus, e3 dock, sheet, dialog. */
  --hf-shadow-1: 0 1px 2px rgb(16 24 40 / 0.06), 0 8px 24px -12px rgb(16 24 40 / 0.16);
  --hf-shadow-2: 0 2px 6px rgb(16 24 40 / 0.06), 0 24px 48px -20px rgb(16 24 40 / 0.22);
  --hf-shadow-3: 0 4px 12px rgb(16 24 40 / 0.08), 0 40px 80px -32px rgb(16 24 40 / 0.30);
  --hf-shadow-inset: inset 0 1px 2px rgb(16 24 40 / 0.08);
  --hf-glow-seal: none;

  /* Glass: one recipe. Composited over flat paper the fill is #FCFCFA, where
     text-1 is 18.94 and text-3 5.67; over a 60% champagne glow text-3 is 5.45,
     and 5.39 over the palest 60% lustre stop. */
  --hf-glass-fill: rgb(255 255 255 / 0.66);
  --hf-glass-fill-solid: #FCFCFA;
  --hf-glass-edge: rgb(11 13 16 / 0.08);
  --hf-glass-highlight: rgb(255 255 255 / 0.85);
  --hf-glass-blur: 16px;
  --hf-glass-blur-raised: 20px;
  --hf-glass-saturate: 1.6;
  --hf-noise-opacity: 0.04;

  --hf-grad-paper: linear-gradient(180deg, #F7F7F3 0%, #F5F5F1 55%, #F0F1EB 100%);
}

/* 3. Night: the dark theme ----------------------------------------------- */
/* The block appears twice: CSS cannot share one rule between a media query
   and an attribute selector. Keep the two identical. */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hf-scheme: dark;
    --hf-color-ground: #06080B;
    --hf-color-surface: #0C1015;
    --hf-color-band: #121820;
    --hf-color-well: #1A222C;
    --hf-color-text-1: #EEF1F5;
    --hf-color-text-2: #A9B2BE;
    --hf-color-text-3: #808A97;
    --hf-color-text-disabled: #5A636E;
    --hf-color-line: #1B222B;
    --hf-color-line-2: #2B3541;
    --hf-color-line-input: #5E6976;
    --hf-color-inverse: #EEF1F5;
    --hf-color-inverse-hover: #FFFFFF;
    --hf-color-on-inverse: #06080B;
    --hf-color-focus: #8EB0FF;
    --hf-color-selection: #33405B;
    --hf-color-on-selection: #EEF1F5;
    --hf-color-overlay: rgb(0 0 0 / 0.6);
    --hf-color-skeleton: #1A222C;
    --hf-color-seal-edge: transparent;
    --hf-color-info: #8EB0FF;
    --hf-color-info-tint: #1E2636;
    --hf-color-info-line: #3F5073;
    --hf-color-info-bright: #8EB0FF;
    --hf-color-success: #48DDB1;
    --hf-color-success-tint: #142D2B;
    --hf-color-success-line: #236254;
    --hf-color-success-bright: #48DDB1;
    --hf-color-warning: #F4BA48;
    --hf-color-warning-tint: #2C281C;
    --hf-color-warning-line: #68542A;
    --hf-color-warning-bright: #F4BA48;
    --hf-color-danger: #FF7B6C;
    --hf-color-danger-tint: #2E1F21;
    --hf-color-danger-line: #6D3B38;
    --hf-color-danger-bright: #FF7B6C;
    --hf-color-flare: #FF7B6C;
    --hf-color-viz-1: #00A1BC;
    --hf-color-viz-2: #A63862;
    --hf-color-viz-3: #7D7D00;
    --hf-color-viz-muted: #465160;
    --hf-color-viz-div-n3: var(--hf-color-rose-200);
    --hf-color-viz-div-n2: var(--hf-color-rose-400);
    --hf-color-viz-div-n1: var(--hf-color-rose-600);
    --hf-color-viz-div-0: #2B3541;
    --hf-color-viz-div-p1: var(--hf-color-sea-600);
    --hf-color-viz-div-p2: var(--hf-color-sea-400);
    --hf-color-viz-div-p3: var(--hf-color-sea-200);
    --hf-color-engrave: #0A0D11;
    --hf-engrave-shadow: 0 -1px 0 rgb(0 0 0 / 0.6), 0 1px 0 rgb(255 255 255 / 0.06);
    --hf-lustre-strength: 0.4;
    --hf-lustre-glow-1: 0.16;
    --hf-lustre-glow-2: 0.14;
    --hf-lustre-glow-3: 0.12;
    --hf-shadow-1: 0 1px 2px rgb(0 0 0 / 0.40), 0 8px 24px -12px rgb(0 0 0 / 0.55);
    --hf-shadow-2: 0 2px 6px rgb(0 0 0 / 0.45), 0 24px 48px -20px rgb(0 0 0 / 0.65);
    --hf-shadow-3: 0 4px 12px rgb(0 0 0 / 0.50), 0 40px 80px -32px rgb(0 0 0 / 0.75);
    --hf-shadow-inset: inset 0 1px 2px rgb(0 0 0 / 0.5);
    --hf-glow-seal: 0 0 0 1px rgb(244 186 72 / 0.35), 0 0 24px 2px rgb(244 186 72 / 0.40);
    --hf-glass-fill: rgb(16 22 32 / 0.58);
    --hf-glass-fill-solid: #0C1017;
    --hf-glass-edge: rgb(255 255 255 / 0.09);
    --hf-glass-highlight: rgb(255 255 255 / 0.10);
    --hf-glass-blur: 14px;
    --hf-glass-blur-raised: 18px;
    --hf-glass-saturate: 1.4;
    --hf-noise-opacity: 0.06;
    --hf-grad-paper: linear-gradient(180deg, #080A0E 0%, #06080B 55%, #05070A 100%);
  }
}

:root[data-theme="dark"],
[data-surface="night"] {
  --hf-scheme: dark;
  --hf-color-ground: #06080B;
  --hf-color-surface: #0C1015;
  --hf-color-band: #121820;
  --hf-color-well: #1A222C;
  --hf-color-text-1: #EEF1F5;
  --hf-color-text-2: #A9B2BE;
  --hf-color-text-3: #808A97;
  --hf-color-text-disabled: #5A636E;
  --hf-color-line: #1B222B;
  --hf-color-line-2: #2B3541;
  --hf-color-line-input: #5E6976;
  --hf-color-inverse: #EEF1F5;
  --hf-color-inverse-hover: #FFFFFF;
  --hf-color-on-inverse: #06080B;
  --hf-color-focus: #8EB0FF;
  --hf-color-selection: #33405B;
  --hf-color-on-selection: #EEF1F5;
  --hf-color-overlay: rgb(0 0 0 / 0.6);
  --hf-color-skeleton: #1A222C;
  --hf-color-seal-edge: transparent;
  --hf-color-info: #8EB0FF;
  --hf-color-info-tint: #1E2636;
  --hf-color-info-line: #3F5073;
  --hf-color-info-bright: #8EB0FF;
  --hf-color-success: #48DDB1;
  --hf-color-success-tint: #142D2B;
  --hf-color-success-line: #236254;
  --hf-color-success-bright: #48DDB1;
  --hf-color-warning: #F4BA48;
  --hf-color-warning-tint: #2C281C;
  --hf-color-warning-line: #68542A;
  --hf-color-warning-bright: #F4BA48;
  --hf-color-danger: #FF7B6C;
  --hf-color-danger-tint: #2E1F21;
  --hf-color-danger-line: #6D3B38;
  --hf-color-danger-bright: #FF7B6C;
  --hf-color-flare: #FF7B6C;
  --hf-color-viz-1: #00A1BC;
  --hf-color-viz-2: #A63862;
  --hf-color-viz-3: #7D7D00;
  --hf-color-viz-muted: #465160;
  --hf-color-viz-div-n3: var(--hf-color-rose-200);
  --hf-color-viz-div-n2: var(--hf-color-rose-400);
  --hf-color-viz-div-n1: var(--hf-color-rose-600);
  --hf-color-viz-div-0: #2B3541;
  --hf-color-viz-div-p1: var(--hf-color-sea-600);
  --hf-color-viz-div-p2: var(--hf-color-sea-400);
  --hf-color-viz-div-p3: var(--hf-color-sea-200);
  --hf-color-engrave: #0A0D11;
  --hf-engrave-shadow: 0 -1px 0 rgb(0 0 0 / 0.6), 0 1px 0 rgb(255 255 255 / 0.06);
  --hf-lustre-strength: 0.4;
  --hf-lustre-glow-1: 0.16;
  --hf-lustre-glow-2: 0.14;
  --hf-lustre-glow-3: 0.12;
  --hf-shadow-1: 0 1px 2px rgb(0 0 0 / 0.40), 0 8px 24px -12px rgb(0 0 0 / 0.55);
  --hf-shadow-2: 0 2px 6px rgb(0 0 0 / 0.45), 0 24px 48px -20px rgb(0 0 0 / 0.65);
  --hf-shadow-3: 0 4px 12px rgb(0 0 0 / 0.50), 0 40px 80px -32px rgb(0 0 0 / 0.75);
  --hf-shadow-inset: inset 0 1px 2px rgb(0 0 0 / 0.5);
  --hf-glow-seal: 0 0 0 1px rgb(244 186 72 / 0.35), 0 0 24px 2px rgb(244 186 72 / 0.40);
  --hf-glass-fill: rgb(16 22 32 / 0.58);
  --hf-glass-fill-solid: #0C1017;
  --hf-glass-edge: rgb(255 255 255 / 0.09);
  --hf-glass-highlight: rgb(255 255 255 / 0.10);
  --hf-glass-blur: 14px;
  --hf-glass-blur-raised: 18px;
  --hf-glass-saturate: 1.4;
  --hf-noise-opacity: 0.06;
  --hf-grad-paper: linear-gradient(180deg, #080A0E 0%, #06080B 55%, #05070A 100%);
}

/* 4. Instrument: always dark, in both themes ----------------------------- */
/* Set data-surface="instrument" on the console, the map, the standards band
   and the nav while it floats over them. Text 16.37 · 8.40 · 5.30 on the
   panel; text-3 is 4.95 on a row and 4.51 on a hovered row. */

[data-surface="instrument"] {
  --hf-scheme: dark;
  --hf-color-ground: var(--hf-color-inst-ground);
  --hf-color-surface: var(--hf-color-inst-panel);
  --hf-color-band: var(--hf-color-inst-row);
  --hf-color-well: var(--hf-color-inst-row-hover);
  --hf-color-text-1: var(--hf-color-inst-text-1);
  --hf-color-text-2: var(--hf-color-inst-text-2);
  --hf-color-text-3: var(--hf-color-inst-text-3);
  --hf-color-text-disabled: #56606B;
  --hf-color-line: var(--hf-color-inst-line);
  --hf-color-line-2: var(--hf-color-inst-tick);
  --hf-color-line-input: #5E6976;
  --hf-color-inverse: var(--hf-color-inst-text-1);
  --hf-color-inverse-hover: #FFFFFF;
  --hf-color-on-inverse: var(--hf-color-inst-ground);
  --hf-color-focus: #8EB0FF;
  --hf-color-selection: #32405C;
  --hf-color-on-selection: var(--hf-color-inst-text-1);
  --hf-color-overlay: rgb(0 0 0 / 0.6);
  --hf-color-skeleton: var(--hf-color-inst-row-hover);
  --hf-color-seal-edge: transparent;
  --hf-color-info: #8EB0FF;
  --hf-color-info-tint: #1D2637;
  --hf-color-info-line: #3F5073;
  --hf-color-info-bright: #8EB0FF;
  --hf-color-success: #48DDB1;
  --hf-color-success-tint: #142D2C;
  --hf-color-success-line: #236254;
  --hf-color-success-bright: #48DDB1;
  --hf-color-warning: #F4BA48;
  --hf-color-warning-tint: #2C281D;
  --hf-color-warning-line: #68542A;
  --hf-color-warning-bright: #F4BA48;
  --hf-color-danger: #FF7B6C;
  --hf-color-danger-tint: #2D1F22;
  --hf-color-danger-line: #6D3B38;
  --hf-color-danger-bright: #FF7B6C;
  --hf-color-flare: #FF7B6C;
  --hf-color-viz-1: #00A1BC;
  --hf-color-viz-2: #A63862;
  --hf-color-viz-3: #7D7D00;
  --hf-color-viz-muted: #465160;
  --hf-color-viz-div-n3: var(--hf-color-rose-200);
  --hf-color-viz-div-n2: var(--hf-color-rose-400);
  --hf-color-viz-div-n1: var(--hf-color-rose-600);
  --hf-color-viz-div-0: #2B3541;
  --hf-color-viz-div-p1: var(--hf-color-sea-600);
  --hf-color-viz-div-p2: var(--hf-color-sea-400);
  --hf-color-viz-div-p3: var(--hf-color-sea-200);
  --hf-color-engrave: #080B0F;
  --hf-engrave-shadow: 0 -1px 0 rgb(0 0 0 / 0.6), 0 1px 0 rgb(255 255 255 / 0.06);
  --hf-lustre-strength: 0.4;
  --hf-lustre-glow-1: 0.16;
  --hf-lustre-glow-2: 0.14;
  --hf-lustre-glow-3: 0.12;
  --hf-shadow-1: 0 1px 2px rgb(0 0 0 / 0.40), 0 8px 24px -12px rgb(0 0 0 / 0.55);
  --hf-shadow-2: 0 2px 6px rgb(0 0 0 / 0.45), 0 24px 48px -20px rgb(0 0 0 / 0.65);
  --hf-shadow-3: 0 4px 12px rgb(0 0 0 / 0.50), 0 40px 80px -32px rgb(0 0 0 / 0.75);
  --hf-shadow-inset: inset 0 1px 2px rgb(0 0 0 / 0.5);
  --hf-glow-seal: 0 0 0 1px rgb(244 186 72 / 0.35), 0 0 24px 2px rgb(244 186 72 / 0.40);
  --hf-glass-fill: rgb(16 22 32 / 0.58);
  --hf-glass-fill-solid: #0B1017;
  --hf-glass-edge: rgb(255 255 255 / 0.09);
  --hf-glass-highlight: rgb(255 255 255 / 0.10);
  --hf-glass-blur: 14px;
  --hf-glass-blur-raised: 18px;
  --hf-glass-saturate: 1.4;
  --hf-noise-opacity: 0.06;
  --hf-grad-paper: linear-gradient(180deg, #080A0E 0%, #06080B 55%, #05070A 100%);
}

/* 5. Language ------------------------------------------------------------ */
/* Same size tokens in both scripts for display (size-adjust carries the
   optical match). Arabic gets +1 px on the reading sizes, taller leading,
   zero tracking, Alexandria weights matched by stem, and labels in
   Alexandria 600 instead of uppercase mono. The Arabic block comes second,
   so an English fragment (lang="en") inside an Arabic page gets English
   values back. */

:root,
[lang|="en"] {
  --hf-fs-caption: clamp(0.75rem, 0.728rem + 0.0939vw, 0.8125rem);
  --hf-fs-small: clamp(0.875rem, 0.853rem + 0.0939vw, 0.9375rem);
  --hf-fs-body: clamp(1rem, 0.956rem + 0.1878vw, 1.125rem);
  --hf-fs-title: clamp(1.125rem, 1.059rem + 0.2817vw, 1.3125rem);
  --hf-fs-lead: clamp(1.1875rem, 1.0775rem + 0.4695vw, 1.5rem);
  --hf-fs-label: var(--hf-fs-caption);
  /* Buttons, inputs and nav links. */
  --hf-fs-ui: var(--hf-fs-small);

  --hf-lh-display-xxl: 0.88;
  --hf-lh-display-xl: 0.94;
  --hf-lh-display-l: 0.98;
  --hf-lh-display-m: 1.04;
  --hf-lh-display-s: 1.1;
  --hf-lh-heading: 1.15;
  --hf-lh-title: 1.3;
  --hf-lh-lead: 1.45;
  --hf-lh-body: 1.6;
  --hf-lh-small: 1.5;
  --hf-lh-caption: 1.45;
  --hf-lh-label: 1.3;
  --hf-lh-ui: 1.3;
  --hf-lh-console: 1.7;

  --hf-tr-display-xxl: -0.05em;
  --hf-tr-display-xl: -0.045em;
  --hf-tr-display-l: -0.04em;
  --hf-tr-display-m: -0.03em;
  --hf-tr-display-s: -0.02em;
  --hf-tr-heading: -0.015em;
  --hf-tr-title: -0.01em;
  --hf-tr-lead: -0.005em;
  --hf-tr-body: 0em;
  --hf-tr-small: 0em;
  --hf-tr-caption: 0.005em;
  --hf-tr-label: 0.08em;
  --hf-tr-accent: -0.01em;
  --hf-tr-console: 0em;

  /* Geist: 250 only at 48 px and up; 300 and up below, because thin weights
     break up on 1080p Windows screens. */
  --hf-wt-display-xxl: 250;
  --hf-wt-display-xl: 250;
  --hf-wt-display: 300;
  --hf-wt-heading: 400;
  --hf-wt-title: 500;
  --hf-wt-lead: 400;
  --hf-wt-body: 400;
  --hf-wt-ui: 500;
  --hf-wt-strong: 600;
  --hf-wt-label: 500;
  --hf-wt-console: 400;

  --hf-font-label: var(--hf-font-mono);
  --hf-tt-label: uppercase;
  --hf-measure: 66ch;
  --hf-display-pad-end: 0em;
  --hf-font-accent: "HF Instrument Serif", "HF Amiri", "HF Alexandria", "HF Serif Fallback", Georgia, serif;
}

:root[lang="ar"],
[lang|="ar"] {
  --hf-fs-caption: clamp(0.8125rem, 0.7905rem + 0.0939vw, 0.875rem);
  --hf-fs-small: clamp(0.9375rem, 0.9155rem + 0.0939vw, 1rem);
  --hf-fs-body: clamp(1.0625rem, 1.0185rem + 0.1878vw, 1.1875rem);
  --hf-fs-title: clamp(1.1875rem, 1.1215rem + 0.2817vw, 1.375rem);
  --hf-fs-lead: clamp(1.25rem, 1.14rem + 0.4695vw, 1.5625rem);
  --hf-fs-label: var(--hf-fs-caption);
  /* Arabic controls read at body size (verbal nouns in Alexandria 500). */
  --hf-fs-ui: var(--hf-fs-body);

  --hf-lh-display-xxl: 1.2;
  --hf-lh-display-xl: 1.22;
  --hf-lh-display-l: 1.25;
  --hf-lh-display-m: 1.3;
  --hf-lh-display-s: 1.35;
  --hf-lh-heading: 1.4;
  --hf-lh-title: 1.5;
  --hf-lh-lead: 1.75;
  --hf-lh-body: 1.85;
  --hf-lh-small: 1.75;
  --hf-lh-caption: 1.6;
  --hf-lh-label: 1.5;
  --hf-lh-ui: 1.5;
  --hf-lh-console: 1.8;

  /* Never letter-space Arabic: it widens or breaks the joins. */
  --hf-tr-display-xxl: 0em;
  --hf-tr-display-xl: 0em;
  --hf-tr-display-l: 0em;
  --hf-tr-display-m: 0em;
  --hf-tr-display-s: 0em;
  --hf-tr-heading: 0em;
  --hf-tr-title: 0em;
  --hf-tr-lead: 0em;
  --hf-tr-body: 0em;
  --hf-tr-small: 0em;
  --hf-tr-caption: 0em;
  --hf-tr-label: 0em;
  --hf-tr-accent: 0em;
  --hf-tr-console: 0em;

  /* Alexandria weights matched to Geist by stem width (300, 360, 490, 600). */
  --hf-wt-display-xxl: 300;
  --hf-wt-display-xl: 300;
  --hf-wt-display: 300;
  --hf-wt-heading: 400;
  --hf-wt-title: 500;
  --hf-wt-lead: 360;
  --hf-wt-body: 360;
  --hf-wt-ui: 500;
  --hf-wt-strong: 600;
  --hf-wt-label: 600;
  --hf-wt-console: 400;

  --hf-font-label: var(--hf-font-sans);
  --hf-tt-label: none;
  --hf-measure: 36em;
  /* Nuqat and Amiri tails hang below the line box of display type. */
  --hf-display-pad-end: 0.12em;
  /* The Arabic accent is Amiri, upright. Instrument Serif leaves the Arabic
     stack: its unicode-range claims the space and the full stop, so an
     Arabic accent such as «نحاول اختراقهم.» would download it (22 KB) for
     two characters, outside the Arabic font budget (Website Spec §8). Its
     metric-matched fallback sets those characters instead, with the same
     line box. English fragments (lang="en") get the stack above back. */
  --hf-font-accent: "HF Amiri", "HF Alexandria", "HF Serif Fallback", Georgia, serif;
}

/* 6. Direction ----------------------------------------------------------- */
/* Multiply horizontal offsets by --hf-dir. The hot spot of gradients and
   glows sits towards the reading end: right in English, left in Arabic. */

:root,
[dir="ltr"] {
  --hf-dir: 1;
  --hf-hotspot-x: 68%;
}

:root[dir="rtl"],
[dir="rtl"] {
  --hf-dir: -1;
  --hf-hotspot-x: 32%;
}

/* 7. Responsive grid ----------------------------------------------------- */
/* 4 columns under 768 px, 8 from 768, 12 from 1024; the margin settles at
   80 px from 1440. The container caps the content at 1360 px. */

:root {
  --hf-grid-cols: 4;
  --hf-grid-gutter: 1rem;
  --hf-grid-margin: 1rem;
}

@media (min-width: 48rem) {
  :root {
    --hf-grid-cols: 8;
    --hf-grid-gutter: 1.25rem;
    --hf-grid-margin: 2rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --hf-grid-cols: 12;
    --hf-grid-gutter: 1.5rem;
    --hf-grid-margin: clamp(2rem, 4vw, 4rem);
  }
}

@media (min-width: 90rem) {
  :root {
    --hf-grid-gutter: 2rem;
    --hf-grid-margin: 5rem;
  }
}

/* 8. Derived tokens ------------------------------------------------------ */
/* Composites that read other tokens. Re-declared on every scope and
   direction change so they resolve against the local values. */

:root,
[data-surface],
[dir] {
  --hf-border: var(--hf-border-width) solid var(--hf-color-line);
  --hf-border-2: var(--hf-border-width) solid var(--hf-color-line-2);
  --hf-border-input: var(--hf-border-width) solid var(--hf-color-line-input);

  --hf-color-link: var(--hf-color-text-1);
  --hf-color-link-underline: var(--hf-color-line-input);
  --hf-color-tick: var(--hf-color-line-2);
  --hf-color-tick-active: var(--hf-color-text-1);
  --hf-color-redaction: var(--hf-color-text-1);

  /* Neutral status: received, logged, staged. */
  --hf-color-neutral: var(--hf-color-text-2);
  --hf-color-neutral-tint: var(--hf-color-band);
  --hf-color-neutral-line: var(--hf-color-line-2);

  /* Chart chrome: values and labels always wear text tokens, never series colour. */
  --hf-color-viz-grid: var(--hf-color-line);
  --hf-color-viz-axis: var(--hf-color-line-2);
  --hf-color-viz-label: var(--hf-color-text-3);

  --hf-grad-seal: linear-gradient(135deg, var(--hf-color-seal-hi) 0%, var(--hf-color-seal-lo) 100%);
  --hf-grad-lustre: linear-gradient(115deg, var(--hf-color-lustre-1) 0%, var(--hf-color-lustre-12) 17%, var(--hf-color-lustre-2) 33%, var(--hf-color-lustre-23) 50%, var(--hf-color-lustre-3) 67%, var(--hf-color-lustre-34) 83%, var(--hf-color-lustre-4) 100%);
  --hf-grad-lustre-conic: conic-gradient(from var(--hf-light-angle), var(--hf-color-lustre-1), var(--hf-color-lustre-12), var(--hf-color-lustre-2), var(--hf-color-lustre-23), var(--hf-color-lustre-3), var(--hf-color-lustre-34), var(--hf-color-lustre-4), var(--hf-color-lustre-41), var(--hf-color-lustre-1));
  --hf-grad-lustre-band: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.55) 50%, transparent 65%);
  --hf-glow-lustre:
    radial-gradient(40% 44% at var(--hf-hotspot-x) 38%, color-mix(in srgb, var(--hf-color-lustre-1) calc(var(--hf-lustre-glow-1) * 100%), transparent), transparent 70%),
    radial-gradient(30% 36% at calc(var(--hf-hotspot-x) + 12% * var(--hf-dir)) 62%, color-mix(in srgb, var(--hf-color-lustre-2) calc(var(--hf-lustre-glow-2) * 100%), transparent), transparent 70%),
    radial-gradient(28% 30% at calc(var(--hf-hotspot-x) - 8% * var(--hf-dir)) 74%, color-mix(in srgb, var(--hf-color-lustre-4) calc(var(--hf-lustre-glow-3) * 100%), transparent), transparent 70%);
  --hf-grad-instrument: radial-gradient(120% 90% at var(--hf-hotspot-x) 38%, var(--hf-color-inst-hot) 0%, var(--hf-color-inst-mid) 48%, var(--hf-color-inst-ground) 100%);
  --hf-grad-core: linear-gradient(180deg, var(--hf-color-ground) 0%, var(--hf-color-core) 52%, var(--hf-color-inst-ground) 100%);
  --hf-grad-scan: linear-gradient(calc(90deg * var(--hf-dir)), transparent, rgb(142 176 255 / 0.18), transparent);

  /* Platform aliases: the placeholder's token names, which the website's
     area stylesheets still read. They map onto the system so this file can
     replace the placeholder today. Retire each alias once no stylesheet
     reads it (design-system README, "Migrating the platform"). */
  --hf-color-bg: var(--hf-color-ground);
  --hf-color-surface-raised: var(--hf-color-band);
  --hf-color-text: var(--hf-color-text-1);
  --hf-color-text-muted: var(--hf-color-text-2);
  --hf-color-line-strong: var(--hf-color-line-input);
  --hf-color-accent: var(--hf-color-inverse);
  --hf-color-accent-ink: var(--hf-color-on-inverse);
  --hf-color-danger-surface: var(--hf-color-danger-tint);
  --hf-color-success-surface: var(--hf-color-success-tint);
  --hf-shadow-raised: var(--hf-shadow-1);
  --hf-gutter: var(--hf-grid-margin);
  --hf-duration-fast: var(--hf-dur-2);
  --hf-duration: var(--hf-dur-3);
  --hf-ease: var(--hf-ease-standard);
}

/* 9. Platform aliases that depend on the language ------------------------ */

:root,
[lang] {
  --hf-font-latin: var(--hf-font-sans);
  --hf-font-arabic: var(--hf-font-sans);
  --hf-font-body: var(--hf-font-sans);
  --hf-font-heading: var(--hf-font-sans);
  --hf-text-xs: var(--hf-fs-caption);
  --hf-text-sm: var(--hf-fs-small);
  --hf-text-base: var(--hf-fs-body);
  --hf-text-lg: var(--hf-fs-title);
  --hf-text-xl: var(--hf-fs-heading);
  --hf-text-2xl: var(--hf-fs-display-s);
  --hf-text-3xl: var(--hf-fs-display-m);
  --hf-leading-tight: var(--hf-lh-heading);
  --hf-leading-body: var(--hf-lh-body);
  --hf-weight-regular: var(--hf-wt-body);
  --hf-weight-bold: var(--hf-wt-strong);
  --hf-tracking-label: var(--hf-tr-label);
}

/* 10. Preferences -------------------------------------------------------- */

/* Reduced motion, and the site-wide Pause control: the server writes
   data-motion="off" on <html> from the visitor's hf_pref cookie (Website
   Spec, S-09). Both take the same complete path: movement and loops stop,
   fades last 120 ms at most, and nothing that carries text starts hidden. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --hf-motion: 0;
    --hf-play-state: paused;
    --hf-scroll-behavior: auto;
    --hf-reveal-from: 1;
    --hf-dur-1: 0ms;
    --hf-dur-2: var(--hf-dur-reduced);
    --hf-dur-3: var(--hf-dur-reduced);
    --hf-dur-4: var(--hf-dur-reduced);
    --hf-dur-5: var(--hf-dur-reduced);
    --hf-dur-6: var(--hf-dur-reduced);
    --hf-dur-stamp: 0ms;
    --hf-dur-scan: 0ms;
    --hf-dur-capsule: 0ms;
    --hf-stagger: 0ms;
    --hf-blur-reveal: 0px;
    --hf-move-lift: 0px;
    --hf-move-rise: 0px;
    --hf-move-hero: 0px;
    --hf-move-page-out: 0px;
    --hf-move-page-in: 0px;
    --hf-move-arrow: 0px;
    --hf-move-dock: 0px;
    --hf-scale-press: 1;
    --hf-scale-stamp-from: 1;
    --hf-scale-stamp-peak: 1;
    --hf-scale-seal-pulse: 1;
  }
}

:root[data-motion="off"] {
  --hf-motion: 0;
  --hf-play-state: paused;
  --hf-scroll-behavior: auto;
  --hf-reveal-from: 1;
  --hf-dur-1: 0ms;
  --hf-dur-2: var(--hf-dur-reduced);
  --hf-dur-3: var(--hf-dur-reduced);
  --hf-dur-4: var(--hf-dur-reduced);
  --hf-dur-5: var(--hf-dur-reduced);
  --hf-dur-6: var(--hf-dur-reduced);
  --hf-dur-stamp: 0ms;
  --hf-dur-scan: 0ms;
  --hf-dur-capsule: 0ms;
  --hf-stagger: 0ms;
  --hf-blur-reveal: 0px;
  --hf-move-lift: 0px;
  --hf-move-rise: 0px;
  --hf-move-hero: 0px;
  --hf-move-page-out: 0px;
  --hf-move-page-in: 0px;
  --hf-move-arrow: 0px;
  --hf-move-dock: 0px;
  --hf-scale-press: 1;
  --hf-scale-stamp-from: 1;
  --hf-scale-stamp-peak: 1;
  --hf-scale-seal-pulse: 1;
}

/* More contrast: secondary text darkens (or lightens) a step, hairlines
   become visible boundaries, glass turns solid. */
@media (prefers-contrast: more) {
  :root,
  [data-surface="paper"] {
    --hf-color-text-2: #2F353C;
    --hf-color-text-3: #454C55;
    --hf-color-line: #A7ADA5;
    --hf-color-line-2: #828992;
    --hf-color-line-input: #5E666F;
    --hf-glass-fill: var(--hf-glass-fill-solid);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --hf-color-text-2: #C9D0D9;
      --hf-color-text-3: #A9B2BE;
      --hf-color-line: #3A4654;
      --hf-color-line-2: #5E6976;
      --hf-color-line-input: #808A97;
      --hf-glass-fill: var(--hf-glass-fill-solid);
    }
  }

  :root[data-theme="dark"],
  [data-surface="night"],
  [data-surface="instrument"] {
    --hf-color-text-2: #C9D0D9;
    --hf-color-text-3: #A9B2BE;
    --hf-color-line: #3A4654;
    --hf-color-line-2: #5E6976;
    --hf-color-line-input: #808A97;
    --hf-glass-fill: var(--hf-glass-fill-solid);
  }
}

/* The three blocks below repeat the night selectors (:root:not([data-theme="light"])
   and :root[data-theme="dark"], specificity 0,2,0), so they also win in the dark
   theme. With :root alone (0,1,0) the night block kept translucent glass, the seal's
   glow and night text colours, which printed light text on white paper. */

/* Reduced transparency: glass becomes the solid fallback. */
@media (prefers-reduced-transparency: reduce) {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"],
  [data-surface] {
    --hf-glass-fill: var(--hf-glass-fill-solid);
    --hf-glass-blur: 0px;
    --hf-glass-blur-raised: 0px;
  }
}

/* Forced colours (Windows contrast themes): lustre, glass and glows switch
   off; the seal becomes a CanvasText square; focus uses Highlight. */
@media (forced-colors: active) {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"],
  [data-surface] {
    --hf-color-seal: CanvasText;
    --hf-color-seal-hi: CanvasText;
    --hf-color-seal-lo: CanvasText;
    --hf-color-seal-edge: CanvasText;
    --hf-color-focus: Highlight;
    --hf-color-selection: Highlight;
    --hf-color-on-selection: HighlightText;
    --hf-lustre-glow-1: 0;
    --hf-lustre-glow-2: 0;
    --hf-lustre-glow-3: 0;
    --hf-glow-seal: none;
    --hf-glass-fill: Canvas;
    --hf-glass-fill-solid: Canvas;
    --hf-glass-edge: CanvasText;
    --hf-glass-highlight: transparent;
    --hf-glass-blur: 0px;
    --hf-glass-blur-raised: 0px;
    --hf-noise-opacity: 0;
  }
}

/* Print: every surface prints as paper, with hairlines and no effects.
   Risk committees print country pages. */
@media print {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"],
  [data-surface] {
    --hf-scheme: light;
    --hf-color-ground: #FFFFFF;
    --hf-color-surface: #FFFFFF;
    --hf-color-band: #FFFFFF;
    --hf-color-well: #FFFFFF;
    --hf-color-text-1: #000000;
    --hf-color-text-2: #2F353C;
    --hf-color-text-3: #454C55;
    --hf-color-line: #C6CAC2;
    --hf-color-line-2: #828992;
    --hf-color-line-input: #5E666F;
    --hf-color-inverse: #000000;
    --hf-color-on-inverse: #FFFFFF;
    --hf-color-info: #2546C4;
    --hf-color-info-tint: #FFFFFF;
    --hf-color-success: #0A7350;
    --hf-color-success-tint: #FFFFFF;
    --hf-color-warning: #875700;
    --hf-color-warning-tint: #FFFFFF;
    --hf-color-danger: #B4271C;
    --hf-color-danger-tint: #FFFFFF;
    --hf-color-inst-ground: #FFFFFF;
    --hf-color-inst-hot: #FFFFFF;
    --hf-color-inst-mid: #FFFFFF;
    --hf-color-inst-panel: #FFFFFF;
    --hf-color-inst-row: #FFFFFF;
    --hf-color-inst-row-hover: #FFFFFF;
    /* Instrument text and lines print dark too (1.17:1 otherwise), so
       anything that reads these tokens directly stays legible on paper. */
    --hf-color-inst-text-1: #000000;
    --hf-color-inst-text-2: #2F353C;
    --hf-color-inst-text-3: #454C55;
    --hf-color-inst-line: #C6CAC2;
    --hf-color-inst-tick: #828992;
    --hf-color-core: #FFFFFF;
    --hf-color-seal-edge: rgb(168 106 10 / 0.45);
    --hf-lustre-glow-1: 0;
    --hf-lustre-glow-2: 0;
    --hf-lustre-glow-3: 0;
    --hf-shadow-1: none;
    --hf-shadow-2: none;
    --hf-shadow-3: none;
    --hf-shadow-inset: none;
    --hf-glow-seal: none;
    --hf-glass-fill: transparent;
    --hf-glass-fill-solid: transparent;
    --hf-glass-blur: 0px;
    --hf-glass-blur-raised: 0px;
    --hf-noise-opacity: 0;
  }
}
