.history {
  --rail: 150px;
  --map-width: min(48vw, 960px, max(320px, calc((100svh - 340px) * 2.25)));
  --edge: clamp(24px, 3.5vw, 64px);
  --nav-height: calc(var(--e) + var(--inset) * 2);
  --reading-top: var(--nav-height);
}
.history::before { display: none; }
.history a { color: inherit; text-underline-offset: 3px; }
.history a.nav-cta { color: #fff; }
.history a:focus-visible { outline: 2px solid #000; outline-offset: 5px; }
.history-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  height: var(--nav-height);
  padding-bottom: var(--inset);
  background: #fff;
}
/* On desktop the nav has no bar: works scroll up through the top edge. */
@media (min-width: 821px) {
  .history-header { background: none; pointer-events: none; }
  .history-header a { pointer-events: auto; }
}
.skip-link { position: fixed; z-index: 50; top: -100px; left: 75px; background: #fff; padding: 8px; }
.skip-link:focus { top: 16px; }
#history {
  margin-left: calc(var(--rail) + 36px);
  margin-right: calc(var(--map-width) + var(--edge) + 40px);
  padding-top: calc(var(--nav-height) + 32px);
}
.history-intro { margin-bottom: 42px; }
.history-intro h1 { font-size: clamp(34px, 3.6vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -.035em; margin: 0 0 10px; }
.history-intro p { max-width: 540px; color: #666; line-height: 1.6; margin: 0; }
.artifact { margin: 0; padding: 24px 0 100px; scroll-margin-top: calc(var(--reading-top) + 24px); }
.artifact + .artifact { padding-top: 56px; }
.image { display: block; cursor: zoom-in; }
.artifact img { display: block; width: 100%; height: clamp(260px, 53svh, 640px); object-fit: contain; }
.artifact figcaption { max-width: 540px; margin: 32px 0 0; }
.artifact h2 { font-size: clamp(28px, 2.7vw, 42px); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; overflow-wrap: break-word; margin: 0 0 10px; text-wrap: balance; }
.date { margin: 0; font-weight: 600; letter-spacing: -.02em; }
.place { margin: 4px 0 18px; color: #666; }
.note { margin: 0 0 18px; line-height: 1.6; }
.source { font-size: 12px; }
.image-credit { margin: 5px 0 0; color: #666; font-size: 11px; line-height: 1.6; }
.history-notes { padding: 24px 0 64px; font-size: 12px; color: #666; }
.history-notes p { margin: 0 0 14px; }
/* A roughly log time scale. Ticks near the current date slide into focus. */
#year-rail {
  --cell: calc(var(--e) / 5);
  --slide: 22px;
  --label: 30px;
  position: fixed; z-index: 30; left: 0; top: calc(var(--nav-height) + 52px); bottom: 54px; width: var(--rail);
  cursor: pointer;
}
.rail-tick {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 36px;
  margin-top: -18px;
  display: flex;
  align-items: center;
  pointer-events: none;
  --shift: 0px;
}
.rail-tick[data-focus="1"] { --shift: calc(var(--slide) * .4); }
.rail-tick[data-focus="2"] { --shift: var(--slide); }
/* Ticks hide their extra length behind the left edge and slide out of it. */
.rail-tick > i, .rail-label { transform: translateX(var(--shift)); transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .3s; }
.rail-tick > i { --length: 22px; display: block; flex: none; width: calc(var(--length) + var(--slide)); margin-left: calc(var(--slide) * -1); height: .5px; background: #000; opacity: .2; }
.rail-tick.minor > i { --length: 9px; }
.rail-tick.zero > i { --length: 24px; height: 1px; opacity: .5; }
.rail-tick[data-focus="1"] > i { opacity: .55; }
.rail-tick[data-focus="2"] > i { height: 1px; opacity: 1; }
.rail-label {
  position: absolute;
  left: var(--label);
  top: 50%;
  margin-top: -.6em;
  font-size: 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  opacity: .5;
}
.rail-tick[data-focus="1"] .rail-label { opacity: .8; }
.rail-tick[data-focus="2"] .rail-label { opacity: 1; }
.rail-tick[data-focus="2"] .rail-label b { font-weight: 650; }
.rail-label b { display: block; font-weight: 500; letter-spacing: -.02em; }
.rail-label small { display: block; font-size: 9px; margin-top: 1px; }
.zero .rail-label { font-size: 16px; opacity: .85; }
.zero .rail-label b { letter-spacing: -.03em; }
.rail-work {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--cell) * 5);
  height: max(12px, var(--cell));
  margin-top: calc(max(12px, var(--cell)) / -2);
}
.rail-work::after {
  content: '';
  position: absolute;
  inset: calc(50% - var(--cell) / 2) 0 auto;
  height: var(--cell);
  background: var(--c);
  opacity: .3;
  transition: opacity .3s;
}
.rail-work[aria-current]::after { opacity: 1; }
/* The map stays put; only the highlighted geography changes. */
.location-panel { position: fixed; z-index: 20; right: var(--edge); top: 50%; width: var(--map-width); transform: translateY(-50%); }
.map-heading { font-size: 12px; color: #666; margin: 0 0 10px; }
#map-place { font-size: clamp(24px, 2.1vw, 32px); line-height: 1.2; font-weight: 500; letter-spacing: -.025em; margin: 0 0 6px; text-wrap: balance; }
.location-copy { min-height: 112px; }
#history-map { aspect-ratio: 360 / 160; width: 100%; margin: 16px 0; }
#history-map svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.map-country { fill: #e8e8e8; stroke: #fff; stroke-width: .3; transition: fill .7s; }
.map-country.active { fill: #666; }
#map-pin { transition: opacity .2s; }
#map-notice { color: #666; font-size: 12px; padding-top: 32px; }
@media (min-width: 1800px) {
  #history { max-width: 900px; margin-left: calc(var(--rail) + 6vw); }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .history { --rail: 126px; --map-width: 36vw; --edge: 24px; }
  #history { margin-left: 154px; margin-right: calc(var(--map-width) + var(--edge) + 32px); }
  .rail-label { font-size: 11px; }
}
@media (max-width: 820px) {
  .history { --rail: 68px; --nav-height: calc(var(--e) + var(--inset) + 8px); --map-height: 96px; --reading-top: calc(var(--nav-height) + var(--map-height)); }
  .history-header { padding-bottom: 8px; }
  #history { margin-left: 86px; margin-right: 18px; padding-top: calc(var(--reading-top) + 12px); }
  .history-intro { margin-bottom: 18px; }
  .history-intro h1 { font-size: clamp(23px, 7.4vw, 34px); }
  .history-intro p { font-size: 13px; }
  .artifact { padding: 10px 0 62px; }
  .artifact + .artifact { padding-top: 20px; }
  .artifact img { height: auto; max-height: 43svh; }
  .artifact figcaption { margin-top: 24px; }
  .artifact h2 { font-size: clamp(22px, 6.4vw, 30px); }
  .note, .date, .place { font-size: 14px; }
  #year-rail { top: calc(var(--nav-height) + 40px); bottom: calc(32px + env(safe-area-inset-bottom)); }
  #year-rail { --cell: 3px; --slide: 10px; --label: 18px; }
  .rail-tick > i { --length: 11px; }
  .rail-tick.minor > i { --length: 4.5px; }
  .rail-tick.zero > i { --length: 13px; }
  .rail-label { font-size: 9px; }
  .rail-label small { font-size: 8px; }
  .zero .rail-label { font-size: 12px; }
  .location-panel {
    top: var(--nav-height);
    right: 0;
    left: 76px;
    width: auto;
    height: var(--map-height);
    padding: 6px 16px 6px 10px;
    transform: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(62%, 189px);
    grid-template-rows: 1fr;
    column-gap: 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
  }
  .location-copy { min-height: 0; align-self: center; }
  .map-heading { display: none; }
  #map-place { font-size: 12px; letter-spacing: 0; margin: 0; text-wrap: initial; }
  #history-map { margin: 0; align-self: center; }
  .history-notes { padding-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .history *, .history *::before, .history *::after { transition: none !important; scroll-behavior: auto !important; }
}
