/* Fabricwright — the public site, in the weaving-draft world.
 *
 * One stylesheet for every page, the blog and its editor included, so the
 * site is one thing. The home page adds home.css for its own pieces. The
 * rules everything here follows (DESIGN.md has them in full):
 *
 *  - Indigo is the cloth. It floods whole regions -- the top of every page
 *    and the closing band -- in both themes, and is never a sprinkled accent.
 *  - A filled cell is the mark of something written or live: weld yellow on
 *    the cloth, inked in indigo on light paper, weld again on night paper.
 *    An outline is the mark of something planned, or not there.
 *  - Every rule is a division that means something: a list's top, a row's
 *    edge. No decorative ruling, no gradients, no glass, no glow, no boxes
 *    around everything.
 *  - Archivo carries every word, at three widths: wide for headings, normal
 *    for reading, condensed for labels and notation. 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,
 * and nothing here loads from anywhere else.
 */

@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);
  --weld: #f0c73a;
  --weld-hover: #f6d565;
  --weld-ink: #141a4a;
  --weld-wash: rgba(240, 199, 58, .13);

  --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;
  --narrow: 760px;
  --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 */
  --on-cell: #eef0fb;
  --cell-hover: #27308a;
  --link: #2a36a0;
  --focus: #2a36a0;
  --danger: #b42318;
  --danger-wash: rgba(180, 35, 24, .07);
  --ok: #1e6b3a;
  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;
  --on-cell: #141a4a;
  --cell-hover: #f6d565;
  --link: #b4bbff;
  --focus: #f0c73a;
  --danger: #ff9b8f;
  --danger-wash: rgba(255, 155, 143, .08);
  --ok: #8fe0a8;
  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, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
img, svg { max-width: 100%; }

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; }
p code, li code, td code, dd code {
  padding: .05em .3em; background: var(--paper-2); border-radius: var(--radius);
}

.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); }
.wrap.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.muted { color: var(--ink-3); }
.small { font-size: 14.5px; }
.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }

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

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

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

/* The primary action is a filled cell: weld on the cloth, the ground's own
 * filled-cell colour on paper. */
.btn-weld, .cloth .btn-primary, .close .btn-primary, .cta-band .btn-primary { background: var(--weld); color: var(--weld-ink); }
.btn-weld:hover, .cloth .btn-primary:hover, .close .btn-primary:hover, .cta-band .btn-primary:hover { background: var(--weld-hover); color: var(--weld-ink); }
.btn-primary { background: var(--cell); color: var(--on-cell); }
.btn-primary:hover { background: var(--cell-hover); color: var(--on-cell); }

/* Everything else is an outline. */
.btn-ghost, .btn-line { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover, .btn-line:hover { border-color: var(--ink); color: var(--ink); }
.cloth .btn-ghost, .close .btn-ghost, .cta-band .btn-ghost { color: var(--on-cloth); border-color: var(--empty-line); }
.cloth .btn-ghost:hover, .close .btn-ghost:hover, .cta-band .btn-ghost:hover { border-color: var(--on-cloth); color: var(--on-cloth); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-wash); color: var(--danger); }

.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); }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 26px; }

/* ---- The cloth: header and page head ------------------------------------ */

.cloth {
  background: var(--cloth);
  color: var(--on-cloth);
  --link: var(--on-cloth);
  --focus: var(--weld);
}
.cloth p code, .cloth li code { background: var(--cloth-deep); }

.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; }
.logo .threads { stroke: var(--weld); }
.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, .nav a[aria-current="page"] {
  color: var(--on-cloth); text-decoration: underline;
  text-decoration-color: var(--weld); text-decoration-thickness: 2px; text-underline-offset: .4em;
}
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  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; }

/* An inner page's head: still on the cloth, under the header. */
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 6vw, 80px); }
.page-head h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  font-weight: 800; font-stretch: 114%;
  line-height: 1; letter-spacing: -.025em;
  max-width: 20ch;
}
.page-head .lead { margin-top: 20px; color: var(--on-cloth-2); max-width: 60ch; }
.page-head .updated { margin-top: 16px; color: var(--on-cloth-3); font-size: 14.5px; }
.page-head-sm { padding: 32px 0 36px; }
.page-head-sm h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.page-head-sm .lead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; font-size: 15.5px; }

/* A status said in words, marked as a cell: filled when it's live, an
 * outline when it's planned. */
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  font-size: 15px; font-weight: 600; font-stretch: 100%;
}
.status::before { content: ""; width: 14px; height: 14px; flex: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.status.live::before { background: var(--weld); box-shadow: none; }
.cloth .status { color: var(--on-cloth-2); }

/* ---- Sections on paper -------------------------------------------------- */

main > section, .sect { padding: clamp(64px, 9vw, 104px) 0; }
main > section + section, .sect + .sect { border-top: 1px solid var(--rule); }
.band { background: var(--paper-2); }
.band + section, section + .band { border-top: 0 !important; }

main h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 760; font-stretch: 114%;
  line-height: 1.04; letter-spacing: -.02em;
}
main h3 { font-size: 19px; font-weight: 680; font-stretch: 104%; line-height: 1.25; letter-spacing: -.005em; }

.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p, .sect-lead { margin-top: 16px; max-width: 62ch; color: var(--ink-2); font-size: 18px; }

/* Blocks of text that used to be boxed cards: a rule above, and room. */
.grid { display: grid; gap: 36px 40px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding-top: 18px; border-top: 2px solid var(--ink); min-width: 0; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }

/* Numbered blocks, where the order is the method. */
.steps { counter-reset: step; }
.steps .step { counter-increment: step; position: relative; }
.steps .step::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 .step h3 { padding-right: 24px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px clamp(40px, 6vw, 96px); align-items: start; }
.split h2 + .ticks, .split h2 + p { margin-top: 22px; }

/* Lists marked with cells: filled for what is there, outlines for what isn't. */
.ticks { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 12px; height: 12px; background: var(--cell);
}
.ticks.no li::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.ticks strong { color: var(--ink); font-weight: 650; }
.cloth .ticks li { color: var(--on-cloth-2); }
.cloth .ticks li::before { background: var(--weld); }

/* Status words in running text and tables. */
.tag {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-2);
}
.tag::before { content: ""; width: 9px; height: 9px; flex: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.tag.live::before { background: var(--cell); box-shadow: none; }

/* ---- Tables ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: 12px 18px 12px 0; border-bottom: 1px solid var(--rule); }
th {
  font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .02em; color: var(--ink-3);
  white-space: nowrap; border-bottom-color: var(--rule-strong);
}
tbody th { font-size: 15px; font-stretch: 90%; color: var(--ink); }
td { color: var(--ink-2); }
td.fab { font-weight: 650; font-stretch: 90%; color: var(--ink); white-space: nowrap; }

/* ---- Pricing ----------------------------------------------------------- */

.launch {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 56px; align-items: end;
  padding: clamp(28px, 4vw, 44px);
  background: var(--cloth); color: var(--on-cloth); border-radius: var(--radius);
  --link: var(--on-cloth); --focus: var(--weld);
}
.launch h2 { color: var(--on-cloth); }
.launch .ticks li { color: var(--on-cloth-2); }
.launch .ticks li::before { background: var(--weld); }
.launch .muted { color: var(--on-cloth-2); }
.launch .btn-primary { background: var(--weld); color: var(--weld-ink); }
.launch .btn-primary:hover { background: var(--weld-hover); }
.price {
  font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 800; font-stretch: 116%;
  line-height: 1; letter-spacing: -.03em; color: inherit;
}
.price small { font-size: 16px; font-weight: 550; font-stretch: 100%; letter-spacing: 0; color: var(--ink-3); }
.plan { display: flex; flex-direction: column; }
.plan .price { margin: 14px 0 6px; font-size: clamp(2.2rem, 3.6vw, 2.8rem); }
.plan.featured { border-top-width: 6px; padding-top: 14px; }

/* ---- Questions --------------------------------------------------------- */

.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  position: relative; cursor: pointer; list-style: none;
  padding: 18px 44px 18px 0; font-size: 18px; font-weight: 650; font-stretch: 104%;
}
.faq summary::-webkit-details-marker { display: none; }
/* A plus drawn from two strokes; the upright folds away when it opens. */
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 2px;
  background: var(--ink-2); transition: transform .2s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq details > div { padding: 0 0 20px; color: var(--ink-2); max-width: 64ch; }
.faq details > div p + p { margin-top: 10px; }

/* ---- Posts ------------------------------------------------------------- */

.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 { color: var(--ink-2); }
.post-meta .tag::before { display: none; }
.post h3 { font-size: 21px; font-weight: 680; font-stretch: 104%; line-height: 1.25; }
.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; }

/* ---- Reading: posts and the legal pages --------------------------------- */

.article-head { padding-top: clamp(36px, 5vw, 60px); padding-bottom: clamp(40px, 5vw, 60px); }
.article-head h1 {
  margin-top: 14px; max-width: 22ch;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem); font-weight: 800; font-stretch: 112%;
  line-height: 1.03; letter-spacing: -.022em;
}
.article-head .lead { margin-top: 18px; color: var(--on-cloth-2); }
.article-head .post-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-top: 24px; color: var(--on-cloth-3); }
.article-head .post-meta .tag { color: var(--on-cloth-2); }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--on-cloth-2); text-decoration: none;
}
.back:hover { color: var(--on-cloth); text-decoration: underline; text-decoration-color: var(--weld); }

.prose { font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 52px; font-size: clamp(1.5rem, 2.6vw, 1.85rem); color: var(--ink); line-height: 1.15; }
.prose h3 { margin-top: 34px; font-size: 20px; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: square; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--cell); }
.prose ol li::marker { color: var(--ink-3); font-weight: 650; font-variant-numeric: tabular-nums; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { font-weight: 550; }
.prose pre {
  margin-top: 22px; padding: 18px 20px; overflow-x: auto;
  background: var(--cloth-deep); color: var(--on-cloth); border-radius: var(--radius);
  font: 14px/1.6 var(--mono); tab-size: 2;
}
.prose pre code { font-size: inherit; padding: 0; background: none; }
/* A note set apart from the text: the paper a shade deeper, ruled above. */
.prose blockquote {
  margin: 22px 0 0; padding: 16px 20px; font-size: 17px;
  background: var(--paper-2); border-top: 2px solid var(--ink);
}
.prose blockquote > * + * { margin-top: 10px; }
.prose .table-wrap, .prose table { margin-top: 22px; }
.prose .table-wrap table { margin-top: 0; }
.prose table { font-size: 15.5px; }
.prose img { height: auto; border: 1px solid var(--rule); }
.prose h2[id], .prose h3[id] { scroll-margin-top: 24px; }
.callout { padding: 16px 20px; background: var(--paper-2); border-top: 2px solid var(--ink); }
.callout > * + * { margin-top: 10px; }

.legal h2 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); }
.legal .panel { padding: 16px 20px; background: var(--paper-2); border-top: 2px solid var(--ink); }
.legal .panel.warn { border-top-color: var(--cell); }
.legal .panel > * + * { margin-top: 10px; }
.legal-note { margin-top: 44px !important; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 15.5px; }

/* ---- The blog editor ---------------------------------------------------- */

.editor-section { padding: 40px 0 72px; }
.editor-wrap { max-width: calc(920px + 2 * var(--gutter)); }

.admin-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 12px 0; margin-bottom: 24px; font-size: 14.5px; color: var(--ink-3);
  border-top: 1px dashed var(--rule-strong); border-bottom: 1px dashed var(--rule-strong);
}
.admin-bar > span:last-of-type { margin-right: auto; }
.article-head .admin-bar { color: var(--on-cloth-3); border-color: var(--cloth-line); }

.flash {
  margin: 0 0 18px; padding: 12px 16px; font-size: 15.5px;
  color: var(--ink); background: var(--paper-2); border-top: 2px solid var(--cell);
}
.form-errors {
  margin: 0 0 22px; padding: 14px 18px; font-size: 15.5px; color: var(--danger);
  background: var(--danger-wash); border-top: 2px solid var(--danger);
}
.form-errors p { margin: 0 0 6px; }
.form-errors ul { margin: 0; padding-left: 20px; }

.editor .field { margin-bottom: 22px; }
.editor label { display: block; margin-bottom: 7px; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.editor .hint, .editor-actions .hint { margin: 7px 0 0; font-size: 14px; color: var(--ink-3); }
.editor input[type="text"], .editor input[type="date"], .editor input[type="number"], .editor select, .editor textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
}
.editor input:hover, .editor select:hover, .editor textarea:hover { border-color: var(--ink-3); }
.editor input:focus, .editor select:focus, .editor textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.editor textarea { resize: vertical; line-height: 1.55; }
/* The pricing editor: one plan card to a fieldset, ruled off like a list row. */
.editor h2 { margin: 0 0 6px; font-size: 22px; }
.editor h2 + .hint { margin: 0 0 18px; }
.plan-edit { margin: 0 0 22px; padding: 18px 0 4px; border: 0; border-top: 1px solid var(--rule-strong); min-width: 0; }
.plan-edit legend { padding: 0 10px 0 0; font-weight: 750; font-size: 17px; color: var(--ink); }
.editor label.check { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-weight: 550; }
.editor label.check input { width: 18px; height: 18px; accent-color: var(--cell); }
.editor textarea.body { min-height: 520px; font: 15px/1.65 var(--mono); tab-size: 2; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.slug-input { display: flex; }
.slug-input span {
  display: flex; align-items: center; padding: 0 10px; font: 14px var(--mono); color: var(--ink-3);
  background: var(--paper-2); border: 1.5px solid var(--rule-strong); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.slug-input input { border-radius: 0 var(--radius) var(--radius) 0 !important; font-family: var(--mono) !important; font-size: 15px !important; }

.body-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.body-head label { margin-bottom: 0; }
.editor-tabs { display: flex; gap: 4px; }
.editor-tabs button {
  padding: 6px 14px; cursor: pointer; font: 600 14.5px/1.2 var(--sans);
  color: var(--ink-2); background: transparent; border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
}
.editor-tabs button:hover { color: var(--ink); border-color: var(--ink); }
.editor-tabs button[aria-selected="true"] { color: var(--on-cell); background: var(--cell); border-color: var(--cell); }
.preview { min-height: 520px; padding: 22px 26px; background: var(--paper); border: 1.5px solid var(--rule-strong); }

.cheatsheet { margin-top: 12px; font-size: 15px; }
.cheatsheet summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.cheatsheet summary:hover { color: var(--ink); }
.cheatsheet .table-wrap { margin-top: 12px; }
.cheatsheet table { font-size: 14.5px; }
.cheatsheet td:first-child { white-space: nowrap; }

.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.editor-actions .hint { margin: 0 0 0 6px; }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: 48px; padding: 16px 0 0; font-size: 15px; color: var(--ink-2);
  border-top: 2px solid var(--danger);
}
.danger-zone p { margin: 0; max-width: 560px; }

.admin-table td { vertical-align: middle; }
.admin-table td:first-child a { font-weight: 650; text-decoration: none; }
.admin-table .slug { margin-top: 2px; font: 13px var(--mono); color: var(--ink-3); }

/* ---- A drawing in a pane, as on the home page --------------------------- */

.term {
  margin: 0; min-width: 0; overflow: hidden;
  background: var(--cloth-deep); color: var(--on-cloth); border-radius: var(--radius);
}
.term-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--cloth-line);
  font: 13px var(--mono); color: var(--on-cloth-2);
}
.term-bar .dots { display: none; }
.term pre { margin: 0; padding: 18px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--on-cloth); }
.term .c { color: var(--on-cloth-3); }
.term .k { color: var(--on-cloth-2); }
.term .v, .term .n { color: var(--on-cloth); font-weight: 700; }
.term-foot { padding: 12px 18px; border-top: 1px solid var(--cloth-line); font-size: 13.5px; color: var(--on-cloth-3); }

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

.close, .cta-band {
  padding: clamp(64px, 9vw, 104px) 0;
  background: var(--cloth); color: var(--on-cloth);
  --link: var(--on-cloth); --focus: var(--weld);
}
.close h2, .cta-band h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 800; font-stretch: 116%;
  line-height: 1; letter-spacing: -.025em; color: var(--on-cloth);
}
.close p, .cta-band p { margin-top: 18px; color: var(--on-cloth-2); font-size: 18px; max-width: 54ch; }
.cta-band .cta-row { margin-top: 26px; }
main > section.cta-band, main > .close { border-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 .threads { stroke: currentColor; }
.foot-grid > div:first-child p { margin-top: 12px; max-width: 34ch; }
.foot-grid h2, .foot-grid h4 {
  margin-bottom: 12px;
  font-size: 13px; font-weight: 650; font-stretch: 80%; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
}
.foot-grid ul { list-style: none; }
.foot-grid 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);
}

/* Status words on the cloth. */
.cloth .tag, .launch .tag { color: var(--on-cloth-2); }
.cloth .tag.live::before, .launch .tag.live::before { background: var(--weld); }

.back svg, .text-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.article-body { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(56px, 8vw, 104px); }
.cta-band h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; font-stretch: 116%;
  line-height: 1; letter-spacing: -.025em; color: var(--on-cloth);
}
.page-head .status, .page-head .cta-row { margin-top: 24px; }

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

@media (max-width: 999px) {
  .split, .launch { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: wrap; gap: 12px; padding-top: 10px; }
  .nav { order: 5; flex-basis: 100%; gap: 20px; padding: 0 0 12px; }
  .grid-2, .grid-3, .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row { gap: 0; }
  .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; }
  .prose { font-size: 17px; }
}

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

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