/* Hub landing page. Static, framework-free. See src/landing/README.md. */

@font-face {
  font-family: "Archivo";
  src: url("/site/fonts/archivo-v25-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/site/fonts/martian-mono-v6-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ecebe5;
  --paper-2: #f6f5f1;
  --paper-3: #e2e0d8;
  --ink: #141412;
  --ink-2: #33332f;
  --muted: #64625b;
  --line: rgba(20, 20, 18, 0.13);
  --line-2: rgba(20, 20, 18, 0.24);
  --signal: #ff5a1f;
  --signal-soft: rgba(255, 90, 31, 0.14);
  --signal-text: #b23a0a;
  --night: #121211;
  --night-2: #1b1b19;
  --night-3: #262623;
  --night-line: rgba(236, 235, 229, 0.12);
  --night-line-2: rgba(236, 235, 229, 0.22);
  --night-muted: #a19f97;
  --ok: #5f8a5a;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --pad: clamp(20px, 4.2vw, 72px);
  --maxw: 1560px;
  --gap: clamp(16px, 1.7vw, 28px);
  --head-h: 68px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-stretch: 100%;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 0;
  overflow-x: clip;
}
body::before { /* paper grain */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.48 0 0 0 0 0.44 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.86em; font-stretch: 87.5%; letter-spacing: -0.01em; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--signal); color: var(--ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden {
  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; left: 12px; top: 12px; z-index: 200;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  border-radius: 8px; text-decoration: none; transform: translateY(-150%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.mono { font-size: 0.7rem; line-height: 1.5; letter-spacing: 0.04em; text-transform: uppercase; font-stretch: 87.5%; font-weight: 450; }

/* ---------- Mark ---------- */
.mark { width: 30px; height: 30px; fill: currentColor; overflow: visible; }
.mark__knob {
  fill: var(--signal);
  stroke: currentColor;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s var(--spring);
}
.mark--sm { width: 20px; height: 20px; }
.mark--xs { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  --bh: 48px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--bh);
  padding: 0 20px 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.98rem; font-weight: 560; font-stretch: 104%; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.4s var(--ease), box-shadow 0.3s;
  will-change: transform;
}
.btn .ico { transition: transform 0.4s var(--ease); }
.btn:hover .ico { transform: translate(3px, 0); }
.btn:hover .ico use[href="#i-arrow-ne"] { }
.btn--sm { --bh: 38px; padding: 0 14px 0 16px; font-size: 0.9rem; gap: 8px; }
.btn--sm .ico { width: 15px; height: 15px; }
.btn--lg { --bh: 56px; padding: 0 24px 0 28px; font-size: 1.02rem; }
.btn--xl { --bh: 64px; padding: 0 28px 0 32px; font-size: 1.1rem; }
.btn--signal { background: var(--signal); color: var(--ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12); }
.btn--signal:hover { background: #ff6d38; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12), 0 10px 30px -10px rgba(255, 90, 31, 0.7); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(20,20,18,0.04); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover:not(:disabled) { background: #000; }
.btn--ink:disabled { background: var(--paper-3); color: var(--muted); cursor: not-allowed; }
.btn--line { background: var(--paper-2); color: var(--ink); border-color: var(--line-2); }
.btn--line:hover { border-color: var(--ink); }
.btn--line[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.theme-night .btn--ghost { color: var(--paper); border-color: var(--night-line-2); }
.theme-night .btn--ghost:hover { border-color: var(--paper); background: rgba(255,255,255,0.04); }
.btn:active { transform: scale(0.98); }


/* ---------- Masthead ---------- */
.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--head-h);
  color: var(--ink);
  transition: background-color 0.4s, color 0.4s, border-color 0.4s, transform 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.masthead.is-scrolled {
  background: rgba(236, 235, 229, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}
.masthead.is-night { color: var(--paper); }
.masthead.menu-open { background: var(--paper) !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; }
.masthead.menu-open .menu-toggle { border-color: var(--line-2); }
.masthead.is-night.is-scrolled { background: rgba(18, 18, 17, 0.82); border-bottom-color: var(--night-line); }
.masthead__inner {
  height: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad);
  display: flex; align-items: center; gap: clamp(16px, 2vw, 32px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__name { font-size: 1.45rem; font-weight: 640; font-stretch: 110%; letter-spacing: -0.04em; line-height: 1; }
.brand__by { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; font-stretch: 87.5%; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); line-height: 1.2; margin-left: 2px; }
.masthead.is-night .brand__by { color: var(--night-muted); border-color: var(--night-line-2); }
.brand:hover .mark__knob, .brand:focus-visible .mark__knob { transform: translateX(4.5px); }
.masthead__where {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; font-stretch: 87.5%;
  color: var(--muted); white-space: nowrap; overflow: hidden; min-width: 0;
}
.masthead.is-night .masthead__where { color: var(--night-muted); }
.masthead__where [data-where-num] { color: var(--signal-text); font-weight: 600; }
.masthead.is-night .masthead__where [data-where-num] { color: var(--signal); }
.masthead__where span { display: inline-block; transition: transform 0.5s var(--ease), opacity 0.3s; }
.masthead__where.is-swapping span { transform: translateY(-60%); opacity: 0; }
.masthead__nav { margin-left: auto; display: flex; gap: clamp(14px, 1.8vw, 28px); }
.masthead__nav a, .link-signin {
  position: relative; text-decoration: none; font-size: 0.92rem; font-weight: 500; font-stretch: 102%; white-space: nowrap; padding: 6px 0;
}
.masthead__nav a::after, .link-signin::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.masthead__nav a:hover::after, .link-signin:hover::after, .masthead__nav a.is-current::after { transform: scaleX(1); transform-origin: left; }
.masthead__actions { display: flex; align-items: center; gap: 18px; flex: none; }
.masthead__actions .btn--signal { color: var(--ink); }
.menu-toggle {
  display: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
}
.masthead.is-night .menu-toggle { border-color: var(--night-line-2); }
.menu-toggle .ico--close { display: none; }
.menu-toggle[aria-expanded="true"] .ico--open { display: none; }
.menu-toggle[aria-expanded="true"] .ico--close { display: block; }
.masthead__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.masthead__progress span { display: block; height: 100%; background: var(--signal); transform-origin: left; transform: scaleX(0); }

.mobile-menu {
  position: fixed; inset: var(--head-h) 0 0 0; z-index: 49;
  background: var(--paper);
  padding: 24px var(--pad) 32px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 520; font-stretch: 108%; letter-spacing: -0.03em; line-height: 1.1; text-decoration: none;
  opacity: 0; transform: translateY(10px); animation: menuIn 0.6s var(--ease) forwards;
}
.mobile-menu nav a:nth-child(2) { animation-delay: 0.04s; } .mobile-menu nav a:nth-child(3) { animation-delay: 0.08s; }
.mobile-menu nav a:nth-child(4) { animation-delay: 0.12s; } .mobile-menu nav a:nth-child(5) { animation-delay: 0.16s; }
.mobile-menu nav a:nth-child(6) { animation-delay: 0.2s; }
.mobile-menu nav a span { font-family: var(--mono); font-size: 0.7rem; color: var(--signal-text); letter-spacing: 0.04em; }
.mobile-menu__actions { display: grid; gap: 12px; }
.mobile-menu__actions .btn { width: 100%; }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* ---------- Kicker + headings ---------- */
.section { position: relative; padding-block: clamp(96px, 13vw, 200px); }
.kicker { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-bottom: clamp(24px, 3vw, 40px); }
.kicker__n { color: var(--signal-text); font-weight: 600; }
.kicker__rule { width: clamp(40px, 7vw, 120px); height: 1px; background: currentColor; opacity: 0.5; }
.theme-night .kicker { color: var(--night-muted); }
.theme-night .kicker__n { color: var(--signal); }
.h2 {
  font-size: clamp(2.35rem, 5.5vw, 5.6rem);
  line-height: 0.95; letter-spacing: -0.04em;
  font-weight: 520; font-stretch: 110%;
  max-width: 15ch;
  text-wrap: balance;
}
.h2--xl { font-size: clamp(2.6rem, 7.4vw, 8rem); max-width: 13ch; }
.body-lg { font-size: clamp(1.08rem, 1.3vw, 1.32rem); line-height: 1.5; letter-spacing: -0.006em; max-width: 40ch; color: var(--ink-2); text-wrap: pretty; }
.theme-night .body-lg { color: #cfcdc5; }
.caption { color: var(--muted); margin-top: 18px; }
.footnote { color: var(--muted); margin-top: clamp(40px, 5vw, 72px); display: flex; align-items: center; gap: 10px; }
.footnote::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; }

/* split words */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.is-in .w > span { transform: none; }

/* reveal */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* registration marks */
.reg { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--ink); opacity: 0.55; }
.reg::before { left: 6.5px; top: 0; width: 1px; height: 14px; }
.reg::after { top: 6.5px; left: 0; height: 1px; width: 14px; }
.reg--tl { left: -22px; top: -22px; }
.reg--br { right: -22px; bottom: -22px; }

/* ---------- Common UI atoms ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 6px; font-size: 0.74rem; color: var(--muted); background: var(--paper-2); white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 560; }
.pill small { font-family: var(--mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 0.74rem; color: var(--muted); white-space: nowrap; background: transparent;
}
.chip--line { border-style: solid; }
.chip--on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--btn { cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s; height: 32px; padding: 0 14px; font-size: 0.8rem; }
.chip--btn:hover { border-color: var(--ink); color: var(--ink); }
.chip--btn[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--ink); font-weight: 560; }
.yes, .no { display: inline-flex; align-items: center; gap: 6px; }
.yes::before, .no::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.no::before { background: transparent; border: 1px solid var(--muted); }
.no { color: var(--muted); }

.switch {
  position: relative; width: 40px; height: 24px; flex: none; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper-3); cursor: pointer; padding: 0;
  transition: background-color 0.3s, border-color 0.3s;
}
.switch span {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-2); border: 1px solid var(--line-2); box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.45s var(--spring), background-color 0.3s;
}
.switch[aria-checked="true"] { background: var(--signal); border-color: var(--signal); }
.switch[aria-checked="true"] span { transform: translateX(16px); background: var(--ink); border-color: var(--ink); }

.segmented {
  display: inline-flex; padding: 3px; border-radius: 10px; background: var(--paper-3); border: 1px solid var(--line);
  position: relative;
}
.segmented button {
  border: 0; background: transparent; cursor: pointer; padding: 0 12px; height: 28px; border-radius: 7px;
  font-size: 0.8rem; font-weight: 500; color: var(--muted); transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 0 0 1px var(--line-2); }
.segmented--wide { display: flex; }
.segmented--wide button { flex: 1; height: 34px; }

.flag-fictional {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.05em; text-transform: uppercase; font-stretch: 87.5%;
  color: var(--signal-text); white-space: nowrap;
}
.flag-fictional::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; transform: rotate(45deg); }
.flag-fictional--line { margin-left: auto; }

/* =================================================================== */
/* HERO                                                                 */
/* =================================================================== */
.hero { position: relative; padding-top: calc(var(--head-h) + clamp(20px, 3vw, 44px)); overflow: clip; }
.guides {
  position: absolute; inset: 0; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: repeat(6, 1fr); pointer-events: none; z-index: 0;
}
.guides i { border-left: 1px solid var(--line); opacity: 0.55; }
.guides i:last-child { border-right: 1px solid var(--line); }
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.hero__eyebrow {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; color: var(--muted);
  padding-bottom: clamp(20px, 3vw, 40px);
}
.hero__eyebrow span:first-child { color: var(--ink); font-weight: 600; }
.hero__eyebrow .rule { width: 56px; height: 1px; background: var(--line-2); }
.hero__left { grid-column: 1 / span 6; }
.hero__title {
  font-size: clamp(3.3rem, 8.3vw, 9.2rem);
  line-height: 0.88; letter-spacing: -0.048em; font-weight: 540; font-stretch: 112%;
  white-space: nowrap;
  position: relative; z-index: 3;
}
.hero__title .line { display: block; width: max-content; max-width: none; overflow: hidden; padding: 0 0.04em 0.06em 0; margin-bottom: -0.06em; }
.hero__title .line > span { display: inline-block; }
.js .hero__title .line > span { transform: translateY(104%); transition: transform 1.25s var(--ease); }
.js .hero__title .line:nth-child(2) > span { transition-delay: 0.08s; }
.js .hero__title .line:nth-child(3) > span { transition-delay: 0.2s; }
.is-loaded .hero__title .line > span { transform: none; }
.hero__title .line--small { font-size: 0.3em; line-height: 1.1; letter-spacing: -0.03em; margin-top: 0.34em; }
.hero__title .line--small > span { font-weight: 600; color: var(--signal-text); padding: 0.06em 0.1em 0.04em 0; position: relative; }
.caret { display: inline-block; width: 0.07em; min-width: 3px; height: 0.9em; margin-left: 0.08em; vertical-align: -0.08em; background: var(--signal); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.hero__copy { margin-top: clamp(28px, 3.4vw, 52px); }
.lede { font-size: clamp(1.06rem, 1.22vw, 1.24rem); line-height: 1.5; max-width: 38ch; color: var(--ink-2); letter-spacing: -0.006em; text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 2.6vw, 36px); }

/* specimen */
.specimen { grid-column: 7 / -1; grid-row: 2 / span 1; align-self: start; margin-top: calc(clamp(3.3rem, 8.3vw, 9.2rem) * 0.88 + 20px); position: relative; z-index: 2; }
.specimen__stage { position: relative; padding-bottom: 150px; perspective: 1600px; }
.app-window {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 30px 60px -30px rgba(40, 32, 20, 0.35), 0 12px 24px -16px rgba(40, 32, 20, 0.2);
  overflow: hidden;
  transform-origin: 50% 100%;
}
.js .app-window { opacity: 0; transform: translateY(40px) rotateX(8deg); transition: opacity 1s var(--ease) 0.25s, transform 1.4s var(--ease) 0.25s; }
.is-loaded .app-window { opacity: 1; transform: none; }
.app-window__bar {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.app-logo { width: 18px; height: 18px; border-radius: 5px; background: conic-gradient(from 200deg, #2b4c7e, #4f7cb8, #2b4c7e); flex: none; }
.app-window__title { font-weight: 640; font-size: 0.9rem; letter-spacing: -0.01em; font-stretch: 105%; }
.app-window__crumb { font-size: 0.78rem; color: var(--muted); }
.app-window__crumb b { color: var(--ink); font-weight: 560; }
.app-window .flag-fictional { margin-left: auto; }
.app-window__tools { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.app-window__count { margin-left: auto; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.sp-grid { font-size: 0.86rem; }
.sp-row {
  display: grid; grid-template-columns: 0.85fr 1.5fr 0.9fr 1fr 0.8fr; align-items: center;
  height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--paper-2);
  gap: 12px;
}
.sp-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row--head { height: 38px; font-size: 0.74rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; background: var(--paper); }
.sp-row--head .num, .sp-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-body { position: relative; }
.sp-row .ref { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0; font-stretch: 87.5%; }
.sp-row--group { height: 32px; background: var(--paper); font-size: 0.72rem; font-weight: 600; color: var(--ink); grid-template-columns: 1fr; }
.sp-row--group span { display: flex; align-items: center; gap: 8px; }
.sp-row--group small { font-family: var(--mono); font-size: 0.6rem; color: var(--muted); font-weight: 400; }
.sp-cell-m { justify-self: end; padding: 3px 7px; border-radius: 5px; margin-right: -7px; transition: background-color 0.45s, color 0.45s, font-weight 0.45s; }
.sp-cell-m.is-hot { background: rgba(255, 90, 31, 0.78); color: var(--ink); font-weight: 700; }
.sp-due { position: relative; }
.sp-flash { animation: spFlash 1s var(--ease); }
@keyframes spFlash { 0% { background: var(--signal-soft); box-shadow: 0 0 0 3px var(--signal-soft); } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
.sp-row--head span.is-target, .sp-row span.is-target { box-shadow: inset 0 -2px 0 var(--signal); }

.st { display: inline-flex; align-items: center; gap: 7px; font-style: normal; font-size: 0.8rem; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); flex: none; }
.st--delayed::before { background: var(--signal); }
.st--transit::before { background: transparent; border: 1.5px solid var(--ink); width: 6px; height: 6px; }
.st--booked::before { background: transparent; border: 1.5px dashed var(--muted); width: 6px; height: 6px; }
.st--done::before { background: var(--ok); }

.inspector {
  position: absolute; left: clamp(-64px, -4vw, -24px); bottom: 0; width: min(310px, 78%); z-index: 3;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 14px 16px 12px;
  box-shadow: 0 30px 60px -24px rgba(20, 16, 10, 0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.js .inspector { opacity: 0; transform: translateY(24px) scale(0.98); transition: opacity 0.9s var(--ease) 0.6s, transform 1.2s var(--ease) 0.6s; }
.is-loaded .inspector { opacity: 1; transform: none; }
.inspector__head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--night-line); font-weight: 600; font-size: 0.86rem; }
.inspector__head .mark { color: var(--paper); }
.inspector__head .mark__knob { stroke: var(--ink); }
.inspector__state { margin-left: auto; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--night-muted); font-weight: 400; }
.inspector__state.is-dirty { color: var(--signal); }
.inspector__row { padding: 10px 0; border-bottom: 1px solid var(--night-line); display: grid; gap: 8px; }
.inspector__row--inline { grid-template-columns: 1fr auto; align-items: center; }
.inspector__label { font-size: 0.78rem; color: #d8d6ce; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.inspector__label code { font-size: 0.62rem; color: var(--night-muted); }
.inspector__input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--night-line-2); background: var(--night-2); color: var(--paper);
  font: 500 0.9rem/1 var(--sans); letter-spacing: -0.005em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inspector__input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.25); }
.inspector .switch { background: var(--night-3); border-color: var(--night-line-2); }
.inspector .switch span { background: var(--night-muted); border-color: transparent; }
.inspector .switch[aria-checked="true"] { background: var(--signal); border-color: var(--signal); }
.inspector .switch[aria-checked="true"] span { background: var(--ink); }
.inspector .segmented { background: var(--night-2); border-color: var(--night-line); }
.inspector .segmented button { color: var(--night-muted); }
.inspector .segmented button:hover { color: var(--paper); }
.inspector .segmented button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: none; }
.inspector__hint { font-size: 0.72rem; color: var(--night-muted); padding-top: 10px; display: flex; align-items: center; gap: 8px; }
.inspector__hint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(255, 90, 31, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); } }
.specimen .caption { padding-left: 2px; max-width: 46ch; }

/* ticker */
.ticker { position: relative; z-index: 1; margin-top: clamp(40px, 4vw, 64px); border-block: 1px solid var(--line); overflow: hidden; background: var(--paper); }
.ticker__track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker li {
  display: flex; align-items: center; gap: 12px; padding: 18px 28px; white-space: nowrap;
  font-size: 0.95rem; font-weight: 450; border-right: 1px solid var(--line);
}
.ticker li b { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--signal-text); font-weight: 600; font-stretch: 87.5%; }
.ticker li i { font-style: normal; color: var(--muted); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* =================================================================== */
/* 01 MODEL                                                             */
/* =================================================================== */
.model__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.model__head .h2 { grid-column: 1 / span 7; max-width: 15ch; }
.model__head .body-lg { grid-column: 8 / -1; }

.circuit {
  position: relative; margin-top: clamp(56px, 7vw, 110px);
  display: grid; grid-template-columns: 1.15fr 0.8fr 0.95fr 1.4fr; gap: clamp(28px, 5vw, 96px); align-items: center;
  padding: clamp(28px, 3.4vw, 48px) 0 clamp(120px, 12vw, 170px);
  border-top: 1px solid var(--line);
}
.circuit__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.circuit__wires path { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0.38; }
.circuit__wires path.is-code { stroke-dasharray: 4 5; opacity: 0.5; }
.circuit__wires .pulse { fill: var(--signal); }
.circuit__col { position: relative; z-index: 1; }
.circuit__head { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 16px; }
.circuit__head .mark { color: var(--ink); }
.circuit__list { display: grid; gap: 6px; }
.circuit__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper-2);
  font-size: 0.94rem; font-weight: 500; transition: border-color 0.3s, transform 0.4s var(--ease), background-color 0.3s;
}
.circuit__list li::after { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); }
.circuit__list li:hover { border-color: var(--ink); transform: translateX(4px); }
.circuit__list li.is-lit::after { background: var(--signal); border-color: var(--signal); }
.circuit__push {
  width: clamp(104px, 9vw, 136px); aspect-ratio: 1; border-radius: 50%; margin-inline: auto;
  display: grid; place-content: center; text-align: center; gap: 4px;
  background: var(--ink); color: var(--paper); box-shadow: 0 0 0 10px var(--paper), 0 0 0 11px var(--line-2);
}
.circuit__push .mono { font-size: 0.78rem; color: var(--signal); font-weight: 600; }
.circuit__push small { font-size: 0.68rem; color: var(--night-muted); line-height: 1.25; padding: 0 14px; }
.circuit__envs { display: grid; gap: 10px; }
.circuit__envs li {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--paper-2); font-weight: 560; font-size: 0.98rem;
}
.env-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); flex: none; }
.is-live .env-dot, .env-dot--live { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.mini-app { border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper-2); overflow: hidden; box-shadow: 0 24px 50px -30px rgba(40,32,20,0.4); }
.mini-app__bar { display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mini-app__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-3); }
.mini-app__bar span { margin-left: 8px; font-size: 0.7rem; font-weight: 600; }
.mini-app__body { display: grid; grid-template-columns: 0.32fr 1fr; min-height: 150px; }
.mini-app__nav { border-right: 1px solid var(--line); padding: 10px 8px; display: grid; gap: 7px; align-content: start; }
.mini-app__nav b, .mini-app__nav span { display: block; height: 6px; border-radius: 3px; background: var(--paper-3); }
.mini-app__nav b { background: var(--ink); opacity: 0.7; width: 70%; }
.mini-app__nav span { margin-left: 8px; }
.mini-app__main { padding: 10px; display: grid; gap: 6px; align-content: start; }
.mini-app__row { display: grid; grid-template-columns: 0.7fr 1.2fr 0.8fr 0.6fr; gap: 6px; }
.mini-app__row span { height: 12px; border-radius: 3px; background: var(--paper-3); }
.mini-app__row--head span { height: 7px; background: var(--ink); opacity: 0.35; }
.mini-app__row .hot { background: var(--signal); }
.circuit__note { margin-top: 10px; font-family: var(--mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--signal-text); }
.circuit__code {
  position: absolute; z-index: 1; right: 0; bottom: 0; width: min(420px, 38%);
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--paper);
}
.circuit__code .mono { padding: 4px 8px; border-radius: 6px; background: var(--ink); color: var(--paper); font-weight: 600; }
.circuit__code p { font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }

.ledger { display: grid; gap: var(--gap); margin-top: clamp(56px, 6vw, 96px); }
.ledger--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ledger__item { border-top: 1px solid var(--ink); padding-top: 18px; }
.ledger__n { color: var(--signal-text); font-weight: 600; margin-bottom: 26px; }
.ledger__item h3 { font-size: clamp(1.3rem, 1.8vw, 1.7rem); font-weight: 560; font-stretch: 108%; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 12px; }
.ledger__item p:last-child { color: var(--ink-2); max-width: 40ch; }

/* =================================================================== */
/* 02 STORY                                                             */
/* =================================================================== */
.story { padding-top: 0; }
.story__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.story__head .h2 { grid-column: 1 / span 7; }
.story__head .body-lg { grid-column: 8 / -1; }
.story__body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 96px); margin-top: clamp(48px, 6vw, 96px); }
.story__steps { counter-reset: step; padding-bottom: 4vh; }
.story__step:last-child { min-height: 62vh; }
.story + .controls { padding-top: clamp(64px, 8vw, 120px); }
.story__step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; max-width: 30rem; position: relative; }
.story__step h3, .story__step p:last-child, .story__num { transition: color 0.5s var(--ease); }
.story__step:not(.is-active) h3, .story__step:not(.is-active) p:last-child, .story__step:not(.is-active) .story__num { color: var(--muted); }
.story__step h3 { position: relative; }
.story__step h3::before { content: ""; position: absolute; left: calc(var(--gap) * -1); top: 0.08em; bottom: 0.08em; width: 3px; background: var(--signal); transform: scaleY(0); transform-origin: top; transition: transform 0.6s var(--ease); }
.story__step.is-active h3::before { transform: scaleY(1); }
.story__step:first-child { min-height: 58vh; justify-content: flex-start; padding-top: 12vh; }

.story__num { color: var(--signal-text); margin-bottom: 18px; font-weight: 600; }
.story__step h3 { font-size: clamp(1.7rem, 2.6vw, 2.5rem); line-height: 1.02; font-weight: 540; font-stretch: 108%; letter-spacing: -0.035em; margin-bottom: 16px; }
.story__step p:last-child { font-size: 1.05rem; color: var(--ink-2); max-width: 38ch; }
.story__sticky { position: sticky; top: calc(var(--head-h) + max(24px, (100vh - var(--head-h) - 620px) / 2)); align-self: start; }
.stage__dots { display: flex; gap: 6px; margin-top: 16px; }
.stage__dots li { height: 3px; flex: 1; background: var(--line-2); border-radius: 2px; overflow: hidden; position: relative; }
.stage__dots li::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
.stage__dots li.is-done::after, .stage__dots li.is-active::after { transform: scaleX(1); }
.stage__dots li.is-active::after { background: var(--signal); }

.stage {
  position: relative; height: 580px; border-radius: 18px;
  background: var(--paper-2); border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -50px rgba(40, 32, 20, 0.45);
  overflow: hidden;
  background-image: radial-gradient(circle at 1px 1px, rgba(20,20,18,0.12) 1px, transparent 0);
  background-size: 22px 22px;
}
.stage__canvas { position: absolute; inset: 0; container-type: inline-size; }
.stage__flag { position: absolute; right: 18px; top: 16px; z-index: 4; color: var(--signal-text); font-size: 0.56rem; }
.layer {
  position: absolute; inset: 0; padding: 52px clamp(18px, 3.4%, 32px) 28px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(0.99);
  transition: opacity 0.55s var(--ease), transform 0.8s var(--ease), visibility 0s linear 0.8s;
}
.stage[data-state="entity"] [data-layer="entity"],
.stage[data-state="fields"] [data-layer="fields"],
.stage[data-state="grid"] [data-layer="grid"],
.stage[data-state="form"] [data-layer="form"],
.stage[data-state="page"] [data-layer="page"] {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0.12s, 0.12s, 0s;
}
.layer > :first-child { margin-top: auto; }
.layer > :last-child { margin-bottom: auto; }
.slot { display: block; height: 32px; min-width: 20px; font-style: normal; }
.slot--hidden { position: absolute; left: 50%; top: 60%; width: 0 !important; height: 0 !important; }

/* tokens */
.tokens { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.tok {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper);
  font-size: 0.9rem; font-weight: 560; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
  transition:
    transform 0.9s var(--ease), width 0.9s var(--ease), height 0.9s var(--ease),
    font-size 0.6s var(--ease), padding 0.6s var(--ease), background-color 0.5s, border-color 0.5s, color 0.5s, opacity 0.5s, border-radius 0.6s;
  transition-delay: calc(var(--i, 0) * 28ms);
  will-change: transform;
}
.tok--calc::after { content: "ƒ"; margin-left: auto; padding-left: 8px; font-style: italic; color: var(--signal-text); font-weight: 500; }
.tok.is-gone { opacity: 0; }
.stage[data-state="fields"] .tok { font-size: 0.82rem; padding: 0 10px; background: transparent; border-color: transparent; }
.stage[data-state="fields"] .tok[data-tok="status"], .stage[data-state="fields"] .tok[data-tok="margin"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stage[data-state="fields"] .tok--calc::after { color: var(--signal); }
.stage[data-state="grid"] .tok { font-size: 0.72rem; font-weight: 640; padding: 0 8px; background: transparent; border-color: transparent; border-radius: 0; color: var(--ink); }
.stage[data-state="grid"] .tok[data-tok="margin"] { background: var(--signal-soft); box-shadow: inset 0 -2px 0 var(--signal); }
.stage[data-state="grid"] .tok--calc::after, .stage[data-state="page"] .tok--calc::after { display: none; }
.stage[data-state="grid"] .tok[data-tok="revenue"], .stage[data-state="grid"] .tok[data-tok="cost"], .stage[data-state="grid"] .tok[data-tok="margin"] { justify-content: flex-end; }
.stage[data-state="form"] .tok { font-size: 0.74rem; font-weight: 560; padding: 0; background: transparent; border-color: transparent; color: var(--ink-2); }
.tok[data-req]::after { content: "*"; margin-left: 3px; color: var(--signal-text); opacity: 0; transition: opacity 0.4s; }
.stage[data-state="form"] .tok[data-req]::after { opacity: 1; }
.stage[data-state="page"] .tok { font-size: 0.62rem; font-weight: 640; padding: 0 6px; background: transparent; border-color: transparent; color: var(--ink); border-radius: 0; }

/* layer: entity */
.ent-card { max-width: 560px; margin: 8px auto 0; background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px 12px; box-shadow: 0 18px 40px -30px rgba(40,32,20,0.4); }
.ent-card__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.ent-card__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.ent-card__name { font-size: 1.35rem; font-weight: 600; font-stretch: 108%; letter-spacing: -0.03em; line-height: 1; }
.ent-card__meta { color: var(--muted); font-size: 0.56rem; margin-top: 4px; }
.ent-card__meta code { text-transform: none; font-size: 0.62rem; color: var(--ink-2); }
.ent-card__head .chip { margin-left: auto; font-size: 0.56rem; height: 24px; }
.ent-fields li { display: grid; grid-template-columns: minmax(0, 200px) 1fr auto; align-items: center; gap: 14px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ent-fields li:last-child { border-bottom: 0; }
.ent-fields .slot { height: 34px; }
.ent-fields .mono { color: var(--muted); font-size: 0.6rem; text-transform: none; letter-spacing: 0; }
.ent-fields .req, .ent-fields .inh, .ent-fields .ovr, .ent-fields .calc { font-family: var(--mono); font-size: 0.54rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 7px; border-radius: 4px; }
.ent-fields .req { background: var(--ink); color: var(--paper); }
.ent-fields .inh { color: var(--muted); border: 1px solid var(--line-2); }
.ent-fields .ovr { color: var(--ink); border: 1px solid var(--ink); }
.ent-fields .calc { background: var(--signal); color: var(--ink); }

/* layer: fields */
.layer--fields { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 20px; align-content: center; }
.fld-list { display: grid; gap: 6px; align-content: start; padding-top: 6px; }
.fld-list li { position: relative; }
.fld-list .slot { height: 34px; }
.fld-props { display: grid; gap: 14px; align-content: start; }
.prop-card { background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; }
.prop-card--calc { border-color: var(--ink); box-shadow: 4px 4px 0 var(--signal); }
.prop-card__title { font-weight: 600; font-size: 1rem; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.prop-card__title .mono { text-transform: none; font-size: 0.62rem; color: var(--muted); }
.prop-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.prop-card dl > div { display: grid; gap: 2px; }
.prop-card dl > div.wide { grid-column: 1 / -1; }
.prop-card dt { font-size: 0.66rem; color: var(--muted); }
.prop-card dd { font-size: 0.82rem; font-weight: 500; }
.prop-card code { font-size: 0.66rem; background: var(--paper-3); padding: 3px 6px; border-radius: 4px; display: inline-block; line-height: 1.5; word-break: break-word; }

/* layer: grid */
.layer--grid { padding-top: 56px; }
.g { background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; font-size: 0.74rem; }
.g__groups, .g__head, .g__row { display: grid; grid-template-columns: 0.9fr 1.5fr 0.9fr 0.8fr 1fr 0.95fr 0.95fr 0.85fr; }
.g__groups span { grid-column: span var(--span); padding: 6px 8px; font-family: var(--mono); font-size: 0.54rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.g__head { border-bottom: 1px solid var(--line-2); background: var(--paper-2); }
.g__head .slot { height: 36px; border-right: 1px solid var(--line); }
.g__row { border-bottom: 1px solid var(--line); }
.g__row:last-child { border-bottom: 0; }
.g__row > span { padding: 0 8px; height: 42px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.g__row > span:first-child { font-family: var(--mono); font-size: 0.62rem; }
.g__row .num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.g__row .hot { background: rgba(255, 90, 31, 0.78); font-weight: 700; }
.g__row .st { font-size: 0.72rem; }
.g__note { display: flex; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 0.56rem; }
.g__note span { padding: 5px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper); position: relative; }
.g__note span::before { content: ""; position: absolute; right: 36px; top: -13px; width: 1px; height: 12px; background: var(--ink); opacity: 0.4; }

/* layer: form */
.frm { max-width: 600px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px 20px 8px; box-shadow: 0 18px 40px -30px rgba(40,32,20,0.4); }
.frm__title { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.frm__title .mono { color: var(--muted); font-size: 0.56rem; font-weight: 400; }
.frm__sec { border: 0; margin: 0; padding: 10px 0 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; border-bottom: 1px dashed var(--line); }
.frm__sec:last-child { border-bottom: 0; }
.frm__sec legend { float: left; width: 100%; grid-column: 1 / -1; color: var(--signal-text); font-size: 0.56rem; padding: 0 0 2px; font-weight: 600; }
.frm__f { display: grid; gap: 4px; align-content: start; position: relative; }
.frm__f .slot, .frm__f .lbl { height: 20px; width: 100%; }
.frm__f .lbl { font-size: 0.74rem; font-weight: 560; color: var(--ink-2); display: flex; align-items: center; }
.inp {
  --ih: 34px; display: block; height: var(--ih); line-height: calc(var(--ih) - 2px); padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--paper-2);
  font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
}
.inp--select { padding-right: 26px; }
.inp--select::after { content: ""; position: absolute; right: 10px; top: calc(50% - 5px); width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.inp--hot { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.inp--calc { background: var(--paper-3); color: var(--ink-2); border-style: dashed; }
.inp--area { height: 34px; }
.frm__f--cond { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.frm__f--cond .cond { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 0.54rem; background: var(--ink); color: var(--paper); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.stage:not(.is-cond) .frm__f--cond { opacity: 0; transform: translateY(6px); }
.stage:not(.is-cond) [data-form-status] { border-color: var(--line-2); box-shadow: none; }

/* layer: page */
.pg { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.pg__menu { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 14px 10px 18px; }
.pg__menu .mono { color: var(--night-muted); padding: 0 8px 10px; font-size: 0.56rem; }
.pg__menu li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-size: 0.8rem; color: #d8d6ce; }
.pg__menu li .ico { width: 15px; height: 15px; }
.pg__menu .grp { font-weight: 600; color: var(--paper); margin-top: 6px; }
.pg__menu .sub { padding-left: 22px; }
.pg__menu .is-on { background: var(--paper); color: var(--ink); font-weight: 600; }
.pg__menu .ord { margin-left: auto; font-size: 0.56rem; opacity: 0.6; }
.pg__main { display: grid; gap: 12px; align-content: start; }
.pg__settings { background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; }
.pg__name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pg__name .mono { text-transform: none; color: var(--muted); font-size: 0.62rem; }
.pg__settings dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.pg__settings dt { font-size: 0.64rem; color: var(--muted); }
.pg__settings dd { font-size: 0.8rem; font-weight: 500; }
.pg__features { display: flex; flex-wrap: wrap; gap: 5px; }
.pg__features .chip { height: 22px; font-size: 0.64rem; padding: 0 8px; }
.pg__preview { position: relative; background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.pg__head { display: grid; grid-template-columns: 1fr 1.4fr 1fr 0.8fr; border-bottom: 1px solid var(--line-2); background: var(--paper-2); }
.pg__head .slot { height: 28px; }
.pg__bars { display: grid; gap: 8px; padding: 10px; }
.pg__bars span { height: 10px; border-radius: 3px; background: var(--paper-3); }
.pg__bars span:nth-child(2) { width: 86%; }
.pg__bars span:nth-child(3) { width: 72%; }

@container (max-width: 620px) {
  .layer { padding: 46px 14px 16px; }
  .ent-fields li { grid-template-columns: minmax(0, 150px) 1fr auto; gap: 8px; }
  .ent-card { padding: 14px 14px 8px; }
  .ent-card__head .chip { margin-left: 0; }
  .ent-fields .slot { height: 29px; }
  .ent-fields .mono { font-size: 0.54rem; }
  .layer--fields { grid-template-columns: 1fr; gap: 10px; }
  .fld-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .fld-list .slot { height: 28px; }
  .prop-card { padding: 10px 12px; }
  .prop-card dl { gap: 6px 10px; }
  .prop-card:first-child dl > div:nth-child(4) { display: none; }
  .g__groups, .g__head, .g__row { grid-template-columns: 1fr 1.1fr 0.9fr; }
  .g__groups { display: none; }
  .g__head .slot[data-slot="customer"], .g__head .slot[data-slot="carrier"], .g__head .slot[data-slot="due"], .g__head .slot[data-slot="revenue"], .g__head .slot[data-slot="cost"] { position: absolute; width: 0; height: 0; overflow: hidden; left: 50%; top: 50%; }
  .g__row > span:nth-child(2), .g__row > span:nth-child(4), .g__row > span:nth-child(5), .g__row > span:nth-child(6), .g__row > span:nth-child(7) { display: none; }
  .frm { padding: 12px 14px 4px; }
  .frm__sec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frm__sec .frm__f:nth-child(4) { grid-column: 1 / -1; }
  .inp { --ih: 28px; font-size: 0.72rem; }
  .frm__f--cond .cond { display: none; }
  .pg { grid-template-columns: 1fr; gap: 10px; }
  .pg__menu { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-radius: 10px; }
  .pg__menu .mono { display: none; }
  .pg__menu ul { display: flex; flex-wrap: wrap; gap: 2px; }
  .pg__menu li { padding: 5px 8px; font-size: 0.72rem; margin: 0; }
  .pg__menu .sub { padding-left: 8px; }
  .pg__menu li:nth-child(n+4) { display: none; }
  .pg__menu .ord { display: none; }
  .pg__settings dl { gap: 5px 10px; }
}
@container (max-width: 400px) {
  .layer { padding: 40px 12px 12px; }
  .stage__flag { right: 12px; top: 13px; }
  .fld-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fld-list .slot { height: 26px; }
  .prop-card:first-child { display: none; }
  .ent-card { padding: 10px 12px 6px; }
  .ent-card__head { padding-bottom: 8px; margin-bottom: 4px; gap: 8px; }
  .ent-card__icon { width: 30px; height: 30px; border-radius: 8px; }
  .ent-card__name { font-size: 1.1rem; }
  .ent-card__head .chip { height: 20px; font-size: 0.5rem; }
  .ent-fields li { grid-template-columns: minmax(0, 132px) 1fr; padding: 2px 0; }
  .ent-fields .slot { height: 25px; }
  .ent-fields li > span:last-child { display: none; }
  .g__row:nth-child(n+8) { display: none; }
  .g__row > span { height: 36px; }
  .frm { padding: 10px 12px 4px; }
  .frm__title { padding-bottom: 6px; font-size: 0.95rem; }
  .frm__sec { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; padding: 6px 0 6px; }
  .frm__sec .frm__f:nth-child(4) { grid-column: auto; }
  .frm__sec .frm__f--cond { grid-column: 1 / -1; }
  .frm__f .slot, .frm__f .lbl { height: 18px; }
  .inp { --ih: 26px; font-size: 0.66rem; padding: 0 6px; }
  .inp--select { padding-right: 18px; }
  .inp--select::after { right: 7px; top: calc(50% - 4px); width: 5px; height: 5px; }
  .stage[data-state="form"] .tok { font-size: 0.66rem; }
}

/* =================================================================== */
/* 03 CONTROLS                                                          */
/* =================================================================== */
.controls__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.controls__head .h2 { grid-column: 1 / span 7; }
.controls__head .body-lg { grid-column: 8 / -1; }
.controls__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 96px); margin-top: clamp(48px, 6vw, 96px); align-items: start; }
.index { position: relative; border-top: 1px solid var(--ink); }
.index__item {
  position: relative; width: 100%; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto 0fr; column-gap: 8px;
  padding: 16px 0 16px 0; border: 0; border-bottom: 1px solid var(--line-2); background: transparent;
  transition: grid-template-rows 0.6s var(--ease), padding 0.5s var(--ease);
}
.index__n { padding-top: 0.9em; color: var(--muted); transition: color 0.3s; }
.index__name {
  font-size: clamp(1.6rem, 2.9vw, 2.9rem); line-height: 1.02; font-weight: 500; font-stretch: 108%; letter-spacing: -0.04em;
  color: var(--ink); opacity: 0.58; transition: opacity 0.35s, transform 0.6s var(--ease); transform-origin: left;
}
.index__desc { grid-column: 2; overflow: hidden; font-size: 0.98rem; color: var(--ink-2); max-width: 36ch; min-height: 0; }
.index__item:hover .index__name { opacity: 0.82; }
.index__item[aria-selected="true"] { grid-template-rows: auto 1fr; padding-bottom: 22px; }
.index__item[aria-selected="true"] .index__name { opacity: 1; }
.index__item[aria-selected="true"] .index__n { color: var(--signal-text); font-weight: 600; }
.index__item[aria-selected="true"] .index__desc { padding-top: 10px; }
.index__item::before {
  content: ""; position: absolute; left: -1px; top: 22px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--signal); border: 1.5px solid var(--ink); transform: scale(0); transition: transform 0.5s var(--spring);
}
.index__item[aria-selected="true"]::before { transform: scale(1); }
.index__item .index__n { padding-left: 20px; }

.viewer {
  position: sticky; top: calc(var(--head-h) + 32px);
  min-height: 520px; display: flex; flex-direction: column; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line-2);
  padding: clamp(20px, 2.6vw, 36px); padding-top: 52px;
  box-shadow: 0 40px 80px -50px rgba(40, 32, 20, 0.45);
}
.viewer__flag { position: absolute; top: 18px; left: clamp(20px, 2.6vw, 36px); color: var(--signal-text); font-size: 0.56rem; }
.viewer__desc { display: none; }
.panel { outline: none; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.panel:focus-visible { outline: 2px solid var(--signal); outline-offset: 8px; border-radius: 8px; }
.panel[hidden] { display: none; }
.panel.is-entering { animation: panelIn 0.7s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

.spec { display: grid; border-top: 1px solid var(--line-2); }
.spec > div { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.spec dt { color: var(--muted); }
.spec dd { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.spec code { background: var(--paper-3); padding: 2px 6px; border-radius: 4px; }
.spec--tight > div { padding: 8px 0; }

.v-columns { display: grid; grid-template-columns: 1fr 0.9fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.v-columns__grid { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--paper); font-size: 0.82rem; }
.vc-head, .vc-row { display: grid; grid-template-columns: 0.9fr 1.3fr var(--vc-w, 0.8fr); transition: grid-template-columns 1.2s var(--ease-io); }
.vc-head { background: var(--paper-2); font-size: 0.72rem; font-weight: 640; border-bottom: 1px solid var(--line-2); }
.vc-head span, .vc-row span { padding: 0 12px; height: 42px; display: flex; align-items: center; border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vc-row span:nth-child(2) { display: block; line-height: 42px; }
.vc-row { border-bottom: 1px solid var(--line); }
.vc-row:last-child { border-bottom: 0; }
.vc-row span:first-child { font-family: var(--mono); font-size: 0.64rem; }
.vc-target { position: relative; justify-content: flex-end; background: var(--signal-soft); }
.vc-head .vc-target { box-shadow: inset 0 -2px 0 var(--signal); justify-content: space-between; }
.vc-row .hot { background: rgba(255, 90, 31, 0.78); font-weight: 700; }
.vc-handle { width: 3px; height: 18px; border-radius: 2px; background: var(--ink); margin-left: 8px; cursor: col-resize; }
.v-columns.is-wide { --vc-w: 1.3fr; }

.v-form { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.v-form__card { border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); padding: 14px 16px 16px; }
.v-form__sec { color: var(--signal-text); font-size: 0.56rem; margin: 6px 0 8px; font-weight: 600; }
.v-form__sec:not(:first-child) { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.v-form__f { display: grid; gap: 6px; margin-bottom: 10px; font-size: 0.78rem; font-weight: 560; }
.v-form__f b { color: var(--signal-text); }
.v-form__f--cond { display: grid; grid-template-rows: 0fr; margin-bottom: 0; opacity: 0; transition: grid-template-rows 0.6s var(--ease), opacity 0.4s, margin 0.6s var(--ease); }
.v-form__f--cond > * { min-height: 0; overflow: hidden; }
.v-form__f--cond > span:first-child { display: block; }
.v-form.is-delayed .v-form__f--cond { grid-template-rows: auto; opacity: 1; margin-bottom: 10px; }
.v-form.is-delayed [data-vform-status] { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.v-form__rules { display: grid; gap: 0; }
.rule-line { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; display: grid; gap: 4px; color: var(--ink-2); }
.rule-line code { white-space: nowrap; }
.rule-line .mono { color: var(--muted); font-size: 0.56rem; }
.rule-line code { font-size: 0.72rem; background: var(--paper-3); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.rule-line--hot .mono { color: var(--signal-text); }
.v-form__rules .btn { justify-self: start; margin-top: 16px; }

.v-menu { display: grid; grid-template-columns: 1fr 0.95fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.v-menu__tree { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px; display: grid; gap: 2px; position: relative; }
.v-menu__tree li { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 0.88rem; color: #d8d6ce; transition: transform 0.8s var(--ease), background-color 0.3s; }
.v-menu__tree .grp { color: var(--paper); font-weight: 600; }
.v-menu__tree .sub { padding-left: 14px; }
.v-menu__tree .grip { width: 14px; height: 14px; opacity: 0.4; fill: currentColor; stroke: none; }
.v-menu__tree .mono { margin-left: auto; font-size: 0.56rem; opacity: 0.55; }
.v-menu__tree [data-vmenu-item="carriers"] { background: var(--night-3); box-shadow: inset 2px 0 0 var(--signal); }
.v-menu__side .btn { margin-top: 16px; }

.v-filters { display: grid; gap: 14px; }
.v-filters__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v-filters__bar > .mono { width: 120px; color: var(--muted); font-size: 0.56rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill--view { background: var(--paper); color: var(--ink); font-weight: 500; }
.v-filters__rows { border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); overflow: hidden; min-height: 200px; }
.v-filters__rows li { display: grid; grid-template-columns: 0.8fr 1.4fr 1fr 0.6fr; gap: 10px; align-items: center; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 0.82rem; animation: rowIn 0.5s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.v-filters__rows li:last-child { border-bottom: 0; }
.v-filters__rows li span:first-child { font-family: var(--mono); font-size: 0.64rem; }
.v-filters__rows li .num { text-align: right; font-variant-numeric: tabular-nums; }
.v-filters__rows li .hot { background: rgba(255, 90, 31, 0.78); font-weight: 700; padding: 2px 6px; border-radius: 4px; justify-self: end; }
.v-filters__rows .count { display: flex; justify-content: space-between; background: var(--paper-2); height: 34px; font-family: var(--mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); grid-template-columns: none; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.v-filters__note { font-size: 0.88rem; color: var(--ink-2); max-width: 52ch; }

.v-access { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.matrix { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: var(--paper); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.matrix th, .matrix td { padding: 12px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.matrix thead th { font-size: 0.74rem; font-weight: 640; background: var(--paper-2); }
.matrix thead th .mono { color: var(--muted); font-size: 0.56rem; font-weight: 400; }
.matrix tbody th { font-weight: 560; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.dot-on, .dot-off { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; }
.dot-on::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); }
.dot-off { color: var(--muted); }
.dot-off::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2); box-sizing: border-box; }
.matrix td { transition: background-color 0.3s; }
.matrix tbody tr:hover { background: var(--paper-2); }
.v-access__areas > .mono { color: var(--muted); font-size: 0.56rem; margin-bottom: 8px; }
.v-access__areas li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.v-access__areas li.off { color: var(--muted); }
.v-access__areas .ico { width: 16px; height: 16px; }
.v-access__areas li:not(.off) .ico { color: var(--signal-text); }
.v-access__note { margin-top: 14px; font-size: 0.86rem; color: var(--ink-2); }

.v-brand { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.v-brand__browser { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--paper-3); }
.v-brand__tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.v-brand__tab { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 8px 8px 0 0; background: var(--paper-2); font-size: 0.78rem; width: 58%; }
.v-brand__tab b { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-brand__tab--ghost { background: transparent; width: 26%; border: 1px solid var(--line); border-bottom: 0; }
.v-brand__app { background: var(--paper-2); }
.v-brand__header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.v-brand__header b { font-weight: 640; letter-spacing: -0.02em; transition: opacity 0.3s; }
.v-brand__header span { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-3); }
.v-brand__body { display: grid; grid-template-columns: 0.36fr 1fr; min-height: 190px; }
.v-brand__nav { padding: 16px 12px; border-right: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.v-brand__nav span { height: 8px; border-radius: 3px; background: var(--paper-3); }
.v-brand__nav span:first-child { background: var(--c-brand); opacity: 0.35; transition: background-color 0.5s; }
.v-brand__lines { padding: 16px; display: grid; gap: 10px; align-content: start; }
.v-brand__lines span { height: 12px; border-radius: 3px; background: var(--paper-3); }
.v-brand__lines span:nth-child(1) { width: 40%; height: 16px; background: var(--c-brand); opacity: 0.85; transition: background-color 0.5s; }
.v-brand__lines span:nth-child(3) { width: 86%; }
.v-brand__lines span:nth-child(4) { width: 64%; }
.v-brand__lines span:nth-child(5) { width: 78%; }
.v-brand__lines span:nth-child(6) { width: 52%; }
.v-brand .file { font-family: var(--mono); font-size: 0.68rem; font-stretch: 87.5%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.v-brand .spec dd { min-width: 0; }
.fav, .logo, .sw { display: inline-block; flex: none; transition: all 0.5s var(--ease); }
.v-brand { --c-brand: #2b4c7e; }
.v-brand[data-brand="b"] { --c-brand: #2f7a64; }
.fav { width: 14px; height: 14px; border-radius: 4px; background: var(--c-brand); }
.logo { width: 26px; height: 26px; border-radius: 7px; background: conic-gradient(from 200deg, var(--c-brand), color-mix(in srgb, var(--c-brand) 55%, white), var(--c-brand)); }
.v-brand[data-brand="b"] .fav, .v-brand[data-brand="b"] .logo { border-radius: 50%; }
.sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c-brand); }
.v-brand[data-brand="b"] .sw { border-radius: 50%; }
.v-brand__side .segmented { margin-top: 16px; }
.v-brand__note { margin-top: 12px; font-size: 0.86rem; color: var(--ink-2); }
.v-brand.is-swapping [data-brand-title], .v-brand.is-swapping [data-brand-title2] { opacity: 0; }

.v-features { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.v-features .mono { color: var(--muted); font-size: 0.56rem; margin-bottom: 8px; }
.toggles li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.avail { display: flex; flex-wrap: wrap; gap: 6px; }
.avail li { padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line-2); font-size: 0.82rem; color: var(--muted); }
.avail li.on { border: 1px solid var(--ink); color: var(--ink); background: var(--paper); }
.v-features__note { margin-top: 16px; font-size: 0.86rem; color: var(--ink-2); }

/* =================================================================== */
/* 04 DENSE (night)                                                     */
/* =================================================================== */
.theme-night { background: var(--night); color: var(--paper); }
.dense { border-radius: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px) 0 0; margin-top: 0; }
.dense__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.dense__head .h2 { grid-column: 1 / span 8; }
.dense__head .body-lg { grid-column: 9 / -1; }
.lab { margin-top: clamp(48px, 6vw, 96px); }
.lab__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 16px; }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--night-line-2); background: transparent; color: var(--paper); cursor: pointer; font-size: 0.86rem; font-weight: 500;
  transition: background-color 0.25s, border-color 0.25s;
}
.toggle:hover { border-color: var(--paper); }
.toggle__box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--night-muted); position: relative; transition: background-color 0.25s, border-color 0.25s; }
.toggle__box::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.35s var(--spring); }
.toggle[aria-pressed="true"] .toggle__box { background: var(--signal); border-color: var(--signal); }
.toggle[aria-pressed="true"] .toggle__box::after { transform: rotate(45deg) scale(1); }
.lab__group { display: inline-flex; align-items: center; gap: 10px; }
.lab__group > .mono { color: var(--night-muted); font-size: 0.6rem; }
.segmented--night { background: var(--night-2); border-color: var(--night-line); }
.segmented--night button { color: var(--night-muted); }
.segmented--night button:hover { color: var(--paper); }
.segmented--night button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: none; }
.lab__flag { margin-left: auto; color: var(--signal); font-size: 0.56rem; display: inline-flex; align-items: center; gap: 6px; }
.lab__flag::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; transform: rotate(45deg); }

.lab__frame { position: relative; border: 1px solid var(--night-line-2); border-radius: 16px; background: var(--night-2); overflow: hidden; }
.lab__scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--night-3) transparent; }
.lab__scroll:focus-visible { outline-offset: -2px; }
.lab__table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.lab__table th, .lab__table td { padding: 0 16px; height: 46px; text-align: left; border-bottom: 1px solid var(--night-line); white-space: nowrap; }
.lab__table thead th { height: 40px; font-size: 0.76rem; font-weight: 600; color: var(--night-muted); letter-spacing: 0.005em; background: var(--night-2); }
.lab__groups th { height: 30px !important; font-family: var(--mono); font-size: 0.56rem !important; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 450 !important; border-right: 1px solid var(--night-line); color: var(--night-muted) !important; }
.lab__groups th:last-child { border-right: 0; }
.lab__table .num { text-align: right; }
.lab__table tbody tr { transition: background-color 0.2s; }
.lab__table tbody tr:not(.grp):hover { background: rgba(255,255,255,0.035); }
.lab__table tbody tr.is-open { background: rgba(255, 90, 31, 0.08); }
.lab__table td.cust { color: #d8d6ce; }
.lab__table td.lane { color: var(--night-muted); font-size: 0.84rem; }
.ref-btn {
  border: 0; background: transparent; padding: 3px 8px; margin-left: -8px; border-radius: 6px; cursor: pointer;
  font-family: var(--mono); font-size: 0.76rem; font-stretch: 87.5%; color: var(--paper); text-decoration: underline; text-decoration-color: var(--night-line-2); text-underline-offset: 4px;
  transition: background-color 0.2s, color 0.3s;
}
.ref-btn:hover { background: var(--night-3); text-decoration-color: currentColor; }
.cf-ref .ref-btn { color: var(--signal); font-weight: 700; background: #141412; }
.cf-fill { position: relative; }
.cf-fill > span { display: inline-block; padding: 4px 8px; margin: -4px -8px; border-radius: 6px; transition: background-color 0.5s, color 0.5s; }
.cf-fill.cf-on > span { background: var(--signal); color: var(--ink); font-weight: 700; }
.lab__table .st { color: #d8d6ce; font-size: 0.86rem; }
.lab__table .st--transit::before { border-color: var(--paper); }
.lab__table .st--booked::before { border-color: var(--night-muted); }
.lab__table .st--done::before { background: #7fae79; }
.lab__table tr.grp td {
  height: 38px; background: var(--night); color: var(--paper); font-weight: 600; font-size: 0.84rem;
  border-bottom-color: var(--night-line-2);
}
.grp__inner { display: flex; align-items: center; gap: 14px; }
.grp__inner .mono { color: var(--night-muted); font-size: 0.58rem; font-weight: 400; }
.grp__inner .grp__sum { margin-left: auto; font-family: var(--sans); font-size: 0.8rem; color: var(--night-muted); font-weight: 450; }
.grp__inner .grp__sum b { color: var(--paper); font-weight: 600; }
.lab__table.no-formula .col-margin, .lab__table.no-formula td.cell-margin { display: none; }
.lab__table tbody tr.row-enter { animation: labRow 0.6s var(--ease) both; animation-delay: calc(var(--i) * 22ms); }
@keyframes labRow { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 4;
  background: #201f1d; border-left: 1px solid var(--night-line-2);
  padding: 18px 20px; overflow-y: auto;
  box-shadow: -30px 0 60px -30px rgba(0,0,0,0.6);
  transform: translateX(0); transition: transform 0.55s var(--ease), opacity 0.4s;
}
.drawer[hidden] { display: block; transform: translateX(104%); opacity: 0; visibility: hidden; transition: transform 0.45s var(--ease), opacity 0.3s, visibility 0s linear 0.45s; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; color: var(--night-muted); }
.drawer__head .mono { font-size: 0.56rem; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--night-line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--paper); }
.icon-btn:hover { border-color: var(--paper); }
.drawer__title { font-family: var(--mono); font-weight: 600; font-size: 1.3rem; font-stretch: 87.5%; margin: 10px 0 14px; letter-spacing: -0.01em; }
.drawer__fields { display: grid; border-top: 1px solid var(--night-line); }
.drawer__fields > div { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--night-line); font-size: 0.86rem; }
.drawer__fields dt { color: var(--night-muted); }
.drawer__fields dd.hot { color: var(--signal); font-weight: 700; }
.drawer__sub { margin: 22px 0 10px; color: var(--night-muted); font-size: 0.56rem; }
.drawer__log { display: grid; gap: 0; position: relative; }
.drawer__log li { position: relative; padding: 0 0 16px 20px; font-size: 0.84rem; color: #d8d6ce; }
.drawer__log li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--night); border: 1.5px solid var(--signal); }
.drawer__log li::after { content: ""; position: absolute; left: 6.5px; top: 16px; bottom: 0; width: 1px; background: var(--night-line-2); }
.drawer__log li:last-child::after { display: none; }
.drawer__log b { color: var(--paper); font-weight: 600; }
.drawer__log s { color: var(--night-muted); text-decoration-thickness: 1px; }
.drawer__log small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--night-muted); }

.lab__legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: 22px; }
.rule-card { border-top: 2px solid var(--signal); padding-top: 14px; display: grid; gap: 6px; align-content: start; transition: opacity 0.4s; }
.rule-card p { font-size: 0.9rem; color: #d8d6ce; }
.rule-card .rule-card__k { color: var(--signal); font-size: 0.58rem; }
.rule-card > code { font-size: 0.66rem; line-height: 1.6; color: var(--paper); background: var(--night-2); border: 1px solid var(--night-line); padding: 6px 8px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; }
.rule-card code.inline { font-size: 0.8rem; background: none; padding: 0; color: var(--paper); }
.rule-card--formula { border-top-color: var(--paper); }
.rule-card--formula .rule-card__k { color: var(--paper) !important; }
.lab.rules-off .rule-card:not(.rule-card--formula), .lab.formula-off .rule-card--formula, .lab.formula-off .rule-card[data-rule="margin"] { opacity: 0.3; }

.capabilities { margin-top: clamp(80px, 10vw, 150px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px; }
.capabilities__lead { grid-column: 1 / span 4; font-size: clamp(1.3rem, 1.9vw, 1.8rem); line-height: 1.2; letter-spacing: -0.025em; font-weight: 500; font-stretch: 105%; }
.capabilities__list { grid-column: 6 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gap); }
.capabilities__list > div { padding: 18px 0 22px; border-top: 1px solid var(--night-line-2); }
.capabilities__list dt { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.capabilities__list dt::before { content: ""; width: 8px; height: 8px; background: var(--signal); border-radius: 2px; }
.capabilities__list dd { color: var(--night-muted); max-width: 32ch; }

/* =================================================================== */
/* 05 PUBLISH                                                           */
/* =================================================================== */
.publish { background: var(--paper); }
.publish__title { max-width: 13ch; }
.publish__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 96px); margin-top: clamp(48px, 6vw, 96px); align-items: start; }
.flow { display: grid; }
.flow li { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 2vw, 28px); padding: 22px 0; border-top: 1px solid var(--line-2); }
.flow li:last-child { border-bottom: 1px solid var(--line-2); }
.flow__n { font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 0.9; font-weight: 400; font-stretch: 90%; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px var(--ink); min-width: 2.2ch; }
.flow li:last-child .flow__n { color: var(--signal); -webkit-text-stroke: 1px var(--signal); }
.flow h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 6px; }
.flow p { color: var(--ink-2); max-width: 40ch; }

.pushlog { position: sticky; top: calc(var(--head-h) + 32px); border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line-2); padding: clamp(18px, 2.2vw, 28px); box-shadow: 0 40px 80px -50px rgba(40, 32, 20, 0.45); }
.pushlog__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pushlog__head > .mono { font-weight: 600; }
.pushlog__env { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 560; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.pushlog__now { margin: 16px 0; padding: 16px; border-radius: 12px; background: var(--ink); color: var(--paper); }
.pushlog__now > .mono { color: var(--night-muted); font-size: 0.56rem; }
.pushlog__version { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.02em; margin: 4px 0 12px; }
.pushlog__version b { font-family: var(--mono); color: var(--signal); font-weight: 600; font-stretch: 87.5%; }
.pushlog__fields { display: flex; flex-wrap: wrap; gap: 6px; }
.pushlog__fields li { padding: 4px 9px; border-radius: 6px; font-size: 0.76rem; border: 1px solid var(--night-line-2); color: #d8d6ce; transition: opacity 0.5s, transform 0.5s var(--ease), background-color 0.4s, color 0.4s; }
.pushlog__fields li.is-rule { border-style: dashed; }
.pushlog__fields li.is-new { background: var(--signal); color: var(--ink); border-color: var(--signal); animation: chipIn 0.6s var(--spring); }
.pushlog__fields li.is-leaving { text-decoration: line-through; opacity: 0.45; border-style: dashed; }
@keyframes chipIn { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pushlog__list { display: grid; }
.pushlog__hint { color: var(--muted); font-size: 0.56rem; padding: 0 10px 8px; }
.btn[hidden] { display: none; }
.pl-row {
  width: 100%; display: grid; grid-template-columns: 58px 1fr auto; gap: 4px 14px; align-items: center; text-align: left; cursor: pointer;
  padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0;
  transition: background-color 0.25s;
}
.pl-row:hover:not(:disabled) { background: var(--paper); }
.pl-row:disabled { cursor: default; }
.pl-row__id { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; font-stretch: 87.5%; grid-row: span 2; }
.pl-row__what { font-weight: 560; font-size: 0.92rem; }
.pl-row__meta { grid-column: 2; font-size: 0.78rem; color: var(--muted); }
.pl-row__status { grid-row: 1 / span 2; grid-column: 3; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.pl-row__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pl-row[aria-pressed="true"] { background: var(--paper); box-shadow: inset 3px 0 0 var(--signal); }
.pl-row.is-current .pl-row__id::after { content: "live"; display: block; margin: 3px 0 0 17px; font-size: 0.5rem; color: var(--signal-text); text-transform: uppercase; letter-spacing: 0.06em; }
.pl-row:disabled .pl-row__id::before { border-color: transparent !important; }
.pl-row .pl-row__id::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; border: 1.5px solid var(--ink); vertical-align: 0; transition: background-color 0.2s, box-shadow 0.2s; }
.pl-row[aria-pressed="true"] .pl-row__id::before { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.pl-row { grid-template-columns: 74px 1fr auto; }
.pl-row.is-settings .pl-row__what { color: var(--ink-2); }
.pl-row.is-new { animation: plIn 0.8s var(--ease); }
.pl-row.is-rollback .pl-row__id { color: var(--signal-text); }
@keyframes plIn { from { opacity: 0; transform: translateY(-10px); background: var(--signal-soft); } to { opacity: 1; transform: none; } }
.pushlog__actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pushlog__actions .btn--ink { gap: 10px; }

.precise {
  margin-top: clamp(48px, 6vw, 96px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  padding: clamp(20px, 2.4vw, 32px) 0; border-block: 1px solid var(--ink);
}
.precise__k { grid-column: 1 / span 3; color: var(--signal-text); font-weight: 600; }
.precise p:last-child { grid-column: 4 / span 8; font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.45; letter-spacing: -0.01em; }

/* =================================================================== */
/* 06 ASSISTANT                                                         */
/* =================================================================== */
.assistant { background: var(--paper-3); overflow: clip; }
.assistant::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 50%, #000 30%, transparent 75%);
}
.assistant .wrap { position: relative; }
.assistant__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 120px); align-items: center; }
.assistant__copy .body-lg { margin-top: 26px; }
.assistant__small { margin-top: 18px; color: var(--muted); max-width: 42ch; }
.concept { position: relative; }
.concept__sheet {
  position: relative; padding: clamp(20px, 2.6vw, 34px); border-radius: 16px; background: var(--paper-2);
  border: 1.5px dashed var(--ink);
  box-shadow: 14px 14px 0 -1px var(--paper-3), 14px 14px 0 0 var(--line-2);
  transform: rotate(-1.2deg);
}
.concept__stamp {
  position: absolute; right: 22px; top: -18px; transform: rotate(6deg);
  padding: 8px 14px; border: 2px solid var(--signal-text); color: var(--signal-text); border-radius: 6px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; background: var(--paper-2);
}
.concept__who { color: var(--muted); font-size: 0.56rem; margin-bottom: 10px; }
.concept__req { padding-bottom: 20px; border-bottom: 1px dashed var(--line-2); }
.concept__text { font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.4; letter-spacing: -0.015em; font-weight: 450; min-height: 3.8em; }
.concept__text .cursor { display: inline-block; width: 2px; height: 1.1em; background: var(--ink); vertical-align: -0.18em; margin-left: 2px; animation: caret 1s steps(1) infinite; }
.concept__draft { padding-top: 20px; }
.concept__draft li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; align-items: baseline; }
.concept__draft li:last-child { border-bottom: 0; color: var(--muted); }
.concept__draft code { font-size: 0.74rem; background: var(--paper-3); padding: 1px 6px; border-radius: 4px; }
.op { font-family: var(--mono); font-weight: 700; color: var(--signal-text); }
.op--eq { color: var(--muted); }
.js .concept[data-armed] .concept__draft li { opacity: 0; transform: translateX(-8px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.js .concept[data-armed] .concept__draft li.is-in { opacity: 1; transform: none; }
.concept .caption { margin-top: 30px; }

/* =================================================================== */
/* 07 FINALE + FOOTER                                                   */
/* =================================================================== */
.finale { padding-bottom: clamp(96px, 12vw, 180px); }
.finale__title {
  font-size: clamp(2.8rem, 7.8vw, 8.8rem); line-height: 0.92; letter-spacing: -0.048em; font-weight: 520; font-stretch: 112%; max-width: 16ch; text-wrap: balance;
}
.finale__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); margin-top: clamp(40px, 5vw, 80px); align-items: start; }
.finale__grid .body-lg { grid-column: 1 / span 5; }
.finale__actions { grid-column: 7 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.finale__note { flex-basis: 100%; margin-top: 10px; font-size: 0.9rem; color: var(--muted); max-width: 52ch; }

.footer { padding-top: clamp(72px, 9vw, 130px); padding-bottom: 28px; overflow: clip; }
.footer__top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--gap); padding-bottom: clamp(48px, 6vw, 90px); }
.footer__brand p { margin-top: 18px; color: var(--night-muted); max-width: 30ch; }
.brand--footer .mark { color: var(--paper); }
.brand--footer .mark__knob { stroke: var(--night); }
.footer__col { display: grid; gap: 10px; align-content: start; }
.footer__col .mono { color: var(--night-muted); margin-bottom: 6px; font-size: 0.6rem; }
.footer__col a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: #e2e0d8; transition: color 0.2s; }
.footer__col a:hover { color: var(--signal); }
.footer__col a .ico { width: 14px; height: 14px; }
.footer__giant { display: flex; align-items: center; gap: 0.06em; font-size: clamp(7rem, 30vw, 34rem); line-height: 0.8; font-weight: 600; font-stretch: 112%; letter-spacing: -0.06em; color: var(--paper); margin-left: -0.04em; }
.giant-mark { width: 0.86em; height: 0.86em; fill: currentColor; flex: none; overflow: visible; }
.giant-mark .mark__knob { stroke: var(--night); stroke-width: 1.2; transition: none; }
.footer__giant span { transform: translateY(0.02em); }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 22px; margin-top: clamp(24px, 3vw, 40px); border-top: 1px solid var(--night-line); color: var(--night-muted); font-size: 0.58rem; }

/* =================================================================== */
/* RESPONSIVE                                                           */
/* =================================================================== */
@media (max-width: 1180px) {
  .masthead__nav { display: none; }
  .masthead__where { margin-left: 8px; }
  .masthead__actions { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 1080px) {
  .story__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .controls__body { grid-template-columns: 1fr; }
  .viewer { position: relative; top: 0; }
  .index { display: flex; overflow-x: auto; gap: 8px; border-top: 0; padding-bottom: 6px; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
  .index::-webkit-scrollbar { display: none; }
  .index__item { width: auto; flex: none; display: inline-flex; align-items: center; gap: 10px; grid-template-rows: none; padding: 0 16px; height: 44px; border: 1px solid var(--line-2); border-radius: 999px; }
  .index__item[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); padding: 0 16px; }
  .index__item[aria-selected="true"] .index__name { color: var(--paper); }
  .index__item[aria-selected="true"] .index__n { color: var(--signal); }
  .index__item::before { display: none; }
  .index__item .index__n { padding: 0; }
  .index__name { font-size: 1rem; letter-spacing: -0.015em; opacity: 0.7; white-space: nowrap; }
  .index__desc { display: none; }
  .viewer__desc { display: block; font-size: 1rem; color: var(--ink-2); margin-bottom: 18px; max-width: 52ch; }
  .viewer { padding-top: 48px; min-height: 0; }
  .circuit { grid-template-columns: 1fr; gap: 36px; padding-bottom: 32px; }
  .circuit__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .circuit__envs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .circuit__col--app { max-width: 560px; margin-inline: auto; width: 100%; }
  .circuit__code { position: relative; width: auto; max-width: 560px; margin-inline: auto; }
  .dense__head .h2 { grid-column: 1 / -1; }
  .dense__head .body-lg { grid-column: 1 / span 10; margin-top: 24px; }
  .lab__legend { grid-template-columns: 1fr 1fr; }
  .capabilities__lead { grid-column: 1 / -1; }
  .capabilities__list { grid-column: 1 / -1; }
  .publish__body { grid-template-columns: 1fr; }
  .pushlog { position: relative; top: 0; }
  .assistant__grid { grid-template-columns: 1fr; }
  .finale__grid .body-lg { grid-column: 1 / -1; }
  .finale__actions { grid-column: 1 / -1; margin-top: 28px; }
  .footer__top { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; margin-bottom: 20px; }
}
@media (max-width: 1080px) and (min-width: 641px) {
  .lab__table { min-width: 0; }
  .lab__groups { display: none; }
  .lab__table th, .lab__table td { padding: 0 12px; }
  .lab__table thead tr:not(.lab__groups) th:nth-child(5), .lab__table thead tr:not(.lab__groups) th:nth-child(6),
  .lab__table tbody tr:not(.grp) td:nth-child(5), .lab__table tbody tr:not(.grp) td:nth-child(6) { display: none; }
}
@media (max-width: 900px) and (min-width: 641px) {
  .lab__table thead tr:not(.lab__groups) th:nth-child(4), .lab__table tbody tr:not(.grp) td:nth-child(4) { display: none; }
}
@media (max-width: 900px) {
  .hero__left { grid-column: 1 / -1; }
  .specimen { grid-column: 1 / -1; grid-row: auto; margin-top: clamp(48px, 7vw, 72px); max-width: 760px; margin-left: auto; margin-right: 0; width: 100%; }
  .hero__title { white-space: normal; font-size: clamp(3.1rem, 11vw, 7.6rem); }
  .inspector { left: 20px; }
  .reg--tl { left: -14px; }
}
@media (max-width: 1080px) and (min-width: 901px) {
  .sp-row { gap: 8px; padding: 0 12px; font-size: 0.8rem; }
  .app-window__crumb { display: none; }
  .inspector { width: min(290px, 70%); }
}
@media (max-width: 860px) {
  .brand__by { display: none; }
  .model__head .h2, .model__head .body-lg, .story__head .h2, .story__head .body-lg, .controls__head .h2, .controls__head .body-lg { grid-column: 1 / -1; }
  .model__head .body-lg, .story__head .body-lg, .controls__head .body-lg { margin-top: 24px; }
  .ledger--3 { grid-template-columns: 1fr; }
  .story__body { grid-template-columns: 1fr; gap: 0; }
  .story__sticky { order: -1; top: calc(var(--head-h) + 8px); z-index: 2; background: var(--paper); padding-bottom: 12px; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
  .stage { height: min(54vh, 460px); }
  @media (min-width: 641px) { .stage { height: min(58vh, 560px); } }
  .stage__dots { margin-top: 10px; }
  .story__steps { padding-bottom: 8vh; }
  .story__step, .story__step:first-child { min-height: 64vh; padding-top: 0; justify-content: flex-start; padding-top: 12px; }
  .story__step h3 { font-size: 1.6rem; }
  .v-columns, .v-form, .v-menu, .v-access, .v-brand, .v-features { grid-template-columns: 1fr; }
  .precise__k, .precise p:last-child { grid-column: 1 / -1; }
  .precise__k { margin-bottom: 10px; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --head-h: 60px; }
  .masthead__where { display: none; }
  .masthead__actions { gap: 10px; }
  .masthead__actions .btn--signal { display: none; }
  .masthead__actions .link-signin { font-size: 0.9rem; }
  .hero__eyebrow { flex-wrap: wrap; row-gap: 6px; }
  .hero__eyebrow .rule { width: 28px; }
  .hero__eyebrow span:last-child { flex-basis: 100%; }
  .hero__title { font-size: clamp(3.1rem, 15.5vw, 5rem); }
  .hero__actions .btn { width: 100%; }
  .specimen__stage { padding-bottom: 0; }
  .inspector { position: relative; left: auto; bottom: auto; width: auto; margin: -28px 12px 0; }
  .app-window__crumb { display: none; }
  .app-window__bar { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 2px; }
  .app-window__title { white-space: nowrap; }
  .app-window .flag-fictional { margin-left: 0; flex-basis: 100%; }
  .app-window__tools .pill:nth-child(2) { display: none; }
  .sp-row { grid-template-columns: 0.95fr 0.9fr 1fr 0.75fr; padding: 0 12px; gap: 8px; }
  .sp-row > span:nth-child(2) { display: none; }
  .sp-row--group { grid-template-columns: 1fr; }
  .reg { display: none; }
  .circuit { grid-template-columns: 1fr; gap: 28px; }
  .circuit__col--hub, .circuit__col--push, .circuit__col--env, .circuit__col--app { grid-column: 1; grid-row: auto; }
  .circuit__list { grid-template-columns: 1fr 1fr; }
  .circuit__list li { font-size: 0.84rem; padding: 8px 10px; }
  .circuit__envs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .circuit__envs li { font-size: 0.8rem; padding: 10px; gap: 6px; }
  .circuit__code { grid-template-columns: 1fr; }
  .circuit__code .mono { justify-self: start; }
  .circuit__envs li { font-size: 0.76rem; }
  .lab__flag { margin-left: 0; flex-basis: 100%; order: -1; }
  .lab__table { min-width: 0; font-size: 0.84rem; }
  .lab__groups { display: none; }
  .lab__table th, .lab__table td { padding: 0 10px; }
  .lab__table thead tr:not(.lab__groups) th:nth-child(2), .lab__table thead tr:not(.lab__groups) th:nth-child(4),
  .lab__table thead tr:not(.lab__groups) th:nth-child(5), .lab__table thead tr:not(.lab__groups) th:nth-child(6),
  .lab__table tbody tr:not(.grp) td:nth-child(2), .lab__table tbody tr:not(.grp) td:nth-child(4),
  .lab__table tbody tr:not(.grp) td:nth-child(5), .lab__table tbody tr:not(.grp) td:nth-child(6),
  .lab__table thead tr:not(.lab__groups) th:nth-child(7), .lab__table tbody tr:not(.grp) td:nth-child(7) { display: none; }
  .lab__table th, .lab__table td { padding: 0 8px; height: 44px; }
  .lab__table th:first-child, .lab__table td:first-child { padding-left: 14px; }
  .lab__table th:last-child, .lab__table td:last-child { padding-right: 14px; }
  .lab__table .st { font-size: 0.78rem; }
  .ref-btn { font-size: 0.7rem; }
  .grp__inner { flex-wrap: wrap; gap: 4px 10px; }
  .lab__legend { grid-template-columns: 1fr; }
  .capabilities__list { grid-template-columns: 1fr; }
  .v-filters__bar > .mono { width: 100%; }
  .v-filters__rows li { grid-template-columns: 0.9fr 1.2fr 0.8fr; }
  .v-filters__rows li span:nth-child(3) { display: none; }
  .pushlog__head .flag-fictional--line { margin-left: 0; flex-basis: 100%; }
  .pl-row { grid-template-columns: 72px 1fr; padding: 12px 4px; }
  .pl-row__id { white-space: nowrap; }
  .pl-row__status { display: none; }
  .finale__actions .btn { width: 100%; }
  .footer__giant { font-size: 29vw; }
  .footer__base { flex-direction: column; }
}

/* =================================================================== */
/* REDUCED MOTION                                                       */
/* =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .w > span, .js .hero__title .line > span, .js .app-window, .js .inspector { opacity: 1 !important; transform: none !important; }
  .ticker__track { animation: none; overflow-x: auto; width: auto; }
  .ticker { overflow-x: auto; }
  .caret, .concept__text .cursor { animation: none; }
  .js .concept[data-armed] .concept__draft li { opacity: 1; transform: none; }
}
.drawer__title:focus { outline: none; }
.assistant__copy .h2 { font-size: clamp(2.2rem, 4.4vw, 4.6rem); max-width: 14ch; }
