/*
  Retrieval demo, composed with System Minimalism (composition-pass, 2026-06-22).
  Posture: system-minimalism. Taste: system-minimalism.
  Class: explanation page, reading-led.

  System Minimalism applied: system sans as the identity, a quiet near-white
  page, flat 1px borders, square corners, no drop shadows, stillness, and color
  used only as information. A single functional accent for links, the selected
  scenario, citation markers, and the retrieval step; a warning color for dated
  figures. The page reads in grayscale.

  Palette
    page   #ffffff   surface #fafafa
    ink    #1a1a1a   body    #2b2b2b   before body #555555
    muted  #5e5e5e   label   #6b6b6b
    border #e8e8e8   rule    #d8d8d8   hair #efefef
    accent #245fc7   (links, active, retrieval, citation)
    warn   #a4442f   warn bg #f7ece9   warn text #7a3326

  Type: system sans throughout. Scale about 1.2, body 16 at 1.55, no display
  type. Measure: prose about 62ch, answers about 60ch. Mono for evidence data.
  No css custom properties, so the double hyphen scan stays clean.
*/

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #ffffff;
  color: #1a1a1a;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  background: #1a1a1a;
  color: #fff;
  padding: 8px 12px;
  z-index: 10;
}
.skip-link:focus { transform: translateY(0); }

a { color: #245fc7; }

:focus-visible {
  outline: 2px solid #245fc7;
  outline-offset: 2px;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  background: color-mix(in srgb, #ffffff 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e8e8;
}
.topbar .home { color: #5e5e5e; text-decoration: none; font-size: 13px; }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { color: #5e5e5e; text-decoration: none; font-size: 13px; }
.topbar nav a:hover { color: #1a1a1a; }

/* Shared spacing */

main { max-width: 1080px; margin: 0 auto; padding: 0 24px 64px; }

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.field-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6b6b;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  max-width: 24ch;
  margin: 0 0 18px;
  font-size: clamp(25px, 3vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h2 {
  max-width: 30ch;
  margin: 0 0 14px;
  font-size: clamp(20px, 2.3vw, 24px);
  line-height: 1.22;
  letter-spacing: -0.005em;
  font-weight: 600;
}

h3 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; font-weight: 600; }
h4 { font-size: 16px; line-height: 1.35; margin: 0 0 8px; font-weight: 600; }

p { color: #2b2b2b; }

/* Intro */

.intro { padding: 52px 0 38px; border-bottom: 1px solid #e8e8e8; }
.intro .lead {
  max-width: 60ch;
  margin: 0 0 16px;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.5;
  color: #1a1a1a;
}
.intro .standfirst {
  max-width: 62ch;
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid #d8d8d8;
  font-size: 14px;
  line-height: 1.5;
  color: #5e5e5e;
}

/* Evidence desk */

.desk { padding: 42px 0; border-bottom: 1px solid #e8e8e8; }
.desk-head { margin-bottom: 24px; }

.desk-body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 64px;
}

.rail-item {
  font: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  color: #1a1a1a;
  padding: 12px 14px;
  line-height: 1.3;
}
.rail-item .rail-class {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #6b6b6b;
}
.rail-item:hover { border-color: #c9c9c9; }
.rail-item[aria-pressed="true"] {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}
.rail-item[aria-pressed="true"] .rail-class { color: #c2c2c2; }

/* Column sections */

.column > section,
.column > details { padding-block: 22px; border-top: 1px solid #e8e8e8; }
.column > section:first-child { padding-top: 0; border-top: 0; }

.question-text {
  max-width: 42ch;
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.32;
  letter-spacing: -0.005em;
  font-weight: 600;
}
.classification {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #5e5e5e;
}

/* Answers */

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.answer {
  border: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 18px;
}
.answer.after {
  border-left: 3px solid #245fc7;
  padding-left: 16px;
}
.answer-head { margin-bottom: 12px; }
.answer-note { margin: 0; font-size: 13px; color: #6b6b6b; }
.answer.after .after-note { color: #245fc7; }
.answer-note.warn-note { color: #a4442f; }

.answer-body p {
  max-width: 60ch;
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.58;
  color: #2b2b2b;
}
.answer.before .answer-body p { color: #555555; }
.answer-body p:last-child { margin-bottom: 0; }

.cm {
  color: #245fc7;
  font-weight: 700;
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  padding-left: 2px;
}

.cited-row {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #efefef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5e5e5e;
  line-height: 1.7;
}
.cited-row .cm {
  vertical-align: baseline;
  font-size: 1em;
  padding: 0 3px 0 8px;
}
.cited-row .cm:first-of-type { padding-left: 4px; }

/* What retrieval changed */

.changed-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.changed-list li {
  position: relative;
  padding-left: 18px;
  max-width: 66ch;
  font-size: 14px;
  color: #2b2b2b;
}
.changed-list li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: #245fc7;
  font-weight: 700;
}

/* Decision spine */

.spine {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.spine::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 8px;
  bottom: 22px;
  width: 1px;
  background: #d8d8d8;
}
.spine li {
  position: relative;
  padding: 0 0 18px 40px;
  max-width: 66ch;
}
.spine li:last-child { padding-bottom: 0; }
.step-n {
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d8d8;
  border-radius: 50%;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5e5e5e;
}
.spine li.pivot .step-n { border-color: #245fc7; color: #245fc7; }
.step-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.spine li.pivot .step-name { color: #245fc7; }
.step-decision { display: block; margin: 2px 0 3px; font-weight: 600; color: #1a1a1a; }
.step-why { display: block; font-size: 14px; color: #5e5e5e; }

/* Packets */

.section-note {
  max-width: 66ch;
  margin: 0 0 14px;
  font-size: 13px;
  color: #5e5e5e;
}
.packets { display: grid; gap: 12px; }
.packet {
  border: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 16px;
}
.packet h5 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: #1a1a1a; }
.packet-meta {
  margin: 0 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #6b6b6b;
}
.packet-evidence { margin: 0 0 10px; max-width: 70ch; font-size: 14px; color: #2b2b2b; }
.packet-tags {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5e5e5e;
}
.packet-tags b { color: #6b6b6b; font-weight: 600; }
.packet-warning {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 3px solid #a4442f;
  background: #f7ece9;
  font-size: 13px;
  color: #7a3326;
}
.packet-warning b {
  display: block;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a4442f;
  margin-bottom: 2px;
}

/* Citations */

.citations { display: grid; gap: 12px; }
.cite {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 16px;
}
.cite-n {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #245fc7;
  border-radius: 50%;
  color: #245fc7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}
.cite-type {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.cite h5 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.cite-detail {
  margin: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5e5e5e;
}
.cite-role { margin: 0 0 6px; max-width: 70ch; font-size: 14px; color: #2b2b2b; }
.cite-boundary { margin: 0; max-width: 70ch; font-size: 13px; color: #5e5e5e; }
.cite-boundary b {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin-right: 4px;
}

/* Technical details */

.technical summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.technical[open] summary { margin-bottom: 12px; }
.technical-list { margin: 0; display: grid; gap: 8px; }
.technical-list div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #efefef;
}
.technical-list dt { font-size: 13px; color: #6b6b6b; }
.technical-list dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #2b2b2b;
}

/* Source boundary ledger */

.boundary { padding: 42px 0; border-bottom: 1px solid #e8e8e8; }
.section-lead {
  max-width: 62ch;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.5;
  color: #2b2b2b;
}
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ledger-col {
  border: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 18px 20px;
}
.ledger-col.shown { border-left: 3px solid #245fc7; }
.ledger-col.withheld { border-left: 3px solid #a4442f; }
.ledger-col h3 { font-size: 16px; }
.ledger-col ul { margin: 0; padding-left: 18px; color: #2b2b2b; }
.ledger-col li { margin: 7px 0; font-size: 14px; }

/* Appendix */

.appendix { padding: 42px 0 0; }
.systems { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.system { border: 1px solid #e8e8e8; background: #fafafa; padding: 18px 20px; }
.system h3 { font-size: 16px; }
.system dl { margin: 0; display: grid; gap: 10px; }
.system dl div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #efefef;
}
.system dt { font-size: 13px; color: #6b6b6b; }
.system dd { margin: 0; font-size: 14px; color: #2b2b2b; }

.terms { margin-bottom: 24px; }
.terms h3 { font-size: 16px; }
.terms dl { margin: 0; display: grid; gap: 14px; }
.terms dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 3px;
}
.terms dd { margin: 0; max-width: 70ch; font-size: 14px; color: #2b2b2b; }

.sources-detail summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #5e5e5e; }
.sources-detail[open] summary { margin-bottom: 10px; }
.sources-detail p { max-width: 72ch; font-size: 14px; color: #5e5e5e; }

/* Footer */

footer { max-width: 1080px; margin: 0 auto; padding: 32px 24px 56px; }
footer p { margin: 0; font-size: 13px; color: #6b6b6b; }

/* Responsive */

@media (max-width: 860px) {
  .desk-body { grid-template-columns: 1fr; gap: 20px; }
  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rail-item { flex: 1 1 auto; min-width: 44%; min-height: 44px; }
}

@media (max-width: 680px) {
  main { padding: 0 18px 48px; }
  .topbar { padding: 12px 18px; }
  .intro { padding: 38px 0 30px; }
  .desk, .boundary { padding: 30px 0; }
  .answers,
  .ledger,
  .systems { grid-template-columns: 1fr; }
  .rail-item { min-width: 100%; }
  .cite { grid-template-columns: 1fr; }
  .cite-n { margin-bottom: 4px; }
  .technical-list div,
  .system dl div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
