/* Kelsey shared styles. Layout: a single column of chapters, like a case file. */
:root {
  --paper: #FFFFFF;
  --panel: #F4F6F8;
  --ink: #0B1A2E;
  --text: #0B1A2E;
  --muted: #4B5563;
  --rule: #E3E7EC;
  --orange: #FF5A1F;
  --orange-text: #C2410C;
  --on-ink: #FFFFFF;
  --capsule-top: #0B1A2E;
  --serif: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1A2E; --panel: #13243C; --ink: #FFFFFF; --text: #E8EDF3; --muted: #A7B2C1;
    --rule: #26374F; --orange: #FF6B33; --orange-text: #FF8A5C; --on-ink: #0B1A2E; --capsule-top: #FFFFFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1A2E; --panel: #13243C; --ink: #FFFFFF; --text: #E8EDF3; --muted: #A7B2C1;
    --rule: #26374F; --orange: #FF6B33; --orange-text: #FF8A5C; --on-ink: #0B1A2E; --capsule-top: #FFFFFF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Reset for the full documents (the home page gets its own from the host) */
body { margin: 0; }
img, svg { max-width: 100%; }
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); text-wrap: balance; margin: 0; }
p { margin: 0; }
.label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.cite { font-family: var(--mono); font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }

/* Header */
.hdr-right { display: flex; align-items: center; gap: 26px; min-width: 0; }
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--paper);
}
header.site {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; font-size: 26px; line-height: 1; color: var(--ink); }
nav { display: flex; align-items: center; gap: 8px 26px; flex-wrap: wrap; min-width: 0; }
nav a.link { font-size: 15px; color: var(--muted); text-decoration: none; padding-block: 6px; border-bottom: 2px solid transparent; }
nav a.link:hover { color: var(--ink); }
nav a.link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  background: var(--ink); color: var(--on-ink);
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  border: 0; border-radius: 0; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--orange); color: #FFFFFF; }
.btn[aria-current="page"] { background: var(--orange); color: #FFFFFF; }
.textlink { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration-color: var(--orange); text-underline-offset: 4px; }
.textlink:hover { color: var(--orange-text); }

/* Hero */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px;
  padding-block: 72px 80px; align-items: start;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.05; margin-top: 18px; }
.hero h1 em { font-style: normal; color: var(--orange-text); }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 34em; margin-top: 24px; }
.hero .actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 36px; }
.hero .actions .note { font-size: 14px; color: var(--muted); }

/* Dossier card */
.dossier {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 28px 28px 24px;
  min-width: 0;
}
.dossier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dossier-head h2 { font-size: 22px; }
.dossier-head .cite { font-size: 12px; }
.dossier ol { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 0; }
.dossier li {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px;
  padding: 13px 0; border-top: 1px solid var(--rule);
}
.dossier li .src { font-family: var(--mono); font-size: 12.5px; color: var(--ink); padding-top: 2px; min-width: 0; }
.dossier li .what { font-size: 15px; line-height: 1.45; color: var(--text); min-width: 0; }
.dossier .foot { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* Page header for sub-pages */
.page-head .wrap { padding-block: 64px 48px; }
.page-head h1 { font-size: clamp(36px, 4.8vw, 56px); line-height: 1.1; margin-top: 16px; max-width: 18em; }
.page-head .lede { font-size: 19px; color: var(--muted); max-width: 36em; margin-top: 20px; }

/* Chapters */
section.chapter { border-top: 1px solid var(--rule); }
section.chapter .wrap { padding-block: 72px; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 56px; }
main.sub section.chapter .wrap { padding-block: 48px; }
section.chapter .head { min-width: 0; }
section.chapter .head h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; margin-top: 14px; }
main.sub section.chapter .head h2 { font-size: clamp(26px, 3vw, 32px); }
.head p { color: var(--muted); margin-top: 16px; max-width: 26em; }
.body { min-width: 0; }

.prose { display: grid; gap: 14px; max-width: 65ch; }
.prose h3 { font-size: 22px; margin-top: 10px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.prose li::marker { color: var(--orange); }
.note-box { border-left: 3px solid var(--orange); background: var(--panel); padding: 18px 20px; max-width: 65ch; }
.note-box strong { color: var(--ink); font-weight: 600; }
.ph { font-family: var(--mono); font-size: 0.92em; color: var(--muted); background: var(--panel); border: 1px dashed var(--rule); padding: 1px 6px; }

/* Home: steps and teasers */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-top: 1px solid var(--rule); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: counter(step); font-family: var(--sans); font-weight: 600; font-size: 34px; line-height: 1; color: var(--orange-text); }
.steps h3 { font-size: 24px; line-height: 1.25; }
.steps p { margin-top: 6px; max-width: 40em; }
.teasers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); }
.teaser { padding: 28px; display: grid; gap: 10px; align-content: start; min-width: 0; border-top: 1px solid var(--rule); }
.teaser:nth-child(-n+2) { border-top: 0; }
.teaser:nth-child(even) { border-left: 1px solid var(--rule); }
.teaser h3 { font-size: 22px; }
.teaser p { font-size: 16px; color: var(--muted); }

/* Questions */
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.questions li { padding: 30px 0; border-top: 1px solid var(--rule); display: grid; gap: 12px; min-width: 0; }
.questions li:first-child { border-top: 0; padding-top: 0; }
.questions h3 { font-size: 24px; line-height: 1.25; }
.questions p { max-width: 40em; }
.k { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.closing { margin-top: 12px; font-family: var(--sans); font-weight: 500; font-size: 22px; line-height: 1.4; color: var(--ink); max-width: 36em; }

/* Sources */
.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.sources div { display: grid; gap: 6px; min-width: 0; }
.sources h3 { font-size: 21px; }
.sources p { font-size: 16px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); max-width: 100%; }
table.src-table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 15px; }
.src-table th, .src-table td { text-align: left; vertical-align: top; padding: 14px 16px; border-top: 1px solid var(--rule); }
.src-table thead th { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
.src-table tbody th { font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); width: 22%; }

/* Audiences */
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); }
.sides div { padding: 28px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.sides div + div { border-left: 1px solid var(--rule); }
.sides h3 { font-size: 22px; }
.sides p { font-size: 16px; color: var(--muted); }
.sides-note { margin-top: 24px; max-width: 42em; }
.audience { display: grid; gap: 10px; padding: 30px 0; border-top: 1px solid var(--rule); min-width: 0; }
.audience:first-child { border-top: 0; padding-top: 0; }
.audience h3 { font-size: 26px; }
.audience p { max-width: 40em; }

/* Name */
.name { display: grid; gap: 20px; max-width: 40em; }
.name blockquote {
  margin: 8px 0 0; padding: 20px 0 0; position: relative;
  font-family: var(--sans); font-weight: 500; font-size: 24px; line-height: 1.35; color: var(--ink);
}
.name blockquote::before { content: ""; position: absolute; top: 0; left: 0; width: 48px; height: 3px; background: var(--orange); }

/* Illustration: timeline of entry types */
.figure { border: 1px solid var(--rule); background: var(--panel); padding: 28px 28px 24px; min-width: 0; }
.figure-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 30px; }
.figure-head .label { color: var(--orange-text); }
.figure-head .cite { font-size: 12px; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tl li { position: relative; padding: 24px 10px 0 0; min-width: 0; display: grid; gap: 4px; align-content: start; }
.tl li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--rule); }
.tl li::after { content: ""; position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 0; background: var(--orange); }
.tl .src { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tl .what { font-size: 15px; line-height: 1.35; color: var(--ink); }

/* Access */
.access { background: var(--ink); color: var(--on-ink); }
.access .wrap { padding-block: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.access .wrap > div { min-width: 0; }
.access h2 { color: var(--on-ink); font-size: clamp(32px, 3.6vw, 44px); line-height: 1.12; }
.access p { color: var(--on-ink); opacity: 0.82; margin-top: 16px; max-width: 30em; }
.access .label { color: var(--orange); }
.access .btn { background: var(--orange); color: #FFFFFF; }
.access .btn:hover { background: var(--on-ink); color: var(--ink); }
.mail {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid color-mix(in srgb, var(--on-ink) 35%, transparent);
  padding: 18px 20px;
}
.mail .addr { font-family: var(--mono); font-size: 19px; color: var(--on-ink); user-select: all; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mail button {
  min-height: 44px; padding: 0 18px; border-radius: 0; cursor: pointer;
  background: var(--orange); color: #FFFFFF; border: 0; font: 500 15px var(--sans);
}
.mail-status { margin-top: 12px; font-size: 14px; min-height: 1.4em; color: var(--on-ink); opacity: 0.82; }
.mail-wrap { background: var(--ink); padding: 24px; }
.mail-wrap .mail-status { margin-top: 12px; }

footer.site { border-top: 1px solid var(--rule); }
footer.site .wrap {
  padding-block: 36px 48px;
  display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted);
}
footer.site .wrap > * { min-width: 0; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer.site a { color: var(--muted); text-underline-offset: 3px; }
footer.site a:hover { color: var(--ink); }

/* Capsule K mark: colors follow the theme */
.mark .top { fill: var(--capsule-top); }
.mark .low { fill: var(--orange); }
.mark .arm { stroke: var(--capsule-top); }

@media (max-width: 860px) {
  .hero .wrap, section.chapter .wrap, .access .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero .wrap { padding-block: 48px 56px; }
  section.chapter .wrap, .access .wrap { padding-block: 56px; }
  main.sub section.chapter .wrap { padding-block: 40px; }
  .page-head .wrap { padding-block: 40px 32px; }
  /* Nav drops to a second row under the logo and button */
  header.site .wrap { flex-wrap: wrap; padding-block: 10px 6px; column-gap: 18px; }
  .hdr-right { display: contents; }
  header.site .brand { order: 1; margin-right: auto; }
  .hdr-right > .btn { order: 2; }
  nav { order: 3; flex: 1 0 100%; gap: 0 22px; }
  nav a.link { padding-block: 10px; }
  .tl { grid-template-columns: minmax(0, 1fr); padding-left: 5px; }
  .tl li { padding: 0 0 22px 26px; }
  .tl li::before { top: 0; bottom: 0; left: 0; right: auto; width: 2px; height: auto; }
  .tl li::after { top: 4px; left: -5px; }
}
@media (max-width: 560px) {
  .sources, .sides, .teasers { grid-template-columns: minmax(0, 1fr); }
  .sides div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .teaser:nth-child(2) { border-top: 1px solid var(--rule); }
  .teaser:nth-child(even) { border-left: 0; }
  .dossier li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dossier { padding: 22px 18px 20px; }
  .figure { padding: 22px 18px 18px; }
  .steps li { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .mail-wrap { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .mail button, nav a.link, .textlink { transition: background-color 0.15s ease, color 0.15s ease; }
}

/* Worked example, label passage, big number, lists of questions (added with the deck-message rewrite; tokens only) */
.qa-q { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--ink); margin-top: 20px; text-wrap: balance; }
.qa-a { display: grid; gap: 10px; margin-top: 14px; font-size: 15px; line-height: 1.55; color: var(--text); }
.figure .qa-a { font-size: 17px; max-width: 42em; }
.figure .qa-q { font-size: 24px; }
.dossier ol { margin-top: 20px; }
.doc { border: 1px solid var(--rule); background: var(--panel); padding: 24px 26px; min-width: 0; max-width: 46em; }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.doc-head .cite { font-size: 12px; }
.doc-sec { margin-top: 18px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
.doc-text { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--text); }
.doc-text b { font-weight: 600; color: var(--ink); }
.doc-text mark { background: color-mix(in srgb, var(--orange) 26%, transparent); color: inherit; padding: 1px 2px; }
.stat { display: grid; gap: 6px; margin: 0 0 28px; }
.stat .num { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(44px, 6vw, 72px); line-height: 1; color: var(--ink); }
.stat .what { color: var(--muted); max-width: 36em; }
.fam { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fam li { border: 1px solid var(--rule); background: var(--panel); padding: 6px 12px; font-size: 15px; color: var(--ink); min-width: 0; }
.qs { list-style: none; margin: 0; padding: 0; display: grid; }
.qs li { display: grid; gap: 8px; padding: 22px 0; border-top: 1px solid var(--rule); min-width: 0; }
.qs li:first-child { border-top: 0; padding-top: 0; }
.qs .q { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; font-size: 21px; line-height: 1.35; color: var(--ink); max-width: 36em; }
.qs .back { font-size: 15px; color: var(--muted); max-width: 40em; }
.qs .back .k { display: inline; margin-right: 8px; }
.tl .k { margin-bottom: 0; }
.tl .cite { font-size: 12px; margin-top: 2px; }
.tl .src { font-size: 14px; color: var(--ink); }
.tl.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl.three li { padding-right: 24px; }
@media (max-width: 860px) {
  .tl.three { grid-template-columns: minmax(0, 1fr); }
  .tl.three li { padding: 0 0 22px 26px; }
}
