/* Relay — paper in, actions out. Revision 2: "the machine is alive".
   Tokens, glass surfaces, dot grid, guarded motion, playground, sections. */

:root {
  --ink: #0A0C0F;
  --graphite: #12161B;
  --raised: rgba(255, 255, 255, .05);
  --hair: rgba(255, 255, 255, .08);
  --glass: rgba(255, 255, 255, .035);
  --glass-border: rgba(255, 255, 255, .08);
  --glass-border-hover: rgba(255, 255, 255, .16);
  --glass-hi: rgba(255, 255, 255, .06);
  --paper: #F4F1EA;
  --sheet: #FBFAF6;
  --paper-ink: #1A1A18;
  --paper-muted: #5E5A52;
  --paper-hair: #DDD8CC;
  --copper: #D9884A;
  --copper-text: #F0A868;
  --amber: #E0A64B;
  --grad: linear-gradient(120deg, #F0A868, #E0A64B);
  --verdigris: #5FB3A1;
  --signal: #E5484D;
  --signal-text: #FF6369;
  --text: #E8ECF0;
  --muted: #98A2AD;

  --sans: Geist, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1240px;
  --gutter: 24px;
  --radius: 3px;
  --r-glass: 14px;
  --band: 128px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 60; background: var(--paper); color: var(--paper-ink); padding: 8px 12px; border-radius: var(--radius); font-size: 14px; }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.inbox :focus-visible, .paper-section :focus-visible { outline-color: var(--paper-ink); }

.eyebrow { font: 500 11.5px/1.4 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.paper-section .eyebrow, .inbox .eyebrow { color: var(--paper-muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Dark ground: dot grid with a radial fade ---------- */

.dark { position: relative; background: var(--ink); isolation: isolate; }
.dark::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.3px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 35%, transparent 100%);
}

/* ---------- Glass ---------- */

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: var(--r-glass);
}
.glass-hover { transition: transform .25s ease, border-color .25s ease; }
.glass-hover:hover { transform: translateY(-2px); border-color: var(--glass-border-hover); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font: 500 14px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --ga: 120deg; background: linear-gradient(var(--ga), #F0A868, #E0A64B); transform: translate(var(--tx, 0), var(--ty, 0)); color: var(--paper-ink); font-weight: 600; box-shadow: 0 0 0 1px rgba(240, 168, 104, .25), 0 8px 24px -10px rgba(217, 136, 74, .6); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(240, 168, 104, .45), 0 10px 28px -8px rgba(217, 136, 74, .75); filter: brightness(1.05); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 10px; }
.btn-outline { background: transparent; border-color: var(--glass-border); color: var(--text); }
.btn-outline:hover { border-color: var(--glass-border-hover); background: var(--glass); }
.btn-ghost { background: transparent; color: var(--muted); padding: 6px 10px; font-size: 13px; }
.btn-ghost:hover { color: var(--text); background: var(--raised); }
.btn-ink { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }
.btn-ink:hover { background: #2C2C29; }

/* ---------- Nav (glass, sticky) ---------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 12, 15, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 5px; font: 600 21px/1 var(--sans); letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.wordmark .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px rgba(240, 168, 104, .7); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 7px 12px; border-radius: 8px; font: 500 13.5px/1.2 var(--sans); color: var(--muted); text-decoration: none; transition: color .15s ease, background-color .15s ease; }
.nav-links a:hover { color: var(--text); background: var(--glass); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-sub { display: none; }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass); font: 500 12px/1 var(--sans); letter-spacing: 0.04em; color: var(--muted); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hair); }
.pill[data-mode="live"] { color: var(--text); }
.pill[data-mode="live"] .pill-dot { background: var(--verdigris); box-shadow: 0 0 8px rgba(95, 179, 161, .8); animation: pulse 2.4s ease-in-out infinite; }
.pill[data-mode="replay"] .pill-dot { background: var(--muted); }
.pill[data-mode="checking"] .pill-dot { background: var(--hair); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Hero ---------- */

.hero-band { overflow: hidden; }
.hero-glow {
  position: absolute; z-index: -1; pointer-events: none;
  top: -140px; left: -120px; width: 980px; height: 720px;
  background: radial-gradient(closest-side, rgba(217, 136, 74, .26), rgba(224, 166, 75, .12) 45%, transparent 76%);
  filter: blur(48px);
}
.hero {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter); row-gap: 22px;
  padding-top: 52px; padding-bottom: 32px; align-items: start;
}
.hero-main { grid-column: 1 / 8; }
.hero-side { grid-column: 8 / 13; padding-top: 6px; }
.hero h1 { margin-top: 22px; font: 600 clamp(52px, 6.7vw, 96px)/0.95 var(--sans); letter-spacing: -0.04em; text-wrap: balance; color: var(--text); }
.hero h1 em { font-style: normal; }
.hero-side p { font-size: 17px; line-height: 1.55; max-width: 44ch; color: var(--text); }
.hero-side .small { margin-top: 14px; font-size: 13.5px; color: var(--muted); max-width: 44ch; }
.proof { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.proof-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 11px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi);
  font: 500 13px/1.2 var(--sans); color: var(--text);
}
.proof-chip svg { width: 16px; height: 16px; fill: none; stroke: var(--copper-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.rise { animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.rise-2 { animation-delay: .08s; }
.rise-3 { animation-delay: .16s; }
.rise-4 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Scroll reveal: resting state is visible; JS only adds .reveal-pre when motion is allowed */
.reveal-pre { transform: translateY(10px); }
.reveal-in { transform: none; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }

/* ---------- Playground ---------- */

.playground { padding-top: 4px; padding-bottom: 28px; }
.pg-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--gutter);
  align-items: stretch;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 18px;
  border-bottom: 1px solid var(--hair);
}
.inbox .panel-head { border-bottom-color: var(--paper-hair); }
.panel-meta { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.inbox .panel-meta { color: var(--paper-muted); }

/* Inbox (paper) */

.inbox {
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-height: 600px;
}

.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--paper-hair);
}
.tab {
  min-width: 0;
  background: none; border: 0;
  border-bottom: 1px solid var(--paper-hair);
  padding: 10px 18px 11px;
  font: 500 13px/1.3 var(--sans);
  color: var(--paper-muted);
  text-align: left;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s ease, background-color .15s ease;
}
.tab:nth-child(odd) { border-right: 1px solid var(--paper-hair); }
.tab:nth-last-child(-n + 2) { border-bottom: 0; }
.tab:hover { color: var(--paper-ink); }
.tab[aria-selected="true"] { color: var(--paper-ink); background: var(--sheet); box-shadow: inset 0 -2px 0 var(--paper-ink); }
.tab:disabled { cursor: default; }
.tab:focus-visible { outline-offset: -3px; }

.blurb { padding: 12px 18px 4px; font-size: 13px; line-height: 1.5; color: var(--paper-muted); min-height: 46px; }

.tray { padding: 10px 12px 16px; }
.sheet {
  position: relative;
  background: var(--sheet);
  padding: 22px 12px 26px;
  transform: rotate(0.4deg);
  box-shadow:
    0 1px 0 rgba(26, 26, 24, .06),
    0 2px 6px rgba(26, 26, 24, .10),
    0 16px 34px -14px rgba(26, 26, 24, .45);
  border-radius: 1px;
}
.sheet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("paper-grain.png") repeat;
  mix-blend-mode: multiply; opacity: .9;
  border-radius: inherit;
}
.sheet::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(26,26,24,.06), rgba(26,26,24,0) 60%);
  pointer-events: none;
}
.sheet:focus-within { outline: 2px solid var(--paper-ink); outline-offset: 4px; }

.doc {
  display: block; width: 100%;
  border: 0; background: transparent; outline: none; resize: none;
  padding: 0; margin: 0;
  font: 400 10.5px/1.65 var(--mono);
  letter-spacing: -0.03em;
  color: var(--paper-ink);
  white-space: pre; overflow-x: hidden; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(107, 103, 94, .35) transparent;
  tab-size: 4;
  min-height: 260px;
  position: relative; z-index: 1;
}
.doc-scale { position: relative; z-index: 1; transform-origin: top left; }
.doc::selection { background: rgba(217, 136, 74, .35); }
.doc::-webkit-scrollbar { height: 6px; }
.doc::-webkit-scrollbar-thumb { background: rgba(107, 103, 94, .35); border-radius: 3px; }
.doc::-webkit-scrollbar-track { background: transparent; }

.stamp {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px 5px;
  border: 1.5px solid rgba(26, 26, 24, .55);
  border-radius: 2px;
  transform: rotate(-6deg);
  color: rgba(26, 26, 24, .6);
  font: 500 10px/1.2 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.stamp-ref { font-size: 12px; letter-spacing: .08em; }

.controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 4px 18px 0;
}
.toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  flex: none; position: relative; width: 34px; height: 20px; margin-top: 1px;
  border-radius: 999px; background: var(--paper-hair);
  transition: background-color .15s ease;
}
.toggle-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--sheet);
  box-shadow: 0 1px 2px rgba(26,26,24,.25);
  transition: transform .15s ease;
}
.toggle input:checked + .toggle-track { background: var(--paper-ink); }
.toggle input:checked + .toggle-track::after { transform: translateX(14px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--paper-ink); outline-offset: 2px; }
.toggle-text { display: flex; flex-direction: column; }
.toggle-label { font: 500 13.5px/1.4 var(--sans); color: var(--paper-ink); }
.toggle-hint { font-size: 12px; line-height: 1.4; color: var(--paper-muted); }

.run-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-run {
  position: relative; overflow: hidden;
  background: var(--copper); color: var(--paper-ink); border-color: var(--copper);
  padding: 11px 20px; font-weight: 600; min-width: 128px;
}
.btn-run:hover { background: #C97A3E; border-color: #C97A3E; }
.btn-run.is-running { cursor: progress; }
.btn-run .progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(26,26,24,.18); display: none;
}
.btn-run.is-running .progress { display: block; }
.btn-run .progress-bar {
  display: block; height: 100%; width: 0; background: var(--paper-ink);
  transition: width .2s linear;
}
.btn-run.is-indeterminate .progress-bar { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.btn-stop { background: transparent; border-color: var(--paper-ink); color: var(--paper-ink); padding: 10px 14px; }
.btn-stop:hover { background: rgba(26,26,24,.06); }

.mode-line { padding: 12px 18px 0; font-size: 12.5px; line-height: 1.5; color: var(--paper-muted); }
.note {
  margin: 8px 18px 0; padding: 8px 10px 8px 12px;
  border-left: 2px solid var(--amber);
  background: rgba(224, 166, 75, .12);
  font-size: 12.5px; line-height: 1.45; color: var(--paper-ink);
}
.inbox > :last-child { margin-bottom: 18px; }

/* Console (graphite) */

.console {
  position: relative;
  align-self: start;
  background: var(--graphite);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.console-inner { display: flex; flex-direction: column; }
.console:not(.is-live) .timeline { flex: none; min-height: 300px; overflow: hidden; }
@media (min-width: 961px) {
  .console.is-live { align-self: stretch; min-height: 600px; }
  .console.is-live .console-inner { position: absolute; inset: 0; }
}
.run-id { font-size: 12px; color: var(--muted); min-width: 0; margin-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.run-id b { font-weight: 500; color: var(--text); }

.metrics-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.7fr);
  gap: 0 12px; padding: 10px 18px 12px;
  border-bottom: 1px solid var(--hair);
}
.metrics-row div { min-width: 0; }
.metrics-row dt { font: 500 10.5px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.metrics-row dd { font: 400 14px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.systems {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--hair);
  border-bottom: 1px solid var(--hair);
}
.sys-card {
  background: var(--graphite);
  padding: 10px 12px 11px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 10px;
  align-items: baseline;
  min-width: 0;
  transition: background-color .5s ease, box-shadow .5s ease;
}
.sys-name { grid-column: 1 / -1; font: 500 11px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sys-count { font: 400 20px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.sys-card.has-action .sys-count { color: var(--verdigris); }
.sys-last { font: 400 11px/1.4 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-card.has-action .sys-last { color: var(--text); }
.sys-card.tick { animation: tick .9s ease-out; }
.sys-card.tick .sys-count { animation: bump .5s cubic-bezier(.2,.8,.2,1); color: var(--verdigris); }
@keyframes tick {
  0% { background: rgba(95, 179, 161, .22); box-shadow: inset 0 0 0 1px var(--verdigris); }
  100% { background: var(--graphite); box-shadow: inset 0 0 0 1px transparent; }
}
@keyframes bump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

.timeline {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--hair) transparent;
}
.timeline::-webkit-scrollbar { width: 8px; }
.timeline::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 4px; }

.idle { display: flex; flex-direction: column; gap: 26px; padding: 22px 6px 10px; }
.empty {
  font: 400 16px/1.5 var(--sans); color: var(--muted);
  max-width: 34ch; text-wrap: pretty;
}
.idle-legend { display: grid; gap: 9px; padding-top: 18px; border-top: 1px solid var(--hair); }
.idle-legend li { display: flex; align-items: center; gap: 12px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.swatch { flex: none; width: 10px; height: 10px; border-radius: 1px; }
.swatch-think { border: 1px solid var(--muted); }
.swatch-tool { background: var(--copper); }
.swatch-retry { background: var(--amber); }
.swatch-done { background: var(--verdigris); }
.idle noscript { display: block; font-size: 13px; color: var(--muted); }

.console-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 46px; padding: 0 12px 0 18px;
  border-top: 1px solid var(--hair);
}
.speed { display: inline-flex; align-items: center; gap: 8px; }
.speed-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
.seg button {
  background: transparent; border: 0; padding: 4px 10px;
  font: 500 12px/1.4 var(--mono); color: var(--muted); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--hair); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.seg button:focus-visible { outline-offset: -2px; }

/* Timeline entries */

.entry { animation: fadein .3s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.entry-tag { display: block; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

.turn { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.turn span { font: 500 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.turn::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

.thinking { padding-left: 14px; border-left: 1px solid var(--hair); }
.thinking-text { font: 400 14.5px/1.55 var(--sans); color: var(--muted); text-wrap: pretty; }
.chunk { animation: fadein .35s ease both; }

.tool {
  background: var(--raised);
  border: 1px solid var(--hair);
  border-left-width: 2px;
  border-radius: var(--radius);
  padding: 11px 14px 12px;
}
.tool.is-pending { border-left-color: var(--copper); }
.tool.is-retrying { border-left-color: var(--amber); }
.tool.is-ok { border-left-color: var(--verdigris); }
.tool.is-failed { border-left-color: var(--signal); }

.tool-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chip {
  font: 500 12px/1.2 var(--mono);
  padding: 3px 7px; border-radius: 2px;
  background: var(--ink); border: 1px solid var(--hair); color: var(--text);
}
.sys-tag { font: 500 11px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tool-state { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--copper-text); }
.tool.is-retrying .tool-state { color: var(--amber); }
.tool.is-retrying .spinner { border-top-color: var(--amber); }
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--hair); border-top-color: var(--copper);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kv {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 16px; margin-top: 10px;
  font-size: 12.5px; line-height: 1.45;
}
.kv dt { font: 400 11.5px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.kv dd { color: var(--text); min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kv dd.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.kv dd.wide, .kv dt.wide { grid-column: 1 / -1; }
.kv .kv { margin-top: 2px; padding-left: 10px; border-left: 1px solid var(--hair); }

.kv-table { width: 100%; border-collapse: collapse; margin-top: 2px; font: 400 11.5px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.kv-table th { text-align: left; font-weight: 500; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 2px 8px 4px 0; border-bottom: 1px solid var(--hair); }
.kv-table td { padding: 4px 8px 4px 0; border-bottom: 1px solid rgba(42, 50, 59, .5); vertical-align: top; color: var(--text); }
.kv-table th.num, .kv-table td.num { text-align: right; padding-right: 0; white-space: nowrap; }
.kv-table tr:last-child td { border-bottom: 0; }
.kv-table-wrap { overflow-x: auto; }

.result { margin-top: 10px; }
.result-line { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.result-icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.result-summary { font-size: 13.5px; color: var(--text); flex: 1 1 200px; }
.tool.is-failed .result-summary { color: var(--signal-text); }
.result-meta { font: 400 11px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.response { margin-top: 8px; }
.response summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 500 11px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  list-style: none;
}
.response summary::-webkit-details-marker { display: none; }
.response summary::before { content: ""; width: 0; height: 0; border: 4px solid transparent; border-left-color: currentColor; margin-right: 2px; transition: transform .15s ease; }
.response[open] summary::before { transform: rotate(90deg); }
.response summary:hover { color: var(--text); }

.retry {
  margin-top: 10px; padding: 10px 12px 11px;
  border: 1px solid rgba(224, 166, 75, .45);
  background: rgba(224, 166, 75, .07);
  border-radius: var(--radius);
}
.retry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.retry-title { font: 500 13px/1.4 var(--sans); color: var(--amber); }
.retry-attempt { font: 400 11px/1.6 var(--mono); color: var(--amber); }
.retry-reason { margin-top: 2px; font: 400 12px/1.45 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.retry-count { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.retry-text { font: 400 12.5px/1.4 var(--sans); color: var(--text); white-space: nowrap; }
.retry-text b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.countdown { flex: 1; height: 3px; background: rgba(224, 166, 75, .2); border-radius: 2px; overflow: hidden; }
.countdown-bar { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left center; transform: scaleX(1); }
.retry.is-done .retry-count { display: none; }
.retry-outcome { display: none; margin-top: 8px; font: 400 12.5px/1.4 var(--sans); color: var(--verdigris); }
.retry.is-done .retry-outcome { display: block; }
.retry.is-done.is-failed .retry-outcome { color: var(--signal-text); }

.summary { margin-top: 6px; padding: 6px 0 6px 14px; border-left: 2px solid var(--verdigris); }
.summary-text { font-size: 17px; line-height: 1.5; color: var(--text); text-wrap: pretty; }

.error-entry {
  padding: 10px 12px; border: 1px solid rgba(229, 72, 77, .5); border-left: 2px solid var(--signal);
  background: rgba(229, 72, 77, .08); border-radius: var(--radius);
}
.error-entry .error-msg { font-size: 13.5px; color: var(--text); }
.error-entry .error-detail { margin: 6px 0 2px; font: 400 12px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.error-entry .response { margin-top: 6px; }

.stopped { font: 400 11px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }


/* ---------- Playground on glass (overrides) ---------- */

.playground { padding-top: 30px; padding-bottom: 8px; }
.inbox { position: relative; z-index: 1; border-radius: var(--r-glass); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .15); overflow: hidden; }
.console-wrap { position: relative; align-self: start; }
.console-wrap:has(.console.is-live) { align-self: stretch; }
.console-glow {
  position: absolute; inset: -60px -80px; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(217, 136, 74, .22), rgba(224, 166, 75, .08) 50%, transparent 78%);
  filter: blur(36px);
  opacity: .45;
  transition: opacity 1.2s ease;
}
.console-wrap:has(.console.is-running) .console-glow { opacity: 1; animation: glow-pulse 2.6s ease-in-out infinite; }
@keyframes glow-pulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; transform: scale(1.03); } }
.console {
  position: relative; z-index: 1; align-self: auto;
  background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 30px 60px -30px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: var(--r-glass); overflow: hidden;
}
.console.is-live { height: 100%; min-height: 600px; }
.sys-card { background: transparent; }
.systems { background: var(--hair); }
.sys-card.tick { animation: tick .9s ease-out; }
@keyframes tick { 0% { background: rgba(95, 179, 161, .22); box-shadow: inset 0 0 0 1px var(--verdigris); } 100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; } }
.tool { border-radius: 10px; background: var(--raised); }
.tool .chip { border-radius: 4px; background: rgba(0, 0, 0, .35); }
.retry { border-radius: 10px; }
.error-entry { border-radius: 10px; }
.seg { border-radius: 8px; }
.btn-run { --ga: 120deg; background: linear-gradient(var(--ga), #F0A868, #E0A64B); transform: translate(var(--tx, 0), var(--ty, 0)); border-color: transparent; border-radius: 8px; box-shadow: 0 8px 22px -10px rgba(217, 136, 74, .7); }
.btn-run:hover { filter: brightness(1.05); }
.btn-stop { border-radius: 8px; }
.sheet {
  --tilt: 1.5deg;
  transform: rotate(var(--tilt));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease;
  box-shadow: 0 1px 1px rgba(26, 26, 24, .08), 0 4px 10px rgba(26, 26, 24, .10), 0 28px 48px -18px rgba(26, 26, 24, .45);
}
.sheet:hover, .sheet:focus-within { transform: rotate(0deg); }
.tray { padding: 14px 14px 18px; }

/* ---------- Facts row ---------- */

.facts-row { padding-top: 40px; padding-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.fact { padding: 18px 20px 20px 0; display: flex; gap: 12px; align-items: baseline; }
.fact + .fact { padding-left: 20px; border-left: 1px solid var(--hair); }
.fact-index { font: 400 11px/1.6 var(--mono); color: var(--muted); }
.fact-text { font-size: 14px; line-height: 1.45; color: var(--text); text-wrap: pretty; }

/* ---------- Integration marquee ---------- */

.integrations { padding: 72px 0 16px; }
.integrations .eyebrow { margin-bottom: 26px; }
.marquee { position: relative; overflow: hidden; display: flex; gap: 12px; padding: 4px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 12px; flex: none; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 12px)); } }
.int-chip {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 10px 18px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi);
  font: 600 15px/1.2 var(--sans); letter-spacing: -0.01em; color: var(--text);
}
.int-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); flex: none; }

/* ---------- Stats ---------- */

.stats { padding-top: 64px; padding-bottom: var(--band); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 8px; }
.stat-num { font: 600 56px/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-unit { font-size: 28px; letter-spacing: -0.02em; color: var(--copper-text); }
.stat-label { font-size: 15px; line-height: 1.4; color: var(--muted); }
.stat-foot { margin-top: 18px; font: 400 13px/1.5 var(--sans); color: var(--muted); }

/* ---------- Sections ---------- */

section.band { padding: var(--band) 0; }
.paper-section { background: var(--paper); color: var(--paper-ink); }
.paper-section p { color: var(--paper-ink); }
.paper-section h2, .band h2, .cta h2 { font: 600 clamp(36px, 3.4vw, 48px)/1.02 var(--sans); letter-spacing: -0.03em; text-wrap: balance; }
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; margin-bottom: 56px; }
.section-head .eyebrow { grid-column: 1 / 4; margin-bottom: 10px; }
.section-head h2 { grid-column: 1 / 9; }
.section-head .lede { grid-column: 9 / 13; font-size: 16px; line-height: 1.5; color: var(--paper-muted); max-width: 60ch; }
.paper-section .section-head .lede { color: var(--paper-muted); }
.dark .section-head .lede { color: var(--muted); }

/* How it works (paper) */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; position: relative; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 24px; height: 1px; background: var(--paper-hair); }
.step { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 10px; align-content: start; }
.step > p:not(.step-see) { align-self: start; }
.step-glyph { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sheet); border: 1px solid var(--paper-hair); box-shadow: 0 6px 16px -10px rgba(26, 26, 24, .35); }
.step-glyph svg { width: 22px; height: 22px; fill: none; stroke: var(--paper-ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.step-n { margin-top: 10px; font: 400 11px/1.6 var(--mono); color: var(--paper-muted); }
.step h3 { font: 600 22px/1.15 var(--sans); letter-spacing: -0.025em; }
.step p { font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.step-see { align-self: end; font-size: 13.5px; color: var(--paper-muted) !important; padding-top: 8px; border-top: 1px solid var(--paper-hair); margin-top: 4px; }

/* Refuses (dark glass) */
.refuse-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.refuse { position: relative; padding: 26px 26px 24px 30px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.refuse::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--signal); }
.refuse.stripe-amber::before { background: var(--amber); }
.refuse .numeral { font: 600 30px/1 var(--sans); letter-spacing: -0.03em; color: var(--muted); opacity: .5; }
.refuse h3 { font: 600 21px/1.2 var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
.refuse p { font-size: 15px; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.outcome { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.outcome::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--signal); flex: none; }
.outcome.held::before { background: var(--amber); }
.closing { margin-top: 48px; font: 500 20px/1.4 var(--sans); letter-spacing: -0.015em; color: var(--text); max-width: 44ch; text-wrap: pretty; }

/* Savings calculator (paper) */
.calc { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-items: stretch; }
.calc-in { display: flex; flex-direction: column; justify-content: space-between; gap: 30px; padding: 12px 0 8px; }
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.range-head label { font: 500 16px/1.3 var(--sans); }
.range-head output { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.range-scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--paper-muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--copper) var(--fill, 0%), var(--paper-hair) var(--fill, 0%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--paper-hair); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--copper); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--paper-ink); box-shadow: 0 2px 6px rgba(26, 26, 24, .25); transition: transform .12s ease; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--paper-ink); box-shadow: 0 2px 6px rgba(26, 26, 24, .25); }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--paper-ink); outline-offset: 3px; }
.calc-out { position: relative; background: var(--sheet); border: 1px solid var(--paper-hair); border-radius: var(--r-glass); padding: 28px 32px 28px; box-shadow: 0 30px 60px -36px rgba(26, 26, 24, .45); display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
.pile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--paper-hair); }
.pile { position: relative; width: 132px; height: 96px; flex: none; }
.paper-mini {
  position: absolute; left: 30px; bottom: 0; width: 64px; height: 82px;
  background: var(--sheet); border: 1px solid rgba(26, 26, 24, .16); border-radius: 1px;
  box-shadow: 0 1px 1px rgba(26, 26, 24, .06), 0 6px 14px -8px rgba(26, 26, 24, .5);
  transform: translateY(calc(var(--i) * -3px)) rotate(var(--r));
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .35s ease;
  animation: pile-in .35s ease backwards;
}
.paper-mini::before { content: ""; position: absolute; inset: 0; background: url("paper-grain.png") repeat; mix-blend-mode: multiply; opacity: .8; }
.paper-mini::after { content: ""; position: absolute; left: 9px; right: 9px; top: 12px; height: 34px; background: repeating-linear-gradient(180deg, rgba(26, 26, 24, .22) 0 1.5px, transparent 1.5px 7px); opacity: .7; }
@keyframes pile-in { from { opacity: 0; transform: translateY(-24px) rotate(var(--r)); } }
.pile-cap { display: flex; flex-direction: column; gap: 4px; text-align: right; font: 500 13px/1.3 var(--sans); color: var(--paper-muted) !important; }
.pile-cap .mono { font-size: 15px; color: var(--paper-ink); }
.out { display: flex; flex-direction: column; gap: 4px; }
.out-primary .out-num { font: 600 clamp(56px, 5.4vw, 78px)/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.out-secondary .out-num { font: 600 clamp(36px, 3.2vw, 46px)/1 var(--sans); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--paper-ink); }
.out-label { font-size: 15px; color: var(--paper-muted); }
.out-primary .out-label { font-size: 16px; font-weight: 500; color: var(--paper-ink); }
.ratio { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; border-top: 1px solid var(--paper-hair); }
.ratio-bar { display: block; height: 6px; border-radius: 3px; background: var(--verdigris); overflow: hidden; }
.ratio-model { display: block; height: 100%; width: 2%; min-width: 3px; background: var(--copper); transition: width .35s ease; }
.ratio-text { font-size: 13.5px; line-height: 1.5; color: var(--paper-muted) !important; text-wrap: pretty; }
.ratio-text b { font-weight: 500; color: var(--paper-ink); }
.calc-note { font-size: 15px; line-height: 1.5; color: var(--paper-ink); text-wrap: pretty; }
.calc-fine { font-size: 12.5px; color: var(--paper-muted) !important; }

/* Built (dark) */
.section-head-inline { display: block; margin-bottom: 44px; }
.section-head-inline .lede { margin-top: 18px; max-width: 62ch; }
.built-list.built-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.schematic { margin: 0; padding: 28px 22px; overflow-x: auto; }
.schematic svg { display: block; width: 100%; max-width: 860px; margin: 0 auto; height: auto; min-width: 560px; font-family: var(--mono); }
.schematic .box { fill: rgba(0, 0, 0, .35); stroke: rgba(255, 255, 255, .3); stroke-width: 1; }
.schematic .box-core { fill: rgba(255, 255, 255, .07); stroke: rgba(232, 236, 240, .75); }
.schematic .box-review { fill: transparent; stroke: rgba(255, 255, 255, .38); stroke-dasharray: 3 3; }
.schematic .box-console { fill: var(--paper); stroke: var(--paper); }
.schematic .lbl { fill: var(--text); font-size: 12px; font-family: var(--sans); font-weight: 500; }
.schematic .lbl-console { fill: var(--paper-ink); }
.schematic .sub { fill: var(--muted); font-size: 9.5px; }
.schematic .wire { stroke: rgba(255, 255, 255, .42); stroke-width: 1; fill: none; }
.schematic .wire-sse { stroke: var(--verdigris); stroke-dasharray: 4 3; }
.schematic .arrow { fill: rgba(255, 255, 255, .5); }
.schematic .arrow-sse { fill: var(--verdigris); }
.built-list { display: flex; flex-direction: column; gap: 10px; }
.built-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 16px 18px; align-content: start; font-size: 15px; line-height: 1.5; color: var(--text); text-wrap: pretty; border-radius: 10px; }
.built-list .idx { font: 400 11px/1.9 var(--mono); color: var(--copper-text); }

/* Bring + delivery (paper) */
.use-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin-bottom: 72px; }
.use { padding: 20px 0 22px; border-top: 1px solid var(--paper-ink); display: flex; flex-direction: column; gap: 12px; }
.use .idx { font: 400 11px/1.6 var(--mono); color: var(--paper-muted); }
.use .flow { font: 600 21px/1.25 var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
.use .flow .arrow { display: inline-block; margin: 0 6px; color: var(--paper-muted); }
.use p:not(.flow) { font-size: 14.5px; color: var(--paper-muted); }
.delivery { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter); align-items: start; padding-top: 48px; border-top: 1px solid var(--paper-hair); }
.delivery-note { margin-top: 14px; font-size: 15px; line-height: 1.55; color: var(--paper-muted) !important; max-width: 36ch; }
.delivery-head h3 { margin-top: 12px; font: 600 clamp(26px, 2.6vw, 34px)/1.1 var(--sans); letter-spacing: -0.03em; text-wrap: balance; }
.timeline-list { position: relative; display: flex; flex-direction: column; }
.timeline-list::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 1px; background: var(--paper-hair); }
.timeline-list li { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 12px 0 12px 28px; align-items: baseline; }
.timeline-list li::before { content: ""; position: absolute; left: 0; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--paper-ink); }
.timeline-list .when { font-size: 12px; color: var(--paper-muted); }
.timeline-list .what { font-size: 16px; line-height: 1.5; }

/* FAQ (dark) */
section.faq-band { padding-bottom: 40px; }
.faq-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.faq-head { display: block; margin-bottom: 8px; }
.faq-head h2 { margin-top: 10px; }
.faq-head .lede { font-size: 15px; color: var(--muted); max-width: 44ch; }
.faq-head .eyebrow { margin-bottom: 10px; }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.faq { padding: 0 22px; transition: border-color .25s ease; min-width: 0; }
.faq:last-child:nth-child(odd) { grid-column: auto; }
.faq[open] { border-color: var(--glass-border-hover); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font: 500 17px/1.35 var(--sans); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq-icon { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--glass-border-hover); }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--copper-text); transform: translate(-50%, -50%); transition: transform .25s ease; }
.faq-icon::before { width: 10px; height: 1.5px; }
.faq-icon::after { width: 1.5px; height: 10px; }
.faq[open] .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq p { padding: 0 0 20px; max-width: 62ch; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.faq summary:focus-visible { outline-offset: 4px; }

/* Final CTA (dark, glow) */
section.cta-band { position: relative; padding-top: 40px; overflow: hidden; }
.cta-glow { position: absolute; z-index: -1; pointer-events: none; left: 50%; top: 50%; width: 1000px; height: 640px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(217, 136, 74, .24), rgba(224, 166, 75, .10) 45%, transparent 76%); filter: blur(48px); }
.cta { padding: 72px 48px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cta p { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 52ch; text-wrap: pretty; }
.cta-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.text-link { font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--text); }

/* Footer */


/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  html { scroll-padding-top: 118px; }
  .hero-main { grid-column: 1 / 7; }
  .hero-side { grid-column: 7 / 13; }
  .nav-links { display: none; }
  .nav-sub { display: flex; gap: 8px; padding: 0 var(--gutter) 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-sub::-webkit-scrollbar { display: none; }
  .nav-sub a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font: 500 13px/1.2 var(--sans); color: var(--text); text-decoration: none; white-space: nowrap; }
  .nav-sub a:hover { border-color: var(--glass-border-hover); }
}

@media (max-width: 960px) {
  :root { --band: 72px; }
  .hero { padding-top: 40px; padding-bottom: 28px; }
  .hero-main, .hero-side { grid-column: 1 / -1; }
  .hero-glow { left: -300px; width: 800px; }
  .pg-grid { grid-template-columns: minmax(0, 1fr); }
  .inbox { min-height: 0; }
  .console-wrap:has(.console.is-live) { align-self: auto; }
  .console.is-live { height: auto; min-height: 0; }
  .console.is-live .console-inner { position: static; }
  .console.is-live .timeline { max-height: 520px; min-height: 240px; }
  .section-head { grid-template-columns: 1fr; row-gap: 10px; margin-bottom: 40px; }
  .section-head .eyebrow, .section-head h2, .section-head .lede { grid-column: auto; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps::before { left: 24px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .refuse-grid { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; gap: 32px; }
  .built-list.built-cols { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; }
  .use-grid { grid-template-columns: 1fr; gap: 0; margin-bottom: 48px; }
  .delivery { grid-template-columns: 1fr; padding-top: 36px; }
  .faq-grid { grid-template-columns: 1fr; }
  .cta { padding: 48px 24px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .nav-row { height: 58px; }
  .nav-right { gap: 8px; }
  .pill { padding: 0 10px 0 8px; }
  .hero h1 { font-size: clamp(44px, 12.5vw, 60px); }
  .hero-side p { font-size: 16px; }
  .metrics-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .metrics-row div:last-child { grid-column: span 2; }
  .sheet { --tilt: 0.8deg; display: flex; flex-direction: column; padding: 18px 14px 20px; }
  .sheet:hover, .sheet:focus-within { transform: rotate(0deg); }
  .stamp { position: static; align-self: flex-end; margin: -6px 0 10px; transform: rotate(-4deg); }
  .run-model { display: none; }
  .tab { white-space: normal; overflow: visible; text-overflow: clip; padding: 9px 12px 10px; font-size: 12.5px; min-height: 54px; display: flex; align-items: flex-start; }
  .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: 1fr; }
  .fact { padding-left: 0 !important; border-left: 0 !important; }
  .fact + .fact { border-top: 1px solid var(--hair); }
  .controls { align-items: flex-start; }
  .run-group { margin-left: 0; width: 100%; }
  .btn-run { flex: 1; }
  .tray { padding: 10px 10px 14px; }
  .console-foot { padding-left: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 48px; }
  .marquee { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; gap: 8px; overflow-x: auto; padding: 4px var(--gutter) 8px; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; }
  .marquee::-webkit-scrollbar { display: none; }
  .marquee-track { display: contents; animation: none; }
  .marquee-copy { display: none; }
  .int-chip { font-size: 12.5px; padding: 7px 11px; gap: 8px; }
  .marquee { gap: 6px; }
  .pile { width: 110px; height: 84px; }
  .paper-mini { left: 22px; width: 56px; height: 72px; }
  .steps::before { display: none; }
  .timeline-list li { grid-template-columns: 1fr; gap: 4px; }
  .calc-out { padding: 24px 20px; }
  .cta-actions { gap: 14px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .entry, .chunk, .reveal-in { animation: none !important; transition: none !important; }
  .reveal-pre { transform: none; }
  .pill-dot, .sys-card.tick, .sys-card.tick .sys-count, .console-glow { animation: none !important; }
  .console-glow { transition: none; }
  .spinner { animation: none; border-top-color: var(--copper); border-right-color: var(--copper); }
  .btn-run.is-indeterminate .progress-bar { animation: none; width: 100%; opacity: .5; }
  .countdown-bar { transition: none !important; }
  .timeline { scroll-behavior: auto; }
  .btn, .toggle-track, .toggle-track::after, .glass-hover, .sheet, .faq-icon::before, .faq-icon::after { transition: none; }
  .glass-hover:hover { transform: none; }
  .sheet:hover, .sheet:focus-within { transform: rotate(var(--tilt)); }
  .marquee { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; flex-wrap: wrap; flex: 1 1 auto; }
  .marquee-copy { display: none; }
  input[type="range"]::-webkit-slider-thumb { transition: none; }
}

@media print {
  .console-wrap, .nav-right, .nav-links, .controls, .console-foot, .marquee, .hero-glow, .cta-glow { display: none; }
  body { background: #fff; color: #000; }
}

/* =================== Revision 3: depth, choreography, finish =================== */

/* 1. Opening choreography */
.sheet { animation: sheet-in .9s cubic-bezier(.2, .7, .2, 1) .35s backwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) rotate(calc(var(--tilt) + 1deg)); } to { opacity: 1; transform: translateY(0) rotate(var(--tilt)); } }
.console-wrap { animation: fade-in .7s ease .75s backwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.proof-chip { animation: rise .55s cubic-bezier(.2, .7, .2, 1) backwards; }
.proof-chip:nth-child(1) { animation-delay: .9s; }
.proof-chip:nth-child(2) { animation-delay: .96s; }
.proof-chip:nth-child(3) { animation-delay: 1.02s; }
.auto-label { flex: 1 1 auto; min-width: 0; margin: 0 12px; font: 500 11.5px/1.3 var(--sans); letter-spacing: .02em; color: var(--copper-text); white-space: nowrap; text-align: right; }
.panel-head:has(.auto-label:not([hidden])) .run-model { display: none; }
.panel-head:has(.auto-label:not([hidden])) .run-id { flex: 0 1 auto; }
.auto-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); margin-right: 8px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }

/* 2. Paper flow canvas */
.pg-grid { position: relative; }
.flow-canvas { position: absolute; top: -24px; left: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); height: calc(100% + 48px); pointer-events: none; z-index: 2; display: block; }

/* 3. Tactile surfaces: spotlight borders, magnetic buttons, sheet hover, slider bubbles */
.glass { position: relative; }
.glass::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 3;
  background: radial-gradient(220px circle at var(--mx, -999px) var(--my, -999px), rgba(240, 168, 104, .35), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity .35s ease;
}
.is-spot .glass::after { opacity: 1; }
.btn-primary, .btn-run { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .2s ease, filter .15s ease; }
.btn-primary:active, .btn-run:active { transform: translate(var(--tx, 0), calc(var(--ty, 0) + 1px)); }
.sheet:hover, .sheet:focus-within { box-shadow: 0 1px 1px rgba(26, 26, 24, .1), 0 6px 14px rgba(26, 26, 24, .13), 0 36px 62px -18px rgba(26, 26, 24, .58); }
.range { position: relative; }
input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; border-width: 2px; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--copper); outline-offset: 3px; }
input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid var(--copper); outline-offset: 3px; }
.range-bubble {
  position: absolute; left: var(--fill, 0%); top: 34px; transform: translate(-50%, -8px) scale(.96);
  padding: 4px 8px; border-radius: 6px; background: var(--paper-ink); color: var(--paper);
  font: 500 12px/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.range-bubble::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 1px; }
.range.is-dragging .range-bubble { opacity: 1; transform: translate(-50%, -14px) scale(1); }

/* 4. Perforated band edges and editorial index rows */
.perf { position: relative; height: 0; z-index: 5; }
.perf::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 5px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--perf-ink) 0 4px, transparent 4px 10px);
}
.perf::after {
  content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 20px; pointer-events: none;
  background: radial-gradient(circle at 0 10px, var(--perf-prev) 0 9.5px, transparent 10.5px) left center / 10px 20px no-repeat,
              radial-gradient(circle at 10px 10px, var(--perf-prev) 0 9.5px, transparent 10.5px) right center / 10px 20px no-repeat;
}
.perf[data-from="dark"] { --perf-prev: var(--ink); --perf-ink: rgba(26, 26, 24, .28); }
.perf[data-from="paper"] { --perf-prev: var(--paper); --perf-ink: rgba(255, 255, 255, .2); }
.sec-index { display: flex; align-items: center; gap: 10px; }
.idx-n { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; color: var(--copper-text); }
.paper-section .idx-n, .inbox .idx-n { color: var(--copper); }
.idx-rule { width: 24px; height: 1px; background: var(--copper); opacity: .8; }
.nav-links a .n, .nav-sub a .n { font: 500 10.5px/1 var(--mono); letter-spacing: .04em; color: var(--copper-text); margin-right: 7px; opacity: .85; }
.pg-head { padding-bottom: 18px; }

/* 5. Console finish: run history, timeline connector, indeterminate bar */
.run-history-row { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 18px; border-top: 1px solid var(--hair); }
.rh-label { flex: none; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.run-history { display: flex; gap: 6px; padding: 8px 0; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.run-history::-webkit-scrollbar { display: none; }
.run-chip { flex: none; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(0, 0, 0, .25); font: 400 11px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; animation: fadein .35s ease; }
.run-chip:first-child { color: var(--text); border-color: var(--glass-border-hover); }
.timeline.has-entries { background: linear-gradient(var(--hair), var(--hair)) no-repeat 21px 24px / 1px calc(100% - 48px); background-attachment: local; }
.timeline .entry { position: relative; padding-left: 20px; }
.timeline .entry::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--graphite); border: 1px solid var(--muted); box-sizing: border-box; }
.timeline .turn { padding-left: 20px; }
.timeline .turn::before { top: 5px; width: 9px; height: 9px; left: -1px; border-color: var(--text); }
.timeline .thinking { border-left: 0; padding-left: 20px; }
.timeline .thinking::before { border-color: var(--hair); background: var(--hair); }
.timeline .tool::before { top: 16px; border-color: var(--copper); background: var(--copper); }
.timeline .tool.is-retrying::before { border-color: var(--amber); background: var(--amber); }
.timeline .tool.is-ok::before { border-color: var(--verdigris); background: var(--verdigris); }
.timeline .tool.is-failed::before { border-color: var(--signal); background: var(--signal); }
.timeline .summary { margin-left: 0; }
.timeline .summary::before { border-color: var(--verdigris); background: var(--verdigris); }
.timeline .error-entry::before { border-color: var(--signal); background: var(--signal); }
.timeline .stopped::before { border-color: var(--muted); }
.timeline .tool, .timeline .error-entry, .timeline .summary { margin-left: 20px; padding-left: 14px; }
.timeline .tool::before, .timeline .error-entry::before, .timeline .summary::before { left: -20px; }
.timeline .summary { padding-left: 14px; }
.console.is-running::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 4; background: linear-gradient(90deg, transparent, var(--copper-text), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: indet 1.4s linear infinite; }
@keyframes indet { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* 6. Footer */
.footer { border-top: 1px solid var(--hair); padding: 56px 0 28px; background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 32px var(--gutter); }
.footer-col p { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--text); max-width: 34ch; }
.footer-col .footer-h { margin-top: 0; font: 500 11.5px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.footer-muted { color: var(--muted) !important; }
.footer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--text); }
.footer-list a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair); }
.footer-list a:hover { text-decoration-color: var(--copper-text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--muted); }
.status-wink { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--verdigris); box-shadow: 0 0 8px rgba(95, 179, 161, .7); animation: pulse 3s ease-in-out infinite; }

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer { padding-top: 44px; }
  .run-history-row { padding-left: 12px; }
}
@media (max-width: 600px) {
  .auto-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .console-wrap, .proof-chip, .auto-label::before, .status-dot, .run-chip { animation: none !important; }
  .console.is-running::before { animation: none; background: var(--copper); background-size: 100% 100%; }
  .glass::after { transition: none; }
  .btn-primary, .btn-run { transition: none; }
  .range-bubble { transition: none; }
  .flow-canvas { display: none; }
}

/* =================== Round 7: files in, stored runs, honest limits =================== */

.inbox-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 18px 4px; }
.inbox-tools .blurb { padding: 0; min-height: 0; flex: 1 1 auto; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-top: 1px; padding: 4px 0; background: none; border: 0; border-bottom: 1px solid transparent; font: 500 12.5px/1.3 var(--sans); color: var(--paper-ink); cursor: pointer; white-space: nowrap; transition: border-color .15s ease, color .15s ease; }
.link-btn:hover { border-bottom-color: var(--paper-ink); }
html[data-mode="replay"] .link-btn#upload-btn { opacity: .55; }
html[data-mode="replay"] .link-btn#upload-btn:hover { opacity: .8; }
.link-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--copper); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.link-btn-inline { display: inline; padding: 0; margin: 0 0 0 4px; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; border: 0; }

.sheet.is-dragging { outline: 2px dashed var(--copper); outline-offset: 4px; }
.drop-overlay {
  position: absolute; inset: 10px; z-index: 4; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--copper); border-radius: 4px; background: rgba(251, 250, 246, .86);
  font: 500 15px/1.4 var(--sans); color: var(--paper-ink); text-align: center; padding: 20px; pointer-events: none;
}
.drop-overlay span::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 10px; border-radius: 50%; border: 1.5px solid var(--copper); background: linear-gradient(var(--copper), var(--copper)) center / 1.5px 12px no-repeat, linear-gradient(var(--copper), var(--copper)) center / 12px 1.5px no-repeat; }

.attach { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 46px; }
.sheet:has(.attach:not([hidden])) .stamp { display: flex; }
.attach-card { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; background: var(--sheet); border: 1px solid rgba(26, 26, 24, .18); border-radius: 2px; transform: rotate(-0.7deg); box-shadow: 0 1px 1px rgba(26, 26, 24, .08), 0 3px 6px rgba(26, 26, 24, .08), 0 14px 26px -14px rgba(26, 26, 24, .55); position: relative; }
.attach-card::before { content: ""; position: absolute; inset: 0; background: url("paper-grain.png") repeat; mix-blend-mode: multiply; opacity: .7; pointer-events: none; }
.attach-card::after { content: ""; position: absolute; left: 18px; top: -7px; width: 30px; height: 12px; background: var(--paper); border: 1px solid rgba(26, 26, 24, .18); border-radius: 2px; transform: rotate(-4deg); box-shadow: 0 1px 2px rgba(26, 26, 24, .12); }
.attach-glyph { flex: none; width: 34px; height: 42px; border: 1.5px solid rgba(26, 26, 24, .5); border-radius: 2px; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font: 500 8.5px/1 var(--mono); letter-spacing: .08em; color: var(--paper-ink); background: linear-gradient(var(--sheet), var(--sheet)); }
.attach-glyph::before { content: ""; position: absolute; top: -1.5px; right: -1.5px; width: 10px; height: 10px; background: var(--paper); border-left: 1.5px solid rgba(26, 26, 24, .5); border-bottom: 1.5px solid rgba(26, 26, 24, .5); }
.attach-glyph.is-image::after { content: ""; position: absolute; left: 6px; right: 6px; top: 10px; height: 14px; background: linear-gradient(135deg, transparent 55%, rgba(26, 26, 24, .35) 56%), radial-gradient(circle at 70% 30%, rgba(26, 26, 24, .5) 2px, transparent 2.5px); }
.attach-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.attach-name { font: 500 14px/1.3 var(--sans); color: var(--paper-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 11.5px; color: var(--paper-muted); }
.attach-remove { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(26, 26, 24, .2); background: transparent; color: var(--paper-muted); font: 400 18px/1 var(--sans); cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.attach-remove:hover { color: var(--paper-ink); border-color: var(--paper-ink); }
.notes { display: block; width: 100%; border: 0; border-top: 1px solid var(--paper-hair); background: transparent; outline: none; resize: none; padding: 12px 0 0; font: 400 13px/1.55 var(--sans); color: var(--paper-ink); min-height: 88px; }
.notes::placeholder { color: var(--paper-muted); }

.note-limit { border-left-color: var(--signal); background: rgba(229, 72, 77, .08); }
.btn-run.is-cooling, .btn-run:disabled { opacity: .6; cursor: not-allowed; pointer-events: none; transform: none; filter: none; box-shadow: none; }
.btn-run.is-cooling .btn-label { font-variant-numeric: tabular-nums; }

.run-chip { display: inline-flex; align-items: center; gap: 7px; }
.run-chip.is-live { cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.run-chip.is-live:hover { border-color: var(--glass-border-hover); color: var(--text); }
.run-chip:focus-visible { outline-offset: 2px; }
.run-glyph { width: 11px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.run-chip .err-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); flex: none; }
.run-history-empty { font: 400 11px/1.4 var(--mono); color: var(--muted); padding: 2px 0; }

@media (max-width: 600px) {
  .inbox-tools { flex-direction: column; gap: 8px; }
  #stored-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .link-btn, .attach-remove, .run-chip.is-live { transition: none; }
}
