/* Kernarc — Drawing Sheet KA-001. Tokens mirror DESIGN.md. */

@font-face { font-family: "Sofia Sans Extra Condensed"; src: url("/fonts/sofia-sans-extra-condensed-200-700.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "B612"; src: url("/fonts/b612-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612"; src: url("/fonts/b612-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("/fonts/b612-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("/fonts/b612-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --sheet: #0A2240;
  --sheet-deep: #081B34;
  --ink: #E9F1FF;
  --ink-2: #A9C3E3;
  --construction: #6F98C4;
  --hair: rgba(233, 241, 255, 0.22);
  --hair-2: rgba(233, 241, 255, 0.12);
  --grid: rgba(233, 241, 255, 0.045);
  --redline: #FF5B3A;

  --f-display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --f-text: "B612", "Helvetica Neue", Arial, sans-serif;
  --f-fig: "B612 Mono", ui-monospace, Menlo, monospace;

  --frame: clamp(8px, 1.4vw, 18px);   /* outer trim line inset */
  --zone: 16px;                        /* gap between trim line and border, holds zone markers */
  --edge: calc(var(--frame) + var(--zone));
  --pad: clamp(16px, 3.6vw, 56px);
  --nav-h: 60px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--construction) var(--sheet-deep); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-text);
  font-variant-numeric: tabular-nums;
  caret-color: var(--redline);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* cyanotype grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.91 0 0 0 0 0.95 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--redline); color: var(--sheet); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--sheet-deep); }
::-webkit-scrollbar-thumb { background: var(--construction); border: 3px solid var(--sheet-deep); }

a { color: inherit; text-decoration-color: var(--construction); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--redline); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: var(--edge); top: var(--edge); z-index: 100; padding: 10px 14px; background: var(--redline); color: var(--sheet); font: 700 0.75rem/1 var(--f-text); letter-spacing: 0.14em; text-transform: uppercase; transform: translateY(calc(-100% - var(--edge) - 8px)); }
.skip:focus { transform: none; }

/* ---------- Sheet frame: trim line, border, zone markers, mat ---------- */
.sheet-frame {
  position: fixed;
  inset: var(--frame);
  z-index: 30;
  pointer-events: none;
  border: 1px solid var(--hair-2);
}
.sheet-frame::before {        /* the drawing border; its shadow is the mat that hides content outside */
  content: "";
  position: absolute;
  inset: var(--zone);
  border: 1.5px solid var(--hair);
  box-shadow: 0 0 0 100vmax var(--sheet);
}
.zones { position: absolute; display: flex; justify-content: space-around; font: 400 0.6875rem/1 var(--f-fig); color: var(--construction); z-index: 1; }
.zones-top { top: 0; left: var(--zone); right: var(--zone); height: var(--zone); align-items: center; }
.zones-left { left: 0; top: var(--zone); bottom: var(--zone); width: var(--zone); flex-direction: column; align-items: center; }
.zones span { position: relative; }
.zones-top span::after, .zones-left span::after { content: ""; position: absolute; background: var(--hair-2); }
.zones-top span::after { width: 1px; height: 6px; left: 50%; top: calc(100% + 3px); }
.zones-left span::after { height: 1px; width: 6px; top: 50%; left: calc(100% + 3px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: var(--edge);
  z-index: 20;
  margin: var(--edge) var(--edge) 0;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(12px, 2.4vw, 36px);
  padding: 0 var(--pad);
  background: var(--sheet);
  border-bottom: 1px solid var(--hair-2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.5rem/1 var(--f-display); letter-spacing: 0.16em; text-transform: uppercase; }
.mark { width: 30px; height: 30px; flex: none; fill: none; stroke-linecap: square; }
.mark-arc { stroke: var(--redline); stroke-width: 2; }
.mark-ext { stroke: var(--ink-2); stroke-width: 1; }
.mark-k { stroke: var(--ink); stroke-width: 1.25; }
.nav-view { margin: 0; justify-self: start; font: 400 0.6875rem/1 var(--f-fig); color: var(--construction); letter-spacing: 0.12em; text-transform: uppercase; }
.nav-view b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border: 1px solid var(--construction); border-radius: 50%; color: var(--ink); font-weight: 400; }
.nav nav { display: flex; gap: clamp(14px, 2vw, 30px); }
.nav nav a { font: 700 0.6875rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); padding: 8px 0; border-bottom: 1px solid transparent; transition: color 160ms, border-color 160ms; }
.nav nav a:hover, .nav nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 22px;
  font: 700 0.75rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent; border-radius: 0; cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.btn-primary { background: var(--redline); color: var(--sheet); }
.btn-primary:hover { background: var(--ink); color: var(--sheet); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 38px; padding: 11px 16px; font-size: 0.6875rem; }
.btn-lg { min-height: 60px; padding: 20px 30px; font-size: 0.8125rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Layout shell ---------- */
main { margin: 0 var(--edge); }
main > section, main > footer { padding: clamp(72px, 11vh, 140px) var(--pad); scroll-margin-top: calc(var(--edge) + var(--nav-h)); border-bottom: 1px solid var(--hair-2); }

h1, h2, h3 { font-variant-numeric: proportional-nums; font-family: var(--f-display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.005em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.5rem, 5.6vw, 5rem); line-height: 0.92; }
p { margin: 0; }

.sec-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px clamp(24px, 4vw, 72px); align-items: end; margin-bottom: clamp(36px, 6vh, 64px); }
.sec-head p { color: var(--ink-2); max-width: 46ch; }

.vt { display: block; font: 700 0.6875rem/1.4 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.vt-under { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--ink); width: max-content; max-width: 100%; }
.tag { display: inline-block; font: 400 0.6875rem/1 var(--f-fig); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--hair); padding: 4px 6px; white-space: nowrap; }
.tag-k { color: var(--redline); border-color: color-mix(in srgb, var(--redline) 60%, transparent); }
.fine { margin-top: 14px; max-width: 70ch; font-size: 0.8125rem; color: var(--ink-2); }

/* ---------- View A (first viewport) ---------- */
.view-a {
  min-height: calc(100svh - 2 * var(--edge) - var(--nav-h));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 1fr;
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: clamp(24px, 4vh, 48px);
  padding-top: clamp(24px, 4vh, 48px) !important;
  padding-bottom: clamp(20px, 3vh, 32px) !important;
}
.hero-copy { grid-column: 1 / span 5; grid-row: 1; align-self: center; display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 24px); }

.bigfig { display: inline-flex; flex-direction: column; align-self: flex-start; }
.cells { display: inline-flex; font: 200 clamp(6.5rem, 17vw, 17rem)/0.8 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.cell { display: inline-block; height: 0.8em; overflow: hidden; width: 0.4em; text-align: center; }
.cell-plus { width: 0.42em; }
.cell > span { display: flex; flex-direction: column; transition: transform 720ms var(--ease); transition-delay: var(--d, 0ms); }
.cell > span > span { display: block; height: 0.8em; line-height: 0.8; }
.dim { position: relative; margin-top: 18px; height: 1px; background: var(--ink-2); }
.dim::before, .dim::after { content: ""; position: absolute; top: -4px; width: 0; height: 0; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.dim::before { left: 0; border-right: 12px solid var(--ink-2); }
.dim::after { right: 0; border-left: 12px solid var(--ink-2); }
.dim > span { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); padding: 0 10px; background: var(--sheet); font: 400 0.6875rem/1 var(--f-fig); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }

.view-a h1 { font-size: clamp(2rem, 2.9vw, 3.1rem); line-height: 0.98; font-weight: 500; max-width: 21ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.plot { grid-column: 6 / -1; grid-row: 1; align-self: center; margin: 0; position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--ink); }
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 400 0.6875rem/1 var(--f-text); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; }
.lg { display: inline-block; width: 28px; height: 0; border-top: 2px solid; }
.lg-k { border-color: var(--redline); }
.lg-s { border-top-style: dashed; border-color: var(--construction); }
.lg-d { width: 14px; border-top-width: 1px; border-color: var(--ink-2); }
.plot.is-s .lg-s { border-top-style: solid; border-color: var(--ink); }
.plot.is-s .lg-k { border-top-style: dashed; border-color: var(--construction); }

.switch { display: flex; width: max-content; margin: 0 0 10px auto; border: 1px solid var(--hair); background: var(--sheet); }
.switch button, .seg button {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  min-height: 36px; padding: 10px 14px; font: 700 0.6875rem/1 var(--f-text); letter-spacing: 0.14em; text-transform: uppercase;
  transition: background-color 160ms, color 160ms;
}
.switch button + button, .seg button + button { border-left: 1px solid var(--hair); }
.switch button:hover, .seg button:hover { color: var(--ink); }
.switch button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

/* plot drawing */
.plot .grid path { stroke: var(--grid); stroke-width: 1; fill: none; }
.plot .grid path:first-child { stroke: var(--hair-2); stroke-dasharray: 2 6; }
.plot .axes path { stroke: var(--ink-2); stroke-width: 1; fill: none; }
.plot text { font-family: var(--f-text); font-size: 13px; fill: var(--ink-2); }
.plot .axis-title { font-family: var(--f-text); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--construction); }
.plot .hatch { stroke: rgba(233, 241, 255, 0.07); stroke-width: 1; }
.plot .zone { stroke: none; }
.plot .datum-line { stroke: var(--ink); stroke-width: 1; }
.plot .datum-label { fill: var(--ink); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.plot .datum-tri { fill: var(--ink); }
.plot .frame { fill: var(--sheet); stroke: var(--ink); stroke-width: 1; }
.plot .frame-t { fill: var(--ink); font-size: 12px; letter-spacing: 0.04em; }
.plot .fcf-sym { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.plot .leader { stroke: var(--ink-2); stroke-width: 1; fill: none; }
.plot .arw { fill: var(--ink-2); }
.plot .ext { stroke: var(--ink-2); stroke-width: 0.75; }
.plot .dimline { stroke: var(--ink-2); stroke-width: 1; }
.plot .dim-t { fill: var(--ink); font-size: 13px; }
.plot .bubble circle { fill: var(--sheet); stroke: var(--ink); stroke-width: 1; transition: fill 160ms; }
.plot .bubble text { fill: var(--ink); font-family: var(--f-text); font-weight: 700; font-size: 13px; }
.plot .bubble:hover circle, .plot .bubble:focus-visible circle { fill: var(--ink); }
.plot .bubble:hover text, .plot .bubble:focus-visible text { fill: var(--sheet); }
.plot .bubble:focus { outline: none; }
.plot .bubble:focus-visible circle { stroke: var(--redline); stroke-width: 2; }

.series .line { fill: none; stroke-linejoin: round; transition: stroke 400ms var(--ease), stroke-width 400ms var(--ease), opacity 400ms var(--ease); }
.series .pts circle { transition: fill 400ms var(--ease), stroke 400ms var(--ease); }
.series .vals text { transition: fill 400ms var(--ease); }
.series-k .line { stroke: var(--redline); stroke-width: 2.5; }
.series-k .pts circle { fill: var(--redline); stroke: var(--sheet); stroke-width: 2; }
.series-k .vals text { fill: var(--ink); font-size: 14px; }
.series-s .line { stroke: var(--construction); stroke-width: 1.5; stroke-dasharray: 22 5 4 5 4 5; }
.series-s .pts circle { fill: var(--sheet); stroke: var(--construction); stroke-width: 1.5; }
.series-s .vals text { fill: var(--construction); }

/* switch state: stock shown as the object line, Kernarc drops to construction */
.plot.is-s .series-s .line { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: none; }
.plot.is-s .series-s .pts circle { fill: var(--ink); stroke: var(--sheet); }
.plot.is-s .series-s .vals text { fill: var(--ink); }
.plot.is-s .series-k .line { stroke: var(--construction); stroke-width: 1.5; opacity: 0.7; }
.plot.is-s .series-k .pts circle { fill: var(--sheet); stroke: var(--construction); }
.plot.is-s .series-k .vals text { fill: var(--construction); }

/* the one authored moment: the sheet plots itself */
@media (prefers-reduced-motion: no-preference) {
  .draw { animation: plot-in 1300ms var(--ease) both; }
  .draw-1 { animation-delay: 150ms; }
  .draw-2 { animation-delay: 450ms; animation-duration: 1500ms; }
  .draw-3 { animation-delay: 800ms; animation-duration: 1700ms; }
  .draw-4 { animation-name: fade-in; animation-duration: 600ms; animation-delay: 2200ms; }
  .dim { animation: dim-in 900ms var(--ease) 300ms both; }
}
@keyframes plot-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dim-in { from { clip-path: inset(-10px 50% -10px 50%); } to { clip-path: inset(-10px 0 -10px 0); } }


.tb { display: grid; gap: 1px; background: var(--hair-2); border: 1.5px solid var(--hair); }
.tb-cell { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--sheet-deep); min-width: 0; }
.tb-l { font: 700 0.6875rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; color: var(--construction); }
.tb-v { font: 400 0.8125rem/1.4 var(--f-text); color: var(--ink); overflow-wrap: anywhere; }
a.tb-v:hover { color: var(--redline); }

/* ---------- Detail B: live stream ---------- */
.live-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--hair); }
.seg button { font-family: var(--f-fig); font-weight: 400; font-size: 0.75rem; letter-spacing: 0.06em; min-width: 64px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--hair); scroll-margin-top: calc(var(--edge) + var(--nav-h) + 16px); }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-left: 1.5px solid var(--hair); }
.pane-s .pane-h { border-bottom-style: dashed; }
.pane-s .tape, .pane-s .meters { border-top-style: dashed; }
.pane-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 10px 18px; border-bottom: 1px solid var(--hair-2); }
.pane-name { font: 700 0.75rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; }
.pane-k .pane-name { color: var(--redline); }
.pane-s .pane-name { color: var(--ink-2); }
.pane-tpot { font: 400 0.75rem/1 var(--f-text); color: var(--ink-2); }
.stream {
  margin: 0; padding: 18px; height: clamp(180px, 26vh, 280px); overflow: hidden;
  font: 400 0.8125rem/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
  display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 64px); mask-image: linear-gradient(to bottom, transparent 0, #000 64px);
}
.pane-s .stream { color: var(--ink-2); }
.stream .caret { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--redline); }
.pane-s .stream .caret { background: var(--construction); }
.stream.is-done .caret { visibility: hidden; }
.tape { position: relative; border-top: 1px solid var(--hair-2); padding: 10px 18px 22px; }
.tape canvas { display: block; width: 100%; height: 44px; }
.tape-dim { position: absolute; left: 18px; right: 18px; bottom: 10px; height: 1px; background: var(--hair); }
.tape-dim > span { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); padding: 0 8px; background: var(--sheet); font: 400 0.6875rem/1 var(--f-fig); color: var(--construction); }
.meters { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--hair-2); }
.meters > div { padding: 12px 18px; }
.meters > div + div { border-left: 1px solid var(--hair-2); }
.meters dt { font: 700 0.6875rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; color: var(--construction); margin-bottom: 8px; }
.meters dd { margin: 0; font: 400 clamp(1.25rem, 2.2vw, 1.75rem)/1 var(--f-text); color: var(--ink); }
.pane-k .meters [data-rate] { color: var(--redline); }
.pane.is-done .pane-h::after { content: "Complete"; font: 400 0.6875rem/1 var(--f-fig); letter-spacing: 0.1em; text-transform: uppercase; color: var(--sheet); background: var(--ink); padding: 4px 6px; margin-left: auto; }
.pane.is-done .pane-h { justify-content: flex-start; }
.pane.is-done .pane-tpot { margin-left: 12px; }

/* ---------- Section C: the stack ---------- */
.xsec { position: relative; padding-left: 0; }
.cut { display: flex; align-items: center; gap: 10px; height: 34px; }
.cut::before { content: ""; flex: 1; height: 0; border-top: 2px dashed var(--ink); border-top-style: dashed; }
.cut span { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--ink); border-radius: 50%; font: 700 0.75rem/1 var(--f-text); }
.cut span::after { content: ""; position: absolute; right: calc(100% + 6px); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.cut-top span::after { top: calc(50% - 1px); border-top: 13px solid var(--ink); }
.cut-bot span::after { bottom: calc(50% - 1px); border-bottom: 13px solid var(--ink); }
.layers { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.layer { display: grid; grid-template-columns: minmax(180px, 5fr) minmax(0, 7fr); align-items: stretch; border-bottom: 2px solid var(--ink); }
.layer:first-child { border-top: 2px solid var(--ink); }
.band { position: relative; display: flex; align-items: center; min-height: 92px; padding: 0 18px; border-right: 1px solid var(--hair); }
.band span { position: relative; z-index: 1; padding: 6px 10px; background: var(--sheet); border: 1px solid var(--hair); font: 700 0.6875rem/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; }
.band::before { content: ""; position: absolute; inset: 0; opacity: 0.55; }
.layer[data-mat="1"] .band::before { background: repeating-linear-gradient(45deg, var(--hair) 0 1px, transparent 1px 12px); }
.layer[data-mat="2"] .band::before { background: repeating-linear-gradient(45deg, var(--hair) 0 1px, transparent 1px 12px), repeating-linear-gradient(-45deg, var(--hair) 0 1px, transparent 1px 12px); }
.layer[data-mat="3"] .band::before { background: repeating-linear-gradient(135deg, var(--hair) 0 1px, transparent 1px 7px); }
.layer[data-mat="4"] .band::before { background: repeating-linear-gradient(45deg, var(--hair) 0 1px, transparent 1px 6px, var(--hair) 6px 7px, transparent 7px 20px); }
.layer[data-mat="5"] .band::before { background: radial-gradient(circle, var(--hair) 1px, transparent 1.5px) 0 0 / 9px 9px; opacity: 0.9; }
.layer[data-mat="6"] .band::before { background: repeating-linear-gradient(0deg, var(--hair) 0 1px, transparent 1px 8px); }
.note { position: relative; align-self: center; padding: 18px 22px 18px 74px; color: var(--ink-2); max-width: 64ch; }
.note b { color: var(--ink); font-weight: 700; }
.note::before { content: ""; position: absolute; left: 0; top: 50%; width: 56px; height: 1px; background: var(--ink-2); }
.note::after { content: ""; position: absolute; left: -4px; top: calc(50% - 3.5px); width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

/* ---------- Notes: table + general notes ---------- */
.notes .sec-head { grid-template-columns: 1fr; }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--hair); }
table { width: 100%; border-collapse: collapse; font: 400 0.9375rem/1.2 var(--f-text); }
caption.vt { display: table-caption; caption-side: bottom; text-align: left; padding: 12px 16px; border-top: 1px solid var(--ink); }
th, td { padding: 14px 16px; text-align: right; border-bottom: 1px solid var(--hair-2); white-space: nowrap; }
th + th, td, th[scope="row"] + td { border-left: 1px solid var(--hair-2); }
thead th { font: 700 0.6875rem/1.5 var(--f-text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); vertical-align: bottom; }
thead .tag { margin-left: 8px; }
th[scope="row"] { text-align: left; font-weight: 400; color: var(--ink-2); }
thead th:first-child { text-align: left; }
thead .grp td { border-bottom: 1px solid var(--hair-2); }
thead .grp th { text-align: center; }
.m-only { display: none; }
td.col-k { color: var(--ink); }
td.col-s { color: var(--ink-2); }
tbody td:last-child, tfoot td:last-child { color: var(--ink); }
tfoot th, tfoot td { border-top: 1.5px solid var(--hair); border-bottom: 0; }
tfoot th { font: 700 0.6875rem/1.2 var(--f-text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.table-wrap.is-k td.col-k.tps { color: var(--redline); }
.table-wrap.is-s td.col-s { color: var(--ink); }
.table-wrap.is-s td.col-k { color: var(--ink-2); }

.gn { margin-top: clamp(48px, 8vh, 80px); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px clamp(24px, 4vw, 72px); }
.gn h3 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); line-height: 1; }
.gn ol { margin: 0; padding: 0; list-style: none; counter-reset: gn; display: grid; gap: 18px; max-width: 72ch; }
.gn li { counter-increment: gn; position: relative; padding-left: 52px; color: var(--ink-2); }
.gn li::before { content: counter(gn); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--ink-2); font: 400 0.75rem/1 var(--f-fig); color: var(--ink); }

/* ---------- Close: title block ---------- */
.close { border-bottom: 0 !important; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: end; gap: clamp(48px, 8vh, 96px) clamp(24px, 4vw, 72px); padding-bottom: calc(var(--pad) + 8px) !important; }
.close .tb-full { grid-column: 1 / -1; }
.detail-d { margin: 0; justify-self: end; width: min(100%, 560px); }
.detail-d svg { display: block; width: 100%; height: auto; overflow: visible; }
.detail-d .frame { fill: var(--sheet); stroke: var(--ink-2); stroke-width: 1.25; }
.detail-d .fcf-sym { fill: none; stroke: var(--ink); stroke-width: 2; }
.detail-d .fcf-t { font: 400 22px var(--f-text); letter-spacing: 0.06em; fill: var(--ink); }
.detail-d .leader { stroke: var(--ink-2); stroke-width: 1.25; fill: none; }
.detail-d .arw { fill: var(--ink-2); }
.detail-d .hatch { stroke: rgba(233, 241, 255, 0.08); stroke-width: 1; }
.detail-d .datum-line { stroke: var(--ink); stroke-width: 1.5; }
.detail-d .datum-tri { fill: var(--ink); }
.detail-d .k-line { fill: none; stroke: var(--redline); stroke-width: 3; stroke-linejoin: round; }
.detail-d .k-pts circle { fill: var(--redline); stroke: var(--sheet); stroke-width: 2; }
.close-copy { display: grid; justify-items: start; gap: 22px; }
.close-copy h2 { font-size: clamp(3rem, 8vw, 7.5rem); line-height: 0.86; max-width: 12ch; }
.close-copy p { color: var(--ink-2); max-width: 50ch; }
.tb-full { grid-template-columns: 1.3fr 2fr repeat(4, 1fr); }
.tb-brand { flex-direction: row; align-items: center; gap: 12px; grid-row: span 2; font: 600 1.75rem/1 var(--f-display); letter-spacing: 0.16em; text-transform: uppercase; }
.tb-title { grid-row: span 2; justify-content: center; }
.tb-title .tb-v { font-size: 1rem; }
.tb-contact, .tb-copy { grid-column: span 2; }
.tb-co, .tb-entity { grid-column: span 2; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .view-a { grid-template-rows: auto auto; }
  .hero-copy { grid-column: 1 / -1; }
  .plot { grid-column: 1 / -1; grid-row: 2; margin-top: 40px; }
  .nav-view { display: none; }
  .nav { grid-template-columns: auto 1fr auto; }
  .nav nav { justify-self: end; }
}
@media (max-width: 820px) {
  :root { --zone: 0px; --nav-h: 56px; }
  .zones { display: none; }
  .sheet-frame { border: 0; }
  .nav nav { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  .sec-head { grid-template-columns: 1fr; }
  .panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; }
  .pane-s { border-top: 1.5px dashed var(--hair); }
  .pane-k { order: -1; }
  .stream { height: 132px; }
  .tape { padding: 8px 14px 20px; }
  .tape-dim { left: 14px; right: 14px; }
  .pane-h { padding: 10px 14px; }
  .meters > div { padding: 10px 14px; }
  .meters dd { font-size: 1.25rem; }
  .close { grid-template-columns: 1fr; }
  .detail-d { display: none; }
  .layer { grid-template-columns: 1fr; }
  .band { min-height: 64px; border-right: 0; border-bottom: 1px solid var(--hair); }
  .note { padding: 16px 18px 18px 18px; }
  .note::before, .note::after { display: none; }
  .gn { grid-template-columns: 1fr; }
  .tb-full { grid-template-columns: 1fr 1fr; }
  .tb-brand, .tb-title, .tb-co, .tb-entity { grid-column: 1 / -1; grid-row: auto; }
  .tb-contact { grid-column: 1 / -1; }
  .tb-copy { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .cells { font-size: clamp(6rem, 36vw, 9rem); }
  .switch { position: static; margin-bottom: 14px; }
  .switch button { padding: 10px 10px; }
  .meters > div { padding: 10px 12px; }
  .seg button { min-width: 0; flex: 1; }
  .seg { display: flex; width: 100%; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-content: center; justify-items: start; gap: 20px; padding: var(--pad); }
.lost h1 { font-size: clamp(3rem, 9vw, 6rem); line-height: 0.9; }
.lost p { color: var(--ink-2); max-width: 44ch; }

/* phones: the plot keeps its data, drops secondary annotation, and sets text at a readable size */
@media (max-width: 620px) {
  .plot .fcf, .plot .bubble, .plot .axis-title, .plot .datum .leader, .plot .datum .frame, .plot .datum .frame-t, .plot .datum-tri { display: none; }
  .plot .ticklabels text { font-size: 24px; }
  .plot .series .vals text { font-size: 27px; }
  .plot .datum-label { font-size: 22px; }
  .plot .series .pts circle { r: 8px; }
  .plot .series-k .line, .plot.is-s .series-s .line { stroke-width: 4.5; }
  .plot .series-s .line { stroke-width: 3; stroke-dasharray: 34 8 6 8 6 8; }
  .plot.is-s .series-k .line { stroke-width: 3; }
  .plot .axes path { stroke-width: 2; }
  .plot .series-s .vals text { transform: translateY(16px); }
  .plot .series-k .vals text { transform: translateY(-6px); }
  .plot .series-k .vals text.v-64k { font-size: 21px; transform: translateY(4px); }
  .plot .dim-t { font-size: 26px; text-anchor: end; transform: translateX(-14px); }
  .plot .dimline { stroke-width: 2; }
  .plot .ext { stroke-width: 1.5; }
  .lg-d-item { display: none !important; }
  thead .grp, .ms { display: none; }
  .m-only { display: inline; }
  th, td { padding: 12px 10px; }
  thead th { white-space: normal; }
}
