@import url('data:text/css,');

:root {
  color-scheme: light;
  --paper: #f1eadb;
  --paper-deep: #e5dac6;
  --panel: rgba(251, 248, 240, 0.86);
  --ink: #202521;
  --muted: #687069;
  --rule: rgba(38, 46, 40, 0.17);
  --rule-strong: rgba(38, 46, 40, 0.34);
  --accent: #b7462f;
  --accent-dark: #7c2b1d;
  --tradition: #2c6770;
  --shadow: 0 22px 60px rgba(62, 48, 28, 0.13);
  --label-width: clamp(220px, 20vw, 300px);
  --plot-width: 1050px;
  --row-height: 68px;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191d1b;
  --paper-deep: #121513;
  --panel: rgba(30, 35, 32, 0.9);
  --ink: #e9e5da;
  --muted: #a4aaa4;
  --rule: rgba(231, 228, 218, 0.13);
  --rule-strong: rgba(231, 228, 218, 0.28);
  --accent: #e06c52;
  --accent-dark: #f08a71;
  --tradition: #6eb4bd;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 2%, rgba(183, 70, 47, 0.12), transparent 28rem),
    linear-gradient(90deg, transparent 49.85%, rgba(50, 45, 37, 0.035) 50%, transparent 50.15%),
    var(--paper);
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
}

button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1rem;
}
.skip-link:focus { top: 1rem; }

.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;
}

.hero {
  padding: 0 clamp(1rem, 4vw, 4.5rem) 4.5rem;
  border-bottom: 1px solid var(--rule);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: .84rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font: 600 .65rem Georgia, serif;
  letter-spacing: -.02em;
}

.topbar-actions { display: flex; gap: .5rem; }
.icon-button, .text-button {
  border: 0;
  background: transparent;
  padding: .65rem .8rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.icon-button:hover, .text-button:hover { color: var(--accent); }
.language-control select {
  min-width: 4.2rem;
  border: 1px solid var(--rule-strong);
  border-radius: 99px;
  background: transparent;
  color: var(--ink);
  padding: .58rem 1.8rem .58rem .7rem;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: clamp(2rem, 8vw, 8rem);
  align-items: end;
  padding-top: clamp(4rem, 10vw, 8rem);
}

.hero-compact { padding-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.hero-compact .topbar { min-height: 64px; }
.hero-compact .hero-grid {
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(1.6rem, 3.2vw, 3rem);
}
.hero-compact h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.9rem, 5.8vw, 5.6rem);
}
.hero-compact .hero-lede { margin-bottom: 0; font-size: clamp(.9rem, 1.15vw, 1.05rem); line-height: 1.55; }
.hero-compact .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-compact .hero-stats > div { display: block; padding: .75rem .45rem .65rem; }
.hero-compact .hero-stats strong { font-size: 1.85rem; }
.hero-compact .hero-stats span { display: block; margin-top: .25rem; font-size: .68rem; }

.hero-copy { min-width: 0; }

.eyebrow, .kicker {
  margin: 0 0 1.2rem;
  color: var(--accent);
  font-size: .7rem;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 920px;
  margin-bottom: 1.6rem;
  font: 500 clamp(3.2rem, 8.4vw, 8rem)/.89 Georgia, "Times New Roman", serif;
  letter-spacing: -.065em;
}
h1 em { color: var(--accent); font-weight: 400; }

.hero-lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.65;
}

.hero-stats {
  border-top: 1px solid var(--rule-strong);
}
.hero-stats > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
}
.hero-stats strong {
  font: 500 2.25rem Georgia, serif;
  color: var(--accent);
}
.hero-stats span { color: var(--muted); font-size: .82rem; }

main { padding: 0 clamp(1rem, 4vw, 4.5rem); }

.controls-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -1px calc(clamp(1rem, 4vw, 4.5rem) * -1) 0;
  padding: 1rem clamp(1rem, 4vw, 4.5rem);
  background: var(--panel);
  border-bottom: 1px solid var(--rule-strong);
  box-shadow: 0 8px 30px rgba(50, 40, 25, .05);
  backdrop-filter: blur(18px);
}
.mobile-filter-toggle { display: none; }
.filters-content { display: block; }

.controls-primary {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(150px, .8fr)) minmax(140px, .7fr);
  gap: .8rem;
  align-items: end;
}

.controls-primary label > span, .range-row label, .presets-row > span {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

input[type="search"], input[type="number"], select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .16);
  padding: .65rem .75rem;
  outline: none;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.search-field { position: relative; }
.search-field > span[aria-hidden] { position: absolute; left: .75rem; bottom: .65rem; font-size: 1.15rem; color: var(--muted); }
.search-field input { padding-left: 2.25rem; }

.zoom-field output { color: var(--ink); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.presets-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  padding-top: .8rem;
}
.presets-row > span { margin: 0; white-space: nowrap; }
.preset-buttons { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.preset-buttons::-webkit-scrollbar { display: none; }
.preset-button {
  white-space: nowrap;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 99px;
  padding: .4rem .7rem;
  font-size: .72rem;
}
.preset-button:hover, .preset-button.active { border-color: var(--accent); color: var(--accent); }
.presets-row .text-button { margin-left: auto; white-space: nowrap; }

.range-row { display: none; align-items: center; gap: .6rem; padding-top: .7rem; }
.range-row.visible { display: flex; }
.range-row label { margin: 0; display: flex; align-items: center; gap: .5rem; }
.range-row input { width: 110px; min-height: 34px; padding: .3rem .45rem; }
.range-rule { flex: 1; height: 1px; background: var(--rule); }

.scale-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(240px, 1fr);
  align-items: center;
  gap: .8rem;
  padding-top: .8rem;
}
.scale-toolbar > span {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.scale-toolbar > p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.scale-mode { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--rule); border-radius: 99px; }
.scale-mode button { border: 0; border-radius: 99px; padding: .42rem .7rem; color: var(--muted); background: transparent; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.scale-mode button.active { color: var(--paper); background: var(--accent); }

.explorer { padding: clamp(1.5rem, 2vw, 2rem) 0 5rem; }
.explorer-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
}
.explorer-heading .kicker { margin-bottom: .6rem; }
.explorer-heading h2 { margin-bottom: 0; font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
.view-switch {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--rule-strong);
  border-radius: 99px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}
.view-button {
  border: 0;
  border-radius: 99px;
  padding: .58rem .9rem;
  color: var(--muted);
  background: transparent;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.view-button.active {
  color: var(--paper);
  background: var(--ink);
}
.explorer-shell {
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255, 255, 255, .06);
  box-shadow: var(--shadow);
}
.atlas-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  min-height: 610px;
}
.atlas-map {
  position: relative;
  min-width: 0;
  min-height: 610px;
  overflow: hidden;
  isolation: isolate;
  color: #f5efe1;
  background: radial-gradient(circle at 50% 42%, #173b39 0, #0b2221 45%, #071514 100%);
}
.atlas-map::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .28) 100%);
}
.atlas-map-title {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  z-index: 6;
  max-width: 17rem;
}
.atlas-map-title span, .atlas-map-title small { display: block; }
.atlas-map-title span {
  color: rgba(245, 239, 225, .62);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.atlas-map-title strong {
  display: block;
  margin: .35rem 0 .55rem;
  font: 500 clamp(1.6rem, 3vw, 2.7rem)/1 Georgia, serif;
  letter-spacing: -.04em;
}
.atlas-map-title small { color: rgba(245, 239, 225, .62); font-size: .7rem; line-height: 1.45; }
.atlas-geography {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1000 / 520;
  transform: translateY(-50%);
}
.atlas-world-layer, .atlas-regions { position: absolute; inset: 0; }
.atlas-world-layer { z-index: 1; display: grid; place-items: center; }
.atlas-world { width: 100%; height: 100%; }
.atlas-ocean { fill: rgba(7, 29, 28, .4); }
.atlas-graticule { fill: none; stroke: rgba(124, 208, 199, .09); stroke-width: .7; vector-effect: non-scaling-stroke; }
.atlas-land {
  fill: #1a3533;
  stroke: none;
}
.atlas-coast {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.atlas-coast-glow { stroke: rgba(89, 219, 205, .44); stroke-width: 5; opacity: .45; filter: blur(4px); }
.atlas-coast-line { stroke: rgba(128, 224, 211, .66); stroke-width: .9; }
#atlas-link-gradient stop:first-child, #atlas-link-gradient stop:last-child { stop-color: #ef8b5d; stop-opacity: .28; }
#atlas-link-gradient stop:nth-child(2) { stop-color: #ffd38f; stop-opacity: .88; }
.atlas-comparison { pointer-events: none; }
.atlas-comparison path {
  fill: none;
  stroke: url(#atlas-link-gradient);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(255, 181, 107, .35));
  animation: atlas-link-in .7s ease-out both;
}
.atlas-regions { z-index: 3; }
.atlas-region {
  --pulse-size: clamp(2.45rem, calc(2rem + var(--atlas-radius) * .075rem), 3.5rem);
  position: absolute;
  left: var(--atlas-x);
  top: var(--atlas-y);
  display: grid;
  place-items: center;
  width: var(--pulse-size);
  height: var(--pulse-size);
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  color: #fff8e8;
  background: transparent;
}
.atlas-region::before, .atlas-region::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(232, 155, 74, .5);
  border-radius: inherit;
  background: rgba(208, 104, 58, .1);
  box-shadow: 0 0 30px rgba(224, 108, 67, .18);
}
.atlas-region::after { animation: atlas-pulse 3.4s ease-out infinite; }
.atlas-region:hover::before, .atlas-region:focus-visible::before { background: rgba(224, 108, 67, .28); border-color: #efaf6e; }
.atlas-region.selected::before { background: rgba(224, 108, 67, .38); border-color: #ffd29b; box-shadow: 0 0 0 5px rgba(255, 210, 155, .1), 0 0 38px rgba(224, 108, 67, .45); }
.atlas-map.has-selection .atlas-region:not(.selected) { opacity: .48; }
.atlas-region span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  background: #b54b32;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  font-size: .68rem;
  font-weight: 850;
}
.atlas-region small {
  position: absolute;
  top: calc(50% + 1.45rem);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 248, 232, .76);
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .04em;
  white-space: nowrap;
  text-shadow: 0 1px 6px #000;
}
.atlas-region[data-region="mediterranean"] small {
  top: 50%;
  right: 50%;
  left: auto;
  transform: translate(-1.4rem, -50%);
  text-align: right;
}
.atlas-region[data-region="west-asia"] small {
  top: 50%;
  left: 50%;
  transform: translate(1.4rem, -50%);
  text-align: left;
}
.atlas-playback {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  z-index: 7;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 1rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 99px;
  background: rgba(7, 14, 12, .78);
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}
.atlas-playback button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 0;
  color: #fff8e8;
  background: transparent;
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
.atlas-playback label, .atlas-playback input { width: 100%; }
.atlas-playback input { accent-color: #e17355; }
.atlas-panel {
  min-width: 0;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border-left: 1px solid var(--rule-strong);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper) 92%, white), var(--paper));
}
.atlas-panel-kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.atlas-insight h3, .atlas-panel > h3 {
  margin: 0 0 1rem;
  font: 500 clamp(1.6rem, 2.5vw, 2.35rem)/1.02 Georgia, serif;
  letter-spacing: -.04em;
}
.atlas-insight > p:not(.atlas-panel-kicker), .atlas-panel > p:not(.atlas-panel-kicker) {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.65;
}
.atlas-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin: 1.7rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.atlas-stats span, .atlas-stats small { display: block; }
.atlas-stats strong { font: 500 1.55rem Georgia, serif; color: var(--accent); }
.atlas-stats small { margin-top: .25rem; color: var(--muted); font-size: .56rem; line-height: 1.25; }
.atlas-panel-action, .atlas-panel-back {
  border: 0;
  padding: .7rem 0;
  color: var(--accent);
  background: transparent;
  font-size: .72rem;
  font-weight: 800;
}
.atlas-region-list { display: grid; gap: .5rem; margin-top: 1.2rem; }
.atlas-region-list button {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .75rem;
  background: rgba(255,255,255,.08);
  text-align: left;
}
.atlas-region-list button:hover { border-color: var(--accent); }
.atlas-region-list strong, .atlas-region-list span { display: block; }
.atlas-region-list strong { font: 600 .83rem Georgia, serif; }
.atlas-region-list span, .atlas-region-empty { margin-top: .25rem; color: var(--muted); font-size: .67rem; }
.chronology-view { padding: clamp(2rem, 4vw, 4rem); }
.chronology-heading { margin-top: 0; }
@keyframes atlas-pulse {
  0% { opacity: .72; transform: scale(.68); }
  75%, 100% { opacity: 0; transform: scale(1.35); }
}
@keyframes atlas-link-in { from { opacity: 0; } to { opacity: 1; } }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}
h2 { font: 500 clamp(2rem, 4.5vw, 4.2rem)/.98 Georgia, serif; letter-spacing: -.045em; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin: 0; color: var(--muted); font-size: .78rem; }
.legend-swatch { display: inline-block; width: 1.5rem; height: .45rem; border-radius: 99px; margin: 0 .25rem 0 .8rem; background: var(--accent); }
.legend-swatch:first-child { margin-left: 0; }
.legend-swatch.tradition { background: transparent; border: 1px dashed var(--tradition); }

.year-explorer {
  display: grid;
  grid-template-columns: 165px minmax(240px, 1fr) minmax(220px, .7fr);
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.year-readout span { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.year-readout strong { display: block; margin-top: .2rem; font: 500 1.3rem Georgia, serif; }
.year-explorer p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }

.timeline-frame {
  position: relative;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  box-shadow: var(--shadow);
}
.timeline-scroll { max-height: 720px; overflow: auto; overscroll-behavior: contain; }
.timeline { width: calc(var(--label-width) + var(--plot-width)); min-height: 220px; }

.timeline-axis, .track-row {
  display: grid;
  grid-template-columns: var(--label-width) var(--plot-width);
}
.timeline-axis { position: sticky; top: 0; z-index: 20; height: 54px; background: var(--panel); border-bottom: 1px solid var(--rule-strong); backdrop-filter: blur(15px); }
.axis-corner {
  position: sticky;
  left: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--panel);
  border-right: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.axis-plot { position: relative; }
.axis-tick { position: absolute; bottom: 0; height: 100%; border-left: 1px solid var(--rule); }
.axis-tick span { position: absolute; left: .35rem; top: 1rem; color: var(--muted); font-size: .67rem; white-space: nowrap; }
.scale-breakpoint { position: absolute; z-index: 4; top: 0; bottom: 0; border-left: 2px dashed var(--accent); pointer-events: none; }
.scale-breakpoint span { position: absolute; left: .4rem; bottom: .25rem; color: var(--accent); font-size: .55rem; font-weight: 850; letter-spacing: .04em; white-space: nowrap; text-transform: uppercase; }

.track-row { min-height: var(--row-height); border-bottom: 1px solid var(--rule); }
.track-row:last-child { border-bottom: 0; }
.track-row.focused { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.track-row.focused .track-label { box-shadow: inset 3px 0 var(--accent); }
.track-label {
  position: sticky;
  left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  padding: .65rem 1rem;
  border: 0;
  border-right: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  text-align: left;
}
.track-label:hover { color: var(--accent); }
.track-label-marker { width: .48rem; height: .48rem; flex: 0 0 auto; border-radius: 50%; background: var(--region-color); }
.track-label-text { min-width: 0; }
.track-label strong {
  display: -webkit-box;
  overflow: hidden;
  font: 600 .9rem/1.18 Georgia, serif;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.track-label small { display: block; margin-top: .2rem; color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .08em; }

.track-plot {
  position: relative;
  min-height: var(--row-height);
  background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 10% 100%;
}
.event-lane, .period-lane { position: absolute; right: 0; left: 0; }
.event-lane { top: 0; height: 22px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 58%, transparent); }
.period-lane { top: 22px; height: 46px; }
.track-row { --period-color: #a8533b; }
.track-row.archaeological-culture { --period-color: #b8863d; }
.track-row.site { --period-color: #ce743d; }
.track-row.polity { --period-color: #b84d3b; }
.track-row.regional-sequence { --period-color: #34877f; }
.track-row.network { --period-color: #477ca4; }
.track-row.tradition { --period-color: #806b9e; }
.track-row.civilization { --period-color: #9f5140; }
.period {
  appearance: none;
  position: absolute;
  top: 7px;
  z-index: 2;
  height: 30px;
  min-width: 6px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--period-color) 72%, #fff);
  border-radius: 4px;
  padding: 0 .45rem;
  background: color-mix(in srgb, var(--period-color) 86%, #17201d);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 2px 8px rgba(0, 0, 0, .08);
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}
.period:hover { z-index: 4; filter: brightness(1.12); }
.period:focus-visible { z-index: 5; outline: 2px solid #fff2c7; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(224, 108, 82, .34); }
.period-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.period-density-wide .period-label { text-overflow: clip; }
.period-density-medium .period-label { text-overflow: ellipsis; }
.period-density-compact { min-width: 8px; padding: 0; border-radius: 3px; }
.period-density-node { min-width: 8px; max-width: 8px; padding: 0; border-radius: 50%; transform: translateX(-4px); }
.period-density-node:hover, .period-density-node:focus-visible { transform: translateX(-4px) scale(1.18); }
.period.open-start { overflow: visible; border-left: 0; border-radius: 0 3px 3px 0; }
.period.open-start::before { content: '‹'; position: absolute; left: -.65rem; color: var(--region-color); font: 800 1.35rem/1 sans-serif; }
.precision-badge { display: inline-flex; align-items: center; gap: .2rem; width: max-content; border: 1px solid currentColor; border-radius: 99px; padding: .12rem .4rem; color: var(--accent); font-size: .61rem; font-weight: 850; line-height: 1.2; }
.precision-badge.compact { flex: 0 0 auto; margin-right: .3rem; border: 0; padding: 0; color: inherit; font-size: .62rem; }
.precision-badge.disputed { color: #a64737; }
.precision-badge.traditional { color: #795c1b; }
.event-marker.disputed { background: #a64737; }
.event-marker.approximate { opacity: .45; }
.track-row.tradition .period { border-style: dashed; background: color-mix(in srgb, var(--period-color) 32%, var(--paper)); color: color-mix(in srgb, var(--period-color) 32%, #fff); }
.event-marker {
  position: absolute;
  top: 7px;
  z-index: 3;
  width: 1px;
  height: 15px;
  background: color-mix(in srgb, var(--ink) 58%, transparent);
  opacity: .72;
}
.event-marker::before { content: ''; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: inherit; }
.current-year-line { position: absolute; z-index: 9; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; opacity: .85; }
.current-year-line::before { content: ''; position: absolute; left: -4px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.period-tooltip {
  position: fixed;
  z-index: 120;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: .65rem .75rem;
  border: 1px solid rgba(255, 222, 173, .28);
  border-radius: 7px;
  color: #fff9eb;
  background: rgba(11, 24, 22, .96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
  font-size: .68rem;
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
}
.period-tooltip[hidden] { display: none; }

.empty-state { padding: 5rem 1rem; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { font: 500 1.8rem Georgia, serif; }
.empty-state span { margin: .5rem 0 1.3rem; color: var(--muted); }
.empty-state button { border: 1px solid var(--ink); background: transparent; border-radius: 99px; padding: .6rem 1rem; }

.contemporaries, .method-note {
  border-top: 1px solid var(--rule-strong);
  padding: 5rem 0;
}
.contemporaries { display: grid; grid-template-columns: minmax(250px, .6fr) minmax(0, 1.4fr); gap: clamp(2rem, 8vw, 8rem); }
.contemporaries h2 { max-width: 440px; }
.contemporaries > div > p:last-child { color: var(--muted); line-height: 1.6; }
.contemporary-list { align-self: center; display: flex; flex-wrap: wrap; gap: .55rem; }
.contemporary-chip { border: 1px solid var(--rule-strong); background: transparent; border-radius: 99px; padding: .6rem .85rem; font-size: .76rem; }
.contemporary-chip:hover { border-color: var(--accent); color: var(--accent); }
.no-contemporaries { color: var(--muted); }

.method-note { max-width: 920px; }
.method-note h2 { max-width: 700px; }
.method-note > p:not(.kicker) { max-width: 820px; color: var(--muted); line-height: 1.75; }
.method-note .evidence-note { margin-top: 1.2rem; border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1rem; color: var(--ink); }
.source-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.source-links a, .dialog-sources a { color: var(--accent); font-size: .75rem; text-underline-offset: .2em; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 4.5rem);
  border-top: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: .72rem;
}

dialog {
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: clamp(1.3rem, 4vw, 3rem);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(12, 15, 13, .65); backdrop-filter: blur(5px); }
.dialog-topline { display: flex; justify-content: space-between; align-items: center; gap: .8rem; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.dialog-topline > span { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.review-status { display: inline-flex; border: 1px solid currentColor; border-radius: 99px; padding: .2rem .45rem; font-size: .55rem; letter-spacing: .06em; }
.review-status.reviewed { color: #477548; }
.review-status.provisional { color: #916919; }
.review-status.legacy { color: var(--muted); }
.dialog-topline button { width: 2.3rem; height: 2.3rem; border: 1px solid var(--rule); border-radius: 50%; background: transparent; font-size: 1.4rem; }
dialog h2 { margin: 1rem 0; }
.dialog-summary { max-width: 720px; color: var(--muted); line-height: 1.65; }
.dialog-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.3rem; }
.dialog-columns h3 { font: 600 1rem Georgia, serif; }
.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li { position: relative; padding: .75rem 0 .75rem 1.2rem; border-top: 1px solid var(--rule); }
.detail-list li.emphasized {
  margin-inline: -.65rem;
  padding-inline: 1.85rem .65rem;
  border-top-color: var(--accent);
  border-radius: 6px;
  outline: 1px solid color-mix(in srgb, var(--accent) 56%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.detail-list li::before { content: ''; position: absolute; left: 0; top: 1.1rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.detail-list strong { display: block; font-size: .82rem; }
.detail-list span, .detail-list p { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.detail-list p { margin: .25rem 0 0; }
.evidence-meta { display: grid; gap: .35rem; margin-top: .65rem; padding: .6rem; border-radius: 5px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.detail-list .evidence-meta > span { display: block; color: var(--muted); font-size: .62rem; }
.detail-list .evidence-meta strong { display: inline; font-size: inherit; }
.evidence-alternatives, .evidence-dispute { overflow-wrap: anywhere; }
.evidence-dispute { padding-top: .35rem; border-top: 1px solid var(--rule); line-height: 1.55; }
.record-sources a { color: var(--accent); text-underline-offset: .15em; }
.dialog-sources { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* Directed journeys: luminous full-screen stage */
.journey-launch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 4rem);
  margin: 0 0 1rem;
  padding: clamp(1.15rem, 2.4vw, 1.8rem);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--rule));
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 17rem),
    linear-gradient(125deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--paper-deep) 70%, transparent));
  box-shadow: 0 18px 54px rgba(92, 48, 34, .1);
}
.journey-launch::after {
  content: '';
  position: absolute;
  right: -4rem;
  bottom: -6rem;
  z-index: -1;
  width: 15rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 50%;
  opacity: .72;
}
.journey-launch > div { min-width: 0; max-inline-size: 52rem; }
.journey-launch .kicker { margin-bottom: .45rem; }
.journey-launch h3 {
  margin-bottom: .45rem;
  font: 500 clamp(1.45rem, 2.6vw, 2.15rem)/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.journey-launch p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.journey-launch .journey-open {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid transparent;
  border-radius: 99px;
  padding: .75rem 1.15rem;
  color: #fff8ec;
  background: linear-gradient(135deg, #a73f2b, #ad4934);
  box-shadow: 0 12px 30px rgba(150, 55, 38, .24);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}
.journey-launch .journey-open:hover { background: linear-gradient(135deg, #8e321f, #bc5038); }
.journey-launch .journey-open:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

body.journey-open { overflow: hidden; }

.journey-dialog {
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #f4ede1;
  background: #07100f;
  box-shadow: none;
}
.journey-dialog::backdrop { background: #030706; backdrop-filter: none; }
.journey-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: #f4ede1;
  background:
    radial-gradient(circle at 72% 28%, rgba(45, 126, 115, .24), transparent 31rem),
    radial-gradient(circle at 18% 82%, rgba(179, 74, 48, .2), transparent 28rem),
    #07100f;
}
.journey-topbar {
  position: relative;
  min-height: 68px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(244, 237, 225, .16);
  background: rgba(5, 12, 11, .92);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
}
.journey-brand {
  min-width: 0;
  color: #f4ede1;
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.journey-topbar button,
.journey-dialog button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(244, 237, 225, .28);
  border-radius: 99px;
  padding: .62rem .9rem;
  color: #f4ede1;
  background: rgba(244, 237, 225, .06);
  font-size: .75rem;
  font-weight: 800;
}
.journey-dialog button:hover:not(:disabled) {
  border-color: #ed936d;
  color: #fff;
  background: rgba(191, 82, 52, .22);
}
.journey-dialog button:focus-visible,
.journey-dialog a:focus-visible {
  outline: 3px solid #ffd19f;
  outline-offset: 3px;
}
.journey-catalog > h2:focus-visible,
.journey-stage > h2:focus-visible,
.journey-complete > h2:focus-visible {
  outline: 3px solid #ffd19f;
  outline-offset: 5px;
}
.journey-dialog button:disabled,
.journey-dialog button[aria-disabled="true"] { cursor: not-allowed; opacity: .42; }
.journey-content {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow-y: auto;
  color: #f4ede1;
}

.journey-catalog {
  min-height: calc(100dvh - 68px);
  padding: clamp(2rem, 7vw, 6rem) clamp(1rem, 5vw, 5rem);
  background:
    linear-gradient(180deg, rgba(6, 15, 14, .12), rgba(6, 15, 14, .9)),
    radial-gradient(circle at 78% 14%, rgba(72, 173, 157, .2), transparent 24rem);
}
.journey-catalog > h2 {
  max-inline-size: 52rem;
  margin: 0 auto clamp(1.5rem, 4vw, 3rem);
  font: 500 clamp(2.3rem, 6vw, 5.2rem)/.95 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.journey-catalog > p {
  max-inline-size: 52rem;
  margin: -1.8rem auto 2.3rem;
  color: rgba(244, 237, 225, .7);
  line-height: 1.6;
}
.journey-cards {
  max-inline-size: 74rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
  margin-inline: auto;
}
.journey-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(244, 237, 225, .18);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(25, 48, 45, .82), rgba(9, 19, 18, .94));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
}
.journey-card-map {
  position: relative;
  min-height: 11rem;
  margin-bottom: 1.2rem;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 34% 52%, #f19562 0 .22rem, rgba(241, 149, 98, .24) .3rem .9rem, transparent 1rem),
    radial-gradient(circle at 67% 37%, #70d3c2 0 .18rem, rgba(112, 211, 194, .22) .28rem .75rem, transparent .8rem),
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 1.8rem, rgba(115, 202, 187, .08) 1.9rem 2rem),
    #0b2220;
}
.journey-card-map::before,
.journey-card-map::after {
  content: '';
  position: absolute;
  inset: 18% -10%;
  border: 1px solid rgba(112, 211, 194, .2);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.journey-card-map::after { inset: 34% 8%; border-color: rgba(241, 149, 98, .23); transform: rotate(18deg); }
.journey-card-map .atlas-world {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}
.journey-card-map .atlas-ocean { fill: rgba(4, 23, 21, .42); }
.journey-card-map .atlas-graticule { stroke: rgba(112, 211, 194, .13); }
.journey-card-map .atlas-land { fill: #24504a; }
.journey-card-map .atlas-coast-glow { stroke: rgba(89, 219, 205, .38); }
.journey-card-map .atlas-coast-line { stroke: rgba(150, 236, 221, .72); }
.journey-card h3 {
  margin-bottom: .7rem;
  font: 500 clamp(1.55rem, 2.6vw, 2.1rem)/1.06 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.journey-card-summary {
  flex: 1;
  margin-bottom: 1.15rem;
  color: rgba(244, 237, 225, .7);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.journey-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin-bottom: 1rem;
  color: #f2a77f;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.journey-card > button { align-self: flex-start; padding-inline: 1.2rem; }

.journey-stage {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 68px);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 42rem) minmax(4rem, 1fr);
  align-content: end;
  gap: .75rem clamp(1rem, 4vw, 3.5rem);
  padding: clamp(1.2rem, 4vw, 3.5rem);
  background: #071514;
  animation: journey-stage-in .62s cubic-bezier(.2, .7, .2, 1) both;
}
.journey-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 10, 9, .96) 0, rgba(4, 10, 9, .78) 36%, rgba(4, 10, 9, .12) 72%),
    linear-gradient(0deg, rgba(4, 10, 9, .96) 0, transparent 62%);
}
.journey-map-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  max-inline-size: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  pointer-events: none;
  background: radial-gradient(circle at 64% 40%, #183e3a 0, #0a211f 48%, #06110f 100%);
  animation: journey-map-drift .8s ease-out both;
}
.journey-map-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 68% 42%, transparent 28%, rgba(0, 0, 0, .45) 92%);
}
.journey-map-layer [data-journey-world],
.journey-map-layer [data-journey-regions] { position: absolute; inset: 0; }
.journey-map-layer [data-journey-world] { display: grid; place-items: center; }
.journey-map-layer .atlas-world { width: 100%; height: 100%; }
.journey-map-layer .atlas-land { fill: #214a45; }
.journey-map-layer .atlas-coast-line { stroke: rgba(126, 229, 211, .78); }
.journey-map-layer .atlas-region { opacity: .9; }
.journey-stage-header,
.journey-stage > h2,
.journey-body,
.journey-progress,
.journey-clock,
.journey-controls { position: relative; z-index: 2; min-width: 0; }
.journey-stage-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  max-inline-size: 42rem;
  color: rgba(244, 237, 225, .7);
}
.journey-stage-header p { margin: 0; }
.journey-route-title {
  color: #f2a77f;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.journey-progress-text { font-size: .72rem; }
.journey-year { font: 500 1rem Georgia, "Times New Roman", serif; color: #8ad8ca; }
.journey-stage > h2 {
  grid-column: 1;
  min-width: 0;
  max-inline-size: 42rem;
  margin: .15rem 0 0;
  font: 500 clamp(2.5rem, 6.5vw, 6.1rem)/.9 Georgia, "Times New Roman", serif;
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
.journey-body {
  grid-column: 1;
  min-width: 0;
  max-inline-size: 60ch;
  margin: 0;
  color: rgba(244, 237, 225, .78);
  font-size: clamp(.92rem, 1.35vw, 1.08rem);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.journey-progress {
  grid-column: 1;
  display: flex;
  gap: .5rem;
  max-inline-size: 42rem;
}
.journey-progress button {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  flex: 1;
  border: 0;
  padding: 0;
  background: transparent;
}
.journey-progress button::before {
  content: '';
  position: absolute;
  right: 0;
  left: 0;
  top: 50%;
  height: 3px;
  border-radius: 99px;
  background: rgba(244, 237, 225, .22);
}
.journey-progress button[aria-current="step"]::before { background: #ed936d; box-shadow: 0 0 18px rgba(237, 147, 109, .52); }
.journey-clock {
  --journey-progress: 0;
  grid-column: 2;
  grid-row: 2 / span 3;
  align-self: end;
  justify-self: end;
  width: clamp(3.5rem, 7vw, 5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0b1a18 58%, transparent 60%),
    conic-gradient(#ed936d calc(var(--journey-progress) * 1turn), rgba(244, 237, 225, .15) 0);
  box-shadow: 0 0 28px rgba(237, 147, 109, .15);
  color: #fff;
  font: 600 1rem Georgia, "Times New Roman", serif;
}
.journey-clock span { display: grid; place-items: center; }
.journey-controls {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  min-width: 0;
  max-inline-size: 58rem;
  overflow-wrap: anywhere;
}
.journey-controls button,
.journey-complete-actions button { min-height: 44px; max-inline-size: 100%; overflow-wrap: anywhere; }
.journey-controls button[data-journey-action="next"],
.journey-complete-actions button:first-child { border-color: #ed936d; background: #a84a34; }

.journey-complete {
  min-height: calc(100dvh - 68px);
  display: grid;
  place-content: center;
  justify-items: center;
  padding: clamp(1.25rem, 6vw, 5rem);
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(50, 146, 130, .26), transparent 25rem),
    radial-gradient(circle at 50% 68%, rgba(187, 78, 52, .18), transparent 23rem);
  animation: journey-stage-in .55s ease-out both;
}
.journey-complete-kicker {
  margin-bottom: .7rem;
  color: #f2a77f;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.journey-complete h2 {
  max-inline-size: 48rem;
  margin: 0 0 1rem;
  font: 500 clamp(2.7rem, 7vw, 6rem)/.94 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.journey-complete > p:not(.journey-complete-kicker) {
  max-inline-size: 60ch;
  color: rgba(244, 237, 225, .75);
  line-height: 1.7;
}
.journey-complete-actions {
  max-inline-size: 50rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .75rem;
}

@keyframes journey-stage-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes journey-map-drift {
  from { transform: scale(1.035); opacity: .62; }
  to { transform: scale(1); opacity: 1; }
}

.edition-companion {
  max-width: 1180px;
  margin: 1.35rem auto 0;
  color: #f4ede0;
}
.edition-companion-card {
  border: 1px solid rgba(207, 105, 73, .55);
  border-radius: calc(var(--radius) * 2);
  padding: clamp(1rem, 2.8vw, 2rem);
  background:
    radial-gradient(circle at 88% 12%, rgba(207, 105, 73, .17), transparent 19rem),
    linear-gradient(135deg, #10251f, #173229);
  box-shadow: 0 24px 70px rgba(7, 24, 19, .22);
  animation: edition-companion-in .28s ease-out both;
}
.edition-companion-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1rem, 2vw, 1.6rem);
}
.edition-companion-label,
.edition-companion-anchor {
  margin: 0;
  color: #e3a184;
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.edition-companion-label span {
  display: inline-block;
  margin-left: .45rem;
  color: rgba(244, 237, 224, .62);
  font-variant-numeric: tabular-nums;
}
.edition-companion-close,
.edition-companion-atlas {
  min-height: 44px;
  border: 1px solid rgba(244, 237, 224, .35);
  color: #f4ede0;
  background: transparent;
}
.edition-companion-close {
  min-width: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
}
.edition-companion-atlas {
  border-color: #cf6949;
  border-radius: 999px;
  padding: .7rem 1.1rem;
  background: #cf6949;
  color: #13261f;
  font-size: .76rem;
  font-weight: 850;
}
.edition-companion-close:hover { background: rgba(244, 237, 224, .1); }
.edition-companion-atlas:hover { background: #e07b59; }
.edition-companion-close:focus-visible,
.edition-companion-atlas:focus-visible {
  outline: 3px solid #f4c36c;
  outline-offset: 4px;
}
.edition-companion h2:focus-visible {
  outline: none;
  box-shadow: inset 3px 0 #f4c36c;
  padding-inline-start: .18em;
}
.edition-companion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr);
  align-items: end;
  gap: clamp(1.25rem, 4vw, 4rem);
}
.edition-companion-copy { max-width: 48rem; }
.edition-companion h2 {
  margin: .65rem 0 .9rem;
  font: 500 clamp(2.3rem, 5.6vw, 5rem)/.96 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.edition-companion-question {
  max-width: 58ch;
  margin: 0 0 1.35rem;
  color: rgba(244, 237, 224, .77);
  font: 500 clamp(1rem, 1.8vw, 1.25rem)/1.55 Georgia, "Times New Roman", serif;
}
.edition-companion-media {
  margin: 0;
  border: 1px solid rgba(244, 237, 224, .16);
  background: rgba(0, 0, 0, .13);
}
.edition-companion-media.is-reconstruction { border-style: dashed; }
.edition-companion-media picture,
.edition-companion-media img { display: block; width: 100%; }
.edition-companion-media img { aspect-ratio: 4 / 3; object-fit: cover; }
.edition-companion-media figcaption { padding: .8rem; }
.edition-companion-media figcaption p { margin: 0 0 .45rem; line-height: 1.45; }
.edition-media-credit,
.edition-media-kind { color: rgba(244, 237, 224, .68); font-size: .72rem; }
.edition-companion-media-unavailable {
  align-self: stretch;
  display: grid;
  place-items: end start;
  min-height: 8rem;
  margin: 0;
  border-top: 1px solid rgba(244, 237, 224, .18);
  padding-top: 1rem;
  color: rgba(244, 237, 224, .54);
  font-size: .75rem;
  line-height: 1.5;
}

@keyframes edition-companion-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 720px) {
  .edition-companion-grid { grid-template-columns: 1fr; align-items: start; }
  .edition-companion h2 { font-size: clamp(2.15rem, 11vw, 3.5rem); }
  .edition-companion-media-unavailable { min-height: 3rem; }
  .edition-companion-atlas { width: 100%; }
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  transform: translateY(150%);
  opacity: 0;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: .78rem;
  transition: .22s ease;
}
.toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  :root { --label-width: 195px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-stats > div { display: block; padding-right: .5rem; }
  .hero-stats span { display: block; margin-top: .3rem; }
  .controls-primary { grid-template-columns: 1fr 1fr; }
  .scale-toolbar { grid-template-columns: auto 1fr; }
  .scale-toolbar > p { grid-column: 1 / -1; }
  .search-field { grid-column: 1 / -1; }
  .year-explorer { grid-template-columns: 150px 1fr; }
  .year-explorer p { grid-column: 1 / -1; }
  .atlas-workspace { grid-template-columns: 1fr; }
  .atlas-panel { border-top: 1px solid var(--rule-strong); border-left: 0; }
}

@media (max-width: 620px) {
  :root { --label-width: 158px; --row-height: 62px; }
  .hero { padding-bottom: 3rem; }
  .topbar { min-height: 64px; }
  .brand > span:last-child { display: none; }
  .topbar-actions { gap: .2rem; }
  .icon-button { padding-inline: .55rem; }
  .hero-grid { padding-top: 3.5rem; gap: 2.8rem; }
  h1 { font-size: clamp(3rem, 14vw, 4.2rem); }
  .hero-stats strong { font-size: 1.7rem; }
  .hero-stats span { font-size: .68rem; }
  .hero-compact { padding-bottom: 1rem; }
  .hero-compact .hero-grid { padding-top: 1.4rem; gap: 1.25rem; }
  .hero-compact h1 { margin-bottom: .8rem; font-size: clamp(2.65rem, 12vw, 3.25rem); line-height: .94; }
  .hero-compact .hero-lede {
    display: -webkit-box;
    overflow: hidden;
    font-size: .86rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .hero-compact .hero-stats > div { padding: .55rem 0; }
  .hero-compact .hero-stats strong { font-size: 1.5rem; }
  .controls-shell { position: relative; padding-block: .6rem; }
  .mobile-filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: .7rem .8rem;
    background: rgba(255,255,255,.08);
    font-size: .72rem;
    font-weight: 800;
  }
  .mobile-filter-toggle[aria-expanded="true"] [aria-hidden] { transform: rotate(180deg); }
  .filters-content { display: none; padding-top: .7rem; }
  .filters-content.open { display: block; }
  .controls-primary { grid-template-columns: 1fr; }
  .scale-toolbar { grid-template-columns: 1fr; align-items: start; }
  .scale-mode { width: 100%; overflow-x: auto; }
  .scale-mode button { flex: 1; }
  .scale-toolbar > p { grid-column: auto; }
  .search-field { grid-column: auto; }
  .presets-row { align-items: flex-start; flex-wrap: wrap; }
  .presets-row > span { width: 100%; }
  .presets-row .text-button { margin-left: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .explorer-heading { align-items: flex-start; flex-direction: column; }
  .explorer { padding-top: 1.5rem; }
  .view-switch { width: 100%; }
  .view-button { flex: 1; }
  .explorer-shell { margin-inline: calc(clamp(1rem, 4vw, 4.5rem) * -.45); }
  .atlas-map, .atlas-workspace { min-height: 500px; }
  .atlas-map-title { max-width: 14rem; }
  .atlas-region small { display: none; }
  .atlas-playback { grid-template-columns: 1fr; gap: .35rem; border-radius: var(--radius); }
  .atlas-playback button { justify-content: center; }
  .atlas-panel { min-height: 320px; }
  .chronology-view { padding: 1rem 0 0; }
  .chronology-view .section-heading, .chronology-view .year-explorer { margin-inline: 1rem; }
  .chronology-view .timeline-frame { border-right: 0; border-left: 0; border-radius: 0; }
  .year-explorer { grid-template-columns: 1fr; gap: .8rem; }
  .year-explorer p { grid-column: auto; }
  .track-label { padding: .5rem .65rem; }
  .track-label strong { font-size: .75rem; }
  .track-label small { font-size: .52rem; }
  .contemporaries { grid-template-columns: 1fr; }
  .dialog-columns { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  .atlas-coast-glow { stroke-width: 3; opacity: .3; filter: blur(2px); }
  .atlas-graticule { opacity: .58; }
  .atlas-comparison path { filter: none; }
  .period-tooltip { max-width: calc(100vw - 16px); }
  .journey-launch { grid-template-columns: 1fr; align-items: start; }
  .journey-launch .journey-open { width: 100%; }
  .journey-topbar { min-height: 64px; padding-inline: .85rem; }
  .journey-catalog { min-height: calc(100dvh - 64px); padding: 1.5rem .85rem 2.5rem; }
  .journey-catalog > h2 { margin-bottom: 1.35rem; font-size: clamp(2.25rem, 12vw, 3.6rem); }
  .journey-cards { grid-template-columns: 1fr; }
  .journey-card-map { min-height: 9rem; }
  .journey-stage {
    min-height: calc(100dvh - 64px);
    grid-template-columns: 1fr;
    gap: .45rem;
    padding: min(30vh, 12rem) .85rem .85rem;
  }
  .journey-stage::after {
    background: linear-gradient(0deg, rgba(4, 10, 9, .98) 0, rgba(4, 10, 9, .84) 54%, transparent 100%);
  }
  .journey-stage-header,
  .journey-stage > h2,
  .journey-body,
  .journey-progress,
  .journey-controls { grid-column: 1; max-inline-size: 100%; }
  .journey-stage > h2 { font-size: clamp(2.25rem, 11vw, 4rem); }
  .journey-body { max-height: 45vh; overflow-y: auto; font-size: .9rem; }
  .journey-clock {
    position: absolute;
    top: .85rem;
    right: .85rem;
    grid-column: 1;
    grid-row: auto;
    width: 3.65rem;
  }
  .journey-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journey-controls button { min-width: 0; padding-inline: .5rem; }
  .journey-complete { min-height: calc(100dvh - 64px); }
}

@media (max-width: 390px) {
  .journey-launch { padding: 1rem; }
  .journey-launch h3 { font-size: 1.45rem; }
  .journey-brand { max-inline-size: 12rem; font-size: .64rem; }
  .journey-topbar button { padding-inline: .7rem; }
  .journey-card { padding: .8rem; }
  .journey-stage { padding: 26vh .7rem .7rem; }
  .journey-stage-header { gap: .25rem .6rem; }
  .journey-stage > h2 { font-size: clamp(2rem, 10.5vw, 3rem); }
  .journey-body { max-height: 38vh; }
  .journey-progress { gap: .5rem; }
  .journey-controls { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .journey-controls > button { grid-column: span 2; }
  .journey-controls > button:nth-child(n + 4) { grid-column: span 3; }
  .journey-controls > button:first-child:nth-last-child(4),
  .journey-controls > button:first-child:nth-last-child(4) ~ button { grid-column: span 3; }
  .journey-complete-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .atlas-region::after { animation: none !important; }
  .atlas-comparison path { animation: none !important; }
  .journey-dialog,
  .journey-dialog *,
  .journey-dialog::before,
  .journey-dialog::after,
  .journey-dialog *::before,
  .journey-dialog *::after {
    animation: none !important;
    transition: none !important;
  }
  .journey-stage,
  .journey-map-layer { transform: none !important; }
  .edition-companion,
  .edition-companion-card { animation: none !important; transition: none !important; }
}
