/* Fablori for developers: a printed technical journal.
   Warm paper, black ink, one blue. Literata for prose, Red Hat Mono for code.
   Every chapter paints its own ground (hard cuts, no drift). */

:root {
  --paper:  #F3EDE1;
  --paper2: #EAE2D0;
  --paper3: #DFD5C0;
  --sheet:  #FAF6EE;
  --ink:    #1A1712;
  --ink-2:  #554C40;
  --night:  #17140F;
  --bone:   #EEE7D8;
  --bone-2: #B8AE9C;
  --blue:   #2340C8;
  --blue-n: #9DB1FF;   /* the same blue, lifted for ink grounds */

  --sc-canvas: var(--paper);
  --sc-surface: var(--sheet);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-2);
  --sc-accent: var(--blue);
  --sc-accent-ink: #FBF8F2;
  --sc-font-display: "Literata", Georgia, serif;
  --sc-font-text: "Literata", Georgia, serif;
  --sc-font-mono: "Red Hat Mono", ui-monospace, monospace;
  --sc-shadow-color: 32 30% 20%;
  --sc-r-sm: 2px;

  --mono: var(--sc-font-mono);
  --rule: color-mix(in oklab, var(--ink) 22%, transparent);
  --rule-soft: color-mix(in oklab, var(--ink) 12%, transparent);
  --g: var(--sc-gutter);
}

html { background: var(--paper); }
body {
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.16rem);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 14;
}
code, pre, kbd, .mono { font-family: var(--mono); font-variation-settings: normal; }
p code, li code, td code, th code, figcaption code, legend code, label code, span code {
  font-size: 0.86em; letter-spacing: -0.01em;
  padding: 0.05em 0.25em; border-radius: 2px;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue); color: #FBF8F2; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--sheet); padding: 8px 12px; color: var(--ink); }

/* grounds: each restates color so inherited text re-inks (taste.md) */
[data-ground="paper"] { background: var(--paper); color: var(--ink); }
.ch--paper2 { background: var(--paper2); }
[data-ground="ink"] {
  background: var(--night); color: var(--bone);
  --sc-ink: var(--bone); --sc-ink-soft: var(--bone-2);
}
[data-ground="ink"] a { color: var(--blue-n); }
[data-ground="ink"] p code, [data-ground="ink"] li code, [data-ground="ink"] figcaption code { background: color-mix(in oklab, var(--bone) 10%, transparent); }
[data-ground="ink"] :focus-visible { outline-color: var(--blue-n); }

.fig {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.01em; line-height: 1.5;
  color: var(--ink-2); text-transform: none;
}
[data-ground="ink"] .fig { color: var(--bone-2); }

/* ============================================================ FOLIO == */
.folio {
  position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 60;
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: var(--sc-e2);
  font-family: var(--mono); font-size: 0.74rem;
  opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden;
  transition: opacity 200ms var(--sc-ease-out), transform 200ms var(--sc-ease-out), background-color 160ms, color 160ms, visibility 0s linear 200ms;
}
.folio.is-shown { transition-delay: 0s; }
.folio.is-shown { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.folio[data-ground="ink"], .folio[data-ground="blue"] { background: var(--night); color: var(--bone); border-color: color-mix(in oklab, var(--bone) 24%, transparent); }
.folio__bar { display: flex; align-items: stretch; }
.folio button { background: none; border: 0; cursor: pointer; color: inherit; min-height: 40px; }
.folio__step { width: 36px; display: grid; place-items: center; }
.folio__step svg { width: 14px; height: 14px; }
.folio__step:hover { background: color-mix(in oklab, currentColor 8%, transparent); }
.folio__step:active, .folio__now:active { transform: translateY(1px); }
.folio__now {
  display: flex; align-items: baseline; gap: 0.6em; padding: 0 0.9em;
  border-left: 1px solid var(--rule-soft); border-right: 1px solid var(--rule-soft);
  font: inherit;
}
.folio__num { font-family: var(--sc-font-display); font-style: italic; font-size: 1rem; color: var(--blue); min-width: 1.6em; text-align: right; }
.folio[data-ground="ink"] .folio__num, .folio[data-ground="blue"] .folio__num { color: var(--blue-n); }
.folio__title { font-family: var(--sc-font-display); font-size: 0.92rem; letter-spacing: 0; }
.folio__label { color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; }
.folio[data-ground="ink"] .folio__label, .folio[data-ground="blue"] .folio__label { color: var(--bone-2); }
.folio__now:hover .folio__label { text-decoration: underline; }
.contents {
  position: absolute; left: -1px; bottom: calc(100% + 8px); margin: 0; padding: 10px 0;
  list-style: none; min-width: 260px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); box-shadow: var(--sc-e3);
}
.contents a { display: flex; gap: 0.8em; padding: 8px 16px; color: var(--ink); text-decoration: none; font-family: var(--sc-font-display); font-size: 1rem; }
.contents a span { width: 2.2em; text-align: right; font-style: italic; color: var(--blue); }
.contents a:hover, .contents a[aria-current="true"] { background: var(--paper2); }

/* wide screens: the folio stands in the left margin, read like a spine */
@media (min-width: 1100px) {
  .folio { left: 14px; bottom: 28px; }
  .folio__bar { writing-mode: vertical-rl; }
  .folio__step { width: 40px; min-height: 0 !important; height: 36px; }
  .folio__now { padding: 0.9em 0; width: 40px; align-items: center; border-left: 0; border-right: 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
  .folio__num { min-width: 0; text-align: center; }
  .contents { left: calc(100% + 8px); bottom: -1px; }
}

/* ======================================================= TITLE PAGE == */
.title {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem;
  padding: clamp(4rem, 9vh, 7rem) var(--g) clamp(3rem, 7vh, 5rem);
  align-content: center;
}
.title__frame { position: absolute; inset: 0; pointer-events: none; color: color-mix(in oklab, var(--ink) 38%, transparent); }
.crop { position: absolute; width: 28px; height: 28px; }
.crop::before, .crop::after { content: ""; position: absolute; background: currentColor; }
.crop::before { width: 28px; height: 1px; } .crop::after { width: 1px; height: 28px; }
.crop--tl { left: 20px; top: 20px; } .crop--tl::before { top: 12px; } .crop--tl::after { left: 12px; }
.crop--tr { right: 20px; top: 20px; } .crop--tr::before { top: 12px; } .crop--tr::after { right: 12px; }
.crop--bl { left: 20px; bottom: 20px; } .crop--bl::before { bottom: 12px; } .crop--bl::after { left: 12px; }
.crop--br { right: 20px; bottom: 20px; } .crop--br::before { bottom: 12px; } .crop--br::after { right: 12px; }
.title__col { position: absolute; top: 11%; bottom: 11%; left: 58%; width: 1px; background: var(--rule); }
.title__base { position: absolute; left: 58%; right: 5%; top: 66%; height: 1px; background: var(--rule); }
.reg { position: absolute; width: 34px; height: 34px; left: calc(58% - 17px); top: calc(66% - 17px); color: var(--blue); opacity: 0.7; }

.title__sheet { grid-column: 1 / span 7; position: relative; z-index: 2; }
.title__series {
  display: flex; align-items: center; gap: 0.7rem; margin: 0 0 clamp(1.5rem, 4vh, 2.75rem);
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink-2);
}
.mark { width: 30px; height: auto; flex: none; }
.title__h {
  margin: 0; font-weight: 420; font-variation-settings: "opsz" 72;
  font-size: clamp(3.1rem, 1.6rem + 6.2vw, 7.6rem); line-height: 0.95; letter-spacing: -0.035em;
  text-wrap: balance; max-width: 9.5em;
}
.title__deck {
  margin: clamp(1.25rem, 3.4vh, 2rem) 0 0; max-width: 32ch;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); line-height: 1.42; font-variation-settings: "opsz" 24;
  text-wrap: pretty;
}
.title__imprint {
  margin: clamp(2rem, 6vh, 4rem) 0 0; padding-top: 0.9rem; border-top: 1px solid var(--ink);
  max-width: 34rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; justify-content: space-between;
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2);
}
.title__imprint a { font-family: var(--sc-font-display); font-size: 1.05rem; font-weight: 560; color: var(--blue); }

.vellum { position: absolute; z-index: 3; right: calc(var(--g) - 0.5rem); top: 50%; width: min(44rem, 48vw); }
.vellum__sheet {
  margin: 0; padding: 1.25rem 1.4rem 1.4rem;
  background: color-mix(in srgb, #FCFAF5 66%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 14px -6px hsl(32 30% 20% / .22), 0 28px 50px -24px hsl(32 30% 20% / .28);
  transform: translate(var(--lx, 0px), var(--ly, 0px)) rotate(calc(-2.4deg + (var(--sc-p, 0.5) - 0.5) * 5deg));
  transform-origin: 80% 10%;
}
.vellum__sheet figcaption { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin-bottom: 0.8rem; }
.vellum__code { margin: 0; font-size: clamp(0.72rem, 0.62rem + 0.25vw, 0.86rem); line-height: 1.7; color: #1B2F94; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ========================================================= CHAPTERS == */
.ch { position: relative; padding: clamp(3.5rem, 8vw, 8rem) var(--g) clamp(4rem, 8vw, 8rem); }
.inter { display: grid; grid-template-columns: minmax(4.5rem, 9rem) 1fr; align-items: end; column-gap: 1.25rem; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); position: relative; padding-bottom: 1.25rem; }
.inter__rule { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); }
.inter__num {
  margin: 0; font-style: italic; font-weight: 300; font-variation-settings: "opsz" 72;
  font-size: clamp(3.4rem, 2rem + 5vw, 7rem); line-height: 0.8; color: var(--blue); letter-spacing: -0.02em;
}
.inter__num--sm { font-size: clamp(2.4rem, 1.6rem + 2.6vw, 4.2rem); margin-bottom: 0.6rem; }
[data-ground="ink"] .inter__num { color: var(--blue-n); }
.inter__h { margin: 0; font-weight: 450; font-variation-settings: "opsz" 60; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; }

.spread { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1.5rem, 3vw, 3rem); row-gap: 3rem; }
.prose { grid-column: 1 / span 6; max-width: 36rem; }
.prose p { margin: 0 0 1.1em; line-height: 1.62; text-wrap: pretty; hanging-punctuation: first; }
.dropcap::first-letter {
  float: left; font-size: 3.6em; line-height: 0.82; margin: 0.06em 0.09em 0 0; font-weight: 400;
  font-variation-settings: "opsz" 72; color: var(--blue);
}
.aside { font-size: 0.9em; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 0.9em; }
.annot { grid-column: 7 / span 6; margin: 0; }
.annot .fig { display: block; margin-bottom: 1rem; }
.annot__lines { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--ink); }
.annot__lines li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule-soft); display: grid; gap: 0.35rem; }
.annot__lines li > code { font-size: 0.84rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.note { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.note b { font-style: normal; font-family: var(--mono); font-weight: 600; color: var(--blue); margin-right: 0.4em; }
.reply, .json, .snip pre, .cmd pre, .leaf pre {
  margin: 0; font-size: 0.82rem; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere;
}
.reply { background: var(--sheet); border: 1px solid var(--rule-soft); padding: 1rem 1.2rem; }
.c { color: var(--ink-2); }
[data-ground="ink"] .c { color: var(--bone-2); }
.ph { color: var(--ink-2); font-style: italic; }

/* ---------- II after the call (pinned) ---------- */
.after__stage {
  height: 100vh; height: 100svh; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center; padding: 0 var(--g);
}
.after { padding: 0; }
.after__side { grid-column: 1 / span 5; }
.after__h { margin: 0 0 2rem; font-weight: 450; font-variation-settings: "opsz" 60; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; }
.ladder { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in oklab, var(--bone) 30%, transparent); }
.ladder li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid color-mix(in oklab, var(--bone) 14%, transparent); opacity: 0.34; transition: opacity 240ms var(--sc-ease-out); font-size: 0.95rem; line-height: 1.5; }
.ladder li b { font-family: var(--mono); font-weight: 500; font-size: 0.85rem; padding-top: 0.15em; }
.ladder li.is-on { opacity: 1; }
.ladder li.is-now b { color: var(--blue-n); }
.ladder li.is-alt { opacity: 0.72; }
.ladder-now { display: none; }
.after__plate { grid-column: 6 / span 7; margin: 0; }
.after__plate .fig { display: block; margin-bottom: 0.9rem; max-width: 52ch; }
.json { background: color-mix(in oklab, var(--bone) 5%, var(--night)); border: 1px solid color-mix(in oklab, var(--bone) 16%, transparent); padding: 1.1rem 1.3rem; color: var(--bone); min-height: 25.5em; }

/* code lines + the blue mark on what changed */
.ln { display: block; position: relative; }
.ln.is-new { color: var(--blue); }
.ln.is-new::before { content: ""; position: absolute; left: -0.85rem; top: 0.45em; width: 5px; height: 0.75em; background: var(--blue); }
[data-ground="ink"] .ln.is-new { color: var(--blue-n); }
[data-ground="ink"] .ln.is-new::before { background: var(--blue-n); }
@media (prefers-reduced-motion: no-preference) {
  .ln.is-new { animation: inked 900ms var(--sc-ease-out); }
  @keyframes inked { from { background: color-mix(in oklab, var(--blue) 14%, transparent); } to { background: transparent; } }
}

/* ---------- III gatefold (pan) ---------- */
.fold { padding: 0; }
.fold__stage { height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.fold__rail { display: flex; align-items: center; gap: clamp(2.5rem, 5vw, 5rem); padding: 0 var(--g); width: max-content; }
.fold__lead { width: min(27rem, 80vw); flex: none; }
.fold__h { margin: 0 0 1.4rem; font-weight: 450; font-variation-settings: "opsz" 60; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; }
.fold__lead p { line-height: 1.6; margin: 0; }
.plate { margin: 0; flex: none; padding-left: clamp(2rem, 4vw, 4rem); border-left: 1px solid var(--rule); }
.plate .fig { display: block; margin-bottom: 1.1rem; max-width: 40ch; }
.shapes { display: flex; align-items: flex-end; gap: 1.75rem; }
.shape { display: grid; gap: 0.4rem; font-size: 0.85rem; }
.shape img, .shape__empty { height: clamp(12rem, 30vh, 17rem); width: auto; object-fit: cover; box-shadow: var(--sc-e2); background: var(--paper2); }
.shape--w img { aspect-ratio: 16 / 9; }
.shape--t img { aspect-ratio: 9 / 16; }
.shape__empty { aspect-ratio: 1; border: 1px dashed var(--rule); box-shadow: none; background: transparent; }
.shape code { font-size: 0.85rem; }
.shape span { color: var(--ink-2); font-style: italic; max-width: 14ch; line-height: 1.35; }

.tbl { border-collapse: collapse; font-size: 0.9rem; }
.tbl th, .tbl td { text-align: left; padding: 0.6rem 1.2rem 0.6rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.tbl thead th { font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); }
.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 1px solid var(--ink); }
.plate--ads .tbl { width: 36rem; }

.looks { display: grid; grid-template-columns: repeat(4, 11.5rem); gap: 1.1rem 1rem; }
.look { margin: 0; }
.look img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; box-shadow: var(--sc-e1); background: var(--paper2); }
.look figcaption { font-size: 0.82rem; font-style: italic; margin-top: 0.3rem; }
.look figcaption code { font-style: normal; }
.looks__cap { align-self: center; font-size: 0.86rem; line-height: 1.45; color: var(--ink-2); }
.fold__note { flex: none; width: min(22rem, 78vw); padding-left: clamp(2rem, 4vw, 4rem); border-left: 1px solid var(--rule); }
.fold__note p { margin: 0 0 1rem; line-height: 1.55; }

/* ---------- IV hush ---------- */
.hush { position: relative; min-height: 100vh; min-height: 100svh; background: var(--paper); display: grid; align-items: end; overflow: hidden; }
.hush__ground { position: absolute; inset: 0; background: var(--blue); }
.hush__in { position: relative; z-index: 1; padding: 0 var(--g) clamp(4rem, 14vh, 9rem); color: #F6F2E9; }
.hush__num { margin: 0; font-style: italic; font-weight: 300; font-variation-settings: "opsz" 72; font-size: clamp(7rem, 4rem + 14vw, 17rem); line-height: 0.8; letter-spacing: -0.04em; }
.hush__line { margin: 1.5rem 0 0; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.6rem); font-variation-settings: "opsz" 40; line-height: 1.15; }

/* ---------- IV specimen composer (peak) ---------- */
.spec { padding-top: clamp(3.5rem, 7vw, 6.5rem); }
.spec__head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; margin-bottom: 2.75rem; border-bottom: 2px solid var(--ink); padding-bottom: 1.6rem; }
.spec__h { grid-column: 1 / span 6; margin: 0; font-weight: 450; font-variation-settings: "opsz" 72; font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.8rem); line-height: 0.98; letter-spacing: -0.035em; }
.spec__deck { grid-column: 7 / span 6; margin: 0; align-self: end; line-height: 1.55; max-width: 44ch; }
.spec__pilot { grid-column: 7 / span 6; margin: 0.9rem 0 0; font-family: var(--mono); font-size: 0.76rem; color: var(--blue); }
.spec__pilot.is-yours { color: var(--ink-2); }

.spec__grid { display: grid; grid-template-columns: minmax(19rem, 22rem) 1fr 1fr; gap: 2.25rem clamp(1.5rem, 2.4vw, 2.5rem); align-items: start; }
.setter { display: grid; gap: 1.35rem; }
.row { border: 0; margin: 0; padding: 0; min-width: 0; }
.row legend, .lbl { display: block; padding: 0; margin-bottom: 0.55rem; font-size: 0.9rem; font-weight: 560; }
.row legend code, .lbl code { font-weight: 500; background: none; padding: 0; color: var(--blue); font-size: 0.86rem; }
.soft { color: var(--ink-2); font-weight: 400; font-style: italic; font-size: 0.85rem; }
.hint { margin: 0.4rem 0 0.5rem; font-size: 0.82rem; color: var(--ink-2); }
textarea, input[type="text"] {
  width: 100%; display: block; resize: vertical;
  font-family: var(--sc-font-text); font-size: 0.98rem; line-height: 1.5;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-bottom: 1px solid var(--ink);
  padding: 0.65rem 0.75rem; border-radius: 0;
}
textarea:focus-visible, input[type="text"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.presets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.presets button, .tabs button, .copy {
  font-family: var(--mono); font-size: 0.74rem; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.38rem 0.6rem; min-height: 32px;
  transition: background-color 140ms var(--sc-ease-out), color 140ms var(--sc-ease-out), border-color 140ms;
}
.presets button:hover, .tabs button:hover, .copy:hover { border-color: var(--ink); }
.presets button:active, .tabs button:active, .copy:active { transform: translateY(1px); }
.presets button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.presets button:disabled { opacity: .4; cursor: default; }

/* radio specimens: the native input stays focusable, visually hidden */
.seg, .aspects, .styles, .ads { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.seg label, .aspects label, .styles label, .ads label { position: relative; cursor: pointer; }
.seg input, .aspects input, .styles input, .ads input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span, .styles span, .ads span {
  display: inline-flex; align-items: baseline; gap: 0.45em; padding: 0.42rem 0.65rem; min-height: 34px;
  border: 1px solid var(--rule); font-size: 0.9rem; transition: background-color 140ms, color 140ms, border-color 140ms;
}
.seg span code { background: none; padding: 0; }
.seg input:checked + span, .styles input:checked + span, .ads input:checked + span { background: var(--blue); border-color: var(--blue); color: #FBF8F2; }
.seg input:checked + span code { color: #FBF8F2; }
.seg input:focus-visible + span, .styles input:focus-visible + span, .ads input:focus-visible + span, .aspects input:focus-visible ~ .a { outline: 2px solid var(--blue); outline-offset: 2px; }
.seg label:hover span, .styles label:hover span, .ads label:hover span { border-color: var(--ink); }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
.styles span { font-style: italic; width: 100%; justify-content: flex-start; }
.ads { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--rule-soft); }
.ads span { width: 100%; border: 0; border-bottom: 1px solid var(--rule-soft); display: grid; grid-template-columns: 6.6rem 1fr auto; font-size: 0.86rem; padding: 0.42rem 0.5rem; }
.ads span code { background: none; padding: 0; font-size: 0.8rem; }
.ads span em { color: var(--ink-2); font-size: 0.8rem; }
.ads input:checked + span em { color: #DCE2FF; }
fieldset:disabled, .row.is-off { opacity: 0.42; }
fieldset:disabled label { cursor: default; }

.aspects { gap: 1rem; align-items: flex-end; }
.aspects label { display: grid; justify-items: center; gap: 0.3rem; font-family: var(--mono); font-size: 0.78rem; padding: 0.3rem; }
.a { display: block; border: 1.5px solid var(--ink); background: var(--sheet); transition: background-color 140ms; }
.a--w { width: 64px; height: 36px; } .a--t { width: 27px; height: 48px; } .a--s { width: 40px; height: 40px; }
.aspects input:checked ~ .a { background: var(--blue); border-color: var(--blue); }
.aspects input:checked ~ span:last-child { color: var(--blue); font-weight: 600; }

.lbl output { font-family: var(--mono); color: var(--blue); font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--blue); margin: 0.2rem 0 0; height: 28px; }
.ticks { position: relative; height: 2.1rem; font-family: var(--mono); font-size: 0.66rem; color: var(--ink-2); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); text-align: center; line-height: 1.2; white-space: nowrap; }
.ticks span::before { content: ""; display: block; width: 1px; height: 6px; background: var(--ink-2); margin: 0 auto 3px; }

.galley { display: grid; gap: 1.75rem; min-width: 0; }
.tabs { display: none; gap: 0.3rem; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.snip { margin: 0; min-width: 0; }
.snip .fig { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--ink); padding-bottom: 0.45rem; margin-bottom: 0.75rem; }
.snip pre { padding: 0 0 0 0.9rem; font-size: 0.8rem; }
.copy { padding: 0.3rem 0.55rem; min-height: 30px; }
.copy.is-done { background: var(--blue); color: #FBF8F2; border-color: var(--blue); }

.proof { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(0, 1.55fr) minmax(0, 0.95fr); gap: clamp(1.5rem, 2.6vw, 2.75rem); margin-top: 3.25rem; padding-top: 1.75rem; border-top: 1px solid var(--ink); align-items: start; }
.notes__h { margin: 0 0 0.8rem; font-size: 1.05rem; font-weight: 600; }
.notes ul { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.notes li { counter-increment: n; position: relative; padding: 0.55rem 0 0.55rem 1.9rem; border-bottom: 1px solid var(--rule-soft); font-size: 0.9rem; line-height: 1.5; }
.notes li::before { content: counter(n); position: absolute; left: 0; top: 0.6rem; font-family: var(--mono); font-size: 0.75rem; color: var(--blue); }
.notes li.is-err { color: var(--ink); }
.notes li.is-err b { font-family: var(--mono); background: var(--ink); color: var(--paper); padding: 0 0.3em; font-weight: 500; font-size: 0.8rem; }
.proof__main, .proof__look { margin: 0; min-width: 0; }
.proof__frame { background: var(--night); box-shadow: var(--sc-e3); display: grid; place-items: center; }
.proof__frame video { width: 100%; height: auto; max-height: 34rem; aspect-ratio: 16 / 9; object-fit: contain; background: var(--night); }
.proof__frame.is-tall { width: min(100%, 19rem); margin: 0 auto 0 0; }
.proof__frame.is-tall video { aspect-ratio: 9 / 16; }
.proof__main figcaption, .proof__look figcaption { margin-top: 0.85rem; font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }
.proof__main figcaption b, .proof__look figcaption b { color: var(--ink); font-weight: 600; }
.proof__main q { font-style: italic; color: var(--ink); quotes: "\201C" "\201D"; }
.proof__lookframe video { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; box-shadow: var(--sc-e2); background: var(--paper2); }

/* ---------- V agents ---------- */
.spread--agents .prose { grid-column: 1 / span 6; }
.cmd { position: relative; margin: 0.4rem 0 1.4rem; background: var(--sheet); border: 1px solid var(--rule-soft); border-left: 1px solid var(--ink); padding: 1rem 1.1rem 0.9rem; }
.cmd pre { font-size: 0.8rem; color: #1B2F94; padding-right: 4.2rem; }
.cmd .copy { position: absolute; right: 0.6rem; top: 0.6rem; }
.tools { grid-column: 8 / span 5; margin: 0; align-self: start; }
.tools .fig { display: block; margin-bottom: 0.8rem; }
.tbl--tools { width: 100%; border-top: 1px solid var(--ink); }
.tbl--tools th { white-space: nowrap; font-weight: 500; padding-right: 1.25rem; }
.tbl--tools th code { background: none; padding: 0; color: var(--blue); }
.tbl--tools td { font-size: 0.88rem; line-height: 1.5; padding-right: 0; }

/* ---------- VI skill (ink) ---------- */
.skill__in { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1.5rem, 3vw, 3rem); align-items: center; }
.skill__text { grid-column: 1 / span 5; }
.skill__h { margin: 0 0 1.4rem; font-weight: 450; font-variation-settings: "opsz" 60; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; }
.skill__text p { line-height: 1.62; max-width: 38rem; }
.skill__links a { font-weight: 560; font-size: 1.08rem; }
.leaf-col { grid-column: 7 / span 6; }
.leaf { margin: 0; background: var(--sheet); color: var(--ink); padding: 1.6rem 1.8rem 1.2rem; transform: rotate(1.4deg); box-shadow: 0 4px 10px -4px rgba(0,0,0,.5), 0 30px 60px -20px rgba(0,0,0,.6); }
.leaf pre { font-size: 0.8rem; }
.leaf .c { color: var(--ink-2); }
.leaf .fig { margin-top: 1rem; padding-top: 0.6rem; border-top: 1px solid var(--rule-soft); color: var(--ink-2); }
.leaf .fig code { background: color-mix(in oklab, var(--ink) 6%, transparent); }

/* ---------- VII cost ---------- */
.spread--cost .prose { grid-column: 1 / span 5; }
.tbl--cost { grid-column: 7 / span 6; width: 100%; align-self: start; }
.tbl--cost caption { text-align: left; caption-side: top; padding-bottom: 0.8rem; }
.tbl--cost tbody th { font-weight: 560; font-family: var(--sc-font-display); }
.tbl--cost td { font-size: 0.9rem; }
.price { font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.inter__rule--static { background: var(--ink); }

/* ---------- colophon ---------- */
.colophon { background: var(--paper3); color: var(--ink); padding: clamp(5rem, 12vw, 10rem) var(--g) 0; }
.colophon__in { max-width: 36rem; margin: 0 auto; text-align: center; padding-bottom: clamp(4rem, 9vw, 7rem); }
.mark--col { width: 40px; margin: 0 auto 1.6rem; }
.colophon__h { margin: 0 0 1.4rem; font-size: 0.78rem; font-family: var(--mono); font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; }
.colophon__text { font-size: 0.98rem; line-height: 1.65; color: var(--ink-2); margin: 0 0 1.6rem; font-style: italic; text-wrap: pretty; }
.colophon__text code { font-style: normal; }
.colophon__cta { font-size: clamp(1.25rem, 1rem + 0.9vw, 1.65rem); line-height: 1.45; margin: 0; text-wrap: balance; font-variation-settings: "opsz" 30; }
.colophon__cta a { font-weight: 600; }
.foot { border-top: 1px solid var(--ink); padding: 1.6rem 0 calc(1.6rem + 64px); display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: baseline; font-size: 0.88rem; }
.foot__brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.foot__brand svg { width: 24px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.foot a { color: var(--ink); }
.foot__for { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; color: var(--ink-2); }
.foot__for a[aria-current] { color: var(--blue); }

/* =========================================================== MEDIUM == */
@media (max-width: 1180px) {
  .spec__grid { grid-template-columns: minmax(18rem, 21rem) 1fr; }
  .galley--b { grid-column: 2; }
  .galley { gap: 0; }
  .tabs { display: flex; margin-bottom: 1rem; }
  .snip { display: none; }
  .snip.is-tab { display: block; }
  .galley--a { grid-row: 1; grid-column: 2; }
  .galley--b { grid-row: 1; grid-column: 2; margin-top: 3.2rem; }
  .proof { grid-template-columns: 1fr 1fr; }
  .notes { grid-column: 1 / -1; }
}

/* ============================================================ PHONE == */
@media (max-width: 760px) {
  .title { display: block; padding-top: 4.5rem; padding-bottom: 3rem; }
  .title__h { font-size: clamp(2.7rem, 11.6vw, 3.6rem); }
  .title__deck { font-size: 1.1rem; }
  .title__imprint { margin-top: 1.75rem; }
  .vellum { position: relative; right: auto; top: auto; width: auto; margin: 2.25rem -0.25rem 0 0.5rem; }
  .vellum__sheet { padding: 1rem 1rem 1.1rem; }
  .vellum__code { font-size: 0.66rem; }
  .folio__now { align-items: center; }
  .title__col { left: auto; right: 12%; top: 55%; bottom: 6%; }
  .title__base { left: 10%; right: 6%; top: 74%; }
  .reg { left: auto; right: calc(12% - 17px); top: calc(74% - 17px); }
  .crop--tl, .crop--tr { top: 12px; } .crop--tl, .crop--bl { left: 10px; } .crop--tr, .crop--br { right: 10px; } .crop--bl, .crop--br { bottom: 12px; }

  .spread, .skill__in, .after__stage { display: block; }
  .prose, .annot, .tools, .tbl--cost { max-width: none; }
  .annot, .tools, .tbl--cost, .leaf-col { margin-top: 2.5rem; }
  .inter { grid-template-columns: 4.2rem 1fr; }

  .after__stage { display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding-top: 1.5rem; padding-bottom: 4.5rem; }
  .after__h { margin-bottom: 1rem; font-size: 2rem; }
  .after__side .inter__num--sm { display: none; }
  .ladder { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; column-gap: 1rem; border: 0; }
  .ladder li { display: block; padding: 0.3rem 0; border: 0; border-bottom: 2px solid transparent; font-size: 0.86rem; }
  .ladder li.is-now { border-bottom-color: var(--blue-n); }
  .ladder li span { display: none; }
  .ladder-now { display: block; font-size: 0.9rem; line-height: 1.45; min-height: 4.4em; margin: 0.6rem 0 0; color: var(--bone); }
  .after__plate .fig { font-size: 0.68rem; }
  .json { font-size: 0.68rem; line-height: 1.5; padding: 0.8rem 0.9rem 0.8rem 1.2rem; min-height: 0; }

  .fold__rail { gap: 2.2rem; }
  .fold__lead { width: 80vw; }
  .plate { padding-left: 1.6rem; }
  .shapes { gap: 0.9rem; }
  .shape img, .shape__empty { height: 9rem; }
  .shape span { font-size: 0.76rem; }
  .plate--ads .tbl { width: 80vw; font-size: 0.8rem; }
  .plate--ads .tbl th:nth-child(5), .plate--ads .tbl td:nth-child(5) { display: none; }
  .tbl th, .tbl td { padding-right: 0.7rem; }
  .looks { grid-template-columns: repeat(3, 26vw); gap: 0.7rem 0.6rem; }
  .look figcaption { font-size: 0.72rem; }
  .looks__cap { grid-column: span 2; font-size: 0.74rem; }

  .hush__num { font-size: 9rem; }

  .spec__head { display: block; }
  .spec__deck, .spec__pilot { margin-top: 1rem; }
  .spec__grid { display: block; }
  .setter { margin-bottom: 2.5rem; }
  .galley--b { margin-top: 0; }
  .styles { grid-template-columns: repeat(2, 1fr); }
  .proof { display: block; }
  .proof__main, .proof__look { margin-top: 2rem; }
  .proof__frame.is-tall { width: min(100%, 15rem); }
  .tbl--tools th { white-space: normal; }
  .tbl--cost th, .tbl--cost td { font-size: 0.82rem; }
  .colophon__in { text-align: left; }
  .mark--col { margin-left: 0; }

  .folio__label { display: none; }
  .folio { right: auto; }
  .folio__now { padding: 0 0.7em; }
  .folio__step, .folio button { min-height: 44px; }
  .folio__step { width: 44px; }
  .contents { min-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .vellum__sheet { transform: rotate(-2.4deg); }
  .folio { transition: none; }
}
@media (hover: none) { .vellum__sheet { --lx: 0px; --ly: 0px; } }

/* a tall proof sits beside its caption instead of above an empty column */
@media (min-width: 761px) {
  .proof__main.is-tall { display: grid; grid-template-columns: minmax(12rem, 17rem) 1fr; gap: 1.5rem; align-items: end; }
  .proof__main.is-tall .proof__frame.is-tall { width: 100%; }
  .proof__main.is-tall figcaption { margin-top: 0; }
}
[data-ground="ink"] .ph { color: var(--bone-2); }
