/* ──────────────────────────────────────────────────────────────
   DYAPASON — dyapason.io
   Tokens are the ones shipping in the Manager (desktop/src/styles/main.css).
   Light is "paper", dark is "backlit". No third colour anywhere.
   ────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Departure Mono";
  src: url("../fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: block;
}

:root {
  --g: #EFE5C0;
  --g2: #E6DBB2;
  --ink: #15130B;
  --ink2: #3F3A2B;
  --mute: #6A6350;          /* web-only: the app's #7A7360 darkened to clear 4.5:1 */
  --hair: rgba(21, 19, 11, .22);
  --inv: #EFE5C0;

  --pixel: "Departure Mono", "JetBrains Mono", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rule: 2px;              /* sleeve furniture — the app stays on 1px */
  --r: 3px;
  --r-sm: 2px;
  --col: 1328px;
  --gut: clamp(16px, 4vw, 56px);
  --step: clamp(44px, 7vw, 76px);
  --measure: 76ch;        /* one reading measure for every standalone prose block */

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g: #14120B;
    --g2: #1D1A10;
    --ink: #EFE5C0;
    --ink2: #CFC6A2;
    --mute: #9A9175;
    --hair: rgba(239, 229, 192, .2);
    --inv: #14120B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --g: #14120B;
  --g2: #1D1A10;
  --ink: #EFE5C0;
  --ink2: #CFC6A2;
  --mute: #9A9175;
  --hair: rgba(239, 229, 192, .2);
  --inv: #14120B;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--g);
  color: var(--ink);
  font: 400 15px/1.6 var(--mono);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain — a print artefact, not UI depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(21, 19, 11, .06) 1px, transparent 0);
  background-size: 3px 3px;
}
:root[data-theme="dark"] body::before { opacity: .5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before { opacity: .5; }
}

a { color: inherit; text-decoration: none; }
/* height:auto keeps the width/height attributes working as an aspect-ratio
   hint (no layout shift) instead of pinning the rendered height. */
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--inv);
  padding: 12px 18px;
  font: 15px/1 var(--pixel);
  z-index: 200;
}
.skip:focus { left: 8px; top: 8px; }

/* ── Opening animation ──────────────────────────────────────
   Hidden unless the head script opts in, so a visitor without JavaScript
   never meets a curtain they cannot lift. */

.intro { display: none; }

.intro-playing .intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  align-content: center;
  background: transparent;
  pointer-events: none;
}

/* The page is still there, just out of focus. Everything at the top level
   except the overlay blurs; the overlay is a sibling, so it stays sharp.
   Untouchable while it is unreadable — the first interaction lifts it. */
body > *:not(.intro) {
  transition: filter 420ms ease-out;
}
.intro-playing:not(.intro-done) body > *:not(.intro) {
  filter: blur(9px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body > *:not(.intro) { transition: none; }
}

.intro img {
  width: min(62vmin, 560px);
  height: auto;
  image-rendering: pixelated;   /* it is pixel art: keep the pixels */
}
/* the curtain lifts rather than cutting */
.intro.is-leaving {
  opacity: 0;
  transition: opacity 420ms ease-out;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro.is-leaving { transition: none; }
}

/* ── Shell ─────────────────────────────────────────────────── */

.wrap { max-width: var(--col); margin: 0 auto; padding-inline: var(--gut); }

.statusbar {
  display: flex;
  align-items: center;
  gap: 14px 26px;
  flex-wrap: wrap;
  padding: 8px var(--gut);
  border-bottom: 1px solid var(--hair);
  font: 11px/1 var(--pixel);
  letter-spacing: .12em;
  color: var(--mute);
}
.statusbar .cur { width: 7px; height: 11px; background: var(--ink); display: inline-block; }
.statusbar .spacer { flex-grow: 1; }
.statusbar .hz { white-space: nowrap; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--g);
  border-bottom: var(--rule) solid var(--ink);
}
.masthead .inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gut);
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.wordmark {
  --glyph: 1.25em;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font: 400 20px/1 var(--pixel);
  letter-spacing: .14em;
}

/* The mark stands a quarter taller than the word beside it. The SVG is trimmed
   to its own ink, so this is the height you actually see, not a padded box.
   --glyph is 1.25 x the line box, so it has to follow line-height: the
   masthead sets 1, the footer 0.86, hence 1.25 and 1.075. */
.wordmark .glyph,
.foot .lockup .mark .glyph {
  height: var(--glyph);
  width: auto;
  flex: none;
}

.nav { display: flex; gap: 22px; flex-grow: 1; }
.nav a {
  font: 11px/1 var(--pixel);
  letter-spacing: .12em;
  color: var(--mute);
  padding: 6px 0;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); }

.themeswitch {
  display: flex;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  /* overflow: hidden zeroes a flex item's automatic minimum size, which made
     this the only header item that could be squeezed away. It was: on a phone
     it shrank to its 2px borders while everything else kept its width. */
  flex: none;
}
.themeswitch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 11px;
  font: 11px/1 var(--pixel);
  letter-spacing: .1em;
  cursor: pointer;
}
.themeswitch button[aria-pressed="true"] { background: var(--ink); color: var(--inv); }

.langswitch {
  display: flex;
  gap: 2px;
  align-items: center;
  font: 11px/1 var(--pixel);
  letter-spacing: .1em;
  color: var(--mute);
}
.langswitch a[aria-current="true"] { color: var(--ink); }

.menu-toggle { display: none; }

/* announcement strip */
.ade {
  background: var(--ink);
  color: var(--inv);
  padding: 10px var(--gut);
}
.ade .inner {
  max-width: var(--col);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font: 14px/1.3 var(--pixel);
}
.ade .chip {
  background: var(--inv);
  color: var(--ink);
  padding: 4px 8px;
  font: 14px/1 var(--pixel);
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  font: 15px/1 var(--pixel);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}
.btn .k { font: 11px/1 var(--mono); opacity: .6; }
.btn--primary { background: var(--ink); color: var(--inv); }
.btn--primary:hover { opacity: .88; }
.btn--secondary:hover { background: var(--ink); color: var(--inv); }
.btn--sm { min-height: 44px; font-size: 14px; }

/* ── Sleeve furniture ──────────────────────────────────────── */

.section { padding-block: var(--step) calc(var(--step) + 8px); }
/* An inked section is a token scope, not just a background: every child
   (lede, mute labels, hairlines, chips) resolves against the local ground.
   In backlit appearance it inverts the other way, to paper. */
.section--inked,
.foot {
  --g: #15130B;
  --g2: #1D1A10;
  --ink: #EFE5C0;
  --ink2: #CFC6A2;
  --mute: #9A9175;
  --hair: rgba(239, 229, 192, .2);
  --inv: #15130B;
  background: var(--g);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section--inked,
  :root:not([data-theme="light"]) .foot {
    --g: #EFE5C0;
    --g2: #E6DBB2;
    --ink: #15130B;
    --ink2: #3F3A2B;
    --mute: #6A6350;
    --hair: rgba(21, 19, 11, .22);
    --inv: #EFE5C0;
  }
}
:root[data-theme="dark"] .section--inked,
:root[data-theme="dark"] .foot {
  --g: #EFE5C0;
  --g2: #E6DBB2;
  --ink: #15130B;
  --ink2: #3F3A2B;
  --mute: #6A6350;
  --hair: rgba(21, 19, 11, .22);
  --inv: #EFE5C0;
}
.section--inset { background: var(--g2); }

.rule { height: var(--rule); background: currentColor; }

.sechead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.sechead .no {
  background: currentColor;
  padding: 6px 11px;
  font: 20px/1 var(--pixel);
}
.sechead .no span { color: var(--g); }
.sechead .title { font: 20px/1 var(--pixel); letter-spacing: .1em; }
.sechead .spacer { flex-grow: 1; }

.tag {
  display: inline-block;
  border: var(--rule) solid currentColor;
  padding: 5px 10px;
  font: 14px/1.2 var(--pixel);
}
.tag--lg { padding: 8px 14px; font-size: 20px; }
.tag--dashed { border-style: dashed; opacity: .75; }

h2.big {
  margin: 28px 0 0;
  font: 400 clamp(34px, 5.2vw, 68px)/0.98 var(--pixel);
  letter-spacing: -.02em;
}
h3.mid { font: 400 clamp(22px, 2.4vw, 30px)/1.1 var(--pixel); letter-spacing: -.015em; }

.lede { margin-top: 20px; max-width: var(--measure); color: var(--ink2); }

.frame { border: var(--rule) solid currentColor; padding: 10px; }
.frame img, .frame video, .plate img { width: 100%; }
.frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font: 13px/1.3 var(--pixel);
  letter-spacing: .1em;
  color: var(--mute);
}

.tags { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Hero ──────────────────────────────────────────────────── */

.hero { padding-block: var(--step) calc(var(--step) + 8px); }
.hero .grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 24px;   /* clears the rule for BOTH columns, not just the heading */
}
.hero h1 {
  margin: 0;
  font: 400 clamp(56px, 9vw, 104px)/0.92 var(--pixel);
  letter-spacing: -.02em;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* Hero device. Default is the photograph, full colour, cut out.
   Swap the element for <div class="device device--mono"> to get the 1-bit
   treatment instead: it paints through a mask so it takes the local ink
   token, and is therefore correct on either ground. */
.hero .device { display: block; width: 100%; }
.hero .device img { width: 100%; }

.hero .device--mono {
  width: 100%;
  aspect-ratio: 1760 / 1038;
  background: url("../assets/device.png") center / contain no-repeat;
}
@supports ((mask-image: url("../assets/device.png")) or (-webkit-mask-image: url("../assets/device.png"))) {
  .hero .device--mono {
    background: currentColor;
    -webkit-mask: url("../assets/device.png") center / contain no-repeat;
    mask: url("../assets/device.png") center / contain no-repeat;
  }
}

/* The hero promise: two numbered claims, in the page's own numbering voice.
   The numerals are a CSS counter, so they are decoration and the reader is
   not read "01" twice. */
.lede--tight { max-width: none; margin-top: 18px; font: 400 clamp(18px, 2vw, 22px)/1.3 var(--pixel); color: var(--ink); }

.promise {
  counter-reset: promise;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 56ch;
}
.promise li {
  counter-increment: promise;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.promise li::before {
  content: "0" counter(promise);
  flex: none;
  background: var(--ink);
  color: var(--inv);
  padding: 6px 10px;
  font: 18px/1.15 var(--pixel);
}
.promise b {
  display: block;
  font: 400 clamp(21px, 2.4vw, 28px)/1.05 var(--pixel);
  letter-spacing: -.01em;
}
.promise span {
  display: block;
  margin-top: 7px;
  color: var(--ink2);
  font-size: 14px;
  line-height: 1.6;
}

.struck {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font: 15px/1.6 var(--pixel);
  color: var(--mute);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
/* ── Fault table ───────────────────────────────────────────── */

.evidence {
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 40px;
  align-items: stretch;
}
.evidence video { filter: grayscale(1) contrast(1.12); width: 100%; height: auto; }
.evidence .code {
  border: var(--rule) solid currentColor;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  flex-grow: 1;
}
.evidence .code b { font: 400 clamp(34px, 4vw, 48px)/1 var(--pixel); }
.evidence .right { display: flex; flex-direction: column; gap: 14px; }

.faults { margin-top: 24px; border: var(--rule) solid currentColor; }
.faults .head,
.faults .row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
}
.faults .head {
  border-bottom: var(--rule) solid currentColor;
  font: 14px/1 var(--pixel);
  letter-spacing: .12em;
  color: var(--mute);
}
.faults .row + .row { border-top: 1px solid var(--hair); }
.faults .c1 { width: 110px; flex-shrink: 0; }
.faults .c2 { width: 300px; flex-shrink: 0; font: 18px/1.2 var(--pixel); }
.faults .c3 { flex-grow: 1; font-size: 14px; color: var(--ink2); }
.faults .code-on {
  background: var(--inv);
  color: var(--ink);
  padding: 3px 7px;
  font: 15px/1 var(--pixel);
}
.faults .code-off {
  border: 1px solid var(--hair);
  color: var(--mute);
  padding: 3px 7px;
  font: 15px/1 var(--pixel);
}

/* ── Generic two-column + cards ────────────────────────────── */

.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.cols-text { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 48px; align-items: start; margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.card { border: var(--rule) solid var(--ink); background: var(--g); display: flex; flex-direction: column; }
.card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: var(--rule) solid var(--ink);
}
.card > header .name {
  background: var(--ink);
  color: var(--inv);
  padding: 9px 14px;
  font: 22px/1 var(--pixel);
}
.card > header .state { padding: 9px 14px; font: 15px/1 var(--pixel); }
.card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.card .body .list {
  border-top: 1px solid var(--hair);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.card .body .list b { font-weight: 500; }

/* ── Manager panels (the app's own components: 1px, radius 3) ─ */

.panel { border: var(--rule) solid var(--ink); }
.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--rule) solid var(--ink);
}
.panel > header .who { background: var(--ink); color: var(--inv); padding: 7px 12px; font: 16px/1 var(--pixel); }
.panel > header .env { padding: 7px 12px; font: 13px/1 var(--pixel); color: var(--mute); }
.panel .ui { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.panel--backlit {
  --g: #14120B;
  --g2: #1D1A10;
  --ink: #EFE5C0;
  --ink2: #CFC6A2;
  --mute: #9A9175;
  --hair: rgba(239, 229, 192, .2);
  --inv: #14120B;
  background: var(--g);
  color: var(--ink);
  border-color: var(--ink);
}
.panel--backlit > header { border-bottom-color: var(--ink); }
.panel--paper {
  --g: #EFE5C0;
  --g2: #E6DBB2;
  --ink: #15130B;
  --ink2: #3F3A2B;
  --mute: #6A6350;
  --hair: rgba(21, 19, 11, .22);
  --inv: #EFE5C0;
  background: var(--g);
  color: var(--ink);
  border-color: var(--ink);
}

.drives { border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.drive {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
}
.drive + .drive { border-top: 1px solid var(--hair); }
.drive.on { background: var(--ink); color: var(--inv); }
.drive .gl { width: 9px; height: 9px; border: 1.5px solid currentColor; flex: none; }
.drive.on .gl { background: currentColor; }
.drive .dn { font: 14px/1 var(--pixel); }
.drive .dm { flex-grow: 1; font: 11px/1.3 var(--mono); color: var(--mute); }
.drive.on .dm { color: inherit; opacity: .66; }
.drive .badge {
  font: 10px/1 var(--pixel);
  letter-spacing: .08em;
  padding: 4px 5px;
  border: 1px solid currentColor;
  border-radius: var(--r-sm);
  flex: none;
}
.select {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 10px 11px;
  font: 13px var(--mono);
}
.status {
  background: var(--g2);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status.done { background: var(--g); box-shadow: inset 0 0 0 1px var(--ink); }
.status .t { display: flex; gap: 8px; align-items: center; font: 12.5px/1.4 var(--mono); }
.status .m { font: 11px/1.4 var(--mono); color: var(--mute); }
.blink { width: 7px; height: 13px; background: currentColor; flex: none; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .blink { animation: none; } }
.segs { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.segs i { height: 9px; border: 1px solid var(--hair); }
.segs i.f { background: var(--ink); border-color: var(--ink); }
.appbtn {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  font: 15px/1 var(--pixel);
}
.appbtn.primary { background: var(--ink); color: var(--inv); }
.keybar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  border-top: 1px solid var(--hair);
  padding-top: 10px;
  font: 11px/1.6 var(--mono);
  color: var(--mute);
}
.keybar b { color: var(--ink); font-weight: 500; }

.callout {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  border: var(--rule) solid var(--ink);
  padding: 14px 18px;
  margin-top: 24px;
}
.callout strong { font: 400 20px/1.2 var(--pixel); }
.callout .spacer { flex-grow: 1; }

/* ── Video ─────────────────────────────────────────────────── */

.player { border: var(--rule) solid var(--ink); background: var(--ink); padding: 10px; margin-top: 30px; }
.player video, .player iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; background: #14120B; display: block; }

/* click-to-load stand-in for the embed */
.facade {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #14120B;
  cursor: pointer;
  color: var(--inv);
}
.facade img { width: 100%; height: auto; display: block; opacity: .55; }
.facade-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px;
  height: 96px;
  border: 3px solid currentColor;
  display: grid;
  place-items: center;
}
.facade:hover .facade-play { background: var(--inv); color: var(--ink); }
.facade-note {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font: 13px/1 var(--pixel);
  letter-spacing: .12em;
}

/* ── Screen viewer ──────────────────────────────────────────
   One screen at a time. Three radios drive it, so it needs no JavaScript
   and the arrow keys move between tabs the way they should. */

.viewer {
  position: relative;   /* contains the off-screen radios, so focusing one
                           cannot scroll the page to the top-left corner */
  margin: 36px 0;
  border: var(--rule) solid var(--ink);
}
.viewer > input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.viewer-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: var(--rule) solid var(--ink);
}
.viewer-tabs label {
  flex: 1 1 auto;
  padding: 13px 18px;
  font: 17px/1.2 var(--pixel);
  letter-spacing: .04em;
  cursor: pointer;
  border-left: var(--rule) solid var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 48px;
}
.viewer-tabs label:first-of-type { border-left: 0; }
.viewer-tabs label b { font-weight: 400; color: var(--mute); }
.viewer-tabs label:hover { background: var(--g2); }

#scr-1:checked ~ .viewer-tabs label[for="scr-1"],
#scr-2:checked ~ .viewer-tabs label[for="scr-2"],
#scr-3:checked ~ .viewer-tabs label[for="scr-3"] {
  background: var(--ink);
  color: var(--inv);
}
#scr-1:checked ~ .viewer-tabs label[for="scr-1"] b,
#scr-2:checked ~ .viewer-tabs label[for="scr-2"] b,
#scr-3:checked ~ .viewer-tabs label[for="scr-3"] b { color: var(--inv); opacity: .55; }

#scr-1:focus-visible ~ .viewer-tabs label[for="scr-1"],
#scr-2:focus-visible ~ .viewer-tabs label[for="scr-2"],
#scr-3:focus-visible ~ .viewer-tabs label[for="scr-3"] {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}

.viewer-panel { display: none; }
#scr-1:checked ~ .viewer-body .viewer-panel:nth-child(1),
#scr-2:checked ~ .viewer-body .viewer-panel:nth-child(2),
#scr-3:checked ~ .viewer-body .viewer-panel:nth-child(3) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.viewer-shot {
  margin: 0;
  padding: 40px 36px;
  background: var(--g2);
  border-right: var(--rule) solid var(--ink);
  display: grid;
  place-items: center;
}
.viewer-shot img {
  width: 256px;          /* the panel at 1:1 — no upscale, no softening */
  max-width: 100%;
  height: auto;
  border: var(--rule) solid var(--ink);
  background: #14120B;
}
/* on a retina display the browser still doubles it, so keep the pixels hard */
.viewer-shot img { image-rendering: pixelated; }

.viewer-text {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-content: start;
}
.viewer-text h3 {
  font: 400 clamp(22px, 2.6vw, 32px)/1.05 var(--pixel);
  letter-spacing: -.015em;
}
.viewer-text p { color: var(--ink2); max-width: 46ch; }

.viewer-facts {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--hair);
}
.viewer-facts li {
  padding: 11px 0;
  font-size: 13px;
  color: var(--ink2);
}
.viewer-facts li + li { border-top: 1px solid var(--hair); }
.viewer-facts b {
  display: inline-block;
  min-width: 118px;
  font: 400 13px/1.4 var(--pixel);
  letter-spacing: .06em;
  color: var(--ink);
  text-transform: uppercase;
}

@media (max-width: 900px) {
  #scr-1:checked ~ .viewer-body .viewer-panel:nth-child(1),
  #scr-2:checked ~ .viewer-body .viewer-panel:nth-child(2),
  #scr-3:checked ~ .viewer-body .viewer-panel:nth-child(3) {
    grid-template-columns: 1fr;
  }
  .viewer-shot {
    border-right: 0;
    border-bottom: var(--rule) solid var(--ink);
    padding: 24px 16px;
  }
  .viewer-text { padding: 22px 16px; }
  .viewer-tabs label { padding: 12px 14px; font-size: 15px; }
  .viewer-facts b { min-width: 0; display: block; margin-bottom: 3px; }
}

/* ── Specs ─────────────────────────────────────────────────── */

.specs { display: flex; gap: 24px; align-items: start; margin-top: 32px; }
.specs .plate { flex: 0 0 auto; width: 494px; }
.specs .plate img { width: 100%; }
.specs .tables { flex-grow: 1; display: flex; flex-direction: column; gap: 20px; }

.table { border: var(--rule) solid var(--ink); }
.table > header { background: var(--ink); color: var(--inv); padding: 9px 14px; font: 18px/1 var(--pixel); }
.table .row { display: flex; gap: 20px; padding: 11px 14px; align-items: baseline; }
.table .row + .row { border-top: 1px solid var(--hair); }
.table .k { width: 200px; flex-shrink: 0; font: 15px/1.2 var(--pixel); }
.table .v { flex-grow: 1; font-size: 14px; color: var(--ink2); }

.target { border: var(--rule) dashed var(--hair); }
.target > header {
  border-bottom: var(--rule) dashed var(--hair);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font: 18px/1 var(--pixel);
}
.target .body { padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink2); }
.target .body b { font-weight: 500; color: var(--ink); }

/* ── Form ──────────────────────────────────────────────────── */

.form { border: var(--rule) solid var(--ink); background: var(--g); margin-top: 20px; }
.form .r { display: flex; border-bottom: var(--rule) solid var(--ink); }
.form .r:last-child { border-bottom: 0; }
.form .r:has(.consent-note) { border-bottom: 0; }
.form .f { flex-grow: 1; padding: 16px 20px; }
.form .f + .f { border-left: var(--rule) solid var(--ink); }
.form label { display: block; font: 13px/1.4 var(--pixel); letter-spacing: .12em; color: var(--mute); }
/* every text-entry field, whatever its type — listing types by name meant a
   new one (number) fell through to the browser's own box */
.form input:not([type="checkbox"]):not([type="hidden"]),
.form textarea {
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  font: 16px/1.6 var(--mono);
}
.form textarea { resize: vertical; min-height: 76px; }
.form input:focus-visible, .form textarea:focus-visible { outline-offset: 4px; }

/* the honeypot: off-screen rather than display:none, which some bots skip */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  color: var(--ink);
  border: var(--rule) solid var(--hair);
  font: 15px/1 var(--pixel);
  letter-spacing: .06em;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--inv); border-color: var(--ink); }

.check { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.check span { font: 16px/1.25 var(--pixel); }

.form-error {
  margin: 0;
  padding: 14px 20px;
  border-top: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--inv);
  font: 15px/1.4 var(--pixel);
}
.form [aria-invalid="true"] { border-bottom-color: var(--ink); border-bottom-width: 2px; }
.check input[aria-invalid="true"] { outline: 2px solid var(--ink); outline-offset: 3px; }

.submit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 16px 20px; }
.submit .note { font-size: 13px; color: var(--ink2); }
.submit .spacer { flex-grow: 1; }

.formstate {
  margin-top: 20px;
  border: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--inv);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.formstate b { font: 400 28px/1.1 var(--pixel); }
[hidden] { display: none !important; }

/* ── Document pages (privacy, mentions légales) ─────────────── */

.doc { max-width: 78ch; }
.doc h2.big { margin-bottom: 8px; }
.doc h3.mid { margin-top: 40px; }
.doc p { margin-top: 14px; color: var(--ink2); max-width: 72ch; }
.doc p.lede { color: var(--ink2); }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.doc .table { margin-top: 18px; }
.doc .table .k { width: 240px; }
.ulist { margin: 14px 0 0; padding-left: 20px; color: var(--ink2); max-width: 72ch; }
.ulist li { margin-top: 8px; }
.ulist li::marker { color: var(--mute); }

.consent-note {
  padding: 0 20px 16px;
  font: 12px/1.6 var(--mono);
  color: var(--ink2);
  max-width: 78ch;
}
.consent-note a { text-decoration: underline; text-underline-offset: 3px; }
.check input:invalid { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── Handbook ───────────────────────────────────────────────
   Long-form documentation in the same furniture: numbered sections,
   hard-bordered tables, framed device shots. */

.toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 32px;
}
.toc a {
  border: var(--rule) solid var(--hair);
  padding: 14px 16px;
  display: block;
}
.toc a:hover { border-color: var(--ink); background: var(--g2); }
.toc b { display: block; font: 400 15px/1.35 var(--pixel); }
.toc span { font-size: 12px; color: var(--mute); }

.doc-split {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin: 32px 0;
}
.doc-split > div > p { color: var(--ink2); margin-top: 14px; max-width: none; font-size: 14px; line-height: 1.65; }
.doc-split > div > p + p { margin-top: 12px; }
.doc-split h3.mid:first-child { margin-top: 0; }
.doc-split ol.steps, .doc-split ul.bullets, .doc-split .note,
.cols2 ol.steps, .cols2 ul.bullets, .cols2 .note { max-width: none; }

h3.mid { margin-top: 36px; margin-bottom: 12px; }

/* tables that are genuinely tabular, unlike the key/value .table */
.dtable {
  border: var(--rule) solid var(--ink);
  margin: 20px 0;
}
/* no min-width, so a table never scrolls sideways — it reflows, and below
   720px it restacks into labelled blocks using each cell's data-label. */
.dtable table { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: auto; }
.dtable td, .dtable th { hyphens: none; }
.dtable th {
  font: 400 11px/1.4 var(--pixel);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: left;
  padding: 11px 14px;
  background: var(--g2);
  border-bottom: var(--rule) solid var(--ink);
}
.dtable td { padding: 11px 14px; border-top: 1px solid var(--hair); vertical-align: top; color: var(--ink2); }
.dtable tbody tr:first-child td { border-top: 0; }
.dtable td.e { font: 13px/1.4 var(--pixel); color: var(--ink); }
.dtable td b { font-weight: 500; color: var(--ink); }
.section--inked .dtable th { background: var(--g2); }

/* wide content with a narrower aside beside it — the mirror of .doc-split */
.split-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 20px 44px;
  align-items: start;
  margin: 18px 0;
}
.split-wide > *, .split-wide .note { margin-top: 0; margin-bottom: 0; max-width: none; }
.split-wide ul.bullets { margin: 0; }
.aside-notes { display: flex; flex-direction: column; gap: 20px; }
.aside-notes .note { margin: 0; max-width: none; }

/* One column for a documentation page: no block sets its own measure, so
   everything lines up on the same two edges. The column is narrower instead,
   which is what keeps the line length readable. */
.doc-page { --col: 1040px; --measure: none; }
/* a single full-width column means long lines, so give them more leading */
.doc-page .lede, .doc-page .note p, .doc-page ul.bullets li, .doc-page ol.steps li { line-height: 1.75; }

/* a subsection whose figures sit in the middle of that column */
.centered .shots {
  grid-template-columns: repeat(auto-fit, 256px);
  justify-content: center;
  justify-items: center;
}
.centered h3.mid:first-child { margin-top: 0; }

@media (max-width: 1040px) {
  .split-wide { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .dtable table, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable thead { display: none; }
  .dtable tr { padding: 4px 0; }
  .dtable tr + tr { border-top: var(--rule) solid var(--ink); }
  .dtable td { border-top: 0; padding: 8px 14px; }
  .dtable td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font: 400 10.5px/1.4 var(--pixel);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mute);
  }
  .dtable td[data-label=""]::before { display: none; }
  .dtable td:empty { display: none; }
}

ol.steps {
  counter-reset: step;
  list-style: none;
  margin: 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--measure);
}
/* NOT a grid: a grid container turns every run of inline text into its own
   anonymous item, so "<b>lead-in</b> then prose" would break across rows and
   the prose would land in the counter column, one word per line. */
ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  color: var(--ink2);
  font-size: 14px;
  line-height: 1.6;
}
ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font: 400 14px/1.6 var(--pixel);
  color: var(--mute);
}
ol.steps b { font-weight: 500; color: var(--ink); }

ul.bullets { margin: 18px 0; padding: 0; list-style: none; max-width: var(--measure); }
ul.bullets li {
  padding: 12px 0 12px 22px;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink2);
  position: relative;
}
ul.bullets li:last-child { border-bottom: 1px solid var(--hair); }
ul.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 19px;
  width: 9px; height: 9px;
  border: 1.5px solid var(--ink);
}
ul.bullets b { font-weight: 500; color: var(--ink); }

.note {
  border: var(--rule) solid var(--ink);
  background: var(--g2);
  padding: 18px 20px;
  margin: 24px 0;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note-label { font: 11px/16px var(--pixel); letter-spacing: .12em; color: var(--mute); }
.note p { font-size: 14px; color: var(--ink2); }
.note b { font-weight: 500; color: var(--ink); }
/* the loudest thing the system can say: fill it with ink */
.note--loud { background: var(--ink); color: var(--inv); border-color: var(--ink); }
.note--loud .note-label { color: var(--inv); opacity: .6; }
.note--loud p, .note--loud b { color: var(--inv); }

code, kbd {
  font: 12px var(--mono);
  background: var(--g2);
  padding: 1px 5px;
  border: 1px solid var(--hair);
}
.section--inked code, .section--inked kbd { background: transparent; }
.keyline { margin-top: 16px; font-size: 12.5px; color: var(--mute); }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  justify-items: start;
  gap: 32px 28px;
  margin: 28px 0;
}
.shots figure, .shot-solo { margin: 0; }
.shots img, .shot-solo img, .device-rig img {
  width: 256px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: var(--rule) solid var(--ink);
  background: #14120B;
}
.shots figcaption {
  margin-top: 12px;
  max-width: 256px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink2);
}
.shots figcaption b {
  display: block;
  margin-bottom: 4px;
  font: 400 13px/1.3 var(--pixel);
  letter-spacing: .05em;
  color: var(--ink);
}

/* the device with its four keys, as they sit on the real thing */
.device-rig {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 18px;
  align-items: center;
  justify-content: start;
  padding: 24px 18px;
  background: var(--ink);
  border: var(--rule) solid var(--ink);
}
.device-keys { display: grid; grid-template-rows: 1fr 1fr; gap: 40px; justify-items: center; }
.device-keys span {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--inv);
  display: grid;
  place-items: center;
  font: 14px/1 var(--pixel);
  color: var(--inv);
}

@media (max-width: 1040px) {
  .doc-split { grid-template-columns: 1fr; gap: 26px; }
  .doc-split .panel, .doc-split .device-rig, .doc-split .shot-solo { max-width: 420px; }
}
@media (max-width: 900px) {
  .device-rig { justify-content: center; gap: 12px; padding: 18px 10px; }
  .device-keys span { width: 34px; height: 34px; }
}

/* ── Footer ────────────────────────────────────────────────── */

.foot { padding-block: 56px 44px; }
.foot .top { display: flex; gap: 48px; flex-wrap: wrap; }
.foot .col { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.foot .col .h { font: 13px/1.4 var(--pixel); letter-spacing: .12em; color: var(--mute); }
.foot .col a, .foot .col span:not(.h) { font: 14px var(--mono); }
.foot .col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot .boxes { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin-left: auto; }
.foot .signoff { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 44px; flex-wrap: wrap; }
.foot .signoff .made { font: 400 clamp(22px, 2.6vw, 40px)/1.05 var(--pixel); }
.foot .lockup { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.foot .lockup .mark {
  --glyph: 1.075em;
  display: inline-flex;
  align-items: center;
  gap: .16em;
  font: 400 clamp(52px, 10.4vw, 150px)/0.86 var(--pixel);
  letter-spacing: -.02em;
}
.foot .lockup .one { border: 3px solid var(--inv); padding: 4px 10px; font: clamp(20px, 2.8vw, 40px)/1 var(--pixel); margin-bottom: 10px; }
.foot .legal { font: 12px/1.7 var(--mono); color: var(--mute); text-align: right; flex-grow: 1; }

.barcode { display: flex; align-items: flex-end; gap: 1px; height: 46px; }
.barcode i { background: currentColor; }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .hero .grid { grid-template-columns: 1fr; gap: 32px; }
  .evidence { grid-template-columns: 1fr; }
  .cols-text { grid-template-columns: 1fr; gap: 28px; }
  .specs { flex-direction: column; }
  .specs .plate { width: 100%; max-width: 520px; }
  .faults .c2 { width: 240px; }
}

@media (max-width: 860px) {
  .masthead .inner { gap: 12px; }
  .themeswitch button { min-height: 44px; padding: 0 12px; }
  .masthead .btn--sm .k { display: none; }   /* no keyboard to press */

  .cols2 { grid-template-columns: 1fr; }
  .nav { display: none; }
  /* the document pages have no menu button — their nav is the way back */
  .nav--doc { display: flex; flex-wrap: wrap; gap: 8px 18px; }
  .nav.open {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--g);
    border-bottom: var(--rule) solid var(--ink);
    padding: 8px var(--gut) 16px;
  }
  .nav.open a { padding: 12px 0; font-size: 14px; border-top: 1px solid var(--hair); }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: var(--rule) solid var(--ink);
    background: transparent;
    cursor: pointer;
  }
  .menu-toggle i { width: 16px; height: 2px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
  .masthead .inner { position: relative; }
  .statusbar .hide-sm { display: none; }

  .faults .row { flex-wrap: wrap; gap: 8px 12px; }
  .faults .head { display: none; }
  .faults .c1 { width: auto; }
  .faults .c2 { width: auto; font-size: 16px; }
  .faults .c3 { flex-basis: 100%; }

  .form .r { flex-direction: column; }
  .form .f + .f { border-left: 0; border-top: var(--rule) solid var(--ink); }


  .table .row { flex-direction: column; gap: 5px; }
  .table .k { width: auto; }

  .foot .signoff { margin-top: 32px; }
  .foot .legal { text-align: left; flex-basis: 100%; }
  .struck { flex-direction: column; gap: 3px; }
}

/* Phones: the wordmark, the switch, the menu and the CTA want 424px in a
   375px row. So below 560px the switch offers a single button — the mode you
   are not in — and tapping it flips. The desktop pair keeps its third state
   (press the active one to unpin and follow the system); on a phone you are
   always pinned. */
@media (max-width: 560px) {
  .themeswitch[data-effective="dark"] button[data-theme-set="dark"],
  .themeswitch[data-effective="light"] button[data-theme-set="light"] {
    display: none;
  }

  /* With four items in the row, the phone budget is tight enough that the
     wordmark, the gaps and the button padding all have to give a little.
     Without this the row over-runs and the page scrolls sideways. */
  .masthead .inner { gap: 6px; }
  .wordmark { font-size: 16px; letter-spacing: .08em; }
  .themeswitch button { padding: 0 10px; }
  .masthead .btn--sm { font-size: 12px; padding: 0 10px; gap: 0; white-space: nowrap; }
}

/* Below this the four items clip however tightly they are packed, so the key
   carries the brand on its own and the word steps aside. Every control stays. */
@media (max-width: 359px) {
  .wordmark span { display: none; }
  .wordmark { --glyph: 2em; }
}

@media print {
  body::before, .masthead, .themeswitch, .menu-toggle, .player, video { display: none; }
  body { background: #fff; color: #000; }
}
