/* Palette: "Ornate Mughal" (Octet Design) — #c5c2c2 #aea6a2 #958d8b #776d69 #5a4b47 #422726.
   Page backgrounds use light/dark tints of the same hues so body text keeps strong contrast. */
:root {
  --p1: #c5c2c2; --p2: #aea6a2; --p3: #958d8b; --p4: #776d69; --p5: #5a4b47; --p6: #422726;

  --bg: #efeceb;          /* tint of p1 */
  --surface: #fbfaf9;
  --surface-2: #e6e2e0;
  --ink: #2e1b1a;         /* deepened p6 */
  --muted: #5a4b47;       /* p5 */
  --line: #c5c2c2;        /* p1 */
  --accent: #776d69;      /* p4 */
  --accent-ink: #422726;  /* p6 */
  --focus: #422726;
  --shadow: 0 2px 10px rgba(66, 39, 38, .18);
  --hero-bg: #422726; --hero-ink: #f3efed; --hero-muted: #c5c2c2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2a1918; --surface: #3a2624; --surface-2: #4a3532; --ink: #eeeae8; --muted: #c5c2c2;
    --line: #5a4b47; --accent: #aea6a2; --accent-ink: #eeeae8; --focus: #c5c2c2;
    --shadow: 0 2px 12px rgba(0, 0, 0, .45);
    --hero-bg: #1f1211; --hero-ink: #f3efed; --hero-muted: #aea6a2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2a1918; --surface: #3a2624; --surface-2: #4a3532; --ink: #eeeae8; --muted: #c5c2c2;
  --line: #5a4b47; --accent: #aea6a2; --accent-ink: #eeeae8; --focus: #c5c2c2;
  --shadow: 0 2px 12px rgba(0, 0, 0, .45);
  --hero-bg: #1f1211; --hero-ink: #f3efed; --hero-muted: #aea6a2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif; font-weight: 500;
  font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, button, input, summary, kbd { font-family: inherit; font-weight: 500; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- 1. Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center;
  padding: 64px 5vw 104px; background-color: var(--hero-bg); color: var(--hero-ink);
  /* jaali-like eight-point star lattice */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23776d69' stroke-opacity='.32' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0l14 14M72 0L58 14M0 72l14-14M72 72L58 58'/%3E%3C/g%3E%3C/svg%3E");
}
.hero::after { /* soften the lattice behind the title */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 28% 50%, var(--hero-bg) 30%, transparent 100%);
}
.hero-grid {
  position: relative; z-index: 1; width: 100%; max-width: 1380px; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 5vw; text-align: left;
}
.hero-inner { position: relative; }
.hero-inner::before { /* ornamental rule */
  content: ""; display: block; width: 120px; height: 1px; margin: 0 0 26px;
  background: linear-gradient(90deg, transparent, var(--hero-muted), transparent);
}
.hero h1 { margin: 0; font-size: clamp(40px, 5.2vw, 80px); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.subtitle { margin: 22px 0 0; font-style: italic; font-weight: 500; font-size: clamp(22px, 2.6vw, 31px); line-height: 1.25; color: var(--hero-muted); }
.intro { margin: 20px 0 0; max-width: 640px; font-size: clamp(18px, 1.55vw, 21px); color: var(--hero-ink); opacity: .94; text-wrap: pretty; }
.intro p { margin: 0 0 14px; }
.intro .lead-q { margin-top: 22px; font-style: italic; color: var(--hero-muted); font-size: 1.1em; }
.hero-art { margin: 0; }
.hero-art img {
  display: block; width: 100%; height: auto; border-radius: 2px;
  outline: 1px solid rgba(197, 194, 194, .35); outline-offset: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.hero-art figcaption { margin-top: 18px; font-size: 14px; line-height: 1.45; color: var(--hero-muted); }
@media (min-width: 961px) and (max-height: 800px) {   /* short laptop screens: keep the hero within one screen */
  .hero { padding-top: 40px; padding-bottom: 84px; }
  .hero h1 { font-size: clamp(38px, 4.4vw, 64px); }
  .subtitle { margin-top: 14px; font-size: 24px; }
  .intro { font-size: 17px; margin-top: 14px; }
  .intro p { margin-bottom: 10px; }
  .intro .lead-q { margin-top: 14px; }
  .hero-inner::before { margin-bottom: 18px; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; row-gap: 40px; max-width: 680px; }
  .hero::after { background: radial-gradient(ellipse 80% 45% at 50% 30%, var(--hero-bg) 30%, transparent 100%); }
}
.scroll-cue {
  position: absolute; z-index: 1; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--hero-muted); text-decoration: none; letter-spacing: .2em; text-transform: uppercase; font-size: 13px;
}
.scroll-cue svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Essay sections (write-up parts 2–4): one screen each ---------- */
/* photo | numeral | text   (mirrored for .essay-left) */
.essay {
  min-height: 100svh; display: grid; align-items: center; column-gap: 2.6vw;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr);
  padding: 8vh 3.5vw; border-bottom: 1px solid var(--line); position: relative;
}
.essay-right .essay-fig { grid-column: 1; grid-row: 1; }
.essay-left { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); }
.essay-right .essay-mark { grid-column: 2; grid-row: 1; }
.essay-right .essay-body { grid-column: 3; grid-row: 1; }
.essay-left .essay-body { grid-column: 1; grid-row: 1; }
.essay-left .essay-mark { grid-column: 2; grid-row: 1; }
.essay-left .essay-fig { grid-column: 3; grid-row: 1; }
.essay-mark {          /* faded numeral between photo and text */
  align-self: start; margin-top: -.12em; font-size: clamp(64px, 6.5vw, 116px); line-height: 1;
  color: var(--p1); opacity: .6; user-select: none; font-variant-numeric: lining-nums; letter-spacing: -.02em;
}
.essay-fig { margin: 0; }
.essay-fig img {
  display: block; width: 100%; height: auto; max-height: 84svh; object-fit: cover;
  border-radius: 4px; box-shadow: var(--shadow); background: var(--surface-2);
}
.essay-fig figcaption { margin-top: 8px; font-size: 14px; font-style: italic; color: var(--muted); }
.essay-left .essay-fig figcaption { text-align: right; }
.essay-body h2 { margin: 0 0 22px; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.1; text-wrap: balance; }
.essay-body h2::after { content: ""; display: block; width: 72px; height: 1px; margin-top: 18px; background: var(--accent); }
.essay-body p, .essay-body li { font-size: clamp(18px, calc(1.3vw + 1px), 21px); line-height: 1.58; text-wrap: pretty; }
.essay-body p { margin: 0 0 16px; }
.essay-body a { color: var(--accent-ink); text-decoration-thickness: 1px; }
.essay-body a:hover { text-decoration-thickness: 2px; }
.essay-body strong { font-weight: 500; font-style: italic; color: var(--accent-ink); }
.args { margin: 0 0 18px; padding-left: 1.4em; }
.args li { margin-bottom: 10px; padding-left: 4px; }
.args li::marker { color: var(--muted); }
sup.fn { line-height: 0; font-size: .68em; }
sup.fn a { text-decoration: none; color: var(--accent-ink); padding: 0 1px; }
.notes { margin: 26px 0 0; padding: 14px 0 0 1.4em; border-top: 1px solid var(--line); color: var(--muted); }
.essay-body .notes li { font-size: 16px; line-height: 1.45; margin-bottom: 6px; }
.notes a { text-decoration: none; }
.cats-list { list-style: none; margin: 4px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.cats-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.3; }
.cat-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--p6); color: #f3efed; }
.cat-ico svg { width: 19px; height: 19px; }
:root[data-theme="dark"] .cat-ico { background: var(--p2); color: #2a1918; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat-ico { background: var(--p2); color: #2a1918; } }
:root[data-theme="dark"] .essay-mark { color: var(--p5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .essay-mark { color: var(--p5); } }

/* ---------- 2/3. Scrollytelling + exploration ---------- */
#scrolly { position: relative; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--bg); }
.mapframe {
  position: absolute; top: 0; bottom: 0; right: 0; left: 40%;
  transition: left .7s cubic-bezier(.4, 0, .2, 1); border-left: 1px solid var(--line);
}
.explore .mapframe { left: 0; border-left-color: transparent; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.story #map { pointer-events: none; }            /* page scroll can never be captured by the map */

.yearbadge {
  position: absolute; top: 16px; left: 16px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 20px;
  font-variant-numeric: lining-nums tabular-nums; transition: opacity .3s;
}
.explore .yearbadge { opacity: 0; }
.story-legend {
  position: absolute; right: 12px; bottom: 38px; width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 120px);
  display: flex; flex-direction: column; overflow: hidden; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); transition: opacity .3s;
}
.story-legend details.sec { border-top: 0; }
.story-legend .row-cat { font-size: 15px; }
.story-legend .sum-count { color: var(--muted); font-size: 14px; font-variant-numeric: lining-nums; }
.story-legend .count { min-width: 56px; text-align: right; white-space: nowrap; }
.delta { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; font-size: 12.5px; line-height: 1.5;
         background: var(--surface-2); color: var(--accent-ink); animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(1.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.explore .story-legend { opacity: 0; visibility: hidden; pointer-events: none; }
/* zoom buttons and scale stay usable during the story; only the map surface ignores the pointer */
.story .maplibregl-ctrl { pointer-events: auto; }
.maplibregl-ctrl-scale { font-family: system-ui, sans-serif; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink); border-color: var(--muted); }

.steps { position: relative; z-index: 2; margin-top: -100svh; pointer-events: none; }
.step { width: 40%; min-height: 100svh; display: flex; align-items: center; padding: 12vh 4vw; }
.step:first-child { padding-top: 30vh; }
.step:last-child { min-height: 120svh; }
.card {
  pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 26px 28px 24px; box-shadow: var(--shadow); max-width: 520px;
  opacity: .45; transition: opacity .4s;
}
.step.is-active .card { opacity: 1; }
.card .kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; color: var(--muted); font-size: 15px; letter-spacing: .06em; }
.card .kicker .n { font-variant-numeric: lining-nums; }
.card .draft { margin-left: auto; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 8px;
               border: 1px dashed var(--accent); border-radius: 999px; color: var(--muted); }
.card h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.15; text-wrap: balance; }
.card p { margin: 0 0 12px; text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--surface-2); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; }

.explore-zone { position: relative; z-index: 2; height: 100svh; pointer-events: none; }
.explore-hint {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
  pointer-events: none; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 10px 18px 12px; opacity: 0; transition: opacity .4s .3s;
}
.explore .explore-hint { opacity: 1; }
.explore.hint-done .explore-hint { opacity: 0; transition-delay: 0s; }
.explore-hint h2 { margin: 0; font-size: 22px; }
.explore-hint p { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
kbd { font-size: .85em; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }

/* explore controls live inside the map frame */
.explore-ui { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.explore .explore-ui { opacity: 1; }
.explore .explore-ui > * { pointer-events: auto; }

.panel {
  position: absolute; top: 104px; left: 16px; width: 330px; max-width: calc(100% - 32px); max-height: calc(100% - 330px);
  display: flex; flex-direction: column; overflow: hidden; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
}
.panel input[type=search] { width: 100%; border: 0; padding: 12px 16px; font-size: 18px; background: transparent; color: var(--ink); outline-offset: -2px; }
.results { max-height: 40vh; overflow: auto; border-top: 1px solid var(--line); display: none; }
.results div { padding: 8px 16px; cursor: pointer; border-bottom: 1px solid var(--surface-2); font-size: 16px; }
.results div:hover, .results div:focus-visible { background: var(--surface-2); }
.results small { display: block; color: var(--muted); font-size: 14px; }
details.sec { border-top: 1px solid var(--line); padding: 6px 14px 10px; overflow: auto; font-size: 16px; }
details.sec summary { cursor: pointer; color: var(--muted); padding: 2px 0; }
.tools { display: flex; gap: 12px; margin: 4px 0; font-size: 15px; }
.tools button { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent); cursor: pointer; font-size: 15px; }
.row-cat { display: flex; align-items: center; gap: 9px; padding: 3px 0; cursor: pointer; line-height: 1.25; }
.row-cat input { margin: 0; accent-color: var(--p6); }
.ico { width: 19px; height: 19px; flex: none; color: var(--ink); }
.count { margin-left: auto; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }

.timebar {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); width: min(1100px, calc(100% - 32px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 10px 20px 6px;
}
.tb-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#play { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; cursor: pointer; font-size: 15px;
        background: var(--p6); color: #f3efed; }
:root[data-theme="dark"] #play { background: var(--p2); color: #2a1918; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #play { background: var(--p2); color: #2a1918; } }
.yr { font-size: 30px; min-width: 120px; font-variant-numeric: lining-nums tabular-nums; }
.era { display: flex; align-items: center; gap: 7px; font-size: 18px; }
.era small { color: var(--muted); font-size: 15px; font-variant-numeric: lining-nums; }
.standing { color: var(--muted); font-size: 15px; }
.seg { display: inline-flex; margin-left: auto; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 4px 12px; font-size: 15px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--ink); }
.slider { position: relative; height: 60px; margin-top: 10px; }
.bands { position: absolute; left: 0; right: 0; top: 8px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.bands span { position: absolute; top: 0; height: 100%; }
#year { position: absolute; inset: 0 0 auto 0; width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
#year::-webkit-slider-runnable-track { height: 26px; background: transparent; }
#year::-moz-range-track { height: 26px; background: transparent; }
#year::-webkit-slider-thumb { -webkit-appearance: none; width: 6px; height: 26px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
#year::-moz-range-thumb { width: 6px; height: 26px; border: 0; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.ticks { position: absolute; left: 0; right: 0; top: 23px; height: 36px; font-size: 13px; color: var(--muted); }
.ticks button { position: absolute; transform: translateX(-50%); white-space: nowrap; background: none; border: 0; padding: 0 2px;
                color: inherit; font-size: 13px; cursor: pointer; line-height: 1.3; font-variant-numeric: lining-nums; }
.ticks button::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: var(--p3); }
.ticks button.r2 { top: 15px; }
.ticks button.r2::before { top: -20px; height: 19px; }
.ticks button.end { transform: translateX(calc(-100% + 8px)); }
.ticks button.end::before { left: calc(100% - 8px); }
.ticks button.on { color: var(--ink); }
.ticks b { font-weight: 500; color: var(--ink); margin-left: 3px; }

/* popup card (Google-maps-like place card) */
.maplibregl-popup-content { padding: 0; border-radius: 8px; overflow: hidden; width: 320px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-family: inherit; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.maplibregl-popup-close-button { z-index: 1; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: rgba(0, 0, 0, .5); font-size: 20px; line-height: 26px; }
.maplibregl-popup-close-button:hover { background: rgba(0, 0, 0, .7); }
.pc .ph { display: block; width: 100%; height: 170px; object-fit: cover; background: var(--surface-2); }
.pc .noph { height: 96px; display: grid; place-items: center; color: var(--muted); font-size: 15px;
            background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); }
.pc .body { padding: 12px 16px 14px; font-size: 16px; line-height: 1.4; }
.pc h3 { margin: 0 0 2px; font-size: 21px; line-height: 1.2; }
.pc .sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.pc .chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px 1px 7px; border-radius: 999px; background: var(--surface-2); font-size: 14px; margin-bottom: 8px; }
.pc .chip .ico { width: 16px; height: 16px; }
.pc .desc { margin: 0 0 10px; }
.pc .erabox { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; margin-bottom: 8px; font-size: 15px; }
.pc .e1 { display: flex; align-items: center; gap: 6px; }
.pc .e2 { color: var(--muted); }
.pc .status { margin-bottom: 8px; padding: 4px 8px; border-radius: 6px; font-size: 14px; background: #f6dcd6; color: #6b1d12; }
.pc .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pc .actions a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; }
.pc .actions a:hover { background: var(--surface-2); }
.pc .credit { margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.maplibregl-map { font-family: "EB Garamond", Garamond, serif; }
.maplibregl-ctrl-attrib { font-family: system-ui, sans-serif; }

/* ---------- 4. Footer ---------- */
.footer { position: relative; z-index: 3; background: var(--hero-bg); color: var(--hero-ink); padding: 56px 20px 64px; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.footer h2 { margin: 0 0 10px; font-size: 24px; color: var(--hero-ink); }
.footer ul { margin: 0; padding-left: 18px; color: var(--hero-muted); font-size: 16px; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--hero-ink); }
.credit-line { max-width: 1100px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid rgba(197, 194, 194, .25);
               display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.credit-line p { margin: 0; font-size: 19px; color: var(--hero-ink); }
.social { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; font-size: 17px; }
.social a { color: var(--hero-muted); text-decoration-color: rgba(197, 194, 194, .5); }
.social a:hover { color: var(--hero-ink); }

/* ---------- Mobile: full-width sticky map, translucent cards ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .mapframe { left: 0; border-left: 0; }
  .step { width: 100%; padding: 10vh 16px; }
  .step:first-child { padding-top: 55vh; }
  .card { opacity: .6; padding: 18px 18px 16px;
          background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .card h2 { font-size: 24px; }
  .card p { font-size: 16px; line-height: 1.5; }
  .yearbadge { top: 12px; left: 12px; font-size: 17px; }
  .story-legend { width: auto; max-width: calc(100% - 24px); max-height: 50svh; }
  .story-legend details.sec:not([open]) { padding-bottom: 6px; }
  .pc .ph { height: 120px; }
  .explore .maplibregl-ctrl-bottom-left { margin-bottom: 218px; }
  .maplibregl-popup-content { width: 300px; }
  .panel { top: 12px; left: 12px; right: 12px; width: auto; max-height: 34vh; }
  .panel details.sec:not([open]) { padding-bottom: 6px; }
  .explore-hint { top: auto; bottom: 228px; }
  .timebar { bottom: 12px; padding: 8px 12px 4px; }
  .tb-top { gap: 8px 10px; }
  .yr { font-size: 22px; min-width: 0; }
  .era { font-size: 16px; }
  .seg { margin-left: 0; }
  .ticks button:not(.on) { font-size: 0; padding: 0; }   /* too many labels for a phone: show the active era only */
  .ticks button.on { font-size: 13px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .essay { display: flex; flex-direction: column; gap: 22px; padding: 8vh 20px; }
  .essay-fig { order: -1; }
  .essay-fig img { max-height: 60svh; }
  .essay-left .essay-fig figcaption { text-align: left; }
  .essay-mark { order: -2; font-size: 56px; margin: 0 0 -10px; opacity: .55; }
  .essay-body { position: relative; }
  .cats-list { grid-template-columns: 1fr; }
}

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