/* Infinibowl. Umber for the story, vellum for the engineering. */
:root {
  --umber: #1E1611;
  --umber-2: #2A1F18;
  --umber-3: #3A2C22;
  --vellum: #E6E8E3;
  --vellum-2: #DADDD6;
  --paper: #F2F3EF;
  --ink: #1C2321;
  --ink-2: #47504D;
  --ink-3: #6E7672;
  --bronze: #A3712F;
  --bronze-lt: #C8934C;
  --verdigris: #3F7A6C;
  --verdigris-lt: #6FA898;
  --sandstone: #CDB89A;
  --sand-2: #A8977F;
  --rule-dark: rgba(205, 184, 154, 0.18);
  --rule: rgba(28, 35, 33, 0.14);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.4rem);
  --step-2: clamp(1.55rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem);
  --step-4: clamp(2.8rem, 1.8rem + 4.6vw, 6.2rem);

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--umber);
  color: var(--sandstone);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; }
p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--bronze-lt); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible, .manual :focus-visible { outline-color: var(--verdigris); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--sandstone); color: var(--umber); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 2 * var(--gutter)); }
.muted { color: var(--ink-3); }
.story .muted, .order .muted, .foot .muted { color: var(--sand-2); }
.small { font-size: var(--step--1); }

.display { font-family: var(--serif); font-size: var(--step-3); line-height: 1.04; letter-spacing: -0.01em; text-wrap: balance; }
.h3 { font-family: var(--serif); font-size: var(--step-2); line-height: 1.1; margin: 0 0 0.5em; }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: 40em; }

/* ------------------------------------------------------------------ Bar */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  color: #F3E9DA;
  transition: background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.bar.bar-solid { background: rgba(30, 22, 17, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--rule-dark); }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; line-height: 1; }
.mark svg { width: 28px; height: 28px; color: var(--bronze-lt); }
.bar nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: var(--step--1); }
.bar nav a { text-decoration: none; opacity: 0.86; }
.bar nav a:hover { opacity: 1; text-decoration: underline; }
.bar .bar-cta { opacity: 1; border: 1px solid currentColor; padding: 7px 14px; border-radius: 999px; }
.bar .bar-cta:hover { background: #F3E9DA; color: var(--umber); text-decoration: none; }
@media (max-width: 760px) { .bar nav a:not(.bar-cta) { display: none; } }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bronze); color: #FFF8EE; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--bronze-lt); }
.btn:active { transform: scale(0.98); }
.btn-small { min-height: 36px; padding: 0 16px; font-size: var(--step--1); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(127, 127, 127, 0.12); }

/* ------------------------------------------------------------------ Hero */
.hero { position: relative; height: 230vh; height: 230svh; --p: 0; background: #0f0b08; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sandstone); }
.hero-fallback[hidden] { display: none; }
.hero-stage::after {
  content: ""; position: absolute; inset: auto 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(18, 12, 8, 0.78), rgba(18, 12, 8, 0));
}
.hero-copy {
  position: absolute; z-index: 2; left: var(--gutter); bottom: clamp(150px, 22vh, 210px);
  max-width: min(640px, 100% - 2 * var(--gutter)); color: #F6EEE1;
  opacity: clamp(0, 1 - var(--p) * 2.6, 1);
  transform: translateY(calc(var(--p) * -40px));
  text-shadow: 0 1px 24px rgba(20, 12, 6, 0.45);
}
.hero-copy h1, .hero-copy h2 { font-family: var(--serif); font-size: var(--step-4); line-height: 0.96; letter-spacing: -0.015em; text-wrap: balance; }
.hero-copy p { margin-top: 18px; font-size: var(--step-1); line-height: 1.45; max-width: 30em; color: #E9DCC8; }
.hero-copy-b { opacity: clamp(0, (var(--p) - 0.42) * 3, 1); transform: translateY(calc((1 - var(--p)) * 30px)); }
.hero-copy-b h2 { font-size: var(--step-3); }

.hero-controls {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 26px;
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 12px 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.hero-hint { grid-column: 1 / -1; font-size: var(--step--1); color: #CDBBA2; opacity: 0.8; }
.btn-sing { min-width: 160px; background: #F3E9DA; color: var(--umber); }
.btn-sing:hover { background: #fff; }
.btn-sing[aria-pressed="true"] { background: var(--bronze); color: #FFF8EE; }
.sing-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bronze); position: relative; }
.btn-sing[aria-pressed="true"] .sing-dot { background: #FFF1DE; }
.btn-sing[aria-pressed="true"] .sing-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid #FFF1DE;
  animation: ripple 2.4s var(--ease) infinite;
}
@keyframes ripple { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

.light-toggle, .seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(20, 13, 9, 0.55); border: 1px solid rgba(243, 233, 218, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.light-toggle button, .seg button {
  border: 0; background: transparent; color: #E9DCC8; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: var(--step--1);
  transition: background-color .25s, color .25s;
}
.light-toggle button[aria-checked="true"], .seg button[aria-checked="true"] { background: #F3E9DA; color: var(--umber); }

/* bowl chips: disc sized to the real bowl */
.bowl-pick, .chips { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
.chip {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 64px; padding: 8px 8px 7px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer;
  color: #E9DCC8; transition: background-color .2s, border-color .2s;
}
.chip:hover { background: rgba(243, 233, 218, 0.08); }
.chip[aria-checked="true"] { border-color: rgba(243, 233, 218, 0.5); background: rgba(20, 13, 9, 0.45); }
.chip-disc {
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #E2B56E, #A3712F 45%, #5E3E17 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 236, 200, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.chip-none { width: 26px; height: 26px; background: none; box-shadow: none; border: 1.5px dashed currentColor; opacity: 0.7; }
.chip-text { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.chip-label { font-size: 0.82rem; }
.chip-note { font-family: var(--serif); font-size: 1.05rem; color: var(--bronze-lt); }
.hero .bowl-pick { padding: 4px; border-radius: 16px; background: rgba(20, 13, 9, 0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

@media (max-width: 760px) {
  .hero-controls { grid-template-columns: 1fr; bottom: 16px; }
  .hero-actions { justify-content: flex-start; }
  .hero-copy { bottom: 250px; }
  .chip { min-width: 56px; padding: 6px 4px; }
}

/* ------------------------------------------------------------------ Story (umber) */
.story { padding: clamp(80px, 12vw, 160px) 0; background: var(--umber); }
.story .display { color: #F3E9DA; margin-bottom: 0.5em; }
.story .lede + .lede { margin-top: 1em; }
.story p { color: var(--sandstone); }
.story strong { color: #F3E9DA; }

.settings { margin-top: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule-dark); }
.settings article { padding: 26px 26px 0 0; }
.settings article + article { padding-left: 26px; border-left: 1px solid var(--rule-dark); }
.settings h3 { font-family: var(--serif); font-size: var(--step-2); color: #F3E9DA; margin-bottom: 8px; }
@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr 1fr; }
  .settings article:nth-child(3) { padding-left: 0; border-left: 0; }
  .settings article:nth-child(n+3) { border-top: 1px solid var(--rule-dark); margin-top: 26px; }
}
@media (max-width: 520px) {
  .settings { grid-template-columns: 1fr; }
  .settings article, .settings article + article { padding-left: 0; border-left: 0; }
  .settings article + article { border-top: 1px solid var(--rule-dark); margin-top: 26px; }
}

.story-how { background: var(--umber-2); }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.split + .split { margin-top: clamp(72px, 10vw, 130px); }
.split p + p { margin-top: 1em; }
.split-rev { grid-template-columns: 1fr 1.05fr; }
.split-even { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 900px) {
  .split, .split-rev, .split-even { grid-template-columns: 1fr; }
  .split-rev > figure { order: 2; }
}
.ticks { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 10px; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 1px; background: currentColor; opacity: 0.6; }

.fig { border-radius: var(--radius); }
.fig-dark { background: var(--vellum); color: var(--ink); padding: 14px; }
.fig-canvas { width: 100%; height: 280px; }
.fig-tall { height: 420px; }
.fig figcaption { margin-top: 10px; font-size: var(--step--1); color: var(--ink-2); padding: 0 4px; }
.fig .seg { margin: 10px 4px 0; background: var(--vellum-2); border-color: var(--rule); backdrop-filter: none; }
.fig .seg button { color: var(--ink-2); }
.fig .seg button[aria-checked="true"] { background: var(--ink); color: var(--vellum); }

.sim { margin-top: clamp(72px, 10vw, 130px); display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.sim .fig-canvas { height: 300px; }
.sim-verdict { margin-top: 18px; padding: 14px 16px; border-radius: 8px; background: var(--umber-3); color: #F3E9DA; min-height: 5.2em; }
.sim-verdict[data-state="sing"] { box-shadow: inset 3px 0 0 var(--verdigris-lt); }
.sim-verdict[data-state="chatter"], .sim-verdict[data-state="choke"] { box-shadow: inset 3px 0 0 #D58A4A; }
.sim-verdict[data-state="quiet"] { box-shadow: inset 3px 0 0 var(--sand-2); }
@media (max-width: 900px) { .sim { grid-template-columns: 1fr; } }

/* range inputs */
.range { display: grid; gap: 6px; margin-top: 18px; }
.range > span { display: flex; justify-content: space-between; gap: 12px; font-size: var(--step--1); }
.range output { font-variant-numeric: tabular-nums; font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: currentColor; opacity: 0.35; }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: currentColor; opacity: 0.35; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%; background: var(--bronze); border: 3px solid var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bronze); border: 3px solid var(--paper); }
.story input[type="range"]::-webkit-slider-thumb { border-color: var(--umber-2); }

/* ------------------------------------------------------------------ Paper (vellum) */
.paper { background: var(--vellum); color: var(--ink); display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.paper-plain { grid-template-columns: minmax(0, 1fr); }
.paper .display { color: var(--ink); }
.paper .lede { color: var(--ink-2); }
.rail { position: sticky; top: 0; align-self: start; height: 100vh; padding: 96px 0 40px var(--gutter); }
.rail-title { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 14px; }
.rail ol { list-style: none; padding: 0; display: grid; gap: 2px; font-size: var(--step--1); counter-reset: r; }
.rail a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); }
.rail a:hover { background: var(--vellum-2); color: var(--ink); }
.rail a.on { color: var(--ink); background: var(--vellum-2); box-shadow: inset 2px 0 0 var(--bronze); }
@media (max-width: 1080px) { .paper { grid-template-columns: minmax(0, 1fr); } .rail { display: none; } }

.paper-body { min-width: 0; padding: 0 var(--gutter); }
.sec { max-width: 860px; margin: 0 auto; padding: clamp(80px, 10vw, 140px) 0; }
.sec + .sec { border-top: 1px solid var(--rule); }
.sec-wide { max-width: 1180px; }
.sec .display { margin-bottom: 0.4em; }
.sec-head { max-width: 860px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec > .lede { margin-bottom: clamp(28px, 4vw, 48px); }
.sec p + p { margin-top: 1em; }

/* concepts */
.concepts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.concept { background: var(--paper); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.concept header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.concept h3 { font-family: var(--serif); font-size: var(--step-2); }
.badge { font-size: 0.8rem; font-weight: 600; color: var(--verdigris); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; }
.concept-line { color: var(--ink); font-weight: 500; }
.concept dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--step--1); color: var(--ink-2); }
.concept dt { color: var(--ink-3); }
.concept-score { margin-top: auto; padding-top: 10px; color: var(--ink-3); font-size: var(--step--1); }
.concept-score span { font-family: var(--serif); font-size: 2rem; color: var(--ink); margin-right: 4px; }
.concept-chosen { background: #fff; }
.concept-chosen .concept-score span { color: var(--verdigris); }
@media (max-width: 700px) { .concepts { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 28px; }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
caption { text-align: left; color: var(--ink-3); padding-bottom: 10px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 600; color: var(--ink-2); border-bottom-color: var(--ink); }
tfoot th, tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score td { white-space: nowrap; }
.col-chosen { background: rgba(63, 122, 108, 0.08); }
.pips { display: inline-block; width: 70px; height: 8px; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(to right, var(--ink) calc(var(--n) * 20%), rgba(28, 35, 33, 0.12) 0); }
.col-chosen .pips { background: linear-gradient(to right, var(--verdigris) calc(var(--n) * 20%), rgba(28, 35, 33, 0.12) 0); }

/* viewer */
.viewer-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; border-radius: 14px; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); }
.viewer { position: relative; min-height: 560px; background: radial-gradient(ellipse at 50% 40%, #FAFAF7, #E3E5DF 75%); }
.viewer-canvas, .viewer-labels { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.viewer-labels { touch-action: none; cursor: grab; }
.viewer-labels:active { cursor: grabbing; }
.viewer-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.part-label {
  pointer-events: none; white-space: nowrap; font-size: 11.5px; line-height: 1; color: var(--ink);
  background: rgba(255, 255, 255, 0.86); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 8px 4px 4px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.part-label span { display: inline-block; background: var(--ink); color: var(--vellum); border-radius: 999px; padding: 2px 6px; margin-right: 4px; font-size: 10px; font-weight: 600; }
.part-label span:empty { display: none; }
.viewer-panel { padding: 22px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.field { border: 0; padding: 0; margin: 0; }
.field legend { font-size: var(--step--1); margin-bottom: 6px; padding: 0; }
.viewer-panel .chip { color: var(--ink); min-width: 0; padding: 6px 6px 5px; }
.viewer-panel .chip:hover { background: var(--vellum-2); }
.viewer-panel .chip[aria-checked="true"] { background: var(--vellum); border-color: var(--ink); }
.viewer-panel .chip-note { color: var(--bronze); }
.toggles { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--step--1); }
.switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: rgba(28,35,33,.2); position: relative; cursor: pointer; transition: background-color .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--verdigris); }
.switch input:checked::after { transform: translateX(14px); }
.run { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); }
.run .range:first-of-type { margin-top: 10px; }
.part-card { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: var(--step--1); min-height: 140px; }
.part-id { color: var(--ink-3); }
.part-name { font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; margin: 2px 0 10px; }
.part-facts { display: grid; gap: 6px; }
.part-facts div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
.part-facts dt { color: var(--ink-3); }
.part-note { margin-top: 10px; color: var(--ink-2); }
@media (max-width: 900px) {
  .viewer-shell { grid-template-columns: 1fr; }
  .viewer { min-height: 62vh; }
  .viewer-panel { border-left: 0; border-top: 1px solid var(--rule); }
}

/* subsystems */
.sub { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 36px 0; border-top: 1px solid var(--rule); }
.sub:first-of-type { border-top: 0; padding-top: 0; }
.sub p { color: var(--ink-2); max-width: 44em; }
.sub .h3 { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; margin-top: 8px; }
.facts div { border-top: 1px solid var(--ink); padding-top: 8px; }
.facts dt { font-size: var(--step--1); color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; }

/* calculator */
.calc { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.calc-in { position: sticky; top: 90px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 20px 20px; }
.calc-in .small { margin-top: 16px; }
.calc-out { display: grid; }
.calc-out > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.calc-out > div:first-child { padding-top: 0; }
.calc-out dt { color: var(--ink-2); font-size: var(--step--1); padding-top: 6px; }
.calc-out dd { margin: 0; display: grid; gap: 2px; }
.calc-val { font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-note { font-size: var(--step--1); color: var(--ink-3); }
@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; }
  .calc-in { position: static; }
  .calc-out > div { grid-template-columns: 1fr; gap: 2px; }
  .calc-out dt { padding-top: 0; }
}

/* drawings */
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px 24px; }
.sheet-open { display: block; width: 100%; padding: 0; border: 1px solid var(--rule); border-radius: 6px; background: #fff; cursor: zoom-in; overflow: hidden; transition: box-shadow .25s, transform .25s var(--ease); }
.sheet-open:hover { box-shadow: 0 10px 30px rgba(28, 35, 33, 0.14); transform: translateY(-2px); }
.sheet-thumb { display: block; aspect-ratio: 420 / 297; }
.sheet-thumb svg { width: 100%; height: 100%; }
.sheet figcaption { margin-top: 12px; display: grid; gap: 2px; font-size: var(--step--1); }
.sheet-no { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sheet figcaption strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.2; }
.sheet-blurb { color: var(--ink-2); }

.lightbox { width: min(1400px, 100vw - 24px); max-width: none; height: calc(100vh - 24px); max-height: none; padding: 0; border: 0; border-radius: 10px; background: #F7F7F4; color: var(--ink); display: none; flex-direction: column; overflow: hidden; }
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(18, 14, 11, 0.78); }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.lb-title { font-family: var(--serif); font-size: 1.3rem; white-space: pre; }
.lb-actions { display: flex; gap: 8px; }
.lb-body { flex: 1; overflow: auto; display: grid; place-items: center; padding: 12px; }
.lb-body svg { width: 100%; height: 100%; max-height: calc(100vh - 110px); }
.lb-body.zoomed { place-items: start; }
.lb-body.zoomed svg { width: 260%; max-width: none; height: auto; max-height: none; }

/* electronics */
.states { list-style: none; padding: 0; counter-reset: st; display: grid; gap: 12px; margin-bottom: 18px; }
.states li { counter-increment: st; position: relative; padding-left: 40px; color: var(--ink-2); }
.states li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.states strong { color: var(--ink); }
#brain .ticks { color: var(--ink-2); margin-bottom: 24px; }
#brain .ticks strong { color: var(--ink); }
#brain p { color: var(--ink-2); }
#brain .h3 + p, #brain .h3 + ul { margin-bottom: 26px; }

/* BOM */
.bom-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.bom-cat { background: var(--paper); padding: 16px 18px; }
.bom-cat-name { font-weight: 600; }
.bom-cat-n { color: var(--ink-3); font-size: var(--step--1); }
.bom-cat-cost { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; margin-top: 8px; }
.bom-printed { box-shadow: inset 0 3px 0 var(--sandstone); }
.bom-machined { box-shadow: inset 0 3px 0 var(--bronze); }
.bom-hardware { box-shadow: inset 0 3px 0 var(--ink-3); }
.bom-electronics { box-shadow: inset 0 3px 0 var(--verdigris); }
.bom-total { background: var(--ink); color: var(--vellum); }
.bom-total .bom-cat-n { color: #A9B0AC; }
@media (max-width: 820px) { .bom-summary { grid-template-columns: 1fr 1fr; } .bom-total { grid-column: 1 / -1; } }
.bom-group { border-top: 1px solid var(--ink); }
.bom-group:last-of-type { border-bottom: 1px solid var(--rule); }
.bom-group summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; }
.bom-group summary::-webkit-details-marker { display: none; }
.bom-group summary::before { content: ""; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); margin-right: 4px; flex: none; align-self: center; }
.bom-group[open] summary::before { transform: rotate(45deg); }
.bom-title { font-family: var(--serif); font-size: var(--step-2); flex: 1; }
.bom-sub { color: var(--ink-3); font-size: var(--step--1); }
.bom-blurb { color: var(--ink-2); max-width: 44em; }
.bom-group .table-scroll { margin: 14px 0 28px; }
.bom-table td { color: var(--ink-2); }
.bom-table td strong { color: var(--ink); font-weight: 500; }
.bom-table td:nth-child(2) { min-width: 220px; }
.bom-table td:nth-child(5) { min-width: 220px; }
.bom-note { display: block; color: var(--ink-3); margin-top: 2px; }
.pid { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); white-space: nowrap; }
.print-notes { margin-top: 48px; }
.print-notes .small { margin-top: 18px; max-width: 44em; }

/* ------------------------------------------------------------------ Build manual */
.manual { background: var(--paper); color: var(--ink); padding: clamp(80px, 10vw, 140px) 0 0; border-top: 1px solid var(--rule); }
.manual .lede { color: var(--ink-2); margin-top: 0.3em; }
.manual-head { margin-bottom: clamp(36px, 5vw, 60px); }
.facts-row { margin-top: 28px; max-width: 900px; }
.manual-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0; width: min(1360px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.manual-steps { padding-bottom: 30vh; }
.step { display: grid; grid-template-columns: 64px 1fr; gap: 0 16px; padding: 36px 0; border-top: 1px solid var(--rule); opacity: 0.5; transition: opacity .35s var(--ease); }
.step-on { opacity: 1; }
.step-n { font-family: var(--serif); font-size: 3rem; line-height: 0.9; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.step-on .step-n { color: var(--bronze); }
.step h3 { font-family: var(--serif); font-size: var(--step-2); line-height: 1.1; }
.step-meta { color: var(--ink-3); font-size: var(--step--1); margin: 6px 0 12px; }
.step-body > p:not(.step-meta) { color: var(--ink-2); max-width: 36em; }
.step-parts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 4px; font-size: var(--step--1); color: var(--ink-2); }
.step-parts .pid { display: inline-block; min-width: 3.2em; }
.step-tip { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: rgba(63, 122, 108, 0.1); color: var(--ink) !important; font-size: var(--step--1); }
.manual-stage { position: sticky; top: 64px; height: calc(100vh - 64px); padding: 0 0 24px 32px; display: flex; flex-direction: column; }
.viewer-build { flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); }
.stage-cap { padding-top: 10px; font-family: var(--serif); font-size: 1.3rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .manual-body { grid-template-columns: 1fr; }
  .manual-stage { order: -1; top: 56px; height: 44vh; padding: 0 0 10px; z-index: 2; background: var(--paper); }
  .manual-steps { padding-bottom: 20vh; }
  .step { grid-template-columns: 44px 1fr; }
  .step-n { font-size: 2.2rem; }
}

/* care, making */
.paper-plain .sec { max-width: 1080px; }
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 56px; margin-top: 32px; }
.cols p, .cols li { color: var(--ink-2); }
.cols p + p { margin-top: 0.9em; }
.plain { padding-left: 1.2em; display: grid; gap: 8px; }
.plain li::marker { color: var(--ink-3); }
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { padding-left: 18px; position: relative; }
ul.plain li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 8px; height: 1px; background: var(--ink-3); }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.plan td:first-child { white-space: nowrap; font-weight: 600; color: var(--ink); }
.plan td { color: var(--ink-2); }
.plan td:last-child { white-space: nowrap; }
#making .h3 { margin-top: 48px; }
.test { color: var(--ink-2); }
.test strong { color: var(--ink); }

/* ------------------------------------------------------------------ Order */
.order { background: var(--umber); padding: clamp(90px, 12vw, 160px) 0; }
.order .display { color: #F3E9DA; }
.order .lede { margin-top: 0.4em; }
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 44px; }
.path {
  text-align: left; display: grid; align-content: start; gap: 6px; padding: 22px; border-radius: 12px; cursor: pointer;
  background: var(--umber-2); border: 1px solid var(--rule-dark); color: var(--sandstone); transition: border-color .2s, background-color .2s;
}
.path:hover { border-color: rgba(205, 184, 154, 0.45); }
.path[aria-checked="true"] { border-color: var(--bronze-lt); background: var(--umber-3); box-shadow: inset 0 0 0 1px var(--bronze-lt); }
.path-name { font-family: var(--serif); font-size: var(--step-2); color: #F3E9DA; line-height: 1.1; }
.path-price { color: var(--bronze-lt); font-weight: 600; }
.path-note { font-size: var(--step--1); }
@media (max-width: 820px) { .paths { grid-template-columns: 1fr; } }
.interest { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.interest .small { grid-column: 1 / -1; }
.field-text { display: grid; gap: 6px; font-size: var(--step--1); }
.field-text input, .field-text select { min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rule-dark); background: var(--umber-2); color: #F3E9DA; }
.field-text input::placeholder { color: var(--sand-2); }
@media (max-width: 820px) { .interest { grid-template-columns: 1fr; } }

.foot { background: #150F0B; padding: 40px 0; font-size: var(--step--1); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }

/* ------------------------------------------------------------------ Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; scroll-behavior: auto !important; }
  .hero-copy, .hero-copy-b { transform: none; }
}
html:not(.reduced) { scroll-behavior: smooth; }
