/* Anomaly site. Paper, ink, and one red pen.
   Ink is what a model or the system wrote. Red is a person's mark: a strike with inserted words, an underline, a note number.
   Nothing else on the page is red. */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --g100: #f5f5f5;
  --g200: #e6e6e6;
  --g400: #9a9a9a;
  --g700: #6f6f6f;
  --g800: #262626;
  --g900: #111111;

  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--g700);
  --line: var(--g200);
  --surface: var(--g100);
  --pen: #b42318;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --r: 16px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --fg: var(--paper);
    --muted: var(--g400);
    --line: var(--g800);
    --surface: var(--g900);
    --pen: #ff6f60;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--ink);
  --fg: var(--paper);
  --muted: var(--g400);
  --line: var(--g800);
  --surface: var(--g900);
  --pen: #ff6f60;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--fg); color: var(--bg); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- navigation ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: inline-flex; align-items: flex-end; gap: 10px; line-height: 0; text-decoration: none; flex-shrink: 0; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav .link { text-decoration: none; font-weight: 500; font-size: 0.9375rem; padding: 6px 0; }
.nav .link:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.nav .link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1.5px; }
@media (max-width: 719px) { .nav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; font-family: inherit; line-height: 1.2;
  transition: transform 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease);
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { border-color: var(--fg); color: var(--fg); background: transparent; }
.btn-secondary:hover { background: var(--surface); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn-primary:hover { transform: none; } }

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start;
}
.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.2vw, 80px); line-height: 0.98; letter-spacing: -0.024em;
  margin: 0 0 22px; text-wrap: balance;
}
.one-line { font-size: 19px; line-height: 1.45; max-width: 26em; margin: 0 0 24px; }
.hero .links { display: grid; justify-items: start; gap: 8px; margin: 0 0 28px; }
.hero .links a { font-size: 17px; font-weight: 600; text-decoration: none; }
.hero .links a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.status-line { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 32em; }
.status-line .stamp { margin-right: 6px; vertical-align: 1px; }
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 48px; }
}
.hero-text .display { font-size: clamp(40px, 4.6vw, 64px); line-height: 1; }
.hero-about { grid-template-columns: 1fr; }
.display-about { font-size: clamp(38px, 5vw, 66px); margin-bottom: 0; }
@media (min-width: 1000px) { .hero-about { grid-template-columns: 1fr; } .display-about { font-size: clamp(38px, 5vw, 66px); } }

/* ---------- the sheet: one item at the desk (an illustration, nothing to operate) ---------- */
.sheet { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; container: sheet / inline-size; }
.s-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  padding: 11px 20px; border-bottom: 1px solid var(--line);
  font-size: 12px; line-height: 1.45; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; color: var(--muted);
}
.s-head strong { color: var(--fg); font-weight: 600; }
.d-label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.45; margin: 0 0 6px; }
.d-why { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; }
.d-why .d-label { display: inline; margin: 0; }
.d-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.d-read { padding: 20px 20px 24px; border-bottom: 1px solid var(--line); }
.d-q { font-weight: 600; font-size: 1.0625rem; line-height: 1.4; margin: 0 0 20px; }
.d-answer { font-family: var(--serif); font-size: 21px; line-height: 1.55; margin: 0; }
.d-notes { list-style: none; margin: 0; padding: 20px 20px 22px; background: var(--surface); display: grid; gap: 22px; align-content: start; }
@container sheet (min-width: 560px) { .d-notes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }
.d-kind { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.d-note { margin: 0 0 10px; font-size: 0.9375rem; line-height: 1.45; }
.d-proof { margin: 0; padding-left: 12px; border-left: 2px solid var(--line); }
.d-proof p { font-family: var(--serif); font-size: 16px; line-height: 1.45; margin: 0 0 4px; }
.d-proof .d-cite { font-family: var(--sans); font-size: 12px; line-height: 1.4; color: var(--muted); margin: 0; }
.d-test { padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.d-test dl { margin: 0; display: grid; gap: 6px; }
.d-test dl div { display: grid; grid-template-columns: 1fr; gap: 0; }
@container sheet (min-width: 480px) { .d-test dl div { grid-template-columns: 128px 1fr; gap: 12px; } }
.d-test dt { font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.6; }
.d-test dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; }

/* a person's marks: the only red on the site */
del { color: var(--pen); text-decoration-thickness: 1.5px; }
ins { color: var(--pen); text-decoration: none; border-bottom: 1.5px solid var(--pen); }
.noted { text-decoration: underline var(--pen) 1.5px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.m { color: var(--pen); font-family: var(--sans); font-size: 12px; font-weight: 700; font-style: normal; }
sup.m { margin-left: 1px; }
del, ins, .noted, .m { forced-color-adjust: none; }

.stamp {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 7px; border: 1.5px solid transparent; border-radius: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1;
}
.stamp-line { border-color: var(--fg); color: var(--fg); }
.s-foot { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0; padding: 12px 20px 14px; border-top: 1px solid var(--line); }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(28px, 4vw, 52px); max-width: 40em; }
.title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -0.02em;
  margin: 0 0 14px; text-wrap: balance;
}
.two-col .title { font-size: clamp(30px, 3.2vw, 42px); }
.kicker { font-size: 0.9375rem; color: var(--muted); margin: 0 0 14px; font-weight: 500; }
.prose { max-width: 35em; }
.prose p:last-child { margin-bottom: 0; }
.two-col { display: grid; gap: 36px; align-items: start; }
@media (min-width: 900px) { .two-col { grid-template-columns: 5fr 7fr; gap: 64px; } }

.pull { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); max-width: 24em; }
.pull blockquote { margin: 0; }
.pull blockquote p {
  font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -0.01em;
  margin: 0; text-wrap: pretty;
}
.pull figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.pull figcaption a { color: var(--muted); }

/* evidence list: one fact per row, the figure set in the serif */
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .facts li { grid-template-columns: 104px 1fr; gap: 20px; align-items: baseline; } }
.facts .fig { font-family: var(--serif); font-size: 36px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.facts .fig small { font-size: 60%; letter-spacing: 0; }
.facts p { margin: 0; max-width: 60ch; }
.facts .src { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }

@media (min-width: 640px) { #why .facts li { grid-template-columns: 150px 1fr; } }

/* offerings: rows, not cards */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 26px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 1000px) { .row { grid-template-columns: 230px 1fr 170px; gap: 36px; align-items: start; } }
.row h3 { margin: 0; font-size: 1.4375rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
.row p { margin: 0; max-width: 58ch; }
.row .status { font-size: 0.875rem; color: var(--muted); font-weight: 500; line-height: 1.45; }
@media (min-width: 1000px) { .row .status { padding-top: 4px; } }
.after-rows { margin: 24px 0 0; }

/* the sequence a claim travels. Numbered because it is a sequence. */
.steps { display: grid; gap: 28px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 28px 24px; } }
@media (min-width: 1100px) { .steps { gap: 36px 40px; } }
.step { padding-top: 16px; border-top: 1px solid var(--fg); }
.step::before {
  content: counter(step); counter-increment: step;
  font-family: var(--serif); font-size: 30px; line-height: 1; display: block; margin-bottom: 12px;
}
.step h3 { font-size: 1.0625rem; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: baseline; gap: 8px; }
.gate-tag { font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.step p { margin: 0; font-size: 0.9375rem; color: var(--muted); line-height: 1.5; }

.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }

/* the ledger: dated status lines */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger li { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .ledger li { grid-template-columns: 120px 1fr; gap: 24px; } }
@media (min-width: 640px) { .ledger--rules li { grid-template-columns: 40px 1fr; } }
.ledger .when { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.ledger p { margin: 0; max-width: 64ch; }
.ledger-full { margin-top: 20px; }
.ledger-full summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; padding: 10px 0; width: fit-content; }
.ledger-full summary:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.ledger-full[open] summary { margin-bottom: 12px; }

/* people */
.people { display: grid; gap: 28px; }
@media (min-width: 900px) { .people { grid-template-columns: 1fr 1fr; gap: 40px; } }
.person { display: flex; gap: 18px; align-items: center; text-decoration: none; }
.person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface); }
.person .name { font-weight: 600; font-size: 17px; margin: 0 0 2px; }
.person:hover .name { text-decoration: underline; text-decoration-thickness: 1.5px; }
.person .role { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }

/* profiles (about page) */
.profile { display: grid; gap: 22px; padding: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
@media (min-width: 820px) { .profile { grid-template-columns: 220px 1fr; gap: 56px; } }
.profile img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; background: var(--surface); }
@media (min-width: 820px) { .profile img { width: 220px; height: 220px; } }
.profile h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.018em; line-height: 1.05; margin: 0 0 4px; }
.profile .role { color: var(--muted); margin: 0 0 18px; font-size: 1rem; }
.profile .links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9375rem; margin: 6px 0 0; padding: 0; list-style: none; }

/* footnotes and footer */
sup { font-size: max(0.7em, 11px); line-height: 0; vertical-align: super; }
sup a { color: var(--muted); padding: 0 2px; }
sup a:hover { color: var(--fg); }
.fn { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; margin: 28px 0 0; padding-left: 1.4em; max-width: 70ch; }
.fn li { margin-bottom: 4px; }
.fn li:target { color: var(--fg); }
.fn a { color: var(--muted); }
footer { border-top: 1px solid var(--line); padding: 40px 0 64px; font-size: 0.875rem; color: var(--muted); }
.foot { display: grid; gap: 20px; }
@media (min-width: 720px) { .foot { grid-template-columns: 1fr auto; align-items: end; } }
.foot p { margin: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--fg); }

/* logo swaps with the colour scheme: the sheep is always black, so dark grounds get the sticker lockup */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
