/* =========================================================
   YHorizon-JM — engineering dossier
   Palette: warm paper, graphite, YHorizon signal red, horizon yellow
   ========================================================= */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f3f1ec;
  --paper-hi: #fbfaf7;
  --paper-lo: #e7e3db;
  --ink: #171719;
  --ink-soft: #36353a;
  --muted: #6a686b;
  --line: rgba(23, 23, 25, 0.16);
  --line-strong: rgba(23, 23, 25, 0.44);
  --copper: #c51e2f;
  --copper-hi: #ff6b75;
  --red: #c51e2f;
  --signal: #f2c94c;
  --horizon: linear-gradient(90deg, #c51e2f 0%, #c51e2f 62%, #f2c94c 100%);
  --dark: #171719;
  --dark-2: #1e1d20;
  --silk: #fafaf7;
  --silk-muted: #b9b5ae;
  --silk-line: rgba(250, 250, 247, 0.16);
  --silk-line-strong: rgba(250, 250, 247, 0.38);

  --font-sans: "Archivo", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-cjk: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;

  --nav-h: 68px;
  --pad: clamp(20px, 4vw, 56px);
  --max: 1400px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.66;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--copper); color: var(--silk); }

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: var(--horizon);
  z-index: 200;
  pointer-events: none;
}

body,
button,
input,
select { caret-color: var(--copper); }

* { scrollbar-width: thin; scrollbar-color: var(--copper) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--copper); }
*::-webkit-scrollbar-track { background: transparent; }

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
code, kbd, pre { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}
.section--dark :focus-visible,
.console :focus-visible,
.footer :focus-visible { outline-color: var(--copper-hi); }

section[id],
main[id] { scroll-margin-top: 0; }

.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

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

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.18s var(--ease);
}
.skip:focus { transform: translateY(0); transition: none; }

/* ---------- shared type ---------- */

h1, h2, h3 {
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

.micro {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

.led {
  width: 6px;
  height: 6px;
  background: var(--red);
  display: inline-block;
  flex: 0 0 auto;
}

/* ---------- buttons + links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease), transform 0.12s ease;
}
.btn svg { transition: transform 0.22s var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper-hi); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.btn--solid:hover { background: linear-gradient(100deg, var(--red), #8f1220); border-color: var(--red); color: var(--silk); }
.btn--line:hover { background: var(--ink); color: var(--paper-hi); }
.btn--dark { border-color: var(--silk-line-strong); color: var(--silk); }
.btn--dark:hover { background: var(--silk); color: var(--ink); border-color: var(--silk); }

.text-link,
.step__links a,
.license__links a,
.footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.text-link { display: inline-block; padding: 3px 0; }
.text-link:hover,
.step__links a:hover,
.license__links a:hover,
.footer a:hover { color: var(--copper); text-decoration-color: var(--copper); }

/* ---------- navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line-strong); }
.nav__inner {
  height: var(--nav-h);
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: 16px;
  line-height: 1;
  padding: 10px 0;
}
.brand__icon { height: 25px; width: auto; display: block; flex: 0 0 auto; }
.brand__mark {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--copper);
  border: 1px solid var(--copper);
  padding: 2px 4px;
  margin-top: 0;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 32px);
  margin-left: auto;
}
.nav__links a {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 3px;
  height: 2px;
  background: var(--horizon);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; background: var(--horizon); }
.nav__links a.is-current { color: var(--ink); }
.nav__links a.is-current::after { transform: scaleX(1); transform-origin: left; background: var(--horizon); }
.nav__tools { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 22px); }
.lang { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.lang__btn {
  border: 0;
  background: none;
  padding: 8px 4px;
  min-width: 30px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.lang__btn:hover { color: var(--ink); }
.lang__btn.is-active { color: var(--ink); text-decoration-color: var(--copper); }
.lang__slash { color: var(--line-strong); }
.nav__github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 0;
}
.nav__github:hover { color: var(--copper); }
.nav__tool {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.nav__tool[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-underline-offset: 4px;
}
.nav__tool:hover { color: var(--copper); }
.menu-btn {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.menu-btn__bars { display: block; width: 18px; position: relative; height: 11px; }
.menu-btn__bars i {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}
.menu-btn__bars i + i { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-btn__bars i:first-child { top: 5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bars i:last-child { top: 5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 90;
  background: var(--paper);
  padding: 24px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav a {
  display: block;
  padding: 14px 0;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu nav a:hover { color: var(--copper); }
.mobile-menu__foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  font-size: 13px;
  color: var(--muted);
}
.mobile-menu__foot a { text-decoration: underline; text-underline-offset: 4px; }
body.menu-open { overflow: hidden; }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  padding-top: var(--nav-h);
  display: grid;
  grid-template-columns: 55fr 45fr;
  background: var(--paper);
}
.hero__copy {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 58px) var(--pad) 0;
  min-width: 0;
}
.hero__title {
  font-size: clamp(2.9rem, 6.1vw, 6.15rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-stretch: 112%;
  margin-top: clamp(24px, 6vh, 74px);
}
.hero__title span { display: block; }
.hero__title span + span { margin-top: 0.06em; }
.hero__lede {
  margin-top: clamp(22px, 3.6vh, 38px);
  max-width: 46ch;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.72;
  color: var(--ink-soft);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(24px, 3.6vh, 40px);
}
.hero__note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.hero__specsline { display: none; }
.ledger {
  margin-top: auto;
  padding-top: clamp(28px, 5vh, 56px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  position: relative;
}
.ledger > div {
  padding: 15px 14px 24px 0;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.ledger > div:first-child { border-left: 0; padding-left: 0; }
.ledger dt {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-bottom: 5px;
  font-size: 11px;
}
.ledger dd {
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero__plate {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  min-height: 100%;
}
.hero__plate::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 54%, rgba(197, 30, 47, 0.22) 100%);
}
.hero__plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 48%;
}
.plate__fig {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--silk);
  mix-blend-mode: difference;
}
.plate__dim {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silk);
  background: rgba(23, 23, 25, 0.78);
  border-left: 2px solid var(--signal);
  padding: 5px 7px;
}
.plate__rule {
  position: absolute;
  left: 0;
  top: 8%;
  bottom: 8%;
  z-index: 2;
  width: 9px;
  background:
    repeating-linear-gradient(to bottom, rgba(231, 236, 227, 0.75) 0 1px, transparent 1px 26px) 0 0 / 7px 100% no-repeat,
    linear-gradient(var(--silk-line-strong), var(--silk-line-strong)) 0 0 / 1px 100% no-repeat;
  opacity: 0.8;
}

/* hero entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero__title span {
    animation: titleIn 1s var(--ease) both;
  }
  .hero__title span:nth-child(2) { animation-delay: 0.09s; }
  .hero__lede { animation: rise 0.9s var(--ease) 0.22s both; }
  .hero__actions { animation: rise 0.9s var(--ease) 0.32s both; }
  .hero__note { animation: rise 0.9s var(--ease) 0.4s both; }
  .hero__plate { animation: plateIn 1.15s var(--ease) 0.05s both; }
  .hero__plate img { animation: imgIn 1.5s var(--ease) 0.05s both; }
  .ledger { animation: rise 0.9s var(--ease) 0.42s both; }
  .ledger::before {
    content: "";
    position: absolute;
    inset: -1px 0 auto;
    height: 1px;
    background: var(--ink);
    transform-origin: left;
    animation: lineIn 1.1s var(--ease) 0.3s both;
  }
}
@keyframes titleIn {
  from { clip-path: inset(0 0 105% 0); transform: translateY(0.22em); }
  to { clip-path: inset(-20% 0 -20% 0); transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes plateIn {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes imgIn {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
@keyframes lineIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- dark sections ---------- */

.section--dark {
  background:
    radial-gradient(95% 120% at 86% 0%, rgba(197, 30, 47, 0.26), rgba(197, 30, 47, 0) 62%),
    linear-gradient(155deg, #1d1c1f 0%, #171719 55%, #101011 100%);
  color: var(--silk);
}
.section--dark ::selection { background: var(--copper); color: var(--silk); }

.section--dark .micro,
.section--dark .section__lede { color: var(--silk-muted); }
.section--dark .section__head { border-top-color: var(--silk-line-strong); }
.section--dark a:hover { color: var(--copper-hi); }

/* ---------- statement ---------- */

.statement {
  min-height: calc(100svh - var(--nav-h));
  padding: clamp(76px, 11vh, 130px) 0 clamp(76px, 10vh, 118px);
}
.statement__h2 {
  font-size: clamp(2.35rem, 4.9vw, 4.7rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
  max-width: 22ch;
}
.statement__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 1.14fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  margin-top: clamp(38px, 6vh, 70px);
  padding-top: 26px;
  border-top: 1px solid var(--silk-line);
}
.statement__photo { margin: 0; }
.statement__photo img { display: block; width: 100%; height: auto; }
.statement__links { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 22px; }
.statement__links a { color: var(--silk); text-decoration: underline; text-underline-offset: 4px; }
.statement__links a:hover { color: var(--copper-hi); }
.statement__copy p {
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.78;
  max-width: 48ch;
  color: var(--silk);
  text-wrap: pretty;
}
.repo__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--silk-line);
}
.repo__row:first-child { border-top: 1px solid var(--copper); }
.repo__name {
  display: inline-block;
  padding: 3px 0;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  color: var(--silk);
}
.repo__name:hover { color: var(--copper-hi); }
.repo__body { font-size: 14px; color: var(--silk-muted); line-height: 1.55; }

/* ---------- generic section ---------- */

.section {
  min-height: calc(100svh - var(--nav-h));
  padding: clamp(76px, 10vh, 118px) 0;
}
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
}
.section__head h2 {
  font-size: clamp(2.25rem, 4.5vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 13em;
}
.section__lede {
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.72;
  color: var(--muted);
  max-width: 42ch;
  padding-bottom: 4px;
}

/* ---------- anatomy ---------- */

.anatomy { padding-top: clamp(60px, 8vh, 86px); }
.anatomy__grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(320px, 1fr);
  gap: clamp(28px, 4.5vw, 60px);
  margin-top: clamp(30px, 5vh, 44px);
  align-items: start;
}
.parts-photo { max-width: 760px; margin: clamp(36px, 6vh, 64px) 0 0; }
.parts-photo img { display: block; width: 100%; height: auto; }
.parts-photo figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cutaway {
  max-width: 760px;
  background: var(--paper-hi);
  border: 1px solid var(--line-strong);
  padding: 12px 12px 10px;
  box-shadow: 0 26px 50px -42px rgba(15, 27, 20, 0.55);
}
.cutaway__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.cutaway__stage { position: relative; margin-top: 10px; }
.viewer {
  position: relative;
  aspect-ratio: 2 / 1;
  background: var(--paper-hi);
  overflow: hidden;
  isolation: isolate;
}
.viewer__canvas { position: absolute; inset: 0; z-index: 1; }
.viewer__canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}
.viewer__canvas canvas:active { cursor: grabbing; }
.viewer__canvas canvas:focus-visible { outline: 2px solid var(--copper); outline-offset: -3px; }
.viewer__poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.viewer.is-ready .viewer__poster { opacity: 0; }
.viewer.is-fallback .viewer__poster { opacity: 1; }
.viewer.is-fallback .viewer__ui,
.viewer.is-fallback .viewer__hint { display: none; }
.viewer__hint {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: rgba(243, 245, 239, 0.9);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  pointer-events: none;
}
.viewer__ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 7px 10px 8px;
  border-top: 1px solid var(--line-strong);
  background: var(--paper-hi);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.viewer__slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.viewer__slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.viewer__slider input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-strong);
}
.viewer__slider input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line-strong);
}
.viewer__slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 0;
  background: var(--copper);
}
.viewer__slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: var(--copper);
}
.viewer__slider input[type="range"]:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.viewer__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer__actions button {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.viewer__actions button:hover { background: var(--ink); color: var(--paper-hi); }
.viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: var(--paper-hi);
}
.viewer:fullscreen .viewer__ui { padding-bottom: 12px; }
.cutaway__note {
  padding: 9px 2px 2px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}
.marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 30px; height: 30px;
  border: 1px solid var(--copper);
  border-radius: 50%;
  background: var(--paper-hi);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
  z-index: 3;
}
.marker:hover { transform: translate(-50%, -50%) scale(1.12); }
.marker.is-active { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.marker:focus-visible { outline-offset: 3px; }

.layers__list { border-top: 1px solid var(--ink); }
.layer {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  text-align: left;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.layer:hover { background: rgba(15, 27, 20, 0.055); }
.layer.is-active { background: var(--ink); color: var(--paper-hi); }
.layer__no { font-size: 11px; color: var(--copper); font-weight: 700; letter-spacing: 0.04em; }
.layer.is-active .layer__no { color: var(--copper-hi); }
.layer__name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.layer__meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.layer.is-active .layer__meta { color: var(--silk-muted); }

.layer-detail {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--copper);
  min-height: 158px;
}
.layer-detail__meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--copper);
  margin-bottom: 7px;
}
.layer-detail h3 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.layer-detail p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 38ch;
}
.layer-detail a {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}
.layer-detail a:hover { color: var(--copper); }

/* reveal */
@media (prefers-reduced-motion: no-preference) {
  .cutaway.is-inview .marker { animation: markerIn 0.55s var(--ease) both; }
  .cutaway.is-inview .marker:nth-of-type(1) { animation-delay: 0.04s; }
  .cutaway.is-inview .marker:nth-of-type(2) { animation-delay: 0.1s; }
  .cutaway.is-inview .marker:nth-of-type(3) { animation-delay: 0.16s; }
  .cutaway.is-inview .marker:nth-of-type(4) { animation-delay: 0.22s; }
  .cutaway.is-inview .marker:nth-of-type(5) { animation-delay: 0.28s; }
}
@keyframes markerIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- specs ---------- */

.specs__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(36px, 6vh, 64px);
  align-items: start;
}
.drawing {
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 0;
  color: var(--ink);
}
.drawing__bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.drawing__meta { font-variant-numeric: tabular-nums; }
.drawing__sheet { display: block; background: #fff; border-bottom: 1px solid var(--line); }
.drawing__sheet img { display: block; width: 100%; height: auto; }
.drawing__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px 9px;
  font-size: 10px;
  color: var(--muted);
}
.drawing__foot a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}
.drawing__foot a:hover { color: var(--copper); }
.drawing__file { letter-spacing: 0.06em; }
.spec-table { padding-top: 2px; }
.spec-table th {
  width: 34%;
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 11px 18px 11px 0;
  vertical-align: baseline;
  border-bottom: 1px solid var(--line);
}
.spec-table td {
  font-size: 14.5px;
  line-height: 1.5;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom-color: var(--line-strong); }
.spec-table .micro { margin-top: 16px; font-size: 11.5px; }

/* ---------- control ---------- */

.control__grid {
  display: grid;
  grid-template-columns: minmax(0, 5.5fr) minmax(0, 6.5fr);
  gap: clamp(28px, 4.5vw, 56px);
  margin-top: clamp(32px, 5vh, 56px);
  align-items: start;
}
.board { position: relative; border: 1px solid var(--silk-line); background: var(--dark-2); }
.board > img { width: 100%; height: auto; }
.control__copy .lead {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.7;
  color: var(--silk);
  max-width: 44ch;
}
.control__copy > p + p {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--silk-muted);
  max-width: 46ch;
}
.loops {
  margin-top: 26px;
  border-top: 1px solid var(--copper);
}
.loops > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--silk-line);
}
.loops dt { font-size: 11px; color: var(--silk-muted); }
.loops dd {
  font-size: 13.5px;
  color: var(--silk);
  font-variant-numeric: tabular-nums;
}
.control__copy .text-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
  text-decoration-color: var(--silk-line-strong);
}

/* ---------- protocol ---------- */

.console {
  margin-top: clamp(34px, 5vh, 56px);
  background: var(--dark);
  color: var(--silk);
  border-top: 2px solid var(--copper);
  padding: clamp(18px, 2.6vw, 34px);
}
.console ::selection { background: var(--copper); color: var(--silk); }

.console__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--silk-line);
}
.console__head h3 { font-size: 21px; letter-spacing: -0.02em; }
.console__head p { font-size: 11px; color: var(--silk-muted); margin-top: 3px; }
.console__state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--silk-muted);
}
.console__state .led { background: var(--signal); }
.console__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 3.4vw, 52px);
  padding-top: 24px;
}
.console__controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: clamp(20px, 3vw, 44px);
  border-right: 1px solid var(--silk-line);
}
.field--id { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field--id label,
.slider label,
.modes legend {
  font-size: 11px;
  color: var(--silk-muted);
  letter-spacing: 0.01em;
}
.field--id input {
  width: 64px;
  height: 34px;
  border: 1px solid var(--silk-line-strong);
  background: transparent;
  color: var(--silk);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 0 8px;
  text-align: center;
  border-radius: 1px;
}
.modes { border: 0; padding: 0; margin: 0; display: block; }
.modes legend { margin-bottom: 8px; padding: 0; }
.modes label { display: inline-block; cursor: pointer; vertical-align: top; }
.modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.modes span {
  display: block;
  padding: 8px 15px;
  border: 1px solid var(--silk-line-strong);
  margin-left: -1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--silk-muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.modes label:first-of-type span { margin-left: 0; }
.modes input:checked + span { background: var(--silk); color: var(--ink); border-color: var(--silk); }
.modes input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.modes label:hover span { color: var(--silk); }

.slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
}
.slider label { grid-column: 1; grid-row: 1; }
.slider output {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--silk);
  font-variant-numeric: tabular-nums;
}
.slider input[type="range"] {
  grid-column: 1 / -1;
  grid-row: 2;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--silk-line-strong);
}
.slider input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--silk-line-strong);
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  margin-top: -5.5px;
  background: var(--copper);
  border: 0;
  border-radius: 0;
}
.slider input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  background: var(--copper);
  border: 0;
  border-radius: 0;
}
.slider input[type="range"]:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; }
.slider[hidden] { display: none; }

.console__out { min-width: 0; }
.frame { display: flex; gap: 40px; }
.frame__id { display: flex; align-items: baseline; gap: 9px; }
.frame__id span { font-size: 10px; color: var(--silk-muted); }
.frame__id strong {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--silk);
  letter-spacing: 0.02em;
}
.bytes {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  margin-top: 16px;
}
.byte {
  border: 1px solid var(--silk-line);
  padding: 7px 2px 6px;
  text-align: center;
  background: rgba(231, 236, 227, 0.025);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.byte b {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  color: var(--silk-muted);
  margin-bottom: 4px;
}
.byte code {
  font-size: clamp(12px, 1.2vw, 15px);
  color: var(--silk);
}
.byte.is-new { animation: byteIn 0.5s var(--ease) both; }
@keyframes byteIn {
  0% { background: var(--copper); border-color: var(--copper); color: var(--dark); }
  100% { background: rgba(231, 236, 227, 0.025); }
}
.console__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.console__actions .btn { min-height: 42px; padding: 9px 15px; }
.console__actions .btn--solid { background: var(--silk); border-color: var(--silk); color: var(--ink); }
.console__actions .btn--solid:hover { background: var(--copper); border-color: var(--copper); color: var(--dark); }

.feedback {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--copper);
}
.feedback[hidden] { display: none; }
.feedback__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  color: var(--silk-muted);
}
.feedback__head code { color: var(--copper-hi); font-size: 11px; }
.feedback__bytes {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--silk);
}
.feedback__vals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.feedback__vals dt { font-size: 9px; color: var(--silk-muted); }
.feedback__vals dd { font-size: 12px; font-variant-numeric: tabular-nums; }
.feedback .micro { font-size: 9.5px; margin-top: 8px; }
.console .micro,
.console .feedback .micro { color: var(--silk-muted); }
.console__out > .micro { font-size: 10.5px; margin-top: 16px; max-width: 56ch; }
.frame-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--silk-line);
}
.frame-map div { min-width: 0; }
.frame-map dt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--copper-hi);
  letter-spacing: 0.04em;
}
.frame-map dd {
  font-size: 11px;
  line-height: 1.45;
  color: var(--silk-muted);
  margin-top: 2px;
}

.protocol__foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.protocol__foot code { font-size: 11px; color: var(--ink); }

/* ---------- build ---------- */

.build__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: clamp(32px, 5.5vw, 84px);
  margin-top: clamp(36px, 6vh, 62px);
  align-items: start;
}
.steps { border-top: 1px solid var(--ink); }
.step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.step__no {
  font-size: 11px;
  font-weight: 700;
  color: var(--copper);
  letter-spacing: 0.04em;
  padding-top: 4px;
}
.step__body h3 { font-size: 19px; line-height: 1.25; margin-bottom: 5px; letter-spacing: -0.02em; }
.step__body p { font-size: 14px; line-height: 1.62; color: var(--ink-soft); max-width: 64ch; }
.step__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.step__links a { display: inline-block; padding: 3px 0; font-size: 12px; font-weight: 500; }

.downloads {
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}
.downloads h3 {
  font-size: 11px;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
}
.downloads ul { margin-top: 8px; border-top: 1px solid var(--line); }
.downloads li { border-bottom: 1px solid var(--line); }
.downloads li a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.18s ease, padding-left 0.18s ease;
}
.downloads li a:hover { color: var(--copper); padding-left: 4px; }
.downloads small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.downloads__kit { margin-top: 18px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.downloads .btn { margin-top: 12px; min-height: 40px; padding: 8px 13px; font-size: 12px; }

/* ---------- software ---------- */

.software__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 76px);
  margin-top: clamp(34px, 5vh, 58px);
  align-items: start;
}
.software__copy,
.software__code { min-width: 0; }
.software__copy h3,
.software__code h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.software__copy > p,
.code-note p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--silk-muted);
  max-width: 52ch;
  margin-top: 4px;
}
.software__copy h3:not(:first-child) { margin-top: 26px; }
.code {
  margin-top: 12px;
  border: 1px solid var(--silk-line);
  background: #08100c;
}.code__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--silk-line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--silk-muted);
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--silk-line);
  background: transparent;
  color: var(--silk-muted);
  font-family: var(--font-sans);
  font-size: 10px;
  padding: 4px 7px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.copy:hover { color: var(--silk); border-color: var(--silk-line-strong); }
.copy.is-done { color: var(--copper-hi); border-color: var(--copper); }
.code pre {
  margin: 0;
  padding: 14px 15px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.75;
  color: var(--silk);
  tab-size: 2;
}
.code--tall pre { min-height: 170px; padding-top: 18px; }
.tok {
  font-family: var(--font-mono);
  font-size: 0.86em;
  white-space: nowrap;
  background: rgba(15, 27, 20, 0.06);
  padding: 1px 3px;
}
.section--dark .tok { background: rgba(231, 236, 227, 0.08); }
.code .c { color: #858287; }
.code .k { color: var(--copper-hi); }
.code .n { color: var(--signal); }
.code .s { color: #e9a6ad; }
.code-note { margin-top: 18px; }
.software__code .code-note { margin-top: 0; margin-bottom: 10px; }
.software__copy .micro { margin-top: 14px; }

/* ---------- license ---------- */

.license__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(32px, 5.5vw, 84px);
  margin-top: clamp(34px, 5.5vh, 60px);
  align-items: start;
}
.licenses { border-top: 1px solid var(--ink); }
.licenses tr { border-bottom: 1px solid var(--line); }
.licenses th {
  width: 43%;
  text-align: left;
  vertical-align: top;
  padding: 18px 24px 18px 0;
  font-weight: 400;
}
.licenses th span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.licenses th strong { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.licenses td {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding: 18px 0;
}
.safety {
  margin-top: 26px;
  background: linear-gradient(120deg, var(--red) 0%, #8f1220 100%);
  color: var(--paper-hi);
  padding: clamp(20px, 3vw, 30px);
}
.safety h3 {
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: var(--paper-hi);
  font-weight: 700;
}
.safety p {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  max-width: 34ch;
  font-weight: 500;
}
.license__links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; font-size: 12px; }
.rear { position: relative; border: 1px solid var(--line-strong); }
.rear img { width: 100%; height: auto; }
.rear .plate__fig { mix-blend-mode: difference; }

/* ---------- footer ---------- */

.footer { padding: clamp(64px, 9vh, 104px) 0 28px; }
.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: var(--silk);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.footer__brand img { height: 22px; width: auto; display: block; }
.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}
.footer__top h2 {
  font-size: clamp(2.6rem, 5.6vw, 5.9rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 12ch;
}
.btn--footer { flex: 0 0 auto; margin-bottom: 6px; background: var(--silk); color: var(--ink); border-color: var(--silk); }
.btn--footer:hover { background: var(--copper); border-color: var(--copper); color: var(--silk); }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(120px, 0.7fr));
  gap: clamp(28px, 4vw, 60px);
  margin-top: clamp(48px, 8vh, 84px);
  padding-top: 28px;
  border-top: 1px solid var(--silk-line-strong);
}
.footer__body { font-size: 14px; line-height: 1.7; color: var(--silk-muted); max-width: 42ch; }
.footer__col h3 {
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--silk-muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.footer__col a,
.footer__col span {
  display: block;
  font-size: 13px;
  padding: 4px 0;
  color: var(--silk);
  text-decoration: none;
}
.footer__col a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.footer__col a:hover { color: var(--copper-hi); text-decoration-color: var(--copper-hi); }
.footer__col span { color: var(--silk-muted); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding-top: 16px;
  border-top: 1px solid var(--silk-line);
  font-size: 10.5px;
  color: var(--silk-muted);
}
.footer__bottom p { max-width: 60ch; }
.footer__parent { align-self: center; color: var(--silk); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.footer__parent:hover { color: var(--copper-hi); }

/* ---------- language-specific display widths ---------- */

html[data-lang="en"] .hero__title {
  font-size: clamp(2.55rem, 5.25vw, 5.35rem);
  letter-spacing: -0.04em;
}
html[data-lang="en"] .statement__h2 { max-width: 22ch; }
html[data-lang="en"] .section__head h2 { max-width: 20ch; }
html[data-lang="en"] .footer__top h2 { max-width: 14ch; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .hero { grid-template-columns: 54fr 46fr; }
  .hero__title { font-size: clamp(2.8rem, 5.9vw, 5.2rem); }
  .section__head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .nav__links { gap: 18px; }
  .ledger > div { padding-right: 10px; padding-left: 10px; }
  .ledger dd { font-size: 13px; }
}

@media (max-width: 980px) {
  .nav__links { display: none; }
  .menu-btn { display: inline-flex; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero__copy { padding-top: 34px; }
  .hero__title { margin-top: 24px; }
  .hero__plate { height: min(72svh, 620px); min-height: 420px; }
  .ledger { margin-top: 40px; }
  .statement__grid { grid-template-columns: 1fr; gap: 36px; }
  .section__head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .section__lede { max-width: 52ch; }
  .anatomy__grid,
  .specs__grid,
  .control__grid,
  .build__grid,
  .software__grid,
  .license__grid { grid-template-columns: minmax(0, 1fr); }
  .anatomy__grid { gap: 30px; }
  .layers { max-width: 620px; }
  .console__grid { grid-template-columns: 1fr; }
  .console__controls { border-right: 0; border-bottom: 1px solid var(--silk-line); padding-right: 0; padding-bottom: 20px; }
  .protocol__foot { grid-template-columns: 1fr; gap: 10px; }
  .control__copy { max-width: 640px; }
  .build__grid { gap: 40px; }
  .downloads { max-width: 520px; }
  .license__grid { gap: 36px; }
  .rear { max-width: 560px; }
  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer__body { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --nav-h: 60px; --pad: 20px; }
  body { font-size: 16px; }
  .brand { font-size: 15px; }
  .brand__icon { height: 23px; }
  .brand__mark { display: none; }
  .nav__github span { display: none; }
  .nav__tools { gap: 10px; }
  .nav__inner { gap: 16px; }
  .hero__copy { padding-top: 26px; }
  .hero__title { font-size: clamp(2.55rem, 11.5vw, 3.6rem); }
  html[data-lang="en"] .hero__title { font-size: clamp(2.2rem, 9.6vw, 3rem); }
  .statement__h2 { font-size: clamp(1.85rem, 8.4vw, 2.3rem); line-height: 1.12; }
  html[data-lang="en"] .statement__h2 { font-size: clamp(1.7rem, 7.2vw, 2rem); }
  .hero__lede { font-size: 15px; max-width: 36ch; }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero__specsline {
    display: block;
    margin-top: 13px;
    font-size: 10.5px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .ledger { display: none; }
  .hero__plate { height: 64svh; min-height: 380px; }
  .plate__fig, .plate__dim { top: 14px; right: 14px; bottom: auto; left: auto; }
  .plate__dim { top: auto; bottom: 14px; left: 14px; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger > div { border-left: 0; padding-left: 0; padding-right: 10px; }
  .ledger > div:nth-child(5) { grid-column: 1 / -1; }
  .repo__row { grid-template-columns: 84px 1fr; gap: 14px; }
  .repo__name { font-size: 14px; }
  .repo__body { font-size: 12.5px; }
  .section { padding: 64px 0; }
  .section__head h2 { font-size: clamp(1.95rem, 8.8vw, 2.7rem); }
  .section__lede { font-size: 13.5px; }
  .anatomy__grid { margin-top: 28px; }
  .cutaway { padding: 8px; }
  .marker { display: none; }
  .viewer { aspect-ratio: auto; height: 320px; }
  .viewer__ui { padding: 6px 8px 7px; }
  .viewer__actions button { font-size: 11px; padding: 4px 6px; }
  .viewer__hint { font-size: 10.5px; top: 7px; left: 7px; }
  #fullscreenViewer { display: none; }
  .layer { padding: 11px 8px; }
  .layer__name { font-size: 14px; }
  .layer-detail { min-height: 0; }
  .spec-table th { width: 38%; font-size: 11px; padding-right: 10px; }
  .spec-table td { font-size: 13px; }
  .licenses th { width: 48%; padding-right: 12px; }
  .licenses th strong { font-size: 15px; }
  .licenses td { font-size: 13px; }
  .control__copy .lead { font-size: 15px; }
  .loops > div { grid-template-columns: 58px 1fr; }
  .console { padding: 14px; }
  .console__grid { gap: 20px; }
  .console__head h3 { font-size: 18px; }
  .bytes { gap: 3px; }
  .byte { padding: 6px 1px 5px; }
  .byte code { font-size: 12px; }
  .feedback__vals { grid-template-columns: 1fr 1fr; }
  .protocol__foot { font-size: 10.5px; }
  .step { grid-template-columns: 34px 1fr; gap: 12px; }
  .step__body h3 { font-size: 17px; }
  .downloads li a { font-size: 13px; }
  .software__code .code pre { font-size: 11px; }
  .footer__top h2 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__col:last-child { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; gap: 8px; }
}

@media (max-width: 400px) {
  .lang { font-size: 11px; }
  .hero__title { font-size: 2.4rem; }
  .byte code { font-size: 11px; }
  .frame { gap: 22px; }
}

@media (max-width: 360px) {
  .nav__github,
  .brand__mark { display: none; }
  .nav__inner { gap: 8px; }
  .nav__tools { gap: 8px; }
  .lang__btn { min-width: 26px; }
  .hero__title { font-size: 2.25rem; }
  .hero__actions .btn { font-size: 12px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero__title span { clip-path: none !important; transform: none !important; }
  .hero__plate { clip-path: none !important; }
  .hero__plate img { transform: none !important; }
}



