:root {
  color-scheme: light;
  --bg: #f4f1e9;
  --paper: #fbf9f4;
  --fg: #252722;
  --muted: #66675f;
  --line: #c9c5ba;
  --line-soft: #dedbd2;
  --accent: #77543b;
  --accent-ink: #fffaf1;
  --image-mat: #e5e0d5;
  --shadow: 0 18px 50px rgb(36 34 27 / 9%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191a18;
  --paper: #222420;
  --fg: #eee9dd;
  --muted: #bbb5a8;
  --line: #615f56;
  --line-soft: #3d3d37;
  --accent: #d6a575;
  --accent-ink: #1b1a17;
  --image-mat: #30312c;
  --shadow: 0 18px 50px rgb(0 0 0 / 25%);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--fg); line-height: 1.65; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: .19em; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; transform: translateY(-150%); background: var(--fg); color: var(--bg); }
.skip-link:focus { transform: none; }
.progress { position: fixed; z-index: 90; inset: 0 0 auto; height: 3px; pointer-events: none; }
.progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.site-bar { position: sticky; z-index: 50; top: 0; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(14px); }
.site-bar-inner { width: min(100% - 2rem, 76rem); min-height: 4.1rem; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.home-link { display: inline-flex; align-items: center; gap: .65rem; color: var(--fg); text-decoration: none; font-size: .87rem; font-weight: 720; letter-spacing: .025em; }
.home-mark { width: 1.55rem; height: 1.8rem; color: var(--accent); flex: none; }
.bar-spacer { flex: 1; }
.edition-nav { display: inline-flex; align-items: center; gap: .2rem; border: 1px solid var(--line-soft); border-radius: 999px; padding: .18rem; }
.edition-nav a { min-width: 2.3rem; padding: .36rem .53rem; border-radius: 999px; text-align: center; text-decoration: none; font-size: .76rem; font-weight: 760; color: var(--muted); }
.edition-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.theme-button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-soft); border-radius: 50%; background: transparent; cursor: pointer; }
.theme-button svg { width: 1.05rem; height: 1.05rem; }
.page { width: min(100% - 2rem, 50rem); margin: 0 auto; }
.hero { padding: clamp(3rem, 8vw, 7.2rem) 0 2.4rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; text-wrap: balance; }
h1 { max-width: 12ch; margin-bottom: 1.2rem; font-size: clamp(2.9rem, 8vw, 5.35rem); line-height: .99; letter-spacing: -.045em; }
.deck { max-width: 44rem; margin-bottom: 1.4rem; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.2rem, 2.8vw, 1.65rem); line-height: 1.42; }
.opening { max-width: 43rem; margin-bottom: 1.25rem; font-size: 1.03rem; }
.visual-note { display: flex; gap: .65rem; align-items: baseline; max-width: 42rem; margin: 1.5rem 0 1.8rem; color: var(--muted); font-size: .88rem; }
.visual-note::before { content: ""; width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--accent); }
.visual-rail { margin: 1.6rem 0 1.25rem; }
.visual-rail ol { display: flex; flex-wrap: wrap; gap: .2rem .4rem; margin: 0; padding: 0; list-style: none; }
.visual-rail li { flex: 1 1 7.5rem; min-width: 0; }
.visual-rail-link { display: flex; min-height: 2.55rem; align-items: center; gap: .48rem; padding: .45rem .2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; font-weight: 720; line-height: 1.25; text-decoration: none; }
.visual-rail-mark { width: .48rem; height: .48rem; flex: none; border: 1px solid var(--accent); border-radius: 50%; background: var(--bg); }
.visual-rail-link:hover .visual-rail-mark, .visual-rail-link:focus-visible .visual-rail-mark { background: var(--accent); }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: .38rem; }
.share-label { margin-right: .25rem; color: var(--muted); font-size: .79rem; }
.share-button { width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; border: 1px solid var(--line-soft); border-radius: 50%; background: transparent; color: var(--fg); text-decoration: none; cursor: pointer; }
.share-button:hover, .share-button:focus-visible { border-color: var(--accent); color: var(--accent); }
.share-button svg { width: 1rem; height: 1rem; }
.share-letter { font-family: Arial, sans-serif; font-size: 1rem; font-weight: 800; }
.share-status { min-height: 1.4em; margin: .35rem 0 0 4.4rem; color: var(--muted); font-size: .78rem; }
.language-suggestion { display: none; align-items: center; gap: .7rem; margin: 1.1rem 0 0; padding: .7rem .9rem; border: 1px solid var(--line-soft); border-radius: .7rem; background: var(--paper); font-size: .84rem; }
.language-suggestion[data-visible="true"] { display: flex; }
.language-suggestion a { font-weight: 760; }
.dismiss-language { margin-left: auto; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.1rem; }
.story { position: relative; margin: 1.2rem 0 0 1rem; padding: 0 0 2rem 2rem; border-left: 1px solid var(--line); }
.story-section { position: relative; padding: .3rem 0 3.4rem; scroll-margin-top: 6.2rem; }
.story-section::before { content: ""; position: absolute; top: .8rem; left: -2.39rem; width: .67rem; height: .67rem; border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.section-kicker { margin: 0 0 .4rem; color: var(--accent); font-size: .74rem; font-weight: 790; letter-spacing: .11em; text-transform: uppercase; }
h2 { max-width: 18ch; margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.05; letter-spacing: -.025em; }
.story-section > p { max-width: 44rem; font-size: 1.015rem; }
.visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; margin: 1.8rem 0 0; }
.visual-grid.one { grid-template-columns: minmax(0, 1fr); }
.evidence-figure { min-width: 0; margin: 0; padding: .85rem; border: 1px solid var(--line-soft); border-radius: .85rem; background: var(--paper); box-shadow: var(--shadow); }
.visual-date { display: flex; align-items: center; gap: .55rem; min-height: 2rem; margin: 0 0 .55rem; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .035em; }
.visual-date::before { content: ""; width: .45rem; height: .45rem; flex: none; border-radius: 50%; background: var(--accent); }
.evidence-mount { position: relative; display: grid; width: 100%; aspect-ratio: 1.56; overflow: hidden; place-items: center; border-radius: .45rem; background: var(--image-mat); }
.evidence-mount[data-scene-floor="fixed"] { min-height: 11rem; }
.evidence-mount img { display: block; width: 100%; height: 100%; object-fit: contain; }
.evidence-figure figcaption { padding: .78rem .15rem .2rem; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.image-credit { margin: .55rem .15rem .12rem; padding-top: .6rem; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .72rem; line-height: 1.55; overflow-wrap: anywhere; }
.image-credit a { color: inherit; }
.conflict-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin: 1.8rem 0; }
.conflict-side { padding: 1.15rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); }
.conflict-side h3 { margin-bottom: .5rem; font-size: 1.28rem; line-height: 1.2; }
.conflict-side p { margin-bottom: .8rem; font-size: .9rem; }
.source-links { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .75rem; }
.ending { margin: 2rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid var(--line); font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; line-height: 1.48; }
.sources, .credits { margin: 1rem 0 5rem 1rem; padding: 1.6rem; border: 1px solid var(--line-soft); border-radius: .9rem; background: var(--paper); }
.sources h2, .credits h2 { font-size: 1.75rem; }
.sources ul, .credits ul { display: grid; gap: .6rem; margin: 0; padding-left: 1.25rem; }
.sources li, .credits li { padding-left: .18rem; font-size: .86rem; }
.site-footer { padding: 1.3rem 0 2.5rem; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .78rem; }
.site-footer-inner { display: flex; justify-content: space-between; gap: 1rem; }
.back-top { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rail { display: none; }

@media (min-width: 760px) {
  .site-bar-inner { width: min(100% - 3rem, 76rem); }
  .page { width: min(100% - 3rem, 50rem); }
  .hero { padding-top: 7rem; }
  .visual-grid { gap: 1.25rem; }
  .story { margin-left: 0; padding-left: 2.4rem; }
  .story-section::before { left: -2.78rem; }
  .sources, .credits { margin-left: 0; }
}

@media (min-width: 1380px) {
  .rail { --col: 50rem; --gut: 1.25rem; position: fixed; z-index: 40; top: 50%; left: calc(50% + var(--col) / 2 + var(--gut)); display: flex; max-height: calc(100vh - 7rem); flex-direction: column; margin: 0; padding: .4rem 0; transform: translateY(-50%); }
  .rail::before { content: ""; position: absolute; top: 1rem; bottom: 1rem; left: .875rem; width: 1px; background: var(--line); }
  .rail-dot { position: relative; display: flex; width: 1.75rem; height: 1.75rem; align-items: center; justify-content: center; border-radius: 50%; text-decoration: none; }
  .rail-dot .dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--bg); transition: transform .2s, background .2s, box-shadow .2s; }
  .rail-dot:hover .dot, .rail-dot:focus-visible .dot { transform: scale(1.25); background: var(--accent); }
  .rail-dot[aria-current="true"] .dot { transform: scale(1.45); background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--accent) 38%, transparent); }
  .rail-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
  .rail-label { position: absolute; top: 50%; left: calc(100% + .25rem); max-width: calc(50vw - var(--col) / 2 - var(--gut) - 3.25rem); overflow: hidden; padding: .12rem .2rem; transform: translate(-4px, -50%); border: 1px solid transparent; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 620; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
  .rail-dot[aria-current="true"] .rail-label, .rail-dot:hover .rail-label, .rail-dot:focus-visible .rail-label { transform: translate(0, -50%); color: var(--fg); opacity: 1; }
}

@media (pointer: coarse) {
  .share-button { width: 2.75rem; height: 2.75rem; }
  .dismiss-language { width: 2.75rem; height: 2.75rem; }
}

@media (max-width: 620px) {
  .site-bar-inner { width: min(100% - 1.25rem, 76rem); min-height: 3.75rem; gap: .55rem; }
  .home-link { gap: .4rem; font-size: .77rem; }
  .home-mark { width: 1.28rem; height: 1.55rem; }
  .edition-nav a { min-width: 2rem; padding: .32rem .4rem; font-size: .7rem; }
  .theme-button { width: 2.3rem; height: 2.3rem; }
  .page { width: min(100% - 1.5rem, 50rem); }
  .hero { padding-top: 3.7rem; }
  h1 { max-width: 13ch; font-size: clamp(2.65rem, 13vw, 4rem); }
  .story { margin-left: .25rem; padding-left: 1.25rem; }
  .story-section::before { left: -1.65rem; }
  .visual-grid, .conflict-panel { grid-template-columns: minmax(0, 1fr); }
  .evidence-figure { padding: .65rem; }
  .evidence-mount[data-scene-floor="fixed"] { min-height: 12rem; }
  .sources { margin-right: 0; margin-left: .25rem; padding: 1.1rem; }
  .sources h2 { font-size: 1.55rem; }
  .site-footer-inner { flex-direction: column; }
  .language-suggestion { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-bar, .progress, .share-row, .language-suggestion, .rail, .theme-button { display: none !important; }
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --paper: #fff; --fg: #111; --muted: #444; --line: #777; --line-soft: #bbb; }
  body { background: #fff; color: #111; }
  .page { width: 100%; }
  .hero { padding-top: 1rem; }
  .story { border-color: #777; }
  .evidence-figure, .conflict-side, .sources { break-inside: avoid; box-shadow: none; }
  a { color: inherit; }
}

@media (forced-colors: active) {
  .rail::before, .story { border-color: CanvasText; }
  .rail-dot .dot { background: CanvasText; box-shadow: none; }
  .rail-dot[aria-current="true"] .dot { background: Highlight; }
}
