/* GPU Errand site. Tokens first; everything below reads them. See ../DESIGN.md. */
:root {
  --soot: #0f0f0f;
  --soot-2: #1a1a1a;
  --paper: #ffffff;
  --paper-2: #f2f2f0;
  --paper-3: #e6e6e3;
  --ink: #0f0f0f;
  --ink-soft: #5c5c5c;
  --light: #ffffff;
  --light-soft: #a3a3a3;
  --lime: #dafa9c;
  --lime-ink: #0f0f0f;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, /* taste-skill-ignore: code, logs and job files only */ "SFMono-Regular", Menlo, Consolas, monospace;

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --step-display: clamp(2.5rem, 1rem + 5.2vw, 5.5rem);

  --margin: clamp(20px, 2.4vw, 32px);
  --section-gap: clamp(96px, 12vw, 176px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-soft) var(--paper-2); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--font);
  font-feature-settings: "tnum" 0;
  caret-color: var(--ink);
}
::selection { background: var(--lime); color: var(--lime-ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease); }
a:hover { text-decoration-color: transparent; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.soot :focus-visible { outline-color: var(--lime); }
code { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -100px; background: var(--lime); color: var(--lime-ink); padding: 10px 14px; z-index: 10; }
.skip:focus { top: 12px; }

/* Grounds */
.soot { background: var(--soot); color: var(--light); }
.soot ::selection { background: var(--lime); color: var(--lime-ink); }
.paper { background: var(--paper); color: var(--ink); }
.paper-2 { background: var(--paper-2); color: var(--ink); }

/* One centred frame; every section hangs from its left edge */
.frame { width: min(58rem, 100%); margin-inline: auto; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: baseline; padding: 28px var(--margin) 0; }
.wordmark { font-weight: 600; text-decoration: none; font-size: var(--step-body); }
.top-link { font-size: var(--step-small); color: var(--light); }

/* Hero: the line, then the pitch beside the receipt */
.hero { padding: 20vh var(--margin) 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); column-gap: 64px; align-items: start; }
.hero h1 { grid-column: 1 / -1; font-size: var(--step-display); line-height: 1.0; letter-spacing: -0.03em; }
.hero-text { padding-top: 40px; }
.lead { font-size: var(--step-body); max-width: 34rem; color: var(--light); }
.install { margin-top: 32px; display: flex; align-items: stretch; max-width: 36rem; }
.install code { background: var(--soot-2); color: var(--light); padding: 0 16px; display: flex; align-items: center; min-height: 48px; font-size: 0.8125rem; white-space: nowrap; overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.btn {
  font: 600 var(--step-small)/1 var(--font);
  background: var(--lime); color: var(--lime-ink);
  border: 0; border-radius: 0; padding: 0 18px; min-height: 46px; cursor: pointer;
  transition: transform 140ms var(--ease), background-color 180ms var(--ease);
}
.btn:hover { background: #e8ffbd; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.done { background: var(--light); }
.install .btn { flex: none; min-width: 5.5rem; }
.hero-link { margin-top: 18px; font-size: var(--step-small); }
.hero-link a { color: var(--light); }

/* The receipt: a white slip on the soot ground */
.receipt { margin: 48px 0 0; }
.slip {
  list-style: none; margin: 0; padding: 22px 22px 24px;
  background: var(--paper); color: var(--ink);
  font-size: var(--step-small); line-height: 1.6; font-variant-numeric: tabular-nums;
}
.slip li { display: flex; justify-content: space-between; gap: 16px; }
.slip li span:last-child { text-align: right; }
.slip .total { margin-top: 10px; padding-top: 10px; font-weight: 600; border-top: 2px dashed var(--paper-3); }
.receipt figcaption { padding-top: 14px; font-size: var(--step-small); color: var(--light-soft); }

/* Section headings */
.h-sec { font-size: var(--step-head); line-height: 1.1; letter-spacing: -0.02em; }

/* How it works: statements on the left, a pinned stage on the right */
.how { padding: var(--section-gap) var(--margin) 0; }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.steps { max-width: 36rem; }
.step { padding: 48px 0 0; }
.step-say { font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.01em; }
.step-more { margin-top: 10px; color: var(--ink-soft); }
.frag, .stage-frag, .panel { background: var(--paper-2); color: var(--ink); font-variant-numeric: tabular-nums; }
.frag { margin-top: 24px; }
pre { margin: 0; padding: 20px 22px; overflow-x: auto; font: 400 0.875rem/1.6 var(--mono); }
pre b { font-weight: 600; }
mark { background: var(--lime); color: var(--lime-ink); padding: 0 3px; }

@media (min-width: 1000px) {
  .js .how-grid { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); column-gap: 56px; }
  .js .step { min-height: 44vh; padding-top: 0; display: flex; flex-direction: column; justify-content: center; }
  .js .step:last-child { min-height: 52vh; }
  /* Shown in the stage instead; kept for screen readers (the stage is aria-hidden). */
  .js .step .frag { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .js .step-say { font-size: clamp(1.75rem, 1.3rem + 1vw, 2.125rem); color: var(--ink-soft); transition: color 220ms var(--ease); }
  .js .step.active .step-say { color: var(--ink); }
  .js .stage { position: sticky; top: 22vh; align-self: start; margin-top: 30vh; height: 24rem; position: sticky; }
  .js .stage-frag { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(12px); transition: opacity 260ms var(--ease), transform 360ms var(--ease); }
  .js .stage-frag.on { opacity: 1; transform: none; }
  .js .stage-frag pre { padding: 28px 30px; font-size: 0.9375rem; }
}

/* Safe to hand to an agent: small proof beside text */
.safe { padding: var(--section-gap) var(--margin) 0; }
.module { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 64px; }
.module + .module { margin-top: 104px; }
.mod-text h3 { font-size: var(--step-lead); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.mod-text p { margin-top: 12px; max-width: 40ch; }
.mod-text p + p { color: var(--ink-soft); }
.panel pre { padding: 20px 22px; font-size: 0.875rem; }

/* The live thing: the cap calculator */
.calc { padding: 22px; }
.calc-form { display: grid; gap: 16px; }
.calc fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.calc legend { font-size: var(--step-small); color: var(--ink-soft); margin-bottom: 8px; }
.calc fieldset label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--paper); font-weight: 600; font-size: var(--step-small); cursor: pointer; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.calc fieldset input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.calc fieldset label:hover { background: var(--paper-3); }
.calc fieldset label:has(input:checked) { background: var(--ink); color: var(--paper); }
.calc fieldset label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.range { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: var(--step-small); line-height: 1.3; }
.range output { font-weight: 600; font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; width: 100%; accent-color: var(--ink); min-height: 28px; }
.calc-result { margin-top: 18px; font-size: var(--step-small); line-height: 1.5; }
.calc-result b { font-weight: 600; }

/* Measured runs */
.proof { margin-top: var(--section-gap); padding: var(--section-gap) var(--margin); }
.h-big { font-size: var(--step-display); line-height: 1; letter-spacing: -0.03em; }
.h-big span { display: block; padding-left: 1.6em; }
.runs { margin-top: 72px; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.runs th { text-align: left; font-weight: 400; font-size: var(--step-small); color: var(--ink-soft); padding: 0 16px 12px 0; }
.runs td { padding: 14px 16px 14px 0; vertical-align: top; }
.runs tbody tr:nth-child(odd) td { background: var(--paper); }
.runs td:first-child, .runs th:first-child { padding-left: 14px; white-space: nowrap; }
.runs td:last-child, .runs th:last-child { text-align: right; padding-right: 14px; white-space: nowrap; }
.note { margin-top: 28px; max-width: 40rem; color: var(--ink-soft); }

/* Recipes, job types and agents: two-ended rows */
.kinds { padding: var(--section-gap) var(--margin) 0; }
.group { margin-top: 40px; color: var(--ink-soft); }
.rows { list-style: none; margin: 4px 0 0; padding: 0; max-width: 40rem; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; min-height: 40px; padding: 6px 0; }
.rows li > span:last-child { color: var(--ink-soft); font-size: var(--step-small); white-space: nowrap; }

/* Questions as reading text */
.faq { padding: var(--section-gap) var(--margin) 0; }
.faq-text { margin-top: 32px; columns: 2 22rem; column-gap: 56px; }
.faq-text p { break-inside: avoid; margin-bottom: 20px; line-height: 1.55; }
.faq-text b { font-weight: 600; }

/* Footer: one quiet line on the soot ground */
.foot { margin-top: var(--section-gap); padding: 120px var(--margin) 30px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 24px; align-items: baseline; font-size: var(--step-small); color: var(--light-soft); }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.foot-links a { color: var(--light); }
.foot-year { text-align: right; }

/* Entrances: content is visible without script; script hides then reveals */
.js [data-rise]:not(.in) { opacity: 0; transform: translateY(20px); }
.js [data-rise] { transition: opacity 600ms var(--ease), transform 700ms var(--ease); }
.js .slip li { transition: opacity 120ms linear, transform 200ms var(--ease); }
.js .slip.printing li:not(.out) { opacity: 0; transform: translateY(-6px); }

@media (prefers-reduced-motion: reduce) {
  .js [data-rise]:not(.in), .js .slip.printing li:not(.out) { transform: none; }
  * { transition-duration: 1ms !important; }
}

/* Tablet and phone */
@media (max-width: 999px) {
  .stage { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .receipt { max-width: 24rem; }
}
@media (max-width: 640px) {
  .hero { padding-top: 16vh; }
  .install { flex-direction: column; }
  .install code { white-space: normal; overflow-wrap: anywhere; padding: 12px 16px; }
  .install .btn { width: 100%; }
  .module { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .module + .module { margin-top: 64px; }
  .h-big span { padding-left: 0.8em; }
  .runs thead { display: none; }
  .runs, .runs tbody, .runs tr, .runs td { display: block; }
  .runs tr { padding: 12px 14px; }
  .runs tbody tr:nth-child(odd) { background: var(--paper); }
  .runs tbody tr:nth-child(odd) td { background: none; }
  .runs td { padding: 0; text-align: left !important; }
  .runs td:first-child { padding-left: 0; font-size: var(--step-small); color: var(--ink-soft); }
  .runs td:empty { display: none; }
  .runs td:last-child { padding-right: 0; }
  .runs td:nth-child(3), .runs td:nth-child(4) { display: inline; color: var(--ink-soft); font-size: var(--step-small); }
  .runs td:nth-child(3)::after { content: ", "; }
  .runs td:nth-child(4)::after { content: " units"; }
  .faq-text { columns: 1; }
  .foot { grid-template-columns: 1fr; padding-top: 80px; gap: 8px; }
  .foot-links { justify-content: flex-start; }
  .foot-year { text-align: left; }
}

/* Recipe pages: the same world, in reading mode */
.doc-head { padding: 18vh var(--margin) 88px; }
.doc-head h1 { font-size: clamp(1.875rem, 0.9rem + 3.7vw, 4.25rem); line-height: 1.02; letter-spacing: -0.03em; }
.doc-head .doc-lead { margin-top: 28px; color: var(--light); font-size: var(--step-lead); line-height: 1.4; }
.doc { padding: 72px var(--margin) 0; }
.doc-body { width: min(46rem, 100%); margin-inline: auto; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2 { font-size: var(--step-lead); line-height: 1.2; margin: 56px 0 0; font-weight: 600; }
.doc-body p, .doc-body ul, .doc-body ol { margin: 16px 0 0; }
.doc-body li { margin-top: 6px; }
.doc-body pre { margin-top: 20px; background: var(--paper-2); }
.doc-body :not(pre) > code { background: var(--paper-2); padding: 1px 5px; overflow-wrap: anywhere; }
.doc-body table { margin-top: 20px; border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.doc-body th { text-align: left; font-weight: 400; color: var(--ink-soft); font-size: var(--step-small); padding: 0 12px 10px 0; }
.doc-body td { padding: 10px 12px 10px 0; vertical-align: top; }
.doc-body tbody tr:nth-child(odd) td { background: var(--paper-2); }
.doc-back { margin-top: 64px; }
