/*
 * RoboDuck Build: the duck's own materials as the design system.
 * Matte white plastic for the page, Marine Blue as the ink, the head band's grey for structure,
 * and the LCD iris cyan only for things that are live (the eye, progress). Panels take the
 * hood's shape: big radius on top, small at the bottom. The footer is the textured build plate.
 * Bump ASSET_VERSION in includes/globals.php after changing this file.
 */

:root {
  --bg: #eef0ee;
  --surface: #f9faf8;
  --surface-2: #e2e6e5;
  --line: #c6cccc;
  --band: #9c9fa1;
  --ink: #13314b;
  --ink-2: #4a5e6f;
  --marine: #1e6197;
  --marine-strong: #154a74;
  --on-marine: #ffffff;
  --iris: #22b0d8;
  --servo: #1b1b1d;
  --amber: #f2c230;
  --amber-ink: #7a5900;
  --plastic-white: #f5f4f0;
  --plastic-grey: #9c9fa1;
  --plastic-blue: #1e6197;
  --plastic-tpu: #3a3a3a;
  --layers: rgba(19, 49, 75, 0.035);

  --display: "Gabarito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-xs: 0.8125rem;
  --fs-s: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-m: 1.3125rem;
  --fs-l: 1.75rem;
  --fs-xl: clamp(2rem, 4.4vw, 2.75rem);
  --fs-mega: clamp(4.25rem, 11vw, 8.5rem);

  --wrap: 72rem;
  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --hood: 2.75rem 2.75rem 0.875rem 0.875rem;
  --radius: 0.625rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a1f;
    --surface: #1b2228;
    --surface-2: #242c34;
    --line: #36424d;
    --band: #5d6873;
    --ink: #e5ebf0;
    --ink-2: #a2b2c0;
    --marine: #78b6e9;
    --marine-strong: #a3cdf2;
    --on-marine: #0d2236;
    --iris: #3cc8ef;
    --amber-ink: #f2c230;
    --plastic-white: #e9e8e3;
    --layers: rgba(255, 255, 255, 0.025);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--marine); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--marine-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--iris); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-l); }
h3 { font-size: var(--fs-m); }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--marine); color: var(--on-marine); padding: 0.5rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

html:not(.js) .js-only { display: none !important; }

/* ---------- Masthead ---------- */

.masthead { padding: 1.1rem 0; }
.masthead__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__badge {
  width: 2.75rem; height: 2.5rem; display: grid; place-items: center;
  background: var(--plastic-white); border: 1.5px solid var(--line);
  border-radius: 1.2rem 1.2rem 0.45rem 0.45rem;
  box-shadow: inset 0 -0.35rem 0 var(--plastic-grey);
}
.brand__badge .eye { width: 1.55rem; margin-top: -0.3rem; }
.brand__name { font-family: var(--display); font-weight: 900; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1; }
.brand__build { font-weight: 600; color: var(--ink-2); margin-left: 0.18em; }

.nav { display: flex; align-items: center; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }
.nav__list a {
  font-family: var(--display); font-weight: 600; font-size: var(--fs-s);
  color: var(--ink); text-decoration: none; padding: 0.3rem 0; display: inline-block;
  border-bottom: 3px solid transparent;
}
.nav__list a:hover { border-bottom-color: var(--line); }
.nav__list a[aria-current="page"] { border-bottom-color: var(--marine); }
.nav__toggle {
  font: 600 var(--fs-s) var(--display); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer;
}

@media (max-width: 52rem) {
  html.js .nav__toggle { display: inline-block; }
  html.js .nav__list {
    display: none; position: absolute; left: var(--gutter); right: var(--gutter); top: 4.4rem; z-index: 5;
    flex-direction: column; gap: 0; background: var(--surface); border: 1.5px solid var(--line);
    border-radius: 1.25rem; padding: 0.5rem 1.25rem;
  }
  html.js .nav.is-open .nav__list { display: flex; }
  html.js .nav__list a { display: block; padding: 0.6rem 0; }
  .masthead { position: relative; }
}
@media (min-width: 52.01rem) { .nav__toggle { display: none; } }

/* ---------- The LCD eye ---------- */

.eye__ring { fill: var(--plastic-blue); }
.eye__glass { fill: #0a0e13; }
.eye__iris { fill: var(--iris); }
.eye__iris-ring { fill: none; stroke: #0f6f8f; stroke-width: 1.4; opacity: 0.55; }
.eye__pupil { fill: #04070a; }
.eye__glint { fill: #ffffff; }
.eye__look { transition: transform 0.25s ease-out; }
.eye__lid { fill: #0a0e13; transform: scaleY(0); transform-origin: 0 -50px; }
.is-blinking .eye__lid { animation: blink 0.22s ease-in-out; }
@keyframes blink { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(1); } }

/* ---------- Hero ---------- */

.hero { padding: 0.5rem 0 3rem; }
.hero__panel {
  max-width: var(--wrap); margin: 0 auto;
  background: var(--surface) repeating-linear-gradient(to bottom, transparent 0 3px, var(--layers) 3px 4px);
  border: 1.5px solid var(--line);
  border-radius: var(--hood);
  padding: clamp(1.25rem, 4vw, 3rem);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-areas: "duck head" "duck body"; grid-template-rows: auto 1fr;
}
.hero__head { grid-area: head; align-self: end; }
.hero__duck { grid-area: duck; align-self: center; }
.hero__body { grid-area: body; }
.hero__wrap { padding: 0 var(--gutter); }
.hero__ask { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); color: var(--ink-2); margin: 0; }
.hero__answer {
  font-family: var(--display); font-weight: 900; font-size: var(--fs-mega); line-height: 0.88;
  letter-spacing: -0.045em; color: var(--marine); margin: 0.05em 0 0.25em; text-wrap: nowrap;
}
.hero__detail { font-size: var(--fs-m); line-height: 1.45; max-width: 32rem; }
.hero__next { color: var(--ink-2); max-width: 32rem; }
.hero__next strong { color: var(--ink); }

@media (max-width: 48rem) {
  .hero__panel { grid-template-columns: 1fr; grid-template-areas: "head" "duck" "body"; grid-template-rows: auto; }
  .hero__duck { max-width: 22rem; width: 100%; margin: 0 auto 1rem; }
}

/* ---------- Progress duck ---------- */

.duck { margin: 0; }
.duck__stage { position: relative; display: grid; touch-action: manipulation; }
.duck__stage > picture, .duck__stage > img, .duck__stage > svg { grid-area: 1 / 1; width: 100%; height: auto; position: relative; }   /* positioned, so the faded ghost doesn't paint over the layers */
.duck__stage > picture > img { width: 100%; height: auto; }
.duck__ghost { opacity: 0.6; }
.duck__part { opacity: 0; transition: opacity 0.45s ease, filter 0.2s ease; pointer-events: none; }
.duck[data-view="made"] .duck__part:is([data-status="printed"], [data-status="in-hand"], [data-status="fitted"]),
.duck[data-view="fitted"] .duck__part[data-status="fitted"] { opacity: 1; }
.duck__part.is-hot { opacity: 1; filter: drop-shadow(0 0 0.35rem var(--iris)) drop-shadow(0 0 0.05rem var(--iris)); }
.duck__part.is-hot.is-ghost { opacity: 0.4; }
.duck__screen { pointer-events: none; transition: opacity 0.45s ease; }
.duck[data-view="fitted"] .duck__screen:not([data-status="fitted"]) { opacity: 0; }
.duck__tip {
  position: absolute; z-index: 2; margin: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: var(--fs-xs); line-height: 1.35;
  padding: 0.4rem 0.6rem; border-radius: 0.5rem; max-width: 15rem; transform: translate(-50%, calc(-100% - 0.8rem));
}
.duck__tip strong { font-family: var(--display); font-weight: 800; display: block; font-size: var(--fs-s); }
.duck figcaption { font-size: var(--fs-s); color: var(--ink-2); margin-top: 0.75rem; }
.duck--pending .duck__fallback { border-radius: var(--radius); }

.progress-duck { max-width: 32rem; width: 100%; margin: 0 auto; }
.duck-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1rem; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 0.2rem; }
.seg__btn {
  font: 700 var(--fs-s) var(--display); color: var(--ink-2); background: transparent;
  border: 0; border-radius: 999px; padding: 0.35rem 0.95rem; cursor: pointer;
}
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 0 0 1.5px var(--line); }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: var(--fs-s); color: var(--ink-2); }
.when-fitted, html[data-duck-view="fitted"] .when-made { display: none; }
html[data-duck-view="fitted"] .when-fitted { display: inline; }
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend__key { width: 0.95rem; height: 0.95rem; border-radius: 0.3rem 0.3rem 0.12rem 0.12rem; border: 1.5px solid var(--band); }
.legend__key--ghost { background: var(--surface-2); }
.legend__key--done { background: var(--plastic-blue); border-color: var(--plastic-blue); box-shadow: inset 0.48rem 0 0 var(--plastic-white); }

/* ---------- Plate chips and tallies ---------- */

.plate {
  display: inline-flex; align-items: center; gap: 0.35em;
  font: 800 var(--fs-xs) / 1 var(--display); letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  padding: 0.28em 0.55em 0.28em 0.4em; border: 1.5px solid var(--line); border-radius: 0.45rem;
  background: var(--surface);
}
a.plate:hover { border-color: var(--marine); color: var(--ink); }
.plate::before { content: ""; width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--swatch, var(--band)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.plate--white { --swatch: var(--plastic-white); }
.plate--grey { --swatch: var(--plastic-grey); }
.plate--blue { --swatch: var(--plastic-blue); }
.plate--tpu { --swatch: var(--plastic-tpu); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }

/* The 20 plates as filament tiles: filled in their colour once printed. */
.tiles { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.3rem; max-width: 30rem; }
.tile {
  aspect-ratio: 1; display: grid; place-items: center;
  font: 800 0.7rem / 1 var(--display); color: var(--band);
  border: 1.5px dashed var(--band); border-radius: 0.55rem 0.55rem 0.25rem 0.25rem;
  text-decoration: none;
}
.tile:hover { color: var(--ink); border-color: var(--ink-2); }
.tile.is-done {
  border-style: solid; border-color: rgba(0, 0, 0, 0.28); background: var(--swatch); color: var(--on-swatch, #fff);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}
.tile--white { --swatch: var(--plastic-white); --on-swatch: #13314b; }
.tile--white.is-done { border-color: var(--band); }
.tile--grey { --swatch: var(--plastic-grey); --on-swatch: #10202e; }
.tile--blue { --swatch: var(--plastic-blue); }
.tile--tpu { --swatch: var(--plastic-tpu); }
@media (max-width: 30rem) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.servos { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.servo { width: 1.05rem; height: 1.45rem; border-radius: 0.2rem; border: 1.5px dashed var(--band); }
.servo.is-arrived { border-style: solid; border-color: var(--servo); background: var(--surface-2); }
.servo.is-fitted { border-style: solid; border-color: var(--servo); background: var(--servo); }
.servo.is-spare { opacity: 0.55; }

.tally { margin: 1.4rem 0 0; }
.tally__line { margin: 0 0 0.55rem; font-size: var(--fs-s); color: var(--ink-2); }
.tally__line strong { color: var(--ink); font-family: var(--display); font-weight: 800; font-size: var(--fs-base); }

/* ---------- Sections and layout ---------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tight { padding-top: 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.section__head h2 { margin: 0; }
.section__more { font-family: var(--display); font-weight: 700; }

.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.page-head { padding: clamp(1.5rem, 4vw, 3rem) 0 1.5rem; }
.page-head__lede { font-size: var(--fs-m); line-height: 1.45; max-width: var(--measure); color: var(--ink-2); }
.page-head h1 { max-width: 22ch; }

/* ---------- Diary timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 1.5rem;
  padding: 0 0 2rem; position: relative;
}
.timeline__item::before {
  content: ""; position: absolute; left: 2.1rem; top: 3.4rem; bottom: 0.6rem; width: 2px; background: var(--line);
}
.timeline__item:last-child::before { display: none; }
.timeline__day { font-family: var(--display); }
.timeline__day b { display: block; font-weight: 900; font-size: var(--fs-l); line-height: 1; color: var(--marine); letter-spacing: -0.02em; }
.timeline__day time { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.timeline__title { font-size: var(--fs-m); margin: 0 0 0.35rem; }
.timeline__title a { color: var(--ink); text-decoration: none; }
.timeline__title a:hover { color: var(--marine); text-decoration: underline; }
.timeline__summary { margin: 0 0 0.6rem; max-width: var(--measure); color: var(--ink-2); }
.timeline__body { display: grid; grid-template-columns: minmax(0, 1fr) 9rem; gap: 1.25rem; align-items: start; }
.timeline__thumb img { border-radius: 0.5rem; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
@media (max-width: 40rem) {
  .timeline__item { grid-template-columns: 4.25rem minmax(0, 1fr); gap: 0 1rem; }
  .timeline__item::before { left: 1.4rem; }
  .timeline__body { grid-template-columns: 1fr; }
  .timeline__thumb { max-width: 14rem; }
}

/* ---------- Diary entry ---------- */

.entry-head { padding: clamp(1.5rem, 4vw, 3rem) 0 1rem; max-width: 48rem; }
.entry-head__day { font-family: var(--display); font-weight: 800; color: var(--marine); margin: 0 0 0.4rem; }
.entry-head__day time { color: var(--ink-2); font-weight: 600; }
.entry-head .chips { margin-top: 0.75rem; }
.entry-hero { margin: 1rem 0 2rem; }
.entry-hero img { border-radius: var(--hood); width: 100%; max-height: 34rem; object-fit: cover; }
.entry-hero--render img { object-fit: contain; background: #f4f5f4; border: 1.5px solid var(--line); max-height: 30rem; }
.entry-hero figcaption { font-size: var(--fs-s); color: var(--ink-2); margin-top: 0.6rem; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--fs-l); margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }
.prose .fig { margin: 1.75rem 0; }
.prose .fig--wide { margin-left: 0; margin-right: calc(-1 * min(18rem, 30vw)); }
@media (max-width: 64rem) { .prose .fig--wide { margin-right: 0; } }

.fig { margin: 0; }
.fig img { border-radius: var(--radius); width: 100%; }
.fig--render img { background: var(--surface); border: 1.5px solid var(--line); }
.fig figcaption { font-size: var(--fs-s); color: var(--ink-2); margin-top: 0.55rem; }
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0; }
.fig-pair .fig { margin: 0; }
@media (max-width: 36rem) { .fig-pair { grid-template-columns: 1fr; } }

.note {
  border-left: 4px solid var(--amber); background: var(--surface); padding: 0.9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0; max-width: var(--measure);
}
.note p:last-child { margin: 0; }

.share {
  margin: 2.5rem 0; max-width: var(--measure); padding: 1.1rem 1.25rem;
  border: 1.5px dashed var(--band); border-radius: 1.25rem 1.25rem 0.5rem 0.5rem;
}
.share h2 { font-size: var(--fs-m); margin-bottom: 0.4rem; }
.share__text { white-space: pre-line; background: var(--surface); border-radius: var(--radius); padding: 0.8rem 1rem; font-size: var(--fs-s); }
.share__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.share__done { font-size: var(--fs-s); color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  font: 700 var(--fs-s) / 1 var(--display); text-decoration: none;
  background: var(--marine); color: var(--on-marine); border: 0; border-radius: 999px; padding: 0.7rem 1.15rem;
}
.btn:hover { background: var(--marine-strong); color: var(--on-marine); }
.btn--quiet { background: var(--surface-2); color: var(--ink); }
.btn--quiet:hover { background: var(--line); color: var(--ink); }

.entry-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1.5px solid var(--line); }
.entry-nav a { text-decoration: none; display: block; }
.entry-nav span { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.entry-nav b { font-family: var(--display); font-weight: 800; }
.entry-nav__next { text-align: right; }

/* ---------- Feature rows (home: our changes) ---------- */

.changes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.change img { border-radius: 1.5rem 1.5rem 0.5rem 0.5rem; background: var(--surface); border: 1.5px solid var(--line); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.change h3 { margin: 0.9rem 0 0.35rem; }
.change h3 a { color: var(--ink); text-decoration: none; }
.change h3 a:hover { color: var(--marine); }
.change p { color: var(--ink-2); margin: 0; }
@media (max-width: 52rem) { .changes { grid-template-columns: 1fr; max-width: 28rem; } }

/* ---------- Spend ---------- */

.spend { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--hood); padding: 1.5rem; }
.spend__figure { font-family: var(--display); font-weight: 900; font-size: var(--fs-xl); line-height: 1; color: var(--ink); margin: 0.2rem 0 0.5rem; letter-spacing: -0.02em; }
.spend__bar { display: block; width: 100%; height: 0.75rem; margin: 0.75rem 0; }
.spend__track { fill: var(--surface-2); }
.spend__fill { fill: var(--marine); }
.spend p { color: var(--ink-2); font-size: var(--fs-s); }
.spend h2 { font-size: var(--fs-m); margin: 0; }

/* ---------- Parts table ---------- */

.parts-section { margin: 0 0 3rem; }
.parts-section__intro { color: var(--ink-2); max-width: var(--measure); }
.parts { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.parts th { text-align: left; font: 700 var(--fs-xs) var(--display); color: var(--ink-2); padding: 0 0.75rem 0.5rem 0; border-bottom: 1.5px solid var(--line); }
.parts td { padding: 0.9rem 0.75rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.parts__name { font-family: var(--display); font-weight: 800; font-size: var(--fs-base); color: var(--ink); }
.parts__for { color: var(--ink-2); }
.parts__note { color: var(--ink-2); margin: 0.35rem 0 0; max-width: 34rem; }
.parts__cost { white-space: nowrap; }
.parts__cost small { display: block; color: var(--ink-2); }
.parts td.num, .parts th.num { text-align: right; }
@media (max-width: 44rem) {
  .parts thead { display: none; }
  .parts, .parts tbody, .parts tr, .parts td { display: block; width: 100%; }
  .parts tr { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .parts td { border: 0; padding: 0.15rem 0; }
  .parts td.num { text-align: left; }
  .parts td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); }
}

.status { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem; }
.status::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1.5px solid var(--band); }
.status--printed::before, .status--fitted::before, .status--arrived::before, .status--in-hand::before, .status--have::before { background: var(--marine); border-color: var(--marine); }
.status--ordered::before { background: linear-gradient(90deg, var(--marine) 50%, transparent 50%); border-color: var(--marine); }
.status time { font-weight: 400; color: var(--ink-2); }

.shop { font-weight: 600; white-space: nowrap; }

/* ---------- Plates table (progress) ---------- */

.plate-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; }
.plate-row { background: var(--surface); border: 1.5px solid var(--line); border-radius: 1rem 1rem 0.4rem 0.4rem; padding: 0.85rem 1rem; scroll-margin-top: 1.5rem; }
.plate-row:target { border-color: var(--iris); box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 30%, transparent); }
.plate-row.is-done { border-color: var(--marine); }
.plate-row__top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.plate-row__name { font-size: var(--fs-base); margin: 0 0 0.2rem; }
.plate-list + h3, .section h3 + .plate-list { margin-top: 0.75rem; }
.plate-list { margin-bottom: 2rem; }
.section-gap { margin-top: 2rem; }
.plate-row p { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.plate-row__note { margin-top: 0.4rem !important; }

.milestones { list-style: none; margin: 0; padding: 0; counter-reset: ms; max-width: 34rem; }
.milestones li { counter-increment: ms; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 0.75rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.milestones li::before {
  content: counter(ms); width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  font: 800 var(--fs-xs) var(--display); border: 1.5px dashed var(--band); color: var(--ink-2);
}
.milestones li.is-done::before { border: 0; background: var(--marine); color: var(--on-marine); }
.milestones time { font-size: var(--fs-s); color: var(--ink-2); }

/* ---------- Fails ---------- */

.fails { list-style: none; margin: 0; padding: 0; }
.fail { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 1.5rem; padding: 1.75rem 0; border-bottom: 1.5px solid var(--line); }
.fail:first-child { padding-top: 0; }
.fail--noimg { grid-template-columns: minmax(0, 1fr); }
.fail__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; font-size: var(--fs-s); color: var(--ink-2); margin-bottom: 0.4rem; }
.fail__caught { font-family: var(--display); font-weight: 700; color: var(--amber-ink); }
.fail h2 { font-size: var(--fs-m); margin: 0 0 0.6rem; }
.fail dl { margin: 0; max-width: var(--measure); }
.fail dt { font-family: var(--display); font-weight: 800; font-size: var(--fs-s); }
.fail dd { margin: 0 0 0.6rem; }
.fail img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; }
@media (max-width: 40rem) { .fail { grid-template-columns: 1fr; } .fail img { max-width: 14rem; } }

.counts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: var(--fs-s); color: var(--ink-2); margin: 0 0 2rem; padding: 0; list-style: none; }
.counts strong { font-family: var(--display); font-weight: 900; font-size: var(--fs-l); color: var(--ink); margin-right: 0.3rem; }

/* ---------- Tools ---------- */

.tools-group { margin: 0 0 2.5rem; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.tool { border-top: 3px solid var(--plastic-grey); padding-top: 0.75rem; }
.tool h3 { font-size: var(--fs-base); margin: 0 0 0.3rem; }
.tool p { font-size: var(--fs-s); color: var(--ink-2); margin: 0 0 0.5rem; }

/* ---------- Decision page ---------- */

.verdicts { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; max-width: 52rem; }
.verdicts li { background: var(--surface); border: 1.5px solid var(--line); border-radius: 1.25rem 1.25rem 0.5rem 0.5rem; padding: 1rem 1.2rem; }
.verdicts h3 { font-size: var(--fs-base); margin: 0 0 0.35rem; }
.verdicts p { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.verdicts .is-yes { border-color: var(--marine); }

/* ---------- Footer: the textured build plate ---------- */

.plate-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  background-color: #1e1c1a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='1' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .82 0 0 0 0 .71 0 0 0 0 .48 34 0 0 0 -24.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  color: #d9d3c6;
  border-radius: var(--hood);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.plate-footer__inner {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 2rem;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem 3rem;
}
.plate-footer a { color: #f1e2b8; }
.plate-footer a:hover { color: #fff; }
.plate-footer__name { font-family: var(--display); font-weight: 900; font-size: var(--fs-m); color: #fff; display: flex; align-items: center; gap: 0.55rem; }
.plate-footer__name .eye { width: 1.6rem; }
.plate-footer__about p { max-width: 34rem; font-size: var(--fs-s); }
.plate-footer__links { list-style: none; margin: 0; padding: 0; font-size: var(--fs-s); }
.plate-footer__links li { margin-bottom: 0.4rem; }
.plate-footer__small { grid-column: 1 / -1; font-size: var(--fs-xs); color: #a69f90; margin: 0; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.12); }
@media (max-width: 40rem) { .plate-footer__inner { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Reference tables (print file, wiring) ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 2rem; -webkit-overflow-scrolling: touch; }
.spec { border-collapse: collapse; font-size: var(--fs-s); min-width: 36rem; width: 100%; max-width: 64rem; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--line); }
.spec thead th { font: 700 var(--fs-xs) var(--display); color: var(--ink-2); border-bottom: 1.5px solid var(--line); padding-top: 0; }
.spec tbody th { font-family: var(--display); font-weight: 800; color: var(--ink); }
.spec td { color: var(--ink-2); }
.spec td strong { color: var(--ink); }
.spec--plates tbody th { min-width: 10rem; }
.spec__name { display: block; font-family: var(--text); font-weight: 600; margin-top: 0.35rem; }
.nowrap { white-space: nowrap; }
.cmds { list-style: none; padding: 0 !important; }
.cmds code, .prose code { font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 0.3rem; }

/* ---------- Horizontal bar chart: one series, so no legend; the caption names it ---------- */

.hbars { margin: 0.5rem 0 1.5rem; max-width: 52rem; }
.hbars__title { font-family: var(--display); font-weight: 700; font-size: var(--fs-s); color: var(--ink-2); margin-bottom: 0.9rem; }
.hbars__list { list-style: none; margin: 0; padding: 0; }
.hbars__row {
  display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) 3.5rem; gap: 0.75rem; align-items: center;
  padding: 0.3rem 0.4rem; border-radius: 0.4rem;
}
.hbars__row:hover { background: var(--surface-2); }
.hbars__label { font-size: var(--fs-s); line-height: 1.25; }
.hbars__label b { font-weight: 600; color: var(--ink); }
.hbars__label time { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.hbars__bar { display: block; height: 16px; overflow: visible; }
.hbars__fill { fill: var(--marine); opacity: 0.55; }
.hbars__row.is-now .hbars__fill { opacity: 1; }
.hbars__value { font-family: var(--display); font-weight: 800; font-size: var(--fs-s); color: var(--ink); text-align: right; }
@media (max-width: 36rem) {
  .hbars__row { grid-template-columns: minmax(0, 1fr) 3rem; }
  .hbars__label { grid-column: 1 / -1; }
}
.versions li { margin-bottom: 0.5rem; }
