/* RunByOps
   A service docket set like a good trade journal: paper, ink, carbon blue,
   a typed record layer, and a red stamp only where something is missing. */

@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --paper: #f7f4ec;        /* the page */
  --paper-2: #efeadf;      /* bands and the footer stub */
  --sheet: #fffdf8;        /* white copy: records, cards */
  --ink: #1c1b18;
  --ink-2: #4a463f;
  --ink-3: #6b655b;
  --rule: #d6cfbf;
  --carbon: #29378f;       /* carbon-copy blue: the one interactive accent */
  --carbon-ink: #1c2766;
  --carbon-tint: #e6e9f5;
  --canary: #fcec9f;       /* yellow copy: the office copy */
  --canary-edge: #d4b84a;
  --pink: #f6d3d8;         /* pink copy: missing */
  --stamp: #ad281e;        /* serial numbers and stamps */
  --ok: #1d6a3a;
  --band: #1c1b18;
  --band-ink: #f7f4ec;
  --band-ink-2: #cfc8b9;
  --shadow-ink: #1c1b18;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 76rem;
  --measure: 44rem;
  --gutter: clamp(1rem, 4.2vw, 3rem);
  --line: 1.5px;
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #171614;
    --paper-2: #1f1e1b;
    --sheet: #24231f;
    --ink: #ede9e0;
    --ink-2: #c3bcae;
    --ink-3: #a29b8d;
    --rule: #3d3a33;
    --carbon: #aab6ff;
    --carbon-ink: #ccd3ff;
    --carbon-tint: #1d2140;
    --canary: #3b3317;
    --canary-edge: #8c7628;
    --pink: #41242a;
    --stamp: #ff8f80;
    --ok: #80d89e;
    --band: #26241f;
    --band-ink: #ede9e0;
    --band-ink-2: #c3bcae;
    --shadow-ink: #6d685d;
  }
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

@media (min-width: 64em) {
  body { font-size: 1.1875rem; }
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

p, ul, ol, dl, dd, figure, blockquote, table, pre { margin: 0; }

a {
  color: var(--carbon);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--carbon-ink); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--carbon);
  outline-offset: 3px;
  border-radius: 1px;
}

main:focus { outline: none; }

strong { font-weight: 700; }

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

/* ------------------------------------------------------------------ type helpers */

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.serial {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--stamp);
  letter-spacing: 0.01em;
}

.standfirst {
  margin-top: 1.25rem;
  max-width: 38em;
  color: var(--ink-2);
  font-size: clamp(1.15rem, 1.02rem + 0.5vw, 1.35rem);
  line-height: 1.5;
}

.textlink {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem 0.82rem;
  border: var(--line) solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--canary-edge);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  color: var(--paper);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--canary-edge);
}

.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--canary-edge); }

.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.btn--canary {
  background: var(--canary);
  border-color: var(--canary);
  color: #1c1b18;
  box-shadow: 4px 4px 0 var(--band-ink-2);
}
.btn--canary:hover { color: #1c1b18; box-shadow: 5px 5px 0 var(--band-ink-2); }

@media screen {
  :root[data-theme="dark"] .btn--canary { background: #f2dc7a; border-color: #f2dc7a; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.6rem;
}

/* ------------------------------------------------------------------ header */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-block: 0.95rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand:hover .brand__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__back { fill: var(--canary); stroke: var(--ink); stroke-width: 1.5; }
.brand__front { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.brand__lines { fill: none; stroke: var(--carbon); stroke-width: 1.5; }

.theme-toggle {
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-right: auto;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}
.theme-toggle:not([hidden]) { display: inline-flex; }
.theme-toggle:hover { border-color: var(--ink-2); color: var(--ink); }
.theme-toggle[aria-pressed="true"] { background: var(--carbon-tint); color: var(--carbon); border-color: var(--carbon); }
.theme-toggle__indicator { width: 0.6rem; height: 0.6rem; border: 1px solid currentColor; border-radius: 50%; }
.theme-toggle[aria-pressed="true"] .theme-toggle__indicator { background: currentColor; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem clamp(1rem, 2.6vw, 2.1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { border-bottom-color: var(--ink); color: var(--ink); }
.site-nav a[aria-current] { border-bottom-color: var(--carbon); color: var(--carbon); }

@media (max-width: 36em) {
  .site-header__inner { padding-block: 0.8rem 0.55rem; }
  .theme-toggle { margin-left: auto; margin-right: 0; }
  .site-nav { width: 100%; }
  .site-nav a { font-size: 0.86rem; }
}

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

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.section--rule { border-top: var(--line) solid var(--ink); }

.section__head {
  display: grid;
  gap: 0.9rem;
  max-width: 46rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__head h2,
.two-col__head h2 {
  font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.section__lede {
  max-width: 38em;
  color: var(--ink-2);
  font-size: 1.08em;
  line-height: 1.55;
}

.perf {
  height: 14px;
  background-color: var(--paper-2);
  background-image: radial-gradient(circle at 9px 7px, var(--paper) 3.5px, transparent 4px);
  background-size: 18px 14px;
  background-repeat: repeat-x;
}

/* ------------------------------------------------------------------ hero */

.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6.5rem); }

.hero__grid {
  display: grid;
  gap: clamp(2.75rem, 6vw, 4.5rem);
  align-items: start;
  margin-top: clamp(1.4rem, 3vw, 2.5rem);
}

@media (min-width: 60em) {
  .hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}

.hero__eyebrow { margin-bottom: 1.4rem; }

.hero h1 {
  font-size: clamp(2.65rem, 1.1rem + 5.9vw, 6.3rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero h1 span { display: block; }
.hero h1 .hero__h1-b { color: var(--ink-2); }

.hero__lede {
  margin-top: 0;
  max-width: 33em;
  color: var(--ink-2);
  font-size: clamp(1.15rem, 1.02rem + 0.5vw, 1.35rem);
  line-height: 1.5;
}

.hero .actions { margin-top: 2rem; }

.byline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 30rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.45;
}

.byline img {
  width: 46px;
  height: 46px;
  flex: none;
  border: var(--line) solid var(--ink);
  border-radius: 50%;
}

/* ------------------------------------------------------------------ docket: the signature record */

.copies {
  /* the carbon-copy sheets behind a record: canary then pink */
  box-shadow:
    7px 7px 0 -1.5px var(--canary),
    7px 7px 0 0 var(--shadow-ink),
    14px 14px 0 -1.5px var(--pink),
    14px 14px 0 0 var(--shadow-ink);
  margin-right: 14px;
  margin-bottom: 14px;
}

.copies--one {
  box-shadow: 6px 6px 0 -1.5px var(--canary), 6px 6px 0 0 var(--shadow-ink);
  margin-right: 6px;
  margin-bottom: 6px;
}

.docket {
  position: relative;
  padding: 1.15rem 1.25rem 1.6rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.docket__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: var(--line) solid var(--ink);
}

.docket__no { font-size: 1.05rem; }

.docket__title {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.fields {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.45;
}

.fields > div {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-block: 0.55rem;
  border-bottom: 1px dashed var(--rule);
}

.fields > div:last-child { border-bottom: 0; }

.fields dt {
  padding-top: 0.12rem;
  color: var(--ink-2);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fields dd { margin: 0; color: var(--ink); }

.fields .is-missing dd { color: var(--stamp); }

.fields .is-next {
  margin-inline: -0.6rem;
  padding-inline: 0.6rem;
  background: var(--canary);
  border-bottom-color: transparent;
}

.docket .fields { margin-top: 0.5rem; }

.stamp {
  display: inline-block;
  padding: 0.38rem 0.6rem 0.32rem;
  border: 2.5px solid currentColor;
  border-radius: 4px;
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.docket__stamp {
  position: absolute;
  right: 1rem;
  bottom: -1.1rem;
  background: var(--sheet);
}

.hero__docket figcaption,
.figure-note {
  margin-top: 1.9rem;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.hero__docket { max-width: 30rem; }

@media (min-width: 60em) {
  .hero__docket { justify-self: end; width: 100%; margin-top: 0.4rem; }
}

.tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.tag--missing { color: var(--stamp); }
.tag--ok { color: var(--ok); }
.tag--next { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .hero__docket .fields > div {
    animation: field-in 0.45s ease-out both;
  }
  .hero__docket .fields > div:nth-child(1) { animation-delay: 0.25s; }
  .hero__docket .fields > div:nth-child(2) { animation-delay: 0.4s; }
  .hero__docket .fields > div:nth-child(3) { animation-delay: 0.55s; }
  .hero__docket .fields > div:nth-child(4) { animation-delay: 0.7s; }
  .hero__docket .fields > div:nth-child(5) { animation-delay: 0.85s; }
  .hero__docket .docket__stamp { animation: stamp-in 0.42s cubic-bezier(0.3, 1.4, 0.5, 1) 1.35s both; }
}

@keyframes field-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-5deg) scale(1.7); }
  to { opacity: 1; transform: rotate(-5deg) scale(1); }
}

/* ------------------------------------------------------------------ home: stuck moments */

.moments {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--line) solid var(--ink);
}

.moment {
  position: relative;
  display: grid;
  gap: 1rem 3rem;
  padding-block: clamp(1.6rem, 3vw, 2.3rem);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 56em) {
  .moment { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

.moment__quote {
  max-width: 26em;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1.02rem, 0.92rem + 0.45vw, 1.24rem);
  font-weight: 500;
  line-height: 1.45;
}

.moment__guide { display: grid; gap: 0.55rem; }

.moment__guide h3 {
  font-size: clamp(1.25rem, 1.08rem + 0.65vw, 1.6rem);
  line-height: 1.18;
}

.moment__guide h3 a {
  color: var(--ink);
  text-decoration: none;
}

.moment__guide h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.moment__guide h3 a:focus-visible { outline: none; }

.moment:has(a:focus-visible) {
  outline: 3px solid var(--carbon);
  outline-offset: 4px;
}

.moment__guide p { color: var(--ink-2); }

.moment__meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
}

.moment__go {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--carbon);
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
}

.moment__go svg { width: 1em; height: 1em; transition: transform 0.18s ease; }

.moment:hover h3 a { color: var(--carbon); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
.moment:hover .moment__go svg { transform: translateX(4px); }

/* ------------------------------------------------------------------ home: the office copy */

.office { background: var(--paper-2); }

.office__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

@media (min-width: 60em) {
  .office__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.office__copy { display: grid; gap: 1.1rem; max-width: 36rem; }

.office__copy h2 {
  font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.office__copy .label { margin-bottom: -0.1rem; }

.office__figure svg { width: 100%; height: auto; }

.dg-sheet { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.dg-canary { fill: var(--canary); stroke: var(--ink); stroke-width: 1.5; }
.dg-pink { fill: var(--pink); stroke: var(--ink); stroke-width: 1.5; }
.dg-rule { stroke: var(--rule); stroke-width: 1.2; }
.dg-ink { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.dg-scribble { stroke: var(--carbon); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dg-missing { fill: none; stroke: var(--stamp); stroke-width: 1.8; stroke-dasharray: 6 5; }
.dg-text { fill: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
.dg-text-2 { fill: var(--ink-2); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; }
.dg-red { fill: var(--stamp); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.dg-bubble { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.3; }
.dg-photo { fill: var(--rule); stroke: var(--ink); stroke-width: 1.3; }
.dg-sky { fill: var(--ink-3); }
.dg-arrow { stroke: var(--ink-2); stroke-width: 1.5; fill: none; }

/* ------------------------------------------------------------------ home: method */

.form-q {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
  border-top: var(--line) solid var(--ink);
}

.form-q li {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding-block: 1.3rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: q;
}

.form-q li::before {
  content: "Q" counter(q);
  padding-top: 0.3rem;
  color: var(--stamp);
  font-family: var(--mono);
  font-weight: 600;
}

.form-q p {
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.form-q .answer-line {
  grid-column: 2;
  height: 0;
  margin-top: 1.4rem;
  border-bottom: 1.5px dotted var(--ink-3);
}

.method__after {
  display: grid;
  gap: 1.1rem;
  max-width: 44rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

@media (min-width: 60em) {
  .method { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem 4.5rem; }
  .method .section__head { grid-column: 1; grid-row: 1 / span 2; align-self: start; position: sticky; top: 2rem; }
  .method .form-q, .method .method__after { grid-column: 2; }
}

/* ------------------------------------------------------------------ home: kevin */

.kevin {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 52em) {
  .kevin { grid-template-columns: 15rem minmax(0, 40rem); gap: 3.5rem; }
}

.portrait {
  max-width: 15rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.portrait img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }

.portrait figcaption {
  padding: 0.5rem 0.75rem;
  border-top: var(--line) solid var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.kevin__copy { display: grid; gap: 1.1rem; }

.kevin__copy h2 {
  font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ call band */

.cta-band {
  background: var(--band);
  color: var(--band-ink);
}

.cta-band__inner {
  display: grid;
  gap: 2rem;
  padding-block: clamp(3rem, 7vw, 5rem);
  align-items: end;
}

@media (min-width: 56em) {
  .cta-band__inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4rem; }
}

.cta-band h2 {
  font-size: clamp(1.9rem, 1.25rem + 2.5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.cta-band p { margin-top: 1rem; max-width: 36em; color: var(--band-ink-2); }

.cta-band__actions { display: grid; gap: 1rem; justify-items: start; }
.cta-band__actions p { margin-top: 0; font-size: 0.92rem; }

.cta-band a:not(.btn) { color: var(--band-ink); }
.cta-band :focus-visible { outline-color: var(--canary); }

@media screen {
  :root[data-theme="dark"] .cta-band :focus-visible { outline-color: #f2dc7a; }
}

/* ------------------------------------------------------------------ inner page heads */

.page-head { padding-block: clamp(1.75rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem); }
.page-head + .about-body { padding-top: 0.5rem; }

.page-head h1 {
  max-width: 22ch;
  margin-top: 0.9rem;
  font-size: clamp(2.3rem, 1.3rem + 4.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.026em;
}

.page-head .actions { margin-top: 2rem; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0;
  margin: 0 0 clamp(1.75rem, 4vw, 2.75rem);
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.crumbs li + li::before {
  content: "/";
  margin-inline: 0.55rem;
  color: var(--ink-3);
}

.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--carbon); }

/* ------------------------------------------------------------------ guides index */

.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--line) solid var(--ink);
}

.guide-item {
  position: relative;
  display: grid;
  gap: 0.9rem 2.5rem;
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 56em) {
  .guide-item { grid-template-columns: 6.5rem minmax(0, 1fr) minmax(0, 16rem); }
}

.guide-item__num { font-size: 1.05rem; padding-top: 0.3rem; }

.guide-item__main { display: grid; gap: 0.75rem; }

.guide-item h3 {
  font-size: clamp(1.35rem, 1.12rem + 0.9vw, 1.85rem);
  line-height: 1.15;
}

.guide-item h3 a { color: var(--ink); text-decoration: none; }
.guide-item h3 a::after { content: ""; position: absolute; inset: 0; }
.guide-item h3 a:focus-visible { outline: none; }
.guide-item:has(h3 a:focus-visible) { outline: 3px solid var(--carbon); outline-offset: 4px; }
.guide-item:hover h3 a { color: var(--carbon); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }

.guide-item__main p { color: var(--ink-2); }

.guide-item__side {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.guide-item__side a { position: relative; z-index: 1; }
.guide-item__side .label { margin-top: 0.5rem; }
.guide-item__side .label:first-child { margin-top: 0; }

.file__meta { color: var(--ink-2); }

.index-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-block: clamp(3rem, 7vw, 5rem);
}

@media (min-width: 60em) {
  .index-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.index-grid h2,
.list-title {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.1rem);
  line-height: 1.12;
}

.list-title { margin-bottom: 1.5rem; }

.choose-list,
.layers-list,
.file-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: var(--line) solid var(--ink);
}

.choose-list li,
.layers-list li,
.file-list li {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.layers-list h3 { font-size: 1.1em; margin-top: 0.3rem; }
.layers-list p { color: var(--ink-2); }

.file-list li { display: grid; gap: 0.2rem; }
.file-list a { font-family: var(--mono); font-weight: 600; font-size: 0.95rem; }
.file-list span { color: var(--ink-2); font-family: var(--mono); font-size: 0.8rem; }

.index-note { margin-top: 1.25rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ guide layout */

.guide-head { padding-block: clamp(1.75rem, 5vw, 3.25rem) clamp(2rem, 5vw, 3rem); }

.guide-head__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}

.guide-head__kicker .serial { font-size: 1.05rem; }

.guide-head h1 {
  max-width: 21ch;
  margin-top: 1rem;
  font-size: clamp(2.05rem, 1.2rem + 3.5vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: -0.024em;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.6rem;
  max-width: 50rem;
  margin: 1.75rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.guide-meta a { color: var(--ink); }

.guide-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

@media (min-width: 70em) {
  .guide-layout {
    grid-template-columns: 13.5rem minmax(0, var(--measure));
    gap: 4.5rem;
  }
}

.toc { display: none; }

@media (min-width: 70em) {
  .toc {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow: auto;
    padding-bottom: 1rem;
  }
  .toc-mobile { display: none; }
}

.toc .label { margin-bottom: 0.8rem; }

.toc ol,
.toc-mobile ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc ol { border-left: var(--line) solid var(--rule); }

.toc a {
  display: block;
  margin-left: -1.5px;
  padding: 0.32rem 0 0.32rem 0.95rem;
  border-left: 3px solid transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover { color: var(--ink); border-left-color: var(--rule); }

.toc a.is-current {
  border-left-color: var(--carbon);
  color: var(--carbon);
  font-weight: 600;
}

.toc-mobile {
  margin-bottom: 2rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
}

.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-size: 1.1rem; line-height: 1; }
.toc-mobile[open] summary::after { content: "–"; }
.toc-mobile[open] summary { border-bottom: 1px solid var(--rule); }

.toc-mobile ol { padding: 0.5rem 1rem 0.9rem; }

.toc-mobile a {
  display: block;
  padding-block: 0.38rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ prose */

.prose > * + * { margin-top: 1.1em; }

.prose h2 {
  position: relative;
  margin-top: 2.6em;
  padding-top: 1.1em;
  border-top: var(--line) solid var(--ink);
  font-size: clamp(1.55rem, 1.22rem + 1.3vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 1.22em;
  line-height: 1.25;
}

.prose h4 {
  margin-top: 1.5em;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * { margin-top: 0.7em; }

.prose ul,
.prose ol { padding-left: 1.3em; }

.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--ink-3); }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }

.anchor {
  margin-left: 0.35em;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.62em;
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h2:hover > .anchor,
.anchor:focus-visible { opacity: 1; }

@media (hover: none) { .anchor { display: none; } }

/* the short version */
.tldr {
  padding: 1.25rem 1.4rem 1.4rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.prose .tldr h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tldr ul { padding-left: 1.15em; }
.tldr li + li { margin-top: 0.5em; }

/* five questions and checklists */
.five {
  padding: 0 !important;
  list-style: none;
  counter-reset: five;
  border-top: var(--line) solid var(--ink);
}

.five li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: five;
  font-weight: 700;
}

.prose .five li + li { margin-top: 0; }

.five li::before {
  content: counter(five);
  color: var(--stamp);
  font-family: var(--mono);
  font-weight: 600;
}

.checklist {
  padding: 0 !important;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
}

.checklist li::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.3em;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

/* numbered steps */
.steps {
  padding: 0 !important;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 3.4rem;
  counter-increment: step;
}

.prose .steps > li + li { margin-top: 2.3em; }

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  padding-top: 0.25rem;
  border-top: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.steps > li > * + * { margin-top: 0.85em; }

.prose .steps h3 { margin-top: 0; }

.steps ul { padding-left: 1.2em; }

/* field tables */
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93em;
  line-height: 1.45;
}

.data th,
.data td {
  padding: 0.65rem 0.75rem 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.data thead th {
  padding-top: 0;
  border-bottom: var(--line) solid var(--ink);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.data tbody th,
.data .mono {
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 600;
}

.data tbody th { width: 30%; }
.data--grid tbody th { width: auto; min-width: 7.5rem; }
.nw { white-space: nowrap; }

.cell-sub {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1.05em;
  font-weight: 400;
}

@media (max-width: 40em) {
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td,
  table.stack th { display: block; width: 100%; }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.stack tr {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--rule);
  }

  table.stack td,
  table.stack tbody th {
    display: grid;
    grid-template-columns: 6.8rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.3rem 0;
    border: 0;
  }

  table.stack td::before,
  table.stack tbody th::before {
    content: attr(data-label);
    padding-top: 0.2rem;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  table.stack.keyed tbody th { display: block; padding-top: 0.6rem; font-size: 0.95em; }
  table.stack.keyed tbody th::before { content: none; }

  /* two-column tables: the key is the heading, so the value needs no label */
  table.stack.pairs td { display: block; padding-top: 0.15rem; }
  table.stack.pairs td::before { content: none; }
}

/* notes */
.note {
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--carbon);
}

.note .label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--carbon);
}

/* illustrative examples */
.example {
  margin-block: 1.8em;
  border: var(--line) solid var(--ink);
  background: var(--paper-2);
}

.example__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  padding: 0.75rem 1.1rem;
  border-bottom: var(--line) solid var(--ink);
  background: var(--sheet);
}

.example__tag {
  padding: 0.12rem 0.45rem;
  border: 1.5px solid var(--stamp);
  border-radius: 2px;
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.example__note {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
}

.example__body {
  display: grid;
  gap: 1.35rem;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.prose .example__body > * + * { margin-top: 0; }

.example h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.example h3:not(:first-child) {
  padding-top: 1.35rem;
  border-top: 1px dashed var(--ink-3);
}

.example p { font-size: 0.95em; }

/* fragments: the scattered "before" */
.fragments {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 40em) {
  .fragments { grid-template-columns: 1fr 1fr; }
}

.frag {
  padding: 0.75rem 0.9rem 0.85rem;
  border: 1px solid var(--ink-3);
  background: var(--sheet);
  font-size: 0.88rem;
  line-height: 1.45;
}

.frag__src {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.frag--chat { border-radius: 14px 14px 14px 3px; }
.frag--chat.frag--me { border-radius: 14px 14px 3px 14px; background: var(--carbon-tint); }

.frag--email .frag__subject { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; }

.frag--sheet .cells {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, auto));
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.frag--sheet .cells span {
  padding: 0.3rem 0.4rem;
  border-right: 1px solid var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frag--sheet .cells span:last-child { border-right: 0; }

.frag--note {
  background: var(--canary);
  border-color: var(--canary-edge);
  font-family: var(--mono);
  font-size: 0.86rem;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
  margin-top: 0.3rem;
}

.thumbs span {
  aspect-ratio: 1;
  background:
    linear-gradient(160deg, transparent 55%, var(--ink-3) 56%, var(--ink-3) 62%, transparent 63%),
    var(--rule);
  border-radius: 1px;
}

.thumbs span:nth-child(3n) { background: linear-gradient(20deg, var(--rule) 50%, var(--ink-3) 51%); }
.thumbs span:nth-child(4n) { background: var(--ink-3); opacity: 0.55; }

.frag-span { grid-column: 1 / -1; }

.unanswered {
  padding: 0 !important;
  list-style: none;
}

.unanswered li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
}

.unanswered li::before {
  content: "?";
  color: var(--stamp);
  font-family: var(--mono);
  font-weight: 700;
}

/* record cards: the "after" */
.record {
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.record__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding: 0.65rem 1rem;
  border-bottom: var(--line) solid var(--ink);
}

.record__title {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
}

.record .fields { padding: 0.15rem 1rem 0.5rem; }
.record .fields .is-next { margin-inline: -1rem; padding-inline: 1rem; }

@media (max-width: 30em) {
  .fields > div { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
}

.obs-grid {
  display: grid;
  gap: 1.1rem;
}

/* yes / no lists */
.two-lists {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 46em) {
  .two-lists { grid-template-columns: 1fr 1fr; }
}

.two-lists > div {
  padding: 1rem 1.15rem 1.2rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.prose .two-lists h3 {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marks {
  padding: 0 !important;
  list-style: none;
  font-size: 0.95em;
}

.marks li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
}

.marks--yes li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.marks--no li::before { content: "✕"; color: var(--stamp); font-weight: 700; }

/* copyable brief */
.brief {
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.brief__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  border-bottom: var(--line) solid var(--ink);
}

.brief pre {
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-btn {
  padding: 0.4rem 0.7rem;
  border: var(--line) solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.78rem/1.2 var(--mono);
  cursor: pointer;
}

.copy-btn:hover { background: var(--canary); }

/* stage track */
.track {
  display: grid;
  margin: 0;
  padding: 0 !important;
  list-style: none;
  counter-reset: stage;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.track li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.5rem;
  border-left: 3px solid var(--ink);
  counter-increment: stage;
}

.prose .track li + li { margin-top: 0; }

.track li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 0.8rem;
  width: 15px;
  height: 15px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.track li span::before {
  content: counter(stage) " ";
  color: var(--stamp);
}

.prose .track { margin-top: 1.9em; }

.track .is-gap { border-color: var(--stamp); }
.track .is-gap::before { border-color: var(--stamp); background: var(--pink); }

@media (min-width: 40em) {
  .track { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .track li {
    padding: 1.2rem 0.5rem 0 0;
    border-left: 0;
    border-top: 3px solid var(--ink);
  }
  .track li::before { left: 0; top: -9px; }
  .track .is-gap { border-top-color: var(--stamp); }
}

/* resource panel: the office copy you take away */
.resource {
  padding: clamp(1.25rem, 3vw, 1.85rem);
  border: var(--line) solid var(--ink);
  background: var(--canary);
  color: var(--ink);
}

.prose .resource > * + * { margin-top: 0.9rem; }

.resource__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.resource .label { color: var(--ink); }

.prose .resource h3 {
  margin-top: 0.4rem;
  font-size: clamp(1.35rem, 1.18rem + 0.6vw, 1.65rem);
}

.resource ul { padding-left: 1.2em; }
.resource li + li { margin-top: 0.3em; }
.resource .btn { margin-top: 0.4rem; }
.resource .small { font-size: 0.88em; color: var(--ink-2); }

/* the technical layer */
.setup {
  margin-top: 2.6em;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: 3px solid var(--carbon);
  background: var(--carbon-tint);
}

.prose .setup > * + * { margin-top: 1em; }

.prose .setup h2 {
  margin-top: 0.4rem;
  padding-top: 0;
  border-top: 0;
}

.prose .setup h3 {
  margin-top: 1.6em;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup .label { color: var(--carbon); }

.setup ul { padding-left: 1.2em; }

/* limits */
.limits {
  padding: 0 !important;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.limits li {
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.prose .limits li + li { margin-top: 0; }

/* help */
.help {
  margin-top: 2.6em;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--band);
  color: var(--band-ink);
}

.prose .help h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--band-ink);
}

.help p { color: var(--band-ink-2); }
.help .actions { margin-top: 1.5rem; }
.help a:not(.btn) { color: var(--band-ink); }
.help :focus-visible { outline-color: var(--canary); }

.related {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: var(--line) solid var(--ink);
}

.related h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }

.related ul {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  .related ul { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}

.related li {
  position: relative;
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 1.1rem 1.2rem 1.25rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

.related a { color: var(--ink); font-weight: 700; font-size: 1.1em; line-height: 1.25; text-decoration: none; }
.related a::after { content: ""; position: absolute; inset: 0; }
.related a:focus-visible { outline: none; }
.related li:has(a:focus-visible) { outline: 3px solid var(--carbon); outline-offset: 3px; }
.related li:hover a { color: var(--carbon); text-decoration: underline; }
.related p { color: var(--ink-2); font-size: 0.95em; }

/* ------------------------------------------------------------------ work with kevin, about */

.two-col {
  display: grid;
  gap: 1.5rem 4.5rem;
}

@media (min-width: 60em) {
  .two-col { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .two-col__head { position: sticky; top: 2rem; align-self: start; }
}

.two-col__head { display: grid; gap: 0.9rem; align-content: start; }

.two-col__body { display: grid; gap: 1.1rem; max-width: var(--measure); }

.two-col__body h3 { margin-top: 1rem; font-size: 1.2em; }

.squares {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--line) solid var(--ink);
}

.squares li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.squares li::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.55em;
  background: var(--ink);
}

.problems { display: grid; border-top: var(--line) solid var(--ink); }

.problems > div {
  display: grid;
  gap: 0.3rem;
  padding-block: 1.05rem 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.problems dt { font-weight: 700; font-size: 1.12em; }
.problems dd { color: var(--ink-2); }
.problems dd a { font-family: var(--mono); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

.process {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: proc;
}

.process li {
  position: relative;
  padding: 0 0 2rem 3.6rem;
  counter-increment: proc;
}

.process li::before {
  content: counter(proc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.process li::after {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 2.6rem;
  bottom: 0.2rem;
  border-left: 1.5px dashed var(--ink-3);
}

.process li:last-child { padding-bottom: 0; }
.process li:last-child::after { content: none; }

.process h3 { padding-top: 0.35rem; font-size: 1.2em; }
.process p { margin-top: 0.55rem; color: var(--ink-2); }

.compare-wrap { max-width: 60rem; }

.faq { display: grid; gap: 0.5rem; }
.faq h3 { margin-top: 1.4rem; font-size: 1.15em; }
.faq h3:first-child { margin-top: 0; }
.faq p { color: var(--ink-2); }

.about-head {
  display: grid;
  gap: 2.5rem;
  align-items: end;
}

@media (min-width: 56em) {
  .about-head { grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; }
}

.portrait--large { max-width: 17rem; }

.principles { display: grid; border-top: var(--line) solid var(--ink); }

.principles > div {
  display: grid;
  gap: 0.3rem;
  padding-block: 1rem 1.1rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 48em) {
  .principles > div { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 2rem; }
}

.principles dt { font-weight: 700; }
.principles dd { color: var(--ink-2); }

.about-body { padding-bottom: clamp(3rem, 7vw, 5rem); }
.about-body .prose > h2:first-child { margin-top: 0; }
.about-body .prose { max-width: var(--measure); }

.notfound { min-height: 50vh; }

/* ------------------------------------------------------------------ revision components */

/* the first step inside "The short version" */
.tldr__first {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--ink-3);
}

.tldr__first a { font-weight: 700; }

/* when to build more: condition on the left, what gets built on the right */
.ladder {
  margin: 0;
  padding: 0 !important;
  list-style: none;
  border-top: var(--line) solid var(--ink);
  counter-reset: rung;
}

.ladder > li {
  display: grid;
  gap: 0.35rem 1.75rem;
  padding-block: 0.95rem 1.05rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: rung;
}

.prose .ladder > li + li { margin-top: 0; }

@media (min-width: 46em) {
  .ladder > li { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

.ladder__when {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.ladder__when::before {
  content: "0" counter(rung) " ";
  color: var(--stamp);
}

.ladder__what { color: var(--ink-2); }

/* real, from Kevin's own business: green tag, as opposed to the red "illustrative" tag */
.real-note {
  padding: 1rem 1.15rem 1.1rem;
  border: var(--line) solid var(--ink);
  border-left: 6px solid var(--ok);
  background: var(--sheet);
}

.real-note .real-tag,
.real-tag {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.12rem 0.45rem;
  border: 1.5px solid var(--ok);
  border-radius: 2px;
  color: var(--ok);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.real-note p { font-size: 0.97em; }
.real-note p + p { margin-top: 0.5rem; }

/* the real-work page */
.flow {
  display: grid;
  margin: 0;
  padding: 0 !important;
  list-style: none;
  counter-reset: flow;
  font-size: 0.95em;
}

.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  padding: 0 0 1.05rem;
  counter-increment: flow;
}

.prose .flow li + li { margin-top: 0; }

.flow li::before {
  content: counter(flow);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.flow li::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.85rem;
  bottom: 0.15rem;
  border-left: 1.5px dashed var(--ink-3);
}

.flow li:last-child { padding-bottom: 0; }
.flow li:last-child::after { content: none; }
.flow strong { font-family: var(--mono); font-size: 0.85em; }

.proof-cards {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 52em) {
  .proof-cards { grid-template-columns: 1fr 1fr; }
}

.proof-card {
  position: relative;
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: var(--line) solid var(--ink);
  border-left: 6px solid var(--ok);
  background: var(--sheet);
}

.proof-card .real-tag { justify-self: start; margin-bottom: 0; }
.proof-card h3 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem); line-height: 1.2; }
.proof-card h3 a { color: var(--ink); text-decoration: none; }
.proof-card h3 a::after { content: ""; position: absolute; inset: 0; }
.proof-card h3 a:focus-visible { outline: none; }
.proof-card:has(h3 a:focus-visible) { outline: 3px solid var(--carbon); outline-offset: 4px; }
.proof-card:hover h3 a { color: var(--carbon); text-decoration: underline; }
.proof-card p { color: var(--ink-2); }

/* what I build: problem, then the thing built, then what you get */
.builds {
  display: grid;
  margin: 0;
  border-top: var(--line) solid var(--ink);
}

.builds > div {
  display: grid;
  gap: 0.3rem 2rem;
  padding-block: 1rem 1.1rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 52em) {
  .builds > div { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

.builds dt {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.45;
}

.builds dd { color: var(--ink-2); }
.builds dd strong { color: var(--ink); }

/* arriving from a homepage problem: mark the row it points to */
.builds > div:target {
  margin-inline: -0.75rem;
  padding-inline: 0.75rem;
  background: var(--canary);
  border-bottom-color: transparent;
}

.builds > div:target dd { color: var(--ink); }

/* ------------------------------------------------------------------ revision 3 components */

/* home: the guide shelf under the five problems */
.shelf {
  display: grid;
  gap: 1.25rem 3rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: var(--line) solid var(--ink);
  background: var(--sheet);
}

@media (min-width: 56em) {
  .shelf { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

.shelf__head { display: grid; gap: 0.6rem; }
.shelf__head h3 { font-size: clamp(1.25rem, 1.08rem + 0.65vw, 1.6rem); line-height: 1.18; }
.shelf__head p { color: var(--ink-2); }

.shelf__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--line) solid var(--ink);
}

.shelf__list li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.15rem 0.5rem;
  padding-block: 0.7rem 0.75rem;
  border-bottom: 1px dashed var(--rule);
}

.shelf__list li:last-child { border-bottom: 0; }
.shelf__list .serial { grid-row: 1 / span 2; padding-top: 0.15rem; font-size: 0.85rem; }
.shelf__list a { font-weight: 700; text-decoration-color: var(--rule); }
.shelf__list a:hover { text-decoration-color: currentColor; }

.shelf__file {
  grid-column: 2;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.76rem;
}

/* work with kevin: the five problems as a tick list */
.fit-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.fit-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 2rem;
  border-bottom: 1px solid var(--rule);
}

.fit-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.95rem;
  width: 0.9rem;
  height: 0.9rem;
  border: 1.5px solid var(--ink);
  background: var(--sheet);
}

/* guides index: the list follows the page head directly */
.section--tight { padding-bottom: clamp(3rem, 7vw, 5rem); }

/* lists that start right after a paragraph need the paragraph gap back (.flow and .ladder reset their margins) */
.prose p + .flow,
.prose p + .ladder { margin-top: 1.25em; }

/* real work: the opening sentence of each system */
.prose .lead { color: var(--ink); font-size: 1.1em; line-height: 1.55; }

/* real work: a sample run of a real script, as opposed to an invented example */
.demo {
  margin-block: 1.8em;
  border: var(--line) dashed var(--ink);
  background: var(--paper-2);
}

.demo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  padding: 0.75rem 1.1rem;
  border-bottom: var(--line) dashed var(--ink);
  background: var(--sheet);
}

.demo__tag {
  padding: 0.12rem 0.45rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo__note {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
}

.demo__body {
  display: grid;
  gap: 1.35rem;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.prose .demo__body > * + * { margin-top: 0; }

.demo__pair { display: grid; gap: 1rem; }

.demo h3 {
  margin: 0;
  padding-top: 1.35rem;
  border-top: 1px dashed var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo .record .fields dt { overflow-wrap: anywhere; }

.cut {
  color: var(--stamp);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* ------------------------------------------------------------------ revision 4 components */

/* real work: the illustrative back-office walkthrough */
.prose .walk__steps {
  display: grid;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prose .walk__steps > li + li { margin-top: 0; }

.walk__step + .walk__step {
  padding-top: 1.35rem;
  border-top: 1px dashed var(--ink-3);
}

.prose .walk__step > * + * { margin-top: 0.75rem; }

.walk__step h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.walk__num {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: var(--line) solid var(--ink);
  background: var(--sheet);
  color: var(--stamp);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.prose .review {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prose .review li + li { margin-top: 0; }

.review li {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  font-size: 0.95em;
}

.review .tag { justify-self: start; margin-left: 0; }

@media (max-width: 30em) {
  .review li { grid-template-columns: minmax(0, 1fr); }
}

/* real work: what is documented, what is illustrated, what isn't shown */
.provenance {
  margin: 0;
  border-top: var(--line) solid var(--ink);
}

.prose .provenance { margin-top: 1.4em; }

.provenance > div {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.25rem 0.9rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--rule);
}

.provenance dt {
  padding-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provenance dd { margin: 0; color: var(--ink-2); }
.provenance .is-real dt { color: var(--ok); }
.provenance .is-illus dt { color: var(--stamp); }
.provenance .is-none dt { color: var(--ink-2); }

@media (max-width: 30em) {
  .provenance > div { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ scroll reveal */

/* site.js adds .rv only to blocks that start below the first screen, and only when motion
   is allowed; .rv-in arrives as the block is reached, then both classes are removed. */
@media (prefers-reduced-motion: no-preference) {
  .rv {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    transition: opacity 0.55s ease-out, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .rv.rv-in { opacity: 1; transform: none; }

  /* the three questions: each answer line is drawn in after its question */
  .form-q li.rv .answer-line {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
  }

  .form-q li.rv.rv-in .answer-line { transform: scaleX(1); }

  /* then and now: the copies appear in order, the scattered pieces follow, the missing copy last */
  .office__figure.dg-wait .dg-seq { opacity: 0; }

  .office__figure.dg-go .dg-seq {
    animation: dg-in 0.5s ease-out both;
    animation-delay: calc(var(--i, 0) * 140ms + 200ms);
  }
}

@keyframes dg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--paper-2); }

.site-footer__inner {
  display: grid;
  gap: 2.25rem;
  padding-block: 2.75rem 2.25rem;
}

@media (min-width: 52em) {
  .site-footer__inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
}

.site-footer__about { display: grid; gap: 0.6rem; max-width: 24rem; align-content: start; }

.site-footer__brand {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
}

.site-footer__who { color: var(--ink-2); font-family: var(--mono); font-size: 0.8rem; }

.site-footer__col ul {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}

.site-footer__col a { color: var(--ink); text-decoration-color: var(--rule); }
.site-footer__col a:hover { color: var(--carbon); text-decoration-color: currentColor; }

.footer__num { color: var(--stamp); font-family: var(--mono); font-size: 0.8rem; font-weight: 600; }

.ext { color: var(--ink-2); font-size: 0.85em; }

.site-footer__fine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem 2.25rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ print */

@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .anchor, .help, .related, .copy-btn, .skip-link { display: none !important; }
  .rv, .dg-seq { opacity: 1 !important; transform: none !important; animation: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  .copies, .copies--one { box-shadow: none; margin: 0; }
  .example, .record, .resource, .tldr, .setup { break-inside: avoid; }
  .guide-layout { display: block; }
}
