:root {
  color-scheme: light;
  --paper: #ffffff;
  --warm: #f6f5f4;
  --blue: #0075de;
  --blue-tint: #e8f3fd;
  --ink: rgba(0, 0, 0, .95);
  --muted: #615d59;
  --pencil: #a39e98;
  --navy: #213183;
  --whisper: rgba(0, 0, 0, .1);
  --section-gap: clamp(4rem, 8vw, 8rem);
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
h1, h2, h3 { font-weight: 700; }
h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -.9px; }
h2 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.45px; max-width: 34ch; }
h3 { font-size: 1.125rem; line-height: 1.4; letter-spacing: -.2px; }
p { max-width: 72ch; }
.technical-value { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1em; font-variant-numeric: tabular-nums; }
p + p { margin-top: 16px; }
a { color: var(--blue); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a { transition: color 200ms, box-shadow 200ms, background-color 200ms; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
a:hover { text-decoration-thickness: 2px; }
::selection { color: var(--ink); background: var(--blue-tint); }

.skip-link { position: absolute; left: 24px; top: -88px; z-index: 3; padding: 12px 16px; min-height: 48px; background: var(--paper); border: 1px solid var(--blue); border-radius: 4px; }
.skip-link:focus { top: 16px; }
.workspace { max-width: 1280px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; padding: 0 24px; margin: 0 auto; }
.workspace__reading { min-width: 0; }
.rail { align-self: start; position: sticky; top: 32px; padding-top: 48px; }
.rail__brand { display: flex; gap: 12px; align-items: flex-start; min-height: 64px; padding: 8px 0; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 700; line-height: 1.3; }
.rail__descriptor { display: block; color: var(--muted); font-size: 16px; line-height: 1.6; font-weight: 400; margin-top: 4px; }
.rail__mark { flex: 0 0 24px; width: 24px; height: 28px; position: relative; margin-top: 3px; border: 1px solid var(--whisper); border-radius: 4px; background: var(--warm); }
.rail__mark::before { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; bottom: 7px; border-left: 1px solid var(--pencil); border-bottom: 1px solid var(--pencil); }
.rail__mark::after { content: ""; width: 6px; height: 6px; position: absolute; top: 5px; left: 3px; background: var(--blue); border-radius: 50%; }
.rail__nav { margin-top: 40px; }
.rail__summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; padding: 8px; font-size: 16px; font-weight: 500; color: var(--muted); list-style: none; }
.rail__summary::-webkit-details-marker { display: none; }
.rail__summary span { color: var(--navy); font-size: 20px; }
.rail__menu:not([open]) .rail__summary span { transform: rotate(-90deg); }
.rail__links { list-style: none; display: grid; gap: 4px; margin-top: 8px; }
.rail__link { display: flex; align-items: center; gap: 10px; min-height: 48px; border-radius: 4px; padding: 12px; color: var(--muted); text-decoration: none; font-size: 16px; line-height: 1.4; }
.rail__link::before { content: ""; width: 5px; height: 5px; border-radius: 50%; flex: 0 0 5px; background: var(--pencil); }
.rail__link:hover { color: var(--ink); background: var(--warm); }
.rail__link--current { background: var(--blue-tint); color: var(--ink); font-weight: 500; }
.rail__link--current::before { background: var(--blue); }
.rail__note { font-size: 16px; color: var(--muted); margin: 40px 8px 0; line-height: 1.6; }
.page { padding-top: 56px; }
.page__trail { font-size: 16px; color: var(--muted); margin-bottom: 56px; }
.page__eyebrow { font-size: 16px; font-weight: 500; color: var(--muted); margin-bottom: 24px; }
.page__lead { font-size: 18px; line-height: 1.6; color: var(--muted); margin-top: 24px; max-width: 52ch; }
.page-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: center; }
.page-hero__copy { min-width: 0; }
.page-section { margin-top: var(--section-gap); }
.page-section h2 { margin-bottom: 32px; }
.page-section--warm { padding: 40px; border-radius: 12px; background: var(--warm); }
.page-section > p + a { margin-top: 16px; }
.page-section > a + p { margin-top: 16px; }
.page-section > p + p { margin-top: 16px; }
.checklist { list-style: none; display: grid; gap: 32px; max-width: 72ch; }
.checklist__item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 16px; align-items: start; }
.checklist__item::before { content: ""; width: 20px; height: 20px; border: 1px solid var(--pencil); border-radius: 4px; margin-top: 3px; background: var(--paper); }
.checklist__text { min-width: 0; }
.checklist__title { margin-bottom: 8px; }
.checklist__text p { font-size: 16px; }
.checklist + p { margin-top: 32px; }
.checklist + .margin-note { margin-top: 32px; }
.margin-note { margin-top: 32px; max-width: 72ch; padding: 24px; background: var(--paper); border: 1px solid var(--whisper); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 2px 8px rgba(0,0,0,.03); }
.margin-note__label { font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.margin-note + p { margin-top: 24px; }
.margin-note + a { margin-top: 16px; }
.source-link { display: inline-flex; gap: 8px; align-items: center; min-height: 48px; min-width: 44px; max-width: 100%; padding: 10px 12px; margin: 12px 8px 0 -12px; font-size: 16px; line-height: 1.4; background: var(--paper); border-radius: 4px; }
.source-link__arrow { flex-shrink: 0; }
.page-section--warm .source-link { margin-left: 0; }
.source-link:hover { box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.action-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; min-width: 44px; max-width: 100%; padding: 12px 16px; border: 1px solid var(--whisper); border-radius: 4px; background: var(--paper); font-size: 16px; line-height: 1.4; text-decoration: none; font-weight: 500; }
.action-link--primary { color: var(--paper); background: var(--blue); border-color: var(--blue); }
.action-link:hover { box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.04); }
.page-section > .action-link { margin-top: 24px; }
.next-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.route-map { padding: 28px; background: var(--warm); border: 1px solid var(--whisper); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 2px 8px rgba(0,0,0,.03); min-width: 0; }
.route-map__label { font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--muted); margin-bottom: 24px; }
.route-map__path { list-style: none; display: grid; }
.route-map__node { display: flex; align-items: center; gap: 16px; min-height: 64px; font-size: 16px; line-height: 1.5; position: relative; }
.route-map__node:not(:last-child)::after { content: ""; position: absolute; top: calc(50% + 7px); bottom: -25px; left: 5px; width: 1px; background: var(--pencil); }
.route-map__point { height: 11px; width: 11px; flex: 0 0 11px; border: 2px solid var(--blue); border-radius: 50%; background: var(--warm); }
.route-map__node:last-child .route-map__point { background: var(--blue); }
.route-map__caption { margin-top: 24px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.page-section--warm .route-map { background: var(--paper); }
.page-section--warm .route-map__point { background: var(--paper); }
.page-section--warm .route-map__node:last-child .route-map__point { background: var(--blue); }
.paper-card { padding: 28px; border: 1px solid var(--whisper); border-radius: 12px; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 2px 8px rgba(0,0,0,.03); }
.paper-card h3 { margin-bottom: 12px; }
.plain-answer + .plain-answer { margin-top: 40px; }
.plain-answer h3 { margin-bottom: 16px; max-width: 56ch; }
.site-footer { margin-top: var(--section-gap); padding: 32px 0 48px; }
.site-footer__purpose { max-width: 62ch; font-size: 16px; line-height: 1.6; color: var(--muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 48px; min-width: 44px; padding: 8px 0; font-size: 16px; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes paper-entry { from { transform: translateY(16px); opacity: .92; } to { transform: translateY(0); opacity: 1; } }
  .page-hero__copy { animation: paper-entry 200ms ease-out; }
  .page-hero > .route-map { animation: paper-entry 200ms ease-out 80ms; }
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 184px minmax(0, 1fr); gap: 32px; }
  .page-hero { gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
  .route-map { padding: 24px; }
  .page-section--warm { padding: 32px; }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rail { position: static; padding-top: 24px; }
  .rail__brand { min-height: 60px; }
  .rail__nav { margin-top: 16px; }
  .rail__menu { background: var(--warm); border-radius: 12px; padding: 4px 8px 8px; }
  .rail__links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .rail__summary { padding: 8px; }
  .rail__link { color: var(--ink); padding: 10px 8px; min-height: 48px; }
  .rail__note { display: none; }
  .page { padding-top: 32px; }
  .page__trail { margin-bottom: 32px; }
  .page-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .page__eyebrow { margin-bottom: 16px; }
  .page__lead { font-size: 18px; }
  .page-section--warm { padding: 24px; }
  .page-section h2 { margin-bottom: 24px; }
  .margin-note { padding: 20px; }
  .checklist__item { gap: 12px; }
  .source-link { margin-left: 0; margin-right: 0; }
  .site-footer { padding-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .workspace { display: block; padding: 0; max-width: none; }
  .rail, .skip-link { display: none; }
  .page { padding-top: 0; }
  .page__trail { margin-bottom: 24px; }
  .page-section { margin-top: 32px; break-inside: avoid; }
  .page-section--warm { padding: 20px; }
  .route-map, .paper-card, .margin-note { box-shadow: none; }
  .site-footer { margin-top: 32px; }
}
