/* Kowan site. One file, no build step. Every colour and the background
   pattern are tokens on :root, so a restyle is a token swap. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Palette "Kowan": washi paper, sumi ink, one signal-orange accent, crimson danger. */
:root {
  color-scheme: light dark;

  --bg: #f4f1ea;              /* page, under the paper grain */
  --surface: #fbfaf6;         /* column, bars, bands */
  --raised: #ffffff;          /* frames, code, label */
  --sunken: #ece8de;          /* media cells (solid, no pattern) */
  --hover: #e7e2d7;
  --border: #ddd7ca;          /* hairlines */
  --line-strong: #c9c2b2;     /* structural rules */
  --tick: #a39d8f;            /* + registration marks on frames */
  --text: #1b1a17;
  --text-muted: #5f5a50;
  --signal: #fa3600;          /* marks, focus, markers, CTA fills */
  --signal-text: #c42c00;     /* accent used as text */
  --on-signal: #1b1a17;       /* text on accent fills */
  --seal: #fa3600;
  --green: #2f7d4f;
  --amber: #8f5a12;
  --red: #c8102e;

  /* Background: 32px tile with a 7px registration cross. */
  --pattern: url("grain-light.png");
  --pattern-size: 124px 124px;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --col: 1320px;
  --gutter: clamp(14px, 3vw, 36px);
  --pad: clamp(20px, 3.6vw, 52px);
  --tick-len: 11px;
  --bar-h: 60px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 140ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --seal: #fa3600;
    --on-signal: #121110;
    --bg: #121110;
    --surface: #1a1917;
    --raised: #22201d;
    --sunken: #0d0c0b;
    --hover: #2a2724;
    --border: #2e2b27;
    --line-strong: #3d3934;
    --tick: #5a554d;
    --text: #ece6da;
    --text-muted: #a8a196;
    --signal: #ff5a1f;
    --signal-text: #ff6a33;
    --green: #5bb07e;
    --amber: #e0a24a;
    --red: #ff4d5e;
    --pattern: url("grain-dark.png");
  }
}

/* ── Base ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 16px);
  scrollbar-color: var(--line-strong) var(--bg);
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--bg) var(--pattern) 0 0 / var(--pattern-size);
  color: var(--text);
  font: 400 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: color-mix(in oklab, var(--signal) 28%, transparent); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--bg); }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.875em; }
p code, li code, dd code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  background: var(--raised);
  font-size: 0.8em;
}
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Mono label voice: uppercase, small but never below 12px. */
.mono, .cell, .btn, .copy, .tab, .pill, .cap, .file, .label-head, .cmd-bar,
.spec dt, .spec-mono dd, .more dt, .foot h2, .foot-base, .marquee li, .num {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 20;
  padding: 10px 14px; background: var(--signal); color: var(--on-signal);
  font: 600 14px var(--font-mono); text-transform: uppercase; text-decoration: none;
}
.skip:focus { top: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sq { display: inline-block; width: 8px; height: 8px; background: var(--signal); flex: none; }

/* ── Sheet: a solid column between rules; full-bleed band rules meet the
      column rules at small registration crosses. ─────────────────────── */

.band { border-top: 1px solid var(--line-strong); }
.col {
  position: relative;
  max-width: calc(var(--col) + 2px);
  margin-inline: var(--gutter);
  background: var(--surface);
  border-inline: 1px solid var(--line-strong);
}
@media (min-width: 1394px) { .col { margin-inline: auto; } }
.band > .col::before,
.band > .col::after {
  content: "";
  position: absolute;
  top: calc(var(--tick-len) / -2 - 0.5px);
  width: var(--tick-len); height: var(--tick-len);
  background:
    linear-gradient(var(--text-muted), var(--text-muted)) center / var(--tick-len) 1px no-repeat,
    linear-gradient(var(--text-muted), var(--text-muted)) center / 1px var(--tick-len) no-repeat;
  pointer-events: none; z-index: 1;
}
.band > .col::before { left: calc(var(--tick-len) / -2 - 0.5px); }
.band > .col::after { right: calc(var(--tick-len) / -2 - 0.5px); }

/* Frame with "+" registration marks centred on its four corners. */
.reg { position: relative; }
.reg::after {
  content: "";
  position: absolute; inset: -6px;
  pointer-events: none;
  --c: var(--tick);
  background:
    linear-gradient(var(--c), var(--c)) 0 5px / 13px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 5px 0 / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 5px / 13px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 6px) 0 / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 calc(100% - 6px) / 13px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 5px 100% / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% calc(100% - 6px) / 13px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 6px) 100% / 1px 13px no-repeat;
}
.frame { border: 1px solid var(--line-strong); background: var(--raised); padding: 6px; }

/* ── Top bar: cells divided by rules ───────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}
.top-row { display: flex; align-items: stretch; height: var(--bar-h); }
.cell {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding-inline: 22px 30px;
  border-left: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.cell .corner {
  position: absolute; right: 7px; bottom: 7px; width: 8px; height: 8px;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.cell:hover { background: var(--hover); }
.cell:hover .corner { color: var(--signal-text); transform: translate(2px, 2px); }
.cell:focus-visible { outline-offset: -3px; }
.brand.cell { border-left: 0; padding-inline: 18px 24px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 22px/1 var(--font-sans); letter-spacing: -0.03em; text-transform: none;
  text-decoration: none; color: var(--text);
}
.mark { width: 26px; height: 26px; flex: none; }
.nav { display: flex; margin-left: auto; }
.nav .hot { color: var(--signal-text); }
@media (max-width: 640px) {
  :root { --bar-h: 54px; }
  .nav .wide { display: none; }
  .cell { padding-inline: 16px 24px; }
  .brand.cell { padding-inline: 14px 16px; }
}

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

.btn {
  display: inline-flex;
  height: 50px;
  border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text);
  font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform 80ms var(--ease-out);
}
.btn { align-items: center; gap: 18px; padding: 0 0 0 20px; }
.btn-arrow {
  display: grid; place-items: center;
  align-self: stretch; width: 50px;
  border-left: 1px solid var(--line-strong);
}
.btn-arrow svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease-out); }
.btn:hover { background: var(--hover); border-color: var(--text-muted); }
.btn:hover .btn-arrow svg { transform: translateX(3px); }
.btn-signal { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
.btn-signal .btn-arrow { border-left-color: color-mix(in oklab, var(--on-signal) 30%, transparent); }
.btn-signal:hover { background: color-mix(in oklab, var(--signal) 88%, var(--on-signal)); border-color: var(--signal); }

/* ── State pill ────────────────────────────────────────────────────────── */

.pill {
  --t: var(--text-muted);
  display: inline-flex; align-items: center; gap: 8px;
  height: 26px; padding-inline: 9px;
  border: 1px solid color-mix(in oklab, var(--t) 60%, transparent);
  background: color-mix(in oklab, var(--t) 8%, var(--surface));
  color: color-mix(in oklab, var(--t) 72%, var(--text));
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; background: var(--t); flex: none; }
.pill .d { display: inline-flex; align-items: center; gap: 8px; text-transform: none; }
.pill .d::before { content: ""; width: 1px; height: 13px; background: color-mix(in oklab, var(--t) 60%, transparent); }
.pill.green { --t: var(--green); }
.pill.amber { --t: var(--amber); }
.pill.red { --t: var(--red); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Spec rows with dotted leaders: KEY ........ value ─────────────────── */

.spec { border-top: 1px solid var(--border); }
.spec > div {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 14px;
  padding-block: 11px;
  border-bottom: 1px solid var(--border);
}
.spec dt {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  padding-top: 2px;
}
.spec dt::after {
  content: ""; flex: 1; min-width: 12px;
  border-bottom: 2px dotted var(--line-strong);
  transform: translateY(-3px);
}
.spec dd { font-size: 16px; line-height: 1.5; }
.spec-mono dd { font-size: 13px; font-weight: 500; padding-top: 2px; line-height: 1.55; }

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

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}
.hero-copy { padding: clamp(48px, 8vw, 104px) var(--pad) clamp(36px, 5vw, 56px); }
.hero h1 {
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  line-height: 0.94;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.lede {
  max-width: 58ch;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: clamp(1.1875rem, 1.7vw, 1.375rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.lede strong { color: var(--text); font-weight: 600; }

.label {
  align-self: end;
  margin: var(--pad) var(--pad) clamp(36px, 5vw, 56px) 0;
  border: 1px solid var(--line-strong);
  background: var(--raised);
}
.label-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 600;
}
.label .spec { border-top: 0; padding: 4px 16px 6px; }
.label .spec > div { grid-template-columns: 6.5rem minmax(0, 1fr); padding-block: 9px; }
.label .spec > div:last-child { border-bottom: 0; }

.start { padding: 0 var(--pad) clamp(32px, 4vw, 48px); }
.cmd { border: 1px solid var(--line-strong); background: var(--raised); }
.cmd-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 500;
}
.cmd-body { display: flex; align-items: flex-start; }
.cmd-body pre {
  flex: 1; min-width: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 15px; line-height: 1.75;
  color: var(--text);
  scrollbar-width: thin;
}
.cmd-body pre .p { color: var(--signal-text); user-select: none; }
.copy {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 42px; min-width: 112px; margin: 14px 14px 0 0; padding-inline: 16px;
  border: 1px solid var(--signal);
  background: var(--signal); color: var(--on-signal);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.copy svg { width: 15px; height: 15px; }
.copy:hover { background: color-mix(in oklab, var(--signal) 88%, var(--on-signal)); }
.copy[data-state="done"] {
  background: var(--surface);
  border-color: var(--green);
  color: color-mix(in oklab, var(--green) 75%, var(--text));
  animation: beat 700ms var(--ease-out) 1;
}
@keyframes beat {
  0% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--green) 30%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 20px; }
.cta-row .note { color: var(--text-muted); font-size: 16px; }
.cta-row .note a { color: var(--text); }
.cta-row .note a:hover { color: var(--signal-text); }

/* Capability strip: a slow marquee, static under reduced motion. */
.marquee {
  display: flex; overflow: hidden;
  border-block: 1px solid var(--line-strong);
  background: var(--raised);
}
.marquee-track {
  display: flex; flex: none;
  animation: marquee 90s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee li {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 13px 14px 13px 0;
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap;
}
.marquee li::before { content: ""; width: 7px; height: 7px; background: var(--signal); margin-left: 14px; }
@keyframes marquee { to { transform: translateX(-100%); } }

.hero-shot { padding: clamp(28px, 4vw, 52px) var(--pad) var(--pad); background: var(--sunken); }
.shot {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top left;
  background: var(--sunken);
  color: var(--text-muted); font-size: 14px;
}
.cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  margin-top: 14px;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
}

/* ── Section heads ─────────────────────────────────────────────────────── */

.head { padding: clamp(60px, 8vw, 104px) var(--pad) clamp(30px, 4vw, 44px); }
.head h2, .close h2 {
  max-width: 18ch;
  font-size: clamp(2.125rem, 4.6vw, 3.75rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.head p { max-width: 62ch; margin-top: 18px; color: var(--text-muted); font-size: 1.1875rem; line-height: 1.55; }

/* ── Feature rows ──────────────────────────────────────────────────────── */

.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-top: 1px solid var(--line-strong);
}
.row.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.row.flip .text { order: 2; border-left: 1px solid var(--line-strong); }
.row:not(.flip) .media { border-left: 1px solid var(--line-strong); }
.text { padding: clamp(36px, 4.5vw, 60px) var(--pad); }
.text h3 {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(1.5rem, 2.5vw, 2.125rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.num { flex: none; font-size: 13px; font-weight: 600; color: var(--signal-text); letter-spacing: 0.04em; transform: translateY(-0.35em); }
.text > p { margin-top: 18px; color: var(--text-muted); text-wrap: pretty; }
.text .spec { margin-top: 26px; }
.text .pills { margin-top: 24px; }

.media {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(24px, 3.4vw, 48px);
  background: var(--sunken);
}
.media figcaption, .pair figcaption { margin-top: 14px; color: var(--text-muted); font-size: 15px; }
.pair figcaption b {
  margin-right: 8px; color: var(--text);
  font: 600 13px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em;
}

.pair {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line-strong);
  background: var(--sunken);
}
.pair figure { padding: clamp(24px, 3.4vw, 48px); }
.pair figure + figure { border-left: 1px solid var(--line-strong); }

/* Screenshot viewer (site.js): screenshots are buttons that open a dialog. */
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.zoom:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.zoom .shot { transition: opacity var(--dur) var(--ease-out); }
.zoom:hover .shot { opacity: 0.92; }
html.viewer-open { overflow: hidden; }
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  /* The dialog fills the screen and carries the colour itself: ::backdrop does
     not see the page's custom properties in every browser. */
  background: var(--bg); color: var(--text);
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.4); }
.viewer[open] { display: flex; flex-direction: column; animation: viewer-in var(--dur) var(--ease-out); }
@keyframes viewer-in { from { opacity: 0; } }
.viewer-bar {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  padding: 12px var(--gutter);
  font: 600 13px var(--font-mono); color: var(--text-muted);
}
.viewer-count { margin-right: auto; letter-spacing: 0.04em; }
.viewer-btn {
  width: 40px; height: 40px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text);
  font: 400 20px/1 var(--font-sans); cursor: pointer;
}
.viewer-btn:hover { background: var(--hover); }
.viewer-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.viewer-fig {
  flex: 1; min-height: 0; margin: 0; padding: 0 var(--gutter) var(--gutter);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.viewer-img {
  max-width: 100%; max-height: calc(100dvh - 140px); width: auto; height: auto;
  border: 1px solid var(--line-strong); background: var(--raised); padding: 6px; cursor: zoom-out;
}
.viewer-cap { max-width: 70ch; text-align: center; color: var(--text-muted); font-size: 15px; }

/* Phone screenshots, side by side */
.phones { display: flex; justify-content: center; gap: clamp(14px, 3vw, 32px); }
.phones .frame { width: min(46%, 270px); }
.shot.tall { aspect-ratio: 390 / 844; }

/* Connection diagram */
.diagram-wrap { border: 1px solid var(--line-strong); background: var(--raised); padding: clamp(12px, 2vw, 24px); }
.diagram { width: 100%; max-width: 520px; margin-inline: auto; height: auto; color: var(--text); }
.diagram .box { fill: var(--surface); stroke: var(--line-strong); }
.diagram .zone { fill: none; stroke: var(--text-muted); stroke-dasharray: 3 4; }
.diagram .t1 { font: 700 19px var(--font-sans); letter-spacing: -0.01em; fill: var(--text); }
.diagram .t2 { font: 400 15px var(--font-mono); fill: var(--text-muted); }
.diagram .t3 { font: 500 15px var(--font-mono); fill: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.diagram .wire { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .flow {
  fill: none; stroke: var(--signal); stroke-width: 1.5;
  stroke-dasharray: 5 13;
  animation: flow 1.1s linear infinite;
}
.diagram .head-a { fill: var(--signal); }
.diagram .tag { fill: none; stroke: currentColor; }
.diagram .tag-t { font: 600 13px var(--font-mono); letter-spacing: 0.05em; fill: currentColor; }
.diagram .g-edge { color: var(--signal-text); }
.diagram .g-direct { color: color-mix(in oklab, var(--green) 75%, var(--text)); }
@keyframes flow { to { stroke-dashoffset: -18; } }
.rule-note {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 18px; padding: 16px 18px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  font-size: 16px; line-height: 1.5;
}
.rule-note b { font-weight: 700; }

/* ── Also in the box: hairline cell grid ───────────────────────────────── */

.more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}
.more div { padding: 24px var(--pad) 26px; border-bottom: 1px solid var(--border); }
.more div:not(:nth-child(3n + 1)) { border-left: 1px solid var(--border); }
.more div:nth-last-child(-n + 3) { border-bottom: 0; }
.more dt {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
}
.more dt::before { content: ""; width: 8px; height: 8px; background: var(--signal); flex: none; }
.more dd { margin-top: 8px; color: var(--text-muted); font-size: 16px; line-height: 1.55; }

/* ── Quick start ───────────────────────────────────────────────────────── */

.qs {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  border-top: 1px solid var(--line-strong);
}
.qs-code { padding: clamp(28px, 3.6vw, 52px) var(--pad); background: var(--sunken); min-width: 0; }
.tabs { display: flex; border: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface); }
.tab {
  position: relative;
  height: 46px; padding-inline: 20px;
  border: 0; border-right: 1px solid var(--line-strong);
  background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab[aria-selected="true"] { color: var(--text); background: var(--raised); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--signal);
}
.tab:focus-visible { outline-offset: -4px; }
.panel { border: 1px solid var(--line-strong); background: var(--raised); }
.panel[hidden] { display: none; }
.panel .cmd-body + .cmd-body { border-top: 1px solid var(--border); }
.file { padding: 10px 22px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 500; }

.steps { padding: clamp(28px, 3.6vw, 52px) var(--pad); border-left: 1px solid var(--line-strong); counter-reset: s; }
.steps li { position: relative; padding: 0 0 26px 60px; counter-increment: s; }
.steps li::before {
  content: "00" counter(s);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 44px; height: 30px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  font: 600 13px/1 var(--font-mono); color: var(--signal-text);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 22px; top: 36px; bottom: 6px;
  border-left: 1px dashed var(--line-strong);
}
.steps h3 {
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 30px;
  text-transform: uppercase;
}
.steps p { margin-top: 6px; color: var(--text-muted); font-size: 16px; line-height: 1.55; }

/* ── Close and footer ──────────────────────────────────────────────────── */

.close .inner {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 28px;
  padding: clamp(60px, 8vw, 104px) var(--pad);
}
.close .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.foot .col { border-bottom: 1px solid var(--line-strong); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.foot-grid > * { padding: 40px var(--pad); }
.foot-grid > * + * { border-left: 1px solid var(--border); }
.foot .meaning { max-width: 44ch; margin-top: 18px; color: var(--text-muted); font-size: 16px; }
.foot .meaning span[lang="ja"] { color: var(--text); }
.foot h2 { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.foot h2::before { content: ""; width: 7px; height: 7px; background: var(--signal); }
.foot ul { margin-top: 16px; display: grid; gap: 8px; }
.foot ul a { color: var(--text); text-decoration: none; font-size: 16px; }
.foot ul a:hover { color: var(--signal-text); text-decoration: underline; }
.foot-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 16px var(--pad);
  border-top: 1px solid var(--line-strong);
  color: var(--text-muted); font-size: 12px; line-height: 1.6;
  text-transform: none; letter-spacing: 0.01em;
}
.foot-base a { color: var(--text); }
.foot-tail { height: 48px; }

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

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .label { margin: 0 var(--pad) clamp(32px, 5vw, 48px); align-self: stretch; }
  .row, .row.flip, .qs { grid-template-columns: minmax(0, 1fr); }
  .row.flip .text { order: 0; border-left: 0; }
  .row:not(.flip) .media { border-left: 0; }
  .media { border-top: 1px solid var(--line-strong); }
  .steps { border-left: 0; border-top: 1px solid var(--line-strong); }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more div:not(:nth-child(3n + 1)) { border-left: 0; }
  .more div:nth-child(2n) { border-left: 1px solid var(--border); }
  .more div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--border); }
  .more div:nth-last-child(-n + 1) { border-bottom: 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--border); }
  .foot-grid > :nth-child(2) { border-left: 0; }
}
@media (max-width: 640px) {
  :root { --pad: 18px; --gutter: 10px; }
  body { font-size: 16.5px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair figure + figure { border-left: 0; border-top: 1px solid var(--line-strong); }
  .more { grid-template-columns: minmax(0, 1fr); }
  .more div:nth-child(2n) { border-left: 0; }
  .more div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--border); }
  .more div:last-child { border-bottom: 0; }
  .media, .pair figure, .hero-shot { padding: 18px 14px; }
  .frame { padding: 4px; }
  .spec > div { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; }
  .cmd-body { flex-direction: column; align-items: stretch; }
  .cmd-body pre { padding: 16px; font-size: 13px; }
  .copy { height: 46px; margin: 0; border-width: 1px 0 0; }
  .tab { flex: 1; padding-inline: 8px; }
  .file { padding-inline: 16px; }
  .steps li { padding-left: 56px; }
  .btn { width: 100%; justify-content: space-between; }
  .close .actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .marquee-track { animation: none !important; }
  .marquee { overflow-x: auto; }
  .diagram .flow { animation: none; stroke-dasharray: none; }
}
