/*
 * DDT Design System: components.
 * Requires tokens.css (and fonts/fonts.css for the real faces).
 * Class names match the site generator. Content is visible without
 * JavaScript; nothing here hides content until scroll or interaction.
 */

/* ---------- Base ---------- */

*,
*::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(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-feature-settings: "kern", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

/* h4 and smaller stay in the text face: the display face is >= 24px only. */
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

p {
  margin: 0;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

a {
  color: inherit;
}

/* One focus treatment for everything that can take focus. */
:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: off-screen until focused, then a visible pill at top left. */
.skip {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: var(--z-skip);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band {
  padding-block: var(--s-8);
  border-top: var(--hairline) solid var(--border);
}

.band--surface {
  background: var(--surface);
  border-top: 0;
}

.section-head {
  display: grid;
  gap: var(--s-3);
  max-width: var(--measure);
  margin-bottom: var(--s-7);
}

.section-head p {
  color: var(--ink-muted);
  font-size: var(--text-lead);
}

.page-header {
  padding-block: var(--s-8) var(--s-7);
}

.page-header p {
  max-width: var(--measure);
  margin-top: var(--s-4);
  color: var(--ink-muted);
  font-size: var(--text-lead);
}

.byline {
  margin-top: var(--s-4);
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

/* ---------- Navigation ---------- */

/* No hamburger: links wrap under the brand on narrow screens, so there is
   no open/closed state that can get stuck across a resize. */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: var(--hairline) solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header {
    background: var(--bg);
  }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
  min-height: var(--nav-height);
  padding-block: var(--s-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--target-min);
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

/* Inline the logo SVG (fill="currentColor") so it follows the theme.
   An <img> cannot inherit currentColor and would stay ink in dark mode. */
.brand-mark,
.brand img,
.brand svg {
  display: block;
  flex: none;
  width: auto;
  height: 22px;
  fill: currentColor;
}

.brand-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.nav-links,
.nav-utilities {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-1);
}

.nav-links a,
.nav-utilities a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--s-3);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.nav-links a:hover,
.nav-utilities a:hover,
.theme-toggle:hover {
  color: var(--ink);
}

/* Current page: colour plus an underline, never colour alone. */
.nav-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.theme-toggle {
  border: 0;
  background: none;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

@media (max-width: 640px) {
  /* Hide the name visually but keep it as the link's accessible name;
     display:none would leave the home link unnamed (WCAG 2.4.4, 4.1.2). */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin-inline: calc(-1 * var(--s-3));
  }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--target-min);
  padding: var(--s-2) var(--s-5);
  border: var(--hairline) solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Text-labelled, so WCAG 1.4.11 does not require the border; it is there
   at >= 3:1 anyway so the button shape reads. */
.btn-secondary {
  border-color: var(--border-ui);
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: var(--s-8) var(--s-8);
  text-align: center;
}

.hero-name {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.hero h1 {
  margin: var(--s-3) auto 0;
  font-size: var(--text-display);
  line-height: var(--leading-display);
}

.board-figure {
  max-width: 880px;
  margin: var(--s-7) auto 0;
  color: var(--ink);
}

.board-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.board-figure figcaption {
  margin-top: var(--s-3);
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

.board-figure figcaption a {
  color: inherit;
  text-underline-offset: 3px;
}

.hero-intro {
  max-width: var(--measure);
  margin: var(--s-7) auto 0;
  font-size: var(--text-lead);
}

.hero-availability {
  max-width: var(--measure);
  margin: var(--s-4) auto 0;
  color: var(--ink-muted);
}

.hero .actions {
  justify-content: center;
  margin-top: var(--s-6);
}

/* ---------- Proof strip ---------- */

.proof-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-5);
  margin: 0;
  padding-block: var(--s-6);
  border-block: var(--hairline) solid var(--border);
}

.proof-strip dt {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: 1;
}

.proof-strip dd {
  margin: var(--s-2) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--s-5);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.band--surface .card {
  background: var(--bg);
}

.card h3 {
  font-size: var(--text-h3);
}

.card p {
  color: var(--ink-muted);
}

/* Whole-card link: the heading link stretches over the card; only one
   real link per card, so there is no nested interactive content. */
.card a.card-link {
  color: var(--ink);
  text-decoration: none;
}

.card a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}

.card:has(a.card-link):hover {
  border-color: var(--border-ui);
}

.card:has(a.card-link:focus-visible) {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}

.card a.card-link:focus-visible {
  outline: none;
}

.card .more {
  margin-top: auto;
  color: var(--accent);
  font-weight: var(--weight-medium);
}

/* ---------- Price card ---------- */

.price-grid {
  align-items: stretch;
}

.price-card {
  gap: var(--s-4);
}

.price-card .price {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: 1;
  color: var(--ink);
}

.price-card .price small {
  margin-left: var(--s-1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--ink-subtle);
}

.price-card .duration {
  color: var(--ink-subtle);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.price-card .outcome {
  color: var(--ink);
}

.price-card ul {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding-left: 1.1em;
  color: var(--ink-muted);
}

.price-card .btn {
  margin-top: auto;
}

.price-card--featured {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  padding-top: var(--s-4);
  border-top: var(--hairline) solid var(--border-ui);
}

.steps > li::before {
  content: counter(step);
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1;
  color: var(--accent);
}

.steps h3,
.steps h4 {
  margin-bottom: var(--s-2);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

.steps p {
  color: var(--ink-muted);
}

/* ---------- Tags ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--s-3);
  border: var(--hairline) solid var(--border-ui);
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

/* ---------- Timeline ---------- */

.timeline {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline > li {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: var(--s-5);
  padding-block: var(--s-5);
  border-top: var(--hairline) solid var(--border);
}

.timeline .dates {
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.timeline h3 {
  font-size: var(--text-h3);
}

.timeline .organization {
  margin-bottom: var(--s-2);
  color: var(--ink-muted);
  font-weight: var(--weight-medium);
}

.timeline p:not(.dates):not(.organization) {
  max-width: var(--measure);
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .timeline > li {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }
}

/* ---------- Prose ---------- */

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--s-4);
}

.prose h2 {
  margin-top: var(--s-7);
  font-size: var(--text-h2);
}

.prose h3 {
  margin-top: var(--s-6);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: var(--s-2);
}

/* Accent vs ink is only 3.0:1 (light) / 2.1:1 (dark), so links in running
   text are always underlined, never colour alone (WCAG 1.4.1). */
.prose a,
.link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover,
.link:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-style: italic;
  line-height: var(--leading-heading);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.prose pre {
  overflow-x: auto;
  padding: var(--s-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  line-height: 1.5;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose figure {
  margin-inline: 0;
}

.prose figcaption {
  margin-top: var(--s-2);
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

.prose hr {
  border: 0;
  border-top: var(--hairline) solid var(--border);
  margin-block: var(--s-7);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.prose th,
.prose td {
  padding: var(--s-2) var(--s-3);
  border-bottom: var(--hairline) solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: var(--weight-semibold);
}

/* ---------- FAQ (native disclosure) ---------- */

.faq {
  max-width: var(--measure);
  border-top: var(--hairline) solid var(--border);
}

.faq details {
  border-bottom: var(--hairline) solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--target-min);
  padding-block: var(--s-4);
  font-weight: var(--weight-medium);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--ink-subtle);
  font-size: var(--text-lead);
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > :not(summary) {
  padding-bottom: var(--s-4);
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--s-9);
  padding-block: var(--s-6);
  border-top: var(--hairline) solid var(--border);
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-1);
}

/* Footer links are underlined: they sit in muted text and must not rely
   on colour to be found. */
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--s-3);
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Section rule: a copper trace ending in a via ---------- */

/* Static drawing, decorative: <hr class="trace-rule"> or on .section-head. */
.trace-rule,
.section-head--trace::after {
  display: block;
  position: relative;
  height: 10px;
  margin: 0;
  border: 0;
  background:
    radial-gradient(circle at calc(100% - 5px) 50%, var(--bg) 0 2px, var(--board-copper) 2.5px 5px, transparent 5.5px) no-repeat,
    linear-gradient(var(--board-copper), var(--board-copper)) left 50% / calc(100% - 9px) 2px no-repeat;
}

.section-head--trace::after {
  content: "";
  width: min(160px, 40%);
  margin-top: var(--s-2);
}

/* ---------- Technical figure (the board, its controls and its specs) ---------- */

/*
 * Markup contract
 * <figure class="tech-figure" aria-labelledby="…">
 *   <div class="tech-stage">
 *     <div class="tech-board">            stacked layers, bottom first
 *       <svg class="tech-layer" data-layer="substrate" viewBox="…">…</svg>
 *       <svg class="tech-layer" data-layer="B.Cu" style="--i: 1">…</svg>
 *       <svg class="tech-layer" data-layer="F.Cu" style="--i: 2">… <g data-net="SCL">…</g> …</svg>
 *       <svg class="tech-layer" data-layer="F.SilkS" style="--i: 3">…</svg>
 *     </div>
 *   </div>
 *   <div class="tech-panel"> .signal-list, .signal-note, .segmented, .spec-plate </div>
 *   <figcaption>…</figcaption>
 * </figure>
 * One SVG with all layers is also valid: it renders flat (no spread).
 * State: JS sets data-lit="<group>" on .tech-figure and .is-lit on matching
 * [data-net] groups; data-spread on .tech-figure spreads the layers.
 * Without JS, or with reduced motion, the board is flat and complete.
 */
.tech-figure {
  display: grid;
  gap: var(--s-6);
  margin: 0;
  color: var(--ink);
}

@media (min-width: 960px) {
  .tech-figure {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    align-items: center;
  }

  .tech-figure > figcaption {
    grid-column: 1 / -1;
  }
}

.tech-stage {
  min-width: 0;
  padding: var(--s-5) 0;
  isolation: isolate;
}

.tech-board {
  display: grid;
  transform-style: preserve-3d;
}

.tech-board > .tech-layer {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  /* Layers are pictures: when spread they overlap neighbouring content and
     must never take its clicks. */
  pointer-events: none;
}

/* Tilt and layer depth: only with JS, room and motion allowed. */
@media (min-width: 720px) and (prefers-reduced-motion: no-preference) {
  .js .tech-stage {
    perspective: var(--figure-perspective);
    /* Room for the spread stack above and below the board. */
    padding-block: max(var(--s-5), calc(var(--layer-mid) * var(--layer-gap-spread)));
  }

  .js .tech-board {
    transform: scale(var(--figure-scale)) rotateX(var(--figure-tilt-x)) rotateZ(var(--figure-tilt-z));
    transition: transform var(--dur-slow) var(--ease-in-out);
  }

  /* Depth is centred on the middle of the stack (--layer-mid), so spreading
     grows the board both ways instead of lifting it into the content above. */
  .js .tech-board > .tech-layer {
    transform: translateZ(calc((var(--i, 0) - var(--layer-mid)) * var(--layer-gap)));
    transition: transform var(--dur-slow) var(--ease-in-out), opacity var(--dur) var(--ease);
  }

  .js .tech-figure[data-spread] .tech-board > .tech-layer {
    transform: translateZ(calc((var(--i, 0) - var(--layer-mid)) * var(--layer-gap-spread)));
  }

  .js .tech-board > .tech-layer[data-layer="substrate"] {
    filter: drop-shadow(0 18px 24px var(--board-shadow));
  }
}

/* Layer isolation works flat too: data-layer-only="F.Cu" hides the others. */
.tech-figure[data-layer-only] .tech-layer:not([data-layer="substrate"]) {
  opacity: 0.12;
}

.tech-figure[data-layer-only="B.Cu"] .tech-layer[data-layer="B.Cu"],
.tech-figure[data-layer-only="F.Cu"] .tech-layer[data-layer="F.Cu"],
.tech-figure[data-layer-only="F.SilkS"] .tech-layer[data-layer="F.SilkS"] {
  opacity: 1;
}

/* Net colouring. The SVG paints copper with var(--net-color, var(--board-copper)). */
.tech-figure [data-layer="B.Cu"] {
  --net-color: var(--board-copper-back);
}

.tech-figure [data-net] {
  transition: stroke var(--dur) var(--ease), fill var(--dur) var(--ease);
}

.tech-figure[data-lit] [data-net] {
  --net-color: var(--board-copper-dim);
}

.tech-figure[data-lit] [data-net].is-lit {
  --net-color: var(--board-highlight);
}

/* One-time copper draw-in. Track paths carry pathLength="1". */
@media (prefers-reduced-motion: no-preference) {
  .js .tech-figure[data-draw] [data-layer="F.Cu"] [data-net] path[pathLength] {
    stroke-dasharray: 1;
    animation: trace-draw var(--dur-draw) var(--ease-draw) both;
    animation-delay: calc(var(--g, 0) * var(--stagger));
  }
}

@keyframes trace-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@media (forced-colors: active) {
  .tech-figure[data-lit] [data-net] { --net-color: GrayText; }
  .tech-figure[data-lit] [data-net].is-lit { --net-color: Highlight; }
}

.tech-figure > figcaption {
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

/* ---------- Signal list ---------- */

/* <ul class="signal-list"><li><button type="button" class="signal" aria-pressed="false">
     <span class="signal-label">Thrusters</span><span class="signal-nets">M1_ESC – M4_ESC</span>
   </button></li></ul>
   <p class="signal-note" aria-live="polite"></p> */
.tech-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-5);
  min-width: 0;
}

.signal-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--hairline) solid var(--border);
}

.signal {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s-3);
  width: 100%;
  min-height: var(--target-min);
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-bottom: var(--hairline) solid var(--border);
  border-left: 2px solid transparent;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

.signal:hover {
  color: var(--ink);
  background: var(--surface);
}

.signal[aria-pressed="true"] {
  border-left-color: var(--board-highlight);
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--weight-medium);
}

.signal-nets {
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  white-space: nowrap;
}

.signal-note {
  min-height: calc(2 * var(--leading-body) * 1em);
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* ---------- Segmented control (layers, theme in references) ---------- */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: var(--hairline) solid var(--border-ui);
  border-radius: var(--radius-pill);
}

.segmented button {
  min-height: 36px;
  padding: 0 var(--s-3);
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Spec plate ---------- */

/* <dl class="spec-plate"><div><dt>Board</dt><dd>93.07 × 53.87 mm</dd></div>…</dl>
   Real, derived figures only. Labels in the text face, values in mono. */
.spec-plate {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr));
  gap: var(--s-4) var(--s-5);
  margin: 0;
  padding: var(--s-4) var(--s-5);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.spec-plate dt {
  color: var(--ink-subtle);
  font-size: var(--text-xs);
}

.spec-plate dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* Spec table for case notes: same voice as the plate, as a real table. */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.spec-table th,
.spec-table td {
  padding: var(--s-2) var(--s-3);
  border-bottom: var(--hairline) solid var(--border);
  text-align: left;
  vertical-align: baseline;
}

.spec-table th {
  width: 40%;
  color: var(--ink-subtle);
  font-weight: var(--weight-regular);
}

.spec-table td {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Interaction intent ---------- */

/* Small, consistent physical responses. Transforms still apply under reduced
   motion but without transition, so nothing slides. */
.btn:active {
  transform: translateY(1px);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline-offset: 4px;
}

.card:has(a.card-link) {
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur) var(--ease);
}

.card:has(a.card-link):hover {
  transform: translateY(-2px);
}

.prose a,
.link {
  transition: color var(--dur-fast) var(--ease), text-decoration-thickness var(--dur-fast) var(--ease);
}

/* ---------- Page transitions ---------- */

/* Cross-document view transitions: progressive, no JS, off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: var(--dur);
    animation-timing-function: var(--ease);
  }

  .site-header {
    view-transition-name: site-header;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
