/* ──────────────────────────────────────────────────────────────────────────
   Shared site chrome. One source of truth for the masthead, reused on every
   page (repl, bench, floatbeat, examples grid, and the injected example
   mastheads). Link it as <link rel="stylesheet" href="<rel>/site.css">.

   This file owns the LOOK (band, brand, nav, font, paddings). Page LAYOUT —
   whether the header is in-flow, sticky, or a fixed overlay — stays per-page;
   add `.fixed` for the full-screen example pages that overlay a canvas.
   ────────────────────────────────────────────────────────────────────────── */

/* Jost (libre Futura) — bundled fallback; URL resolves relative to this file (assets/).
   On machines with real Futura installed the stack below renders it; Jost matches elsewhere. */
@font-face {
  font-family: Jost; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/asset?u=https%3A%2F%2Fjz.js.org%2Fassets%2Fjost.woff2) format('woff2');
}

/* ── Shared design tokens. The invariants every page reuses (fonts, band, spacing).
   Per-page palettes (light docs vs dark playgrounds) still set their own ink/paper. ── */
:root {
  --font: Futura, 'Futura PT', 'Avant Garde', 'ITC Avant Garde Gothic Std', 'Century Gothic', Jost, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mast-px: 24px;       /* header inset — matches the examples grid padding-x */

  /* ── Themed palette — ONE set of tokens, each a light-dark(LIGHT, DARK) pair. A page opts into theming
     by setting data-theme on <html> (the no-flash snippet restores a saved choice, else dark); the
     toggle then flips `color-scheme` (below) and every token switches at once. ── */
  color-scheme: dark;
  /* light = blueprint paper: near-white, ink near-black */
  --ink:   light-dark(#111214, #f0f0f2);   /* primary text */
  --soft:  light-dark(#45484d, #b7b7c1);   /* secondary text */
  --link:  light-dark(#666a70, #d7d7de);   /* content links */
  --dim:   light-dark(#6c6f74, #7e7e8a);   /* tertiary / labels */
  --mute:  light-dark(#a0a3a8, #50505a);   /* faintest text / separators */
  --paper: light-dark(#f7f7f7, #000000);   /* page background */
  --band:  light-dark(#f7f7f7, #000000);   /* chrome blends with the page (header has no band) */
  --line:  light-dark(#dedfe1, #1c1c25);   /* hairline */
  --rule:  light-dark(rgb(0 0 0 / .14), rgb(255 255 255 / .12)); /* translucent: crossings accumulate light */
  --code-bg: #000;
  --code-rule: #333;


  /* ── Blueprint grid: 80px major lines (= half the logo) · 40px mid lines · 8px unit lines — all translucent,
     so where they cross the ink adds up into dots. A line of a coarser level also carries the finer ones, so
     the levels stack: rulers > 80px lines > 40px lines > unit crossings (the dots) > 8px lines. ── */
  --u: 8px;
  --u2: 40px;
  --U: 80px;
  --g-maj: light-dark(rgba(0,0,0,.02), rgba(255,255,255,.042));   /* ink added by each level: an 80px line = all three */
  --g-mid: light-dark(rgba(0,0,0,.022), rgba(255,255,255,.05));   /* a 40px line = mid + unit */
  --g-min: light-dark(rgba(0,0,0,.012), rgba(255,255,255,.028));  /* an 8px line; two crossing = a dot, still under a 40px line */

  /* ── ONE shared content column for every page: width = cw, left edge = gx-pad. The width STEPS in
     whole major units (never fluid) and the column is centred, so both edges — the rulers — and every
     cell inside land on grid lines at any viewport. So the column lines up across pages. ── */
  --cw: 960px;           /* content column width: 12 major units at most */
  --padx: 40px;          /* minimum side inset (a mid unit) */
  --colw: calc(var(--cw) + 2 * var(--padx));
  --gx-pad: var(--padx); /* column left edge; centred just below */

  /* ── Type: seven sizes, one per role — every text on the site takes one. Display sizes are picked so their
     caps are whole grid cells (Futura caps: .761em medium, .754em bold → 42px = 32, 31.8px = 24, 21px = 16). ── */
  --fs-display: 42px;    /* page and hero titles */
  --lh-display: 40px;    /* their line */
  --title-top: var(--U); /* a page title's caps: this far under the menu ruler (the landing logo's top line) */
  --fs-figure: 31.8px;   /* figures, landing section titles */
  --fs-head: 21px;       /* questions, block heads */
  --fs-body: 16px;       /* reading text, on 24px lines */
  --fs-small: 13px;      /* meta and data: version, footer, captions, table rows */
  --fs-caps: 12px;       /* uppercase, tracked: menu, figure labels, chips, section and column heads */
  --fs-mono: 13px;       /* code, and figures in tables */
  --ls-caps: .1em;       /* the one tracking for uppercase caps labels */

  /* ── The one alignment rule: a block HANGS its first line's caps from a field line (40/80); every line of
     text keeps its BASELINE on the 8px grid; nothing is centred but icons and controls. Where a size's caps
     aren't whole cells (16px body, 13px small), the baseline wins and the cap line sits a few px under the
     field line. ── */
  /* baseline grid: pad a text block trimmed to its ink (text-box, cap line → last baseline) up to whole
     minor cells, so its baselines sit on grid lines. `padding-top: var(--bl)` on the trimmed block. */
  --bl: mod(calc(-1 * 1cap), var(--u));
}
/* phones: the side inset shrinks to 2 minor units, so 352–479px screens keep a four-unit column */
@media (max-width: 479px) { :root { --padx: 16px; } }
/* phones and narrow tablets: the display size steps down (31.5px medium = 24px caps, still whole cells) and a
   title's caps hang half a unit under the menu ruler (y 120, the landing logo's top line there) */
@media (max-width: 799px) { :root { --fs-display: 31.5px; --lh-display: 32px; --title-top: var(--u2); } }
:root[data-theme="light"] { color-scheme: light; }   /* explicit override; the toggle sets data-theme on <html> */
:root[data-theme="dark"]  { color-scheme: dark; }
@supports (padding: mod(1px, 1px)) {
  :root {
    --cw: min(960px, calc(100vw - 2 * var(--padx) - mod(100vw - 2 * var(--padx), var(--U))));
    --gx-pad: max(var(--padx), round(calc((100vw - var(--cw)) / 2), var(--u)));
  }
}

/* ── Lined paper (pages opt in with <html class="paper">): the grid over the whole page, its origin on
   the column's left edge, and the rulers — the column's two edges, the full page height, under
   everything. +1px width puts the right ruler ON its grid line (a line is the first pixel of its cell);
   a line is the first pixel of its cell at every level. ── */
html.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--g-maj) 1px, transparent 1px), linear-gradient(90deg, var(--g-maj) 1px, transparent 1px),
    linear-gradient(var(--g-mid) 1px, transparent 1px), linear-gradient(90deg, var(--g-mid) 1px, transparent 1px),
    linear-gradient(var(--g-min) 1px, transparent 1px), linear-gradient(90deg, var(--g-min) 1px, transparent 1px);
  background-size: var(--U) var(--U), var(--U) var(--U), var(--u2) var(--u2), var(--u2) var(--u2), var(--u) var(--u), var(--u) var(--u);
  background-position: var(--gx-pad) 0;
}
html.paper body { position: relative; display: flow-root; min-height: 100vh; background: none; }   /* flow-root: a first child's top margin stays inside, so the rulers start at the page top */
html.paper body::before {
  content: ''; position: absolute; top: 0; bottom: 0; z-index: -1; pointer-events: none; box-sizing: border-box;   /* its own, not the page's reset: example pages have none */
  left: var(--gx-pad); width: calc(var(--cw) + 1px);
  border-inline: 1px solid var(--rule);
}
/* horizontal ruler: a full-width section's top edge, drawn inside it (an inset shadow) so it takes no height. */
.ruled { box-shadow: inset 0 1px var(--rule); }
/* One viewport-sized light field, clipped to the existing rulers by glint.js. */
.ruler-refl { display: none; position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 3; pointer-events: none; color: #fff; mix-blend-mode: screen; }
:root[data-theme="light"] .ruler-refl { color: #000; mix-blend-mode: multiply; }
html.paper:not(.jz-saver):not(.jz-embed) .ruler-refl { display: block; }
.grid-bursts { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Cross-document View Transitions: every page links this stylesheet, so same-origin navigations
   (landing ↔ examples ↔ bench ↔ repl) cross-fade instead of hard-cutting. The shared masthead column
   makes the header look continuous across the fade. Progressive enhancement — ignored where unsupported. */
@view-transition { navigation: auto; }

/* Futura (the brand face) for every title, site-wide. */
h1, h2, h3, h4, h5, h6 { font-family: var(--font); }
/* The brushed rim and diagonal silver glare follow the same cursor light. The glare band scales by
   --glare-w (width) and --glare-a (strength): on light paper its dark face reads as a smudge, so there it
   narrows to a thin reflected streak. */
.reflect-title { display: grid; position: relative; font-variant-ligatures: none; }
.reflect-title > span { grid-area: 1 / 1; text-box: inherit; padding: .25em; margin: -.25em; }
.title-outline { visibility: hidden; pointer-events: none; user-select: none; }
.reflect-title[data-metal-ready="true"] > .title-fill { -webkit-text-fill-color: transparent; }
.reflect-title[data-metal-ready="true"] > .title-outline { visibility: visible; }
.metal-face {
  --glare: calc(var(--fill-x, 0px) * sin(120deg) - var(--fill-y, 0px) * cos(120deg));
  --gw: var(--glare-w, 1); --ga: var(--glare-a, 1);
  mask-image: linear-gradient(120deg, transparent calc(var(--glare) - 260px * var(--gw)),
      rgb(0 0 0 / calc(.33 * var(--ga))) calc(var(--glare) - 135px * var(--gw)),
      rgb(0 0 0 / calc(.8 * var(--ga))) calc(var(--glare) - 55px * var(--gw)), rgb(0 0 0 / var(--ga)) var(--glare),
      rgb(0 0 0 / calc(.73 * var(--ga))) calc(var(--glare) + 80px * var(--gw)), transparent calc(var(--glare) + 220px * var(--gw))),
    linear-gradient(145deg, #00000008, #00000002);
  pointer-events: none;
}
.reflect-title { --fill-x: calc(var(--shine-x, 50%) + .25em); --fill-y: calc(var(--shine-y, 50%) + .25em); }
:root[data-theme="light"] .reflect-title { --glare-w: .15; --glare-a: .75; }
.title-outline {
  -webkit-text-fill-color: transparent;
  background: repeating-linear-gradient(0deg, #ffffff18 0 .5px, #0000000d .5px 1px, transparent 1px 2.5px),
    linear-gradient(145deg, light-dark(#111, #fff), light-dark(#353b44, #edf0f5) 48%, light-dark(#111, #cbd2dc));
  background-clip: text; -webkit-background-clip: text;
}
.reflect-title:focus-visible > .metal-face { opacity: 1; mask-image: none; }
.title-metal { position: absolute; pointer-events: none; user-select: none; }
.title-metal i {
  position: absolute; display: block; mask: var(--atlas, none) 0 0 / 100% 100% no-repeat;   /* a title's glyphs share one atlas (title-metal.js) */
  --metal-angle: atan2(calc(var(--light-x, 0px) - var(--gx)), calc(var(--gy) - var(--light-y, -160px)));
  background: repeating-linear-gradient(0deg, #ffffff26 0 .5px, #0000001a .5px 1px, transparent 1px 2.5px),
    conic-gradient(from var(--metal-angle) at var(--cx) var(--cy),
      #f4f6f9, #b3bac4 55deg, #626974 110deg, #a4acb6 155deg,
      #e9edf3 185deg, #707783 250deg, #bac2ce 315deg, #f4f6f9);
}
:root[data-theme="light"] .reflect-title > .title-metal { filter: brightness(.55); }
.metal-logo > .metal-face { position: absolute; inset: auto; margin: 0; opacity: 1; mask-image: none; }
.metal-logo > .title-metal { z-index: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) {
  .reflect-title > .metal-face { opacity: 1; mask-image: none; }
}
@media (forced-colors: active) {
  .reflect-title[data-metal-ready="true"] > .title-fill { -webkit-text-fill-color: CanvasText; }
  .title-metal, .title-outline { visibility: hidden !important; }
}
.reflect-text { -webkit-text-fill-color: color-mix(in srgb, currentColor,
  light-dark(#000, #fff) calc(var(--light-power, 0) * 35%)); }
/* A quick wipe reaches the normal hover color and holds it until the pointer leaves. */
.glare-ink, .metrics .lab, .glare-icon::before {
  background: linear-gradient(110deg, light-dark(#000, #fff) 45%, currentColor 55%) 100% 0 / 230% 100%;
  transition: background-position .18s ease-out; }
.glare-ink, .metrics .lab { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.glare-icon { position: relative; }
.glare-icon svg { visibility: hidden; }
.glare-icon::before { content: ""; position: absolute; width: 20px; height: 20px;
  mask: var(--icon-mask) center / contain no-repeat; }
/* Inline padding gives the paint room for descenders without changing line metrics. */
.glare-ink { padding-block: .25em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.glare-link:is(:hover, :focus-visible, [aria-expanded="true"]) .glare-ink,
.glare-icon:is(:hover, :focus-visible)::before,
.metrics .stat:is(:hover, :focus-visible) .lab { background-position: 0% 0; }
/* Content-link underline: a 1px layer of the same ink, lit by the ruler's cursor light (--lx/--ly, glint.js)
   and takes the same wipe on hover, so the line is covered by the text's gradient instead of a native decoration. */
.glare-ul { text-decoration-line: none !important; --ul-y: calc(100% - .2em); }   /* over any page's own underline: the lit line replaces it */
.glare-ul > .glare-ink {
  background-image:
    radial-gradient(circle 320px at var(--lx, -999px) var(--ly, -999px), color-mix(in srgb, light-dark(#000, #fff) 65%, transparent),
      color-mix(in srgb, light-dark(#000, #fff) 22%, transparent) 30%, transparent),
    linear-gradient(110deg, light-dark(#000, #fff) 45%, color-mix(in srgb, currentColor 18%, transparent) 55%),
    linear-gradient(110deg, light-dark(#000, #fff) 45%, currentColor 55%);
  background-size: 100% 1px, 230% 1px, 230% 100%;
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: 0 var(--ul-y), 100% var(--ul-y), 100% 0;
  background-clip: border-box, border-box, text; -webkit-background-clip: border-box, border-box, text;
}
.glare-ul > .glare-tail { background-size: 0 0, 0 0, 230% 100%; }   /* the arrow keeps the wipe, not the line */
/* the underlined part may sit inside the link (a card's name), lit with the whole link's hover */
.glare-ul:is(:hover, :focus-visible, [aria-expanded="true"]) > .glare-ink,
.glare-link:is(:hover, :focus-visible) .glare-ul > .glare-ink { background-position: 0 var(--ul-y), 0% var(--ul-y), 0% 0; }
@media (prefers-reduced-motion: reduce) {
  .glare-ink, .metrics .lab, .glare-icon::before { transition: none; }
}

/* Page title — one face and one place on every page: the display size, caps --title-top under the menu ruler
   (each page's main starts right at the ruler), trimmed to its ink so the cap line sits exactly there. Only
   margin-top is set here, so a page keeps its own space under the title. */
.title { margin-top: var(--title-top); font-size: var(--fs-display); font-weight: 500; letter-spacing: -.01em; line-height: var(--lh-display); text-wrap: balance; }
@supports (text-box: trim-both cap alphabetic) {
  .title, .prose p { text-box: trim-both cap alphabetic; padding-top: var(--bl); }   /* prose: baselines on the 8px grid */
}

/* substrate-class glyphs (JS / WASM / native): the marks from CLS_ICO in assets/headline.js, which carry their own
   colours. One 12px size on every page, centred on the caps, muted to 40% saturation (a page may bring it to full
   on hover). */
.cico { width: 12px; height: 12px; flex: none; vertical-align: calc((1cap - 12px) / 2); filter: saturate(.4); transition: filter .18s; }

/* Native fallback; selection.js outlines document text while editors keep native highlighting. */
::selection { background: light-dark(#16161a, #fff); color: light-dark(#fff, #000); }
:root.outline-selection ::selection { background: transparent !important; color: var(--ink) !important; }
.selection-outline { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 210; pointer-events: none;
  fill: none; stroke: var(--ink); stroke-width: 1; }
@media (forced-colors: active) {
  :root.outline-selection ::selection { background: Highlight !important; color: HighlightText !important; }
  .selection-outline { display: none; }
  .glare-ink, .metrics .lab { background: none; -webkit-text-fill-color: currentColor; }
  .glare-icon::before { display: none; }
  .glare-icon svg { visibility: visible; }
}

/* One themed keyboard-focus ring everywhere (else links/buttons fall back to the inconsistent browser
   default). :where() keeps specificity at zero so a page's own focus styles still win. */
:where(a, button, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.masthead {
  background: transparent; color: var(--ink); flex: 0 0 auto;   /* no header band — blends into the page */
  display: flex; align-items: center; gap: 16px;
  min-height: 60px; margin-top: 20px; padding: 0 var(--mast-px);   /* 1 unit (80px) tall — matches the landing's hero-nav for a frictionless cross-page header */
  font-family: var(--font); -webkit-user-select: none; user-select: none;
}
.masthead.fixed { position: fixed; top: 0; left: 0; right: 0; z-index: 200; margin-top: 0; padding-top: 20px; }
.masthead .logo { display: flex; align-items: center; line-height: 0; flex: 0 0 auto; }

/* Square rims and brushed letter contours share the cursor light. */
:is(.logo, footer .wordmark), .reflect-box { position: relative; isolation: isolate; }
.logo { align-self: flex-start; }
:is(.logo, footer .wordmark) > :is(img, svg) { position: relative; z-index: 1; }
.edge-refl { position: absolute; inset: -1px; z-index: 2; pointer-events: none; padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; mix-blend-mode: screen; }
.logo > .edge-refl { inset: 0 -1px -1px 0; }
footer .wordmark > .edge-refl { inset: 1px -1px -1px 1px; }
:root[data-theme="light"] .edge-refl { mix-blend-mode: multiply; }
.masthead .logo > :is(img, svg) { display: block; width: 40px; height: 40px; }

/* brand: the jz.svg logo, linking home. The logo is the SVG FILE itself — never re-created in Futura text. The page
   is named by the menu (its active item), not by a label beside the mark. */
.masthead .brand { display: flex; flex: 0 0 auto; }
.masthead .tag { font-size: var(--fs-small); color: var(--dim); margin-left: 16px; }

.masthead nav { margin-left: auto; }
.site-nav { display: flex; align-items: center; --nav-gap: 24px; gap: var(--nav-gap); }
@media (min-width: 800px) { .site-nav { padding-right: var(--U); } }
.site-nav a { color: var(--soft); font-size: var(--fs-caps);
  text-transform: uppercase; letter-spacing: var(--ls-caps); }
.site-nav .ver { font-size: var(--fs-small); text-transform: none; letter-spacing: .02em; opacity: .5; margin-left: var(--nav-gap); }   /* set apart from the menu: twice its gap */
/* the two icons take a grid cell each. A cell
   meets its neighbour flush (the negative margin cancels the menu's gap) and fills on hover. */
.site-nav > :is(.theme-toggle, .gh) { flex: none; width: var(--u2); height: var(--u2); margin-left: calc(-1 * var(--nav-gap));
  display: inline-flex; align-items: center; justify-content: center; opacity: .7; transition: opacity .18s, background-color .18s; }
.site-nav > .theme-toggle:hover { opacity: 1; background: light-dark(rgba(0,0,0,.06), rgba(255,255,255,.1)); }
.site-nav > .gh { opacity: 1; transition: none; }
.site-nav > .theme-toggle { margin-left: 0; }   /* the first icon keeps the menu's gap from the words (the version) before it */

/* ── Theme toggle — an icon-only button after the version; one sun/moon glyph that swaps via the
   ::before content per theme. Shared by the masthead (bench/examples) and the landing hero-nav. ── */
.theme-toggle { -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0;
  margin: 0; cursor: pointer; color: inherit; opacity: .7; display: inline-flex; align-items: center;
  justify-content: center; width: 20px; height: 20px; line-height: 0; transition: opacity .18s; }
.theme-toggle:hover { opacity: 1; }
.theme-toggle svg { width: 17px; height: 17px; display: block; }
.theme-toggle .i-sun  { display: block; }   /* dark theme → show the sun */
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }   /* light theme → show the moon */

/* Content links share one color and the glare's hover/focus treatment. */
a, .lnk { text-decoration-color: color-mix(in srgb, currentColor 18%, transparent); text-decoration-thickness: 1px; }
s { text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); text-decoration-thickness: 1px; }   /* a strike carries meaning; fainter than this vanishes into the grid */
a, .lnk { color: var(--link); cursor: pointer; text-decoration-line: underline; text-underline-offset: .25em; }
a:hover, .lnk:hover { text-decoration-color: currentColor; }
.site-nav a, footer .wordmark { text-decoration: none; }

/* Shared reading style: FAQ answers and the getting-started guide. */
.prose { max-width: 720px; font-size: var(--fs-body); line-height: 24px; color: var(--soft); }
.prose :is(h1, h2, h3, h4, h5, h6) { color: var(--ink); }
.prose p { margin: 0; }
.prose p+p { margin-top: 16px; }
.prose :not(pre)>code { font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 0; color: var(--ink); background: light-dark(rgba(0,0,0,.06), rgba(255,255,255,.08)); padding: .1em .4em; white-space: nowrap; }   /* line-height 0: a second font must not grow the line box off the 24px rhythm */
.prose a code { color: inherit; }

/* ─── CTA chip — the ONE call-to-action button, shared: the bench page's "Report a slow case" and the
   landing's "Sponsor the dev". Outline box in ink on paper; inverts on hover. Pattern: a plain 16px
   question in a centred section, then this chip 14px below it. ─── */
.report { display: inline-block; margin-top: 14px; font-family: var(--font); font-size: var(--fs-caps); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--ink); background: var(--paper); border: 1px solid light-dark(var(--ink), var(--rule)); padding: 8px 15px; text-decoration: none; transition: background .14s, color .14s; }
.report:hover { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] :is(.report, #runAll):hover { background: #0b0b0d; color: var(--ink); }

/* ─── Footer — shared on landing, bench, examples. Logo + nav columns grouped left; credit and
   license stacked right. On the grid: 40/80 paddings, columns on 40px steps, every line's baseline on a
   minor grid line (trimmed blocks padded by --bl, 8px apart → 24px baselines). ─── */
footer { padding: var(--u2) var(--padx) var(--U); background: var(--paper); }
html.paper footer { background: none; box-shadow: inset 0 1px var(--rule); }   /* on lined paper: no paper of its own, a ruler across its top */
footer .fwrap { max-width: var(--cw); margin-inline: calc(var(--gx-pad) - var(--padx)) auto; display: flex; align-items: flex-start; gap: var(--u2); }
footer .wordmark { display: inline-flex; width: 40px; height: 40px; padding: 1px 0 0 1px; box-sizing: border-box; line-height: 0; text-decoration: none; }
footer .wordmark > :is(img, svg) { width: 39px; height: 39px; display: block; }
footer .fcol { display: flex; flex-direction: column; gap: var(--u); width: var(--U); padding-top: calc(1.5 * var(--u)); }
footer .fcol a { color: var(--soft); font-size: var(--fs-small); transition: color .16s; }
footer .legal { margin-left: auto; align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: var(--u); font-size: var(--fs-small); line-height: 24px; text-align: right; color: var(--dim); }
footer .legal .credit { color: var(--mute); }   /* "made with watr and jessie" — muted lead, soft links (jz's parser + assembler) */
footer .legal .dot { color: var(--mute); }       /* the middot between MIT and ॐ */
footer .legal a { color: var(--soft); }
footer .legal .om { font-size: 15px; font-weight: 700; }   /* Devanagari strokes are thin — bump weight so ॐ reads as dark as the MIT link (same colour, matched density) */
@supports (text-box: trim-both cap alphabetic) {
  footer .fcol a, footer .legal > * { text-box: trim-both cap alphabetic; padding-top: var(--bl); }
}
@media (max-width: 640px) { footer .fwrap { flex-wrap: wrap; row-gap: var(--u2); } footer .legal { width: 100%; align-items: flex-start; text-align: left; } }   /* the right column drops below navigation when space is tight */

@media (max-width: 520px) {
  .masthead { gap: 10px; }
}

/* Keep every primary destination visible; compact the surrounding chrome first. The active item names the
   page: full ink, and a 2px bar at the logo's foot (the menu shares the logo's centre line, so the foot is 20px
   below the caps' centre) — on lined paper that is the menu ruler, the bar a tab on it. */
.site-nav a[aria-current="page"] { color: var(--ink); position: relative; }
.site-nav a[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: calc(.5cap - 20px); height: 2px; background: currentColor; }
/* On lined paper the logo takes the 40–80 cell above the menu ruler and the menu shares its centre line — the
   question-and-chevron rule of the landing FAQ: a 40–80 band, labels trimmed to their ink and centred in it,
   icons with them. The landing's menu sits in the same cell, so the header holds still between pages. */
@supports (text-box: trim-both cap alphabetic) { .site-nav a { text-box: trim-both cap alphabetic; } }
html.paper .masthead { height: 60px; align-items: flex-start; }
html.paper .masthead .brand { margin-top: 20px; }
html.paper .masthead nav { height: var(--u2); margin-top: 20px; align-items: center; }
@media (max-width: 800px) {
  .site-nav .ver { display: none; }
}
@media (max-width: 799px) {
  .site-nav { --nav-gap: 14px; }
}
@media (max-width: 520px) {
  .site-nav { --nav-gap: 8px; }
  .site-nav a.gh { display: none; }
}
@media (max-width: 359px) {
  .site-nav { --nav-gap: 6px; }
  .site-nav a { font-size: 11px; }
  .masthead .brand { position: absolute; left: var(--u); }
  html.paper .masthead .brand { margin-top: 28px; }
  .masthead .logo > :is(img, svg) { width: 24px; height: 24px; }
}
