/* Fabricwright — the home page, in the weaving-draft world.
 *
 * A fabric is woven from its draft, and the page shows one: devices across
 * as warp, configuration down as weft, a filled cell wherever the generator
 * wrote that section for that device. The rules that follow from it:
 *
 *  - Indigo is the cloth. It floods whole regions (the top of the page and
 *    the close) in both themes and is never sprinkled as an accent.
 *  - Weld yellow is the weft: filled cells on the cloth, and the one primary
 *    button. On paper a filled cell is inked in indigo instead.
 *  - Every grid line is a device or a section. No decorative ruling, no
 *    gradients, no glass, no glow.
 *  - Live things are filled cells; planned things are outlines.
 *  - Archivo carries every word, at three widths: wide for headings, normal
 *    for reading, condensed for the draft's own labels. Configuration is set
 *    in the visitor's own monospace, because it is code.
 *
 * Same origin only (the CSP): the one font is self-hosted beside this file.
 */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens ------------------------------------------------------------ */

:root {
  /* The cloth and the weft: the same in both themes. */
  --cloth: #1b2366;
  --cloth-deep: #121850;
  --cloth-line: rgba(238, 240, 251, .16);
  --on-cloth: #eef0fb;
  --on-cloth-2: #bfc5ea;
  --on-cloth-3: #9aa1d6;
  --empty-line: rgba(238, 240, 251, .46);
  --empty-recede: rgba(238, 240, 251, .42);
  --recede: #6670c4;            /* a filled cell outside the pulled thread */
  --weld: #f0c73a;
  --weld-hover: #f6d565;
  --weld-ink: #141a4a;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 2px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Paper: bleached, cool, inked in indigo. */
:root, [data-theme="light"] {
  --paper: #f3f4f9;
  --paper-2: #e8eaf3;
  --ink: #141a4a;
  --ink-2: #394170;
  --ink-3: #555d8b;
  --rule: #cfd3e6;
  --rule-strong: #9aa0c4;
  --cell: #1b2366;              /* a filled cell, inked on paper */
  --link: #2a36a0;
  --focus: #2a36a0;
  color-scheme: light;
}

/* Night: the paper turns to the dark of an unlit dye vat. The cloth stays the
 * cloth, so on this ground it reads as the lighter, raised thing. */
[data-theme="dark"] {
  --paper: #0b0f2e;
  --paper-2: #10153b;
  --ink: #eceefa;
  --ink-2: #bcc1e4;
  --ink-3: #959cc9;
  --rule: #252c66;
  --rule-strong: #3d4590;
  --cell: #f0c73a;
  --link: #b4bbff;
  --focus: #f0c73a;
  color-scheme: dark;
}

/* ---- Base -------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-stretch: 100%;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--focus);
}

::selection { background: var(--weld); color: var(--weld-ink); }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

code { font-family: var(--mono); font-size: .88em; }

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  padding: 10px 14px; background: var(--weld); color: var(--weld-ink);
  font-weight: 650; text-decoration: none; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Scrollbars belong to the world too. */
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.cloth * { scrollbar-color: rgba(238, 240, 251, .3) transparent; }

/* ---- Buttons and links ------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font: 650 16px/1 var(--sans); font-stretch: 108%; letter-spacing: .005em;
  text-decoration: none; border-radius: var(--radius); border: 0;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.btn-weld { background: var(--weld); color: var(--weld-ink); }
.btn-weld:hover { background: var(--weld-hover); text-decoration: none; }
.btn-weld:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-stretch: 104%;
}
.text-link svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease);
}
.text-link:hover svg { transform: translateX(3px); }

/* ---- The cloth: header and hero ----------------------------------------- */

.cloth {
  background: var(--cloth);
  color: var(--on-cloth);
  --link: var(--on-cloth);
  --focus: var(--weld);
}
.cloth ::selection { background: var(--weld); color: var(--weld-ink); }

.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  min-height: 68px;
  border-bottom: 1px solid var(--cloth-line);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: inherit; text-decoration: none;
  font-weight: 750; font-size: 18px; font-stretch: 112%; letter-spacing: -.01em;
}
.logo svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 26px; }
.nav a {
  color: var(--on-cloth-2); text-decoration: none;
  font-size: 15px; font-weight: 550; font-stretch: 100%;
}
.nav a:hover { color: var(--on-cloth); text-decoration: underline; text-decoration-color: var(--weld); text-decoration-thickness: 2px; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  background: transparent; color: var(--on-cloth-2);
  border: 1px solid var(--cloth-line); border-radius: var(--radius); cursor: pointer;
}
.theme-toggle:hover { color: var(--on-cloth); border-color: var(--empty-line); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .theme-toggle .moon,
[data-theme="light"] .theme-toggle .sun { display: none; }

.hero { padding: 30px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "intro pane" "draft pane";
  column-gap: clamp(32px, 4vw, 56px);
  row-gap: 30px;
}
.intro { grid-area: intro; }
.draft { grid-area: draft; }
.pane-slot { grid-area: pane; }

.hero h1 {
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  font-weight: 800; font-stretch: 116%;
  line-height: .98; letter-spacing: -.025em;
}
.hero .lead {
  margin-top: 18px; max-width: 54ch;
  color: var(--on-cloth-2); font-size: 18px; line-height: 1.55;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 22px; }
.hero-note { margin-top: 14px; color: var(--on-cloth-3); font-size: 14px; }

/* ---- The drawdown ------------------------------------------------------- */

.drawdown {
  --cw: 58px;           /* one warp end: a device */
  --ch: 31px;           /* one pick: a section */
  border-collapse: separate; border-spacing: 0;
  font-stretch: 75%;
}
.drawdown th { font-weight: 600; text-align: left; vertical-align: bottom; }
.drawdown thead th, .drawdown .tieup { padding: 0 0 10px; }
.drawdown thead th {
  width: var(--cw);
  color: var(--on-cloth-2);
  transition: color .2s var(--ease);
}
.drawdown thead th .dev, .drawdown thead th .role { display: block; padding-left: 4px; }
.drawdown thead th .dev { font-size: 14px; line-height: 1.2; color: var(--on-cloth); }
.drawdown thead th .role { font-size: 12px; line-height: 1.3; font-weight: 500; }

/* The tie-up corner: the rule the cloth is woven by. */
.tieup {
  padding-right: 14px !important; vertical-align: bottom;
  color: var(--on-cloth-3); font-size: 12px; line-height: 1.3; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; text-align: right;
}
.tieup span { display: block; white-space: nowrap; }
.tieup span:first-child { color: var(--on-cloth); }

.drawdown tbody th {
  padding: 0 14px 0 0; height: var(--ch);
  color: var(--on-cloth-2); font-size: 13.5px; line-height: 1.15; text-align: right;
  white-space: nowrap; vertical-align: middle;
  transition: color .2s var(--ease);
}
.drawdown td { padding: 0; width: var(--cw); height: var(--ch); }

.cell {
  position: relative; display: block; width: 100%; height: 100%;
  padding: 0; margin: 0; border: 0; background: transparent;
  cursor: pointer; border-radius: 0;
  transition: opacity .25s var(--ease);
}
.cell::before {
  content: ""; position: absolute; inset: 2px;
  box-shadow: inset 0 0 0 1.5px var(--empty-line);
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.cell.on::before { background: var(--weld); box-shadow: none; }

/* The weave-in. Only with scripts on (theme.js marks the page before it is
 * drawn), and draft.js ends it with .woven whatever the clock did, so a cell
 * can never be left hidden by an animation that was paused. */
.js .drawdown:not(.woven) .cell.on::before {
  animation: pick .34s var(--ease) both;
  animation-delay: calc(var(--r, 0) * 70ms + var(--c, 0) * 32ms + 120ms);
}
.cell:hover::before { transform: scale(1.08); }
.cell.on:hover::before { background: var(--weld-hover); }
.cell:not(.on):hover::before { box-shadow: inset 0 0 0 1.5px var(--on-cloth); }
.cell:focus-visible { outline-offset: 0; }

/* The chosen cell: undyed thread, ringed in weft. */
.cell[aria-pressed="true"]::before {
  background: var(--on-cloth);
  box-shadow: inset 0 0 0 4px var(--weld);
}
.cell:not(.on)[aria-pressed="true"]::before {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--on-cloth);
  outline: 2px dashed var(--weld); outline-offset: -8px;
}

/* A pulled thread: the chosen column and row stay up, the rest recede into
 * the cloth -- filled cells to a pale indigo, empty ones to a fainter
 * outline -- so filled and empty still read apart while they wait. */
.drawdown.has-pick .cell.on:not(.lift)::before { background: var(--recede); }
.drawdown.has-pick .cell:not(.on):not(.lift)::before { box-shadow: inset 0 0 0 1.5px var(--empty-recede); }
.drawdown.has-pick .cell.on:not(.lift):hover::before { background: var(--weld-hover); }
.drawdown.has-pick .cell:not(.on):not(.lift):hover::before { box-shadow: inset 0 0 0 1.5px var(--on-cloth); }
.drawdown.has-pick th.lift { color: var(--on-cloth); }
.drawdown.has-pick thead th.lift .role { color: var(--weld); }
.drawdown.has-pick tbody th.lift { color: var(--weld); }

@keyframes pick {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px;
  color: var(--on-cloth-3); font-size: 13.5px; font-stretch: 90%;
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
/* The key names the states on screen: before a thread is pulled every written
 * cell is weft; after, the written cells outside it are the receded indigo. */
.swatch { width: 14px; height: 14px; box-shadow: inset 0 0 0 1.5px var(--empty-line); }
.swatch.on, .swatch.pick { background: var(--weld); box-shadow: none; }
.legend .when-picked { display: none; }
.draft.picked .legend .when-picked { display: inline-flex; }
.draft.picked .swatch.on { background: var(--recede); }

/* ---- The pane: the lines a cell stands for ------------------------------ */

.pane {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--cloth-deep);
  border: 1px solid var(--cloth-line);
  border-radius: var(--radius);
}
.pane-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--cloth-line);
}
.pane-head .file { font-family: var(--mono); font-size: 13px; color: var(--on-cloth-2); }
.pane-head .where {
  order: -1; flex-basis: 100%;
  font-size: 20px; font-weight: 700; font-stretch: 108%; letter-spacing: -.01em; color: var(--on-cloth);
}
.pane-head .lines { margin-left: auto; font-size: 13px; color: var(--on-cloth-3); font-variant-numeric: tabular-nums; }

.pane-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; }
.stanza {
  flex: 1 1 auto; margin: 0; padding: 14px 0 18px; overflow: auto;
  font: 13px/1.6 var(--mono); color: var(--on-cloth);
  tab-size: 2;
}
.stanza:focus-visible { outline-offset: -3px; }
.stanza code { font-size: inherit; display: block; min-width: max-content; }
.stanza .ln { display: block; padding: 0 18px 0 0; white-space: pre; }
.stanza .ln b {
  display: inline-block; width: 4.5ch; margin-right: 2ch; padding-right: 1ch;
  text-align: right; font-weight: 400; color: var(--on-cloth-3);
  font-variant-numeric: tabular-nums; user-select: none;
}
.stanza .ln.hit { background: rgba(240, 199, 58, .13); }
.stanza .ln.hit b { color: var(--weld); }
.stanza .gap {
  display: block; margin: 6px 0; padding: 2px 0 2px 7.5ch;
  font-family: var(--sans); font-size: 12px; font-stretch: 90%;
  color: var(--on-cloth-3); user-select: none;
  border-top: 1px dashed var(--cloth-line); border-bottom: 1px dashed var(--cloth-line);
}
.why {
  padding: 18px; color: var(--on-cloth-2); font-size: 16px; line-height: 1.6; max-width: 44ch;
}
.why strong { display: block; margin-bottom: 6px; color: var(--on-cloth); font-weight: 650; }

.pane-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 12px 18px; border-top: 1px solid var(--cloth-line);
  color: var(--on-cloth-3); font-size: 13.5px;
}
.text-btn {
  padding: 4px 0; background: none; border: 0; cursor: pointer;
  color: var(--on-cloth); font: 600 14px/1.2 var(--sans); font-stretch: 100%;
  text-decoration: underline; text-decoration-color: var(--weld); text-underline-offset: .25em;
}
.text-btn:hover { text-decoration-thickness: 2px; }

/* Beside the draft the pane may be as tall as the intro and the draft
 * together, but no taller than its lines need: the slot takes the height
 * without letting the lines size the rows, and the pane shrinks inside it. */
@media (min-width: 1000px) {
  .hero-grid { grid-template-rows: auto 1fr; }
  .pane-slot { display: flex; flex-direction: column; height: 0; min-height: 100%; }
  .pane-slot .pane { flex: 0 1 auto; }
  .drawdown { --cw: clamp(58px, 6vw, 84px); --ch: clamp(31px, 2.5vw, 37px); }
}
.pane { scroll-margin-top: 12px; }

.stanza.swap { animation: swap .22s var(--ease); }
@keyframes swap { from { opacity: .25; } to { opacity: 1; } }

/* ---- Paper sections ----------------------------------------------------- */

.sect { padding: clamp(64px, 9vw, 112px) 0; }
.sect + .sect { border-top: 1px solid var(--rule); }
.sect h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  font-weight: 760; font-stretch: 114%;
  line-height: 1.04; letter-spacing: -.02em;
}
.sect-head { max-width: 760px; }
.sect-lead { margin-top: 16px; max-width: 62ch; color: var(--ink-2); font-size: 18px; }
.sect h3 { font-size: 19px; font-weight: 680; font-stretch: 104%; line-height: 1.25; letter-spacing: -.005em; }

/* How it works: four picks, numbered because the order is the method. */
.how-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px clamp(40px, 6vw, 96px); }
.steps { counter-reset: step; display: grid; grid-template-columns: 1fr 1fr; gap: 36px 40px; }
.steps li { counter-increment: step; position: relative; padding-top: 18px; border-top: 2px solid var(--ink); }
.steps li::before {
  content: counter(step); position: absolute; top: 14px; right: 0;
  font-size: 13px; font-weight: 650; font-stretch: 75%; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.steps p { margin-top: 8px; color: var(--ink-2); max-width: 46ch; }

/* The cutsheet: the links as the generator wrote them. */
.table-scroll { margin-top: 36px; overflow-x: auto; border-top: 2px solid var(--ink); }
.table-scroll:focus-visible { outline-offset: 4px; }
.cutsheet { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.cutsheet th {
  padding: 12px 16px 10px 0; text-align: left; white-space: nowrap;
  font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .02em; color: var(--ink-3);
  border-bottom: 1px solid var(--rule-strong);
}
.cutsheet td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; color: var(--ink); }
.cutsheet td code { font-size: 14px; }
.cutsheet td:last-child code { color: var(--ink-2); }
.cutsheet tbody tr:hover td { background: var(--paper-2); }

/* Notes on the draft: one ruled list, each entry pointing at the part of the
 * draft it explains -- a filled cell when it is drawn above, an outline when
 * this fabric doesn't show it. */
.notes { margin-top: 72px; border-top: 2px solid var(--ink); }
.notes li {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 18rem) minmax(0, 1fr);
  gap: 6px 32px; align-items: baseline;
  padding: 20px 0 22px; border-bottom: 1px solid var(--rule);
}
.notes .ref {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; font-stretch: 80%; letter-spacing: .01em; color: var(--ink-3);
}
.notes .mark { flex: none; width: 12px; height: 12px; box-shadow: inset 0 0 0 1.5px var(--ink-2); transform: translateY(1px); }
.notes .in .mark { background: var(--cell); box-shadow: none; }
.notes .in .ref { color: var(--ink-2); }
.notes p:not(.ref) { color: var(--ink-2); max-width: 64ch; }
.notes code { color: var(--ink); }

/* Refusals: the empty cells, each with its reason. */
.refuse { background: var(--paper-2); }
.refuse-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px clamp(40px, 6vw, 96px); align-items: start; }
.refusals { margin: 32px 0 28px; display: grid; gap: 18px; }
.refusals li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: start; }
.refusals .mark, .toolset .mark { display: block; width: 14px; height: 14px; margin-top: 6px; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.refusals p { color: var(--ink-2); }
.refusals strong { color: var(--ink); font-weight: 650; }

.matrix-fig { margin: 0; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.matrix caption { caption-side: top; text-align: left; padding-bottom: 14px; font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .02em; color: var(--ink-3); }
.matrix th { font-weight: 650; text-align: left; }
.matrix thead th { padding: 0 6px 10px; font-size: 13px; font-stretch: 80%; color: var(--ink-3); text-align: center; vertical-align: bottom; }
.matrix thead th:first-child { text-align: left; padding-left: 0; }
.matrix tbody th { padding: 0 16px 0 0; height: 46px; font-size: 15px; font-stretch: 90%; white-space: nowrap; border-top: 1px solid var(--rule); }
.matrix td { height: 46px; padding: 0; text-align: center; border-top: 1px solid var(--rule); }
.matrix td span {
  display: inline-block; width: 22px; height: 22px; vertical-align: middle;
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  font-size: 0; color: transparent; overflow: hidden;
}
.matrix td.y span { background: var(--cell); box-shadow: none; }
.matrix .roles-col { text-align: left; padding-left: 18px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.matrix thead .roles-col { text-align: left; padding-left: 18px; }
.matrix-fig figcaption { margin-top: 14px; color: var(--ink-3); font-size: 14px; max-width: 52ch; }

/* Coming soon: unthreaded warp -- outlines, waiting to be filled. */
.soon-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(40px, 6vw, 96px); align-items: start; }
.soon { border-top: 2px solid var(--ink); list-style: none; }
.soon li {
  display: grid; grid-template-columns: 22px minmax(0, 15rem) minmax(0, 1fr); gap: 4px 18px; align-items: baseline;
  padding: 18px 0 20px; border-bottom: 1px solid var(--rule);
}
.soon .mark { display: block; width: 18px; height: 18px; box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(3px); }
.soon h3 { font-size: 19px; }
.soon p { color: var(--ink-2); }

/* Posts */
.posts-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(40px, 6vw, 96px); }
.posts-grid .sect-head .text-link { margin-top: 22px; }
.post-list { border-top: 2px solid var(--ink); }
.post {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 24px;
  padding: 20px 0 22px; border-bottom: 1px solid var(--rule);
  color: inherit; text-decoration: none;
}
.post-meta { grid-row: span 2; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.post-meta .tag { font-weight: 650; font-stretch: 80%; letter-spacing: .02em; color: var(--ink-2); }
.post h3 { font-size: 21px; transition: color .15s var(--ease); }
.post p { color: var(--ink-2); max-width: 64ch; }
.post:hover h3 { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }

/* The maker */
.maker { background: var(--paper-2); }
.maker-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(40px, 6vw, 96px); align-items: start; }
.maker-lead { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.4; font-weight: 520; font-stretch: 104%; color: var(--ink); max-width: 36ch; }
.maker-grid p + p { margin-top: 18px; color: var(--ink-2); max-width: 62ch; }
.maker .text-link { margin-top: 22px; }

/* The toolset: live is a filled cell, planned is unthreaded. */
.toolset { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 44px; border-top: 2px solid var(--ink); }
.toolset li { padding: 28px 32px 8px 0; display: flex; flex-direction: column; align-items: flex-start; }
.toolset li + li { padding-left: 32px; border-left: 1px solid var(--rule); }
.toolset .mark { width: 30px; height: 30px; margin: 0 0 18px; box-shadow: inset 0 0 0 2px var(--ink-2); }
.toolset .live .mark { background: var(--cell); box-shadow: none; }
.toolset h3 { font-size: 24px; font-stretch: 112%; }
.toolset p { margin-top: 10px; color: var(--ink-2); max-width: 40ch; }
.toolset p strong { color: var(--ink); font-weight: 650; }
.toolset .text-link { margin-top: auto; padding-top: 18px; }

/* ---- The close: back on the cloth -------------------------------------- */

.close { background: var(--cloth); color: var(--on-cloth); padding: clamp(64px, 9vw, 104px) 0; --link: var(--on-cloth); --focus: var(--weld); }
.close-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px clamp(40px, 6vw, 96px); align-items: end; }
.close h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 800; font-stretch: 116%; line-height: 1; letter-spacing: -.025em; }
.close-grid > div:first-child p { margin-top: 18px; color: var(--on-cloth-2); font-size: 18px; max-width: 50ch; }
.close-act { display: flex; justify-content: flex-end; }
.close .cta-row { margin-top: 0; }

/* ---- Footer ------------------------------------------------------------ */

.site-footer { padding: 56px 0 36px; color: var(--ink-2); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .logo { color: var(--ink); margin-right: 0; }
.site-footer .logo svg { color: var(--ink); }
.foot-grid > div:first-child p { margin-top: 12px; max-width: 34ch; }
.site-footer h2 { font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.site-footer li + li { margin-top: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }

/* ---- Narrower screens --------------------------------------------------- */

@media (max-width: 999px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "draft" "pane"; }
  .pane { max-height: 560px; }
  .how-grid, .refuse-grid, .soon-grid, .posts-grid, .maker-grid, .close-grid { grid-template-columns: minmax(0, 1fr); }
  .notes li { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); }
  .notes li p:not(.ref) { grid-column: 2; }
  .close-act { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .site-header .wrap { gap: 12px; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: clamp(2rem, 9.2vw, 2.5rem); font-stretch: 104%; }
  .hero .lead { font-size: 17px; }
  .drawdown { --cw: 42px; --ch: 32px; }
  .drawdown thead th .dev { font-size: 12.5px; }
  .drawdown thead th .role { font-size: 11px; }
  .drawdown tbody th { font-size: 12.5px; padding-right: 8px; white-space: normal; max-width: 9.5em; }
  .tieup { font-size: 11px; padding-right: 8px !important; }
  .pane { max-height: 70vh; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .soon li { grid-template-columns: 22px minmax(0, 1fr); }
  .soon li p { grid-column: 2; }
  .notes li { grid-template-columns: minmax(0, 1fr); }
  .notes li p:not(.ref) { grid-column: auto; }
  /* One column: the pointer to the draft follows the note, never heads it. */
  .notes .ref { order: 3; margin-top: 6px; }
  .toolset { grid-template-columns: minmax(0, 1fr); }
  .toolset li, .toolset li + li { padding: 26px 0 22px; border-left: 0; }
  .toolset li + li { border-top: 1px solid var(--rule); }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-meta { grid-row: auto; flex-direction: row; gap: 12px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .matrix .roles-col { display: none; }
}

@media (max-width: 380px) {
  .drawdown { --cw: 39px; }
  .head-cta { padding: 0 10px; }
}

/* Header links come back on a phone as a row of their own. */
@media (max-width: 720px) {
  .nav { display: flex; order: 5; flex-basis: 100%; gap: 20px; padding: 0 0 12px; }
  .site-header .wrap { flex-wrap: wrap; padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
