/* site.css: hardware-lab template. Uses brand.css tokens only; no brand values here. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--brand-900);
  color: var(--on-brand);
  font-family: var(--font-text);
  font-weight: var(--weight-text);
  font-size: var(--step-0);
  line-height: 1.5;
  font-feature-settings: "kern", "pnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
svg { display: block; }

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 192px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --maxw: 1600px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-turn: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Grounds: every section sets its own text and rule colours from brand tokens. */
.ground[data-ground="brand"] {
  --fg: var(--on-brand); --fg-muted: var(--on-brand-muted); --line: color-mix(in srgb, var(--on-brand) 22%, transparent);
  --line-strong: color-mix(in srgb, var(--on-brand) 70%, transparent);
  --focus: var(--on-brand);
  background: var(--brand-grad);
  color: var(--fg);
}
.hero.ground, .candour.ground { background: var(--plate-scrim), var(--plate) center / cover no-repeat, var(--brand-grad); }
@media (max-width: 760px) { .hero.ground, .candour.ground { background-image: var(--plate-scrim), var(--plate-small), var(--brand-grad); } }
.ground[data-ground="deep"] {
  --fg: var(--on-brand); --fg-muted: var(--brand-200); --line: color-mix(in srgb, var(--brand-300) 26%, transparent);
  --line-strong: var(--brand-200);
  --focus: var(--on-brand);
  background: var(--brand-900);
  color: var(--fg);
}
.ground[data-ground="paper"] {
  --fg: var(--ink); --fg-muted: var(--n-600); --line: var(--n-200); --line-strong: var(--ink);
  --focus: var(--brand);
  background: var(--paper);
  color: var(--fg);
}
.ground[data-ground="ink"] {
  --fg: var(--paper); --fg-muted: var(--n-300); --line: color-mix(in srgb, var(--paper) 14%, transparent);
  --line-strong: var(--paper);
  --focus: var(--brand-300);
  background: var(--ink);
  color: var(--fg);
}

.frame { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Focus: square, offset, the ground's own focus colour. */
:focus-visible { outline: 2px solid var(--focus, var(--on-brand)); outline-offset: 4px; border-radius: var(--radius); }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 10;
  background: var(--paper); color: var(--ink); padding: var(--s-3) var(--s-4); text-decoration: none;
}
.skip:focus { top: var(--s-4); }

/* Type roles */
.label {
  font-size: var(--step--1); font-weight: var(--weight-display); letter-spacing: var(--tracking-label);
  text-transform: uppercase; line-height: 1.3; color: var(--fg-muted);
  font-feature-settings: "kern", "tnum";
}
.label span { color: var(--fg); margin-right: 0.9em; }
.claim {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-6); line-height: 0.9; letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-4); line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
}
.h3 {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-2); line-height: 1.1; letter-spacing: -0.015em;
}
.lede { font-size: var(--step-1); line-height: 1.4; max-width: 34ch; color: var(--fg); text-wrap: pretty; }

/* Buttons and links: square, level, like the wordmark's cut terminals. */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  min-height: 48px; padding: 0 var(--s-5);
  font: var(--weight-display) var(--step-0)/1 var(--font-text);
  text-decoration: none; border-radius: var(--radius);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn::after {
  content: ""; width: 0.62em; height: 0.62em; flex: none;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateY(1px) rotate(45deg);
  margin-left: -2px;
}
.btn--solid { background: var(--fg); color: var(--brand-700); }
.ground[data-ground="ink"] .btn--solid { background: var(--paper); color: var(--ink); }
.btn--solid:hover { background: var(--brand-100); }
.ground[data-ground="ink"] .btn--solid:hover { background: var(--brand-200); }
.btn--ghost { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--fg); min-height: 40px; padding: 0 var(--s-4); font-size: var(--step--1); letter-spacing: 0.02em; }
.btn--ghost:hover { background: var(--fg); color: var(--brand-700); }
.btn--large { min-height: 64px; padding: 0 var(--s-6); font-size: var(--step-1); }
.link { color: var(--fg); text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* Top bar */
.top { position: absolute; inset: 0 0 auto 0; z-index: 2; }
.top.ground { background: none; }
.top__bar { display: flex; align-items: center; gap: var(--s-6); height: 72px; border-bottom: var(--rule) solid var(--line); }
.wordmark { display: block; text-decoration: none; }
.wordmark__art {
  display: block; height: 26px; aspect-ratio: var(--wordmark-ratio);
  background: var(--wordmark) left center / contain no-repeat;
}
.top__nav { display: flex; gap: var(--s-6); margin-left: auto; }
.top__nav a { font-size: var(--step--1); font-weight: var(--weight-display); letter-spacing: var(--tracking-label); text-transform: uppercase; text-decoration: none; color: var(--fg-muted); padding: var(--s-2) 0; }
.top__nav a:hover { color: var(--fg); }

/* Column rules: five hairlines that hold the grid, with registration ticks. */
.rules { position: absolute; inset: 73px 0 0 0; pointer-events: none; display: grid; grid-template-columns: repeat(4, 1fr); max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.rules i { border-left: var(--rule) solid var(--line); position: relative; }
.rules i:nth-child(5) { position: absolute; right: var(--gutter); top: 0; bottom: 0; border-left: var(--rule) solid var(--line); }
.rules i::before, .rules i::after { content: ""; position: absolute; left: -5px; width: 9px; height: 1px; background: var(--line-strong); }
.rules i::before { top: var(--s-7); }
.rules i::after { display: none; }

/* 00 Hero */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-top: 73px; }
.hero__inner {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s-5);
  padding-top: clamp(var(--s-7), 7vh, var(--s-9)); padding-bottom: var(--s-8);
  min-height: calc(100svh - 73px - 92px);
  align-content: space-between; row-gap: var(--s-7);
}
.hero__index { grid-column: 1 / -1; }
.hero .claim { grid-column: 1 / -1; grid-row: 2; position: relative; z-index: 1; max-width: 10.5em; align-self: end; }
/* Rim follows the claim's full stop, sized in em so it stays tied to the type at every width. */
.rim {
  display: inline-block; height: 0.74em; aspect-ratio: var(--mark-ratio);
  margin-left: 0.18em; vertical-align: baseline;
  background: var(--mark) center / contain no-repeat;
}
.hero__foot { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-6); }
.hero__actions { display: flex; align-items: center; gap: var(--s-6); }

.spec { display: grid; grid-template-columns: 1fr 1fr 2fr; border-top: var(--rule) solid var(--line); }
.spec > div { padding: var(--s-5) var(--s-5) var(--s-5) 0; display: flex; gap: var(--s-4); align-items: baseline; min-height: 92px; }
.spec > div + div { padding-left: var(--s-5); border-left: var(--rule) solid var(--line); }
.spec dd { font-size: var(--step-0); font-weight: var(--weight-display); }

/* Section heads */
.section-head { display: grid; gap: var(--s-5); padding-block: var(--s-10) var(--s-8); max-width: 20em; }
.section-head .h2 { max-width: 13em; }
.section-head { max-width: none; }
.section-head--row { display: grid; grid-template-columns: calc(25% - var(--s-5)) 1fr; align-items: baseline; gap: var(--s-5); border-bottom: var(--rule) solid var(--line); padding-block: var(--s-9) var(--s-5); }

/* 01 Method */
.method { border-top: var(--rule) solid color-mix(in srgb, var(--on-brand) 12%, transparent); padding-bottom: var(--s-10); }
.diagram { border-top: var(--rule) solid var(--line); border-bottom: var(--rule) solid var(--line); padding-block: var(--s-8); }
.diagram__svg { width: 100%; height: auto; overflow: visible; }
.diagram__svg--tall { display: none; max-width: 420px; margin-inline: auto; }
.dg-block rect { fill: none; stroke: var(--line-strong); stroke-width: 1.25; }
.dg-block--core > rect:first-child { fill: color-mix(in srgb, var(--brand-500) 22%, transparent); stroke: var(--on-brand); stroke-width: 1.5; }
.dg-pins { stroke: var(--line-strong); stroke-width: 1.25; }
.dg-ticks path { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 6; }
.dg-label { fill: var(--fg-muted); font: var(--weight-display) 14px var(--font-text); letter-spacing: 0.1em; }
.dg-title { fill: var(--fg); font: var(--weight-display) 30px var(--font-display); letter-spacing: -0.02em; }
.dg-title--s { font-size: 22px; letter-spacing: -0.01em; }
.dg-title--m { font-size: 26px; }
.dg-sub { fill: var(--fg-muted); font: var(--weight-text) 16px var(--font-text); }
.dg-band { fill: color-mix(in srgb, var(--on-brand) 10%, transparent); }
.dg-axis { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; }
.dg-bound { stroke: var(--on-brand); stroke-width: 1.25; }
.dg-dots circle { fill: var(--on-brand); }
.dg-wires path { fill: none; stroke: var(--on-brand); stroke-width: 1.5; }
.dg-arrow { fill: none; stroke: var(--on-brand); stroke-width: 1.5; }
.dg-junction rect { fill: var(--on-brand); }
.dg-slash { stroke: var(--on-brand); stroke-width: 1.25; }
.dg-pulse { fill: var(--on-brand); opacity: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); padding-top: var(--s-7); }
.steps li { display: grid; gap: var(--s-3); align-content: start; padding-right: var(--s-6); }
.steps p { color: var(--fg-muted); max-width: 30ch; text-wrap: pretty; }

/* Diagram motion: wires draw once, then one bit travels the path. JS adds the classes. */
@media (prefers-reduced-motion: no-preference) {
  .js .diagram .dg-wires path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 900ms var(--ease-out); }
  .js .diagram .dg-wires path:nth-child(2) { transition-delay: 500ms; }
  .js .diagram .dg-wires path:nth-child(3) { transition-delay: 600ms; }
  .js .diagram .dg-wires path:nth-child(4) { transition-delay: 700ms; }
  .js .diagram .dg-dots circle { opacity: 0; transition: opacity 240ms var(--ease-out); }
  .js .diagram.is-live .dg-wires path { stroke-dashoffset: 0; }
  .js .diagram.is-live .dg-dots circle { opacity: 1; }
}

/* 02 Result */
.result { padding-bottom: var(--s-10); }
.numbers { width: 100%; border-collapse: collapse; font-feature-settings: "kern", "tnum"; }
.numbers thead th { text-align: left; font-size: var(--step--1); font-weight: var(--weight-display); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-muted); padding: 0 0 var(--s-3); border-bottom: var(--rule) solid var(--line-strong); }
.numbers tbody th, .numbers tbody td { border-bottom: var(--rule) solid var(--line); padding-block: var(--s-4); vertical-align: baseline; }
.numbers tbody th { text-align: left; width: 24%; font-size: var(--step-2); font-weight: var(--weight-display); letter-spacing: -0.01em; }
.numbers tbody td { color: var(--fg-muted); font-size: var(--step-0); }
.numbers .num { text-align: right; }
.numbers tbody .num {
  color: var(--fg); font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-5); line-height: 1; letter-spacing: -0.045em; white-space: nowrap;
}
.numbers .num--word { letter-spacing: -0.035em; }

.bits { padding-top: var(--s-9); display: grid; gap: var(--s-5); }
.bits__svg { width: 100%; height: auto; }
.bits__svg--tall { display: none; max-width: 520px; }
.bits__group { fill: var(--fg); font: var(--weight-display) 15px var(--font-display); letter-spacing: -0.005em; }
@media (max-width: 900px) {
  .bits__svg--wide { display: none; }
  .bits__svg--tall { display: block; }
}
.bits__name { fill: var(--fg); font: var(--weight-display) 15px var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; }
.bits__row { fill: var(--fg-muted); font: var(--weight-display) 13px var(--font-text); letter-spacing: 0.06em; }
.b-on { fill: var(--ink); }
.b-off { fill: var(--n-100); }
.b-diff { fill: var(--brand); }
.bits figcaption { max-width: 62ch; color: var(--fg-muted); font-size: var(--step-0); }
.bits figcaption .label { color: var(--fg); margin-right: var(--s-3); }

/* 03 Candour */
.candour { position: relative; overflow: hidden; }
.candour__inner { display: grid; gap: var(--s-7); padding-block: var(--s-10); }
.claim--candour { font-size: var(--step-6); max-width: 9em; }
.candour__note { max-width: 40ch; font-size: var(--step-1); line-height: 1.4; color: var(--fg-muted); margin-left: auto; margin-right: 8%; }

/* 04 Notes */
.notes { padding-bottom: var(--s-8); }
.index li { border-bottom: var(--rule) solid var(--line); }
.index a { display: grid; grid-template-columns: calc(25% - var(--s-5)) 1fr auto; align-items: baseline; gap: var(--s-5); padding-block: var(--s-6); text-decoration: none; }
.index__title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; transition: color 160ms var(--ease-out); }
.index__tag { color: var(--fg-muted); }
.index__arrow { width: 18px; height: 18px; border-top: 2px solid var(--fg-muted); border-right: 2px solid var(--fg-muted); transform: rotate(45deg); align-self: center; transition: transform 200ms var(--ease-out), border-color 160ms; }
.index a:hover .index__title { color: var(--accent-on-ink); }
.index a:hover .index__arrow { transform: translateX(6px) rotate(45deg); border-color: var(--fg); }

/* 05 Founders */
.founders { padding-bottom: var(--s-10); }
.people { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s-5); row-gap: var(--s-7); padding-top: var(--s-7); }
.person { grid-column: span 3; display: grid; gap: var(--s-3); align-content: start; }
.person__name { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--step-3); line-height: 1.05; letter-spacing: -0.025em; }
.person__mail { color: var(--fg); font-size: var(--step-1); text-underline-offset: 0.3em; text-decoration-thickness: 1px; justify-self: start; }
.person:first-child { grid-column: 4 / 7; }
.contact { grid-column: 10 / -1; display: grid; gap: var(--s-5); align-content: start; justify-items: start; }
.contact p { color: var(--fg-muted); max-width: 36ch; }

/* Footer: the wordmark set as the floor of the page. */
.foot { overflow: hidden; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-6); border-bottom: var(--rule) solid var(--line); font-size: var(--step--1); color: var(--fg-muted); letter-spacing: 0.02em; }
.foot__links { display: flex; gap: var(--s-6); }
.foot__links a { color: var(--fg); text-underline-offset: 0.3em; }
.foot__mark { max-width: var(--maxw); margin-inline: auto; padding: var(--s-8) var(--gutter) 0; }
.foot__mark .wordmark__art { width: 100%; height: auto; margin-bottom: -4.6%; }

/* Rim: half a turn on load, ending upright (the mark is symmetric under a half turn). */
@media (prefers-reduced-motion: no-preference) {
  .rim { animation: rim-turn 1800ms var(--ease-turn) 250ms both; }
  @keyframes rim-turn { from { transform: rotate(-180deg); } to { transform: rotate(0deg); } }
}

/* Responsive */
@media (max-width: 1100px) {
  .top__nav { display: none; }
  .top__cta { margin-left: auto; }
  .spec { grid-template-columns: 1fr 1fr; }
  .spec > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: var(--rule) solid var(--line); }
  .person, .person:first-child { grid-column: span 6; }
  .contact { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rules { grid-template-columns: repeat(2, 1fr); }
  .rules i:nth-child(3), .rules i:nth-child(4) { display: none; }
  .hero__inner { min-height: 0; row-gap: var(--s-6); padding-bottom: var(--s-7); }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero__actions { flex-wrap: wrap; gap: var(--s-5); }
  .spec { grid-template-columns: 1fr; }
  .spec > div, .spec > div + div { border-left: 0; padding-left: 0; min-height: 0; padding-block: var(--s-4); }
  .spec > div + div { border-top: var(--rule) solid var(--line); }
  .spec > div:nth-child(3) { grid-column: auto; }
  .spec dt { min-width: 4.5rem; }
  .section-head { padding-block: var(--s-9) var(--s-6); }
  .diagram__svg--wide { display: none; }
  .diagram__svg--tall { display: block; }
  .steps { grid-template-columns: 1fr; }
  .numbers thead { display: none; }
  .numbers, .numbers tbody { display: block; }
  .numbers tbody tr { display: grid; grid-template-columns: 1fr auto; column-gap: var(--s-4); align-items: end; border-bottom: var(--rule) solid var(--line); padding-block: var(--s-4); }
  .numbers tbody tr:first-child { border-top: var(--rule) solid var(--line-strong); }
  .numbers tbody th, .numbers tbody td { border: 0; padding: 0; }
  .numbers tbody th { font-size: var(--step-1); width: auto; grid-column: 1; grid-row: 1; }
  .numbers tbody td:not(.num) { grid-column: 1; grid-row: 2; font-size: var(--step--1); }
  .numbers tbody .num { grid-column: 2; grid-row: 1 / 3; }
  .numbers tbody .num { font-size: clamp(2.5rem, 13vw, 4rem); }
  .index a { grid-template-columns: 1fr auto; row-gap: var(--s-2); }
  .section-head--row { grid-template-columns: 1fr; gap: var(--s-3); }
  .index__tag { grid-column: 1 / -1; }
  .person, .person:first-child { grid-column: 1 / -1; }
  .candour__note { margin: 0; }
  .btn--large { width: 100%; justify-content: space-between; }
  .top__cta { padding: 0 var(--s-3); }
}

/* Rules sit behind text: fainter than section rules. Candour has no nav above it. */
.rules { --line: color-mix(in srgb, var(--on-brand) 14%, transparent); }
.candour .rules { inset: 0; }
