@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/spacegrotesk-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/spacemono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/spacemono-700.woff2') format('woff2');
}

:root {
  --grot: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ground: #05070a;
  --ink: #ece6da;
  --ink-soft: rgba(236, 230, 218, 0.74);
  --ink-faint: rgba(236, 230, 218, 0.5);
  --line: rgba(236, 230, 218, 0.16);
  --gold: #d8ae5c;
  --tip: rgba(8, 10, 14, 0.94);
  --edge-x: 34px;
  --edge-y: 26px;
  --chart-h: 196px;
  --legend-w: 236px;
}

* { box-sizing: border-box; }

/* no border, outline or radius on any control — docs/paris-mobile.md */
button {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  outline: none;
}
/* keyboard focus still shows: a gold bar under the control, no frame */
button:focus-visible { box-shadow: 0 2px 0 0 var(--gold); }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ground);
  color: var(--ink);
  font: 400 14px/1.45 var(--grot);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* touch-action: none — app.js owns orbit/pan/pinch, never a browser gesture */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---- title and clock ---- */

#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: var(--edge-y) var(--edge-x);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 11px;
  font: 400 13px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.city-name {
  margin: 0;
  font: 600 clamp(27px, 2.45vw, 35px)/0.96 var(--grot);
  letter-spacing: -0.026em;
  color: var(--ink);
}

.clock { text-align: right; }

#year {
  display: block;
  font-size: 56px;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: var(--ink);
}

#built {
  display: block;
  margin-top: 9px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---- legend: text on the scene, a scrim instead of a plate ---- */

#legend {
  position: fixed;
  top: 136px;
  right: var(--edge-x);
  width: var(--legend-w);
  max-height: calc(100vh - 136px - var(--chart-h) - 12px);
  overflow-y: auto;
  scrollbar-width: none;
}
#legend::-webkit-scrollbar { display: none; }

body::after {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: calc(var(--legend-w) + var(--edge-x) + 120px);
  background: linear-gradient(to left, rgba(5, 7, 10, 0.86) 55%, rgba(5, 7, 10, 0));
  pointer-events: none;
  z-index: 0;
}
#topbar, #legend, #timeline { z-index: 2; }

.modes { display: none; }

/* phone-only controls (styles.css phone block near the end turns them on) */
.legend-toggle, .legend-close, .found-close { display: none; }

#legend h2 {
  margin: 22px 0 12px;
  font: 600 13px/1 var(--grot);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#legend ul { list-style: none; margin: 0; padding: 0; }

#legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  column-gap: 11px;
  align-items: baseline;
  padding: 6px 0 5px;
  cursor: pointer;
}
#legend li .sw { width: 10px; height: 10px; align-self: center; }
#legend li .lab { font: 500 14px/1.25 var(--grot); color: var(--ink); }
#legend li .span {
  grid-column: 2;
  font: 400 12px/1.3 var(--mono);
  color: var(--ink-faint);
}
#legend li .cnt {
  grid-column: 3;
  grid-row: 1;
  font: 400 13px/1.25 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
#legend li:hover .lab { color: #fff; }
#legend li.is-off .lab,
#legend li.is-off .cnt { color: var(--ink-faint); }
#legend li.is-off .sw { opacity: 0.22; }
#legend li.is-off .bar { opacity: 0.25; }

.note {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font: 400 12.5px/1.55 var(--grot);
  color: var(--ink-faint);
}
.note b { color: var(--ink-soft); font-weight: 500; }

/* ---- chips: words, no plates; chosen is gold and bold ---- */

#legend .toggles { display: flex; gap: 18px; margin: 0 0 16px; }

.tog,
.about-btn,
.about-close,
.legend-toggle,
.transport button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: 500 13.5px/1 var(--grot);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}
.tog:hover,
.about-btn:hover,
.about-close:hover,
.legend-toggle:hover,
.transport button:hover { color: var(--ink); }
.legend-toggle[aria-expanded="true"] { color: var(--gold); font-weight: 700; }
.tog.is-on { color: var(--gold); font-weight: 700; }

/* top-centre switch: fixed on desktop so brand/clock widths cannot push it
   off centre; a real grid item on phone, in the header's own empty cell */
#color-switch {
  position: fixed;
  top: var(--edge-y);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 18px;
  pointer-events: auto;
}

#legend.tight li { padding: 3px 0 2px; }
#legend.tight li .lab { font-size: 13px; line-height: 1.15; }
#legend.tight li .span { line-height: 1.15; }
#legend.tight h2 { margin: 14px 0 8px; }
#legend.tighter .note { display: none; }

/* ---- timeline ---- */

#timeline {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--chart-h);
  display: flex;
  align-items: stretch;
  gap: 22px;
  padding: 14px var(--edge-x) 18px;
  background: linear-gradient(to top, rgba(5, 7, 10, 0.86) 0%, rgba(5, 7, 10, 0.6) 45%, rgba(5, 7, 10, 0) 100%);
}

.transport {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  width: 56px;
}
.transport button { text-align: left; font-size: 15px; letter-spacing: 0; }

.chart-wrap { position: relative; flex: 1; }

#chart, #playhead { position: absolute; inset: 0; width: 100%; height: 100%; }
/* touch-action: none — a drag here is a handle or the map passed through, never a scroll */
#chart { cursor: default; touch-action: none; }
#playhead { pointer-events: none; }

/* ---- tooltips ---- */

#tip,
#hover {
  padding: 10px 13px 11px;
  background: var(--tip);
  color: var(--ink);
  font: 400 13.5px/1.45 var(--grot);
  pointer-events: none;
}
#tip b,
#hover b {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
}
#tip i,
#hover i { font-style: normal; color: var(--ink-faint); }
#tip em,
#hover em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-faint);
}

#tip {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 3;
}
#tip.is-on { opacity: 1; }

#hover {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  max-width: 300px;
  will-change: transform;
}
#hover[hidden] { display: none !important; }
#hover .hover-photo-wrap { margin-top: 8px; }
#hover .hover-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(274px, 100%);
  max-height: 160px;
}
/* two lines max, with an ellipsis: a safety net on the author field's length */
#hover .hover-credit {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---- the street pulled out of the city ---- */

#street-plate {
  position: fixed;
  left: 50%;
  top: 104px;
  transform: translateX(-50%);
  font: 600 28px/1.1 var(--grot);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 0 2px 22px rgba(5, 7, 10, 0.9);
  pointer-events: none;
  opacity: 1;
  transition: opacity 260ms ease;
  z-index: 3;
}
#street-plate[hidden] { display: block !important; opacity: 0; }

/* ---- loader ---- */

#loader {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: var(--ground);
  transition: opacity 0.5s;
}
#loader.is-gone { opacity: 0; pointer-events: none; }
/* the Eiffel Tower rises dot by dot as the city loads; dots in the Belle Epoque colour */
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tower-box { position: relative; width: min(30vw, 34vh); aspect-ratio: 220 / 350; }
.tower-box svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.tower-box .ground-line { stroke: var(--ink-faint); stroke-width: 1; }
.tower-box .dot-ghost { fill: var(--ink); opacity: 0.14; }
.tower-box .dot-built { fill: #f8dca0; }
.tower-box .row { transform-box: fill-box; transform-origin: center bottom; }
.tower-box .row.pop { animation: tower-settle 0.4s ease-out both; }
@keyframes tower-settle { from { transform: scale(0.4); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }
.tower-count { margin: 0; font: 700 clamp(24px, 3.6vw, 40px)/1 var(--mono); color: var(--ink); }
.tower-caption { margin: 0; font: 13px/1.3 var(--grot); color: var(--ink-soft); text-align: center; }

@media (max-width: 1100px) {
  #legend, body::after { display: none; }
  #year { font-size: 42px; }
}

/* ---- about ---- */

.relief-note {
  margin: 12px 0 0;
  font: 400 14px/1.45 var(--grot);
  color: var(--ink-soft);
}

.about-btn {
  margin-top: 40px;
  padding: 0;
  pointer-events: auto;
  font: 500 14px/1.3 var(--grot);
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.about {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 30;
  width: min(470px, 92vw);
  padding: var(--edge-y) var(--edge-x) 40px;
  overflow-y: auto;
  background: rgba(5, 7, 10, 0.97);
  color: var(--ink-soft);
  opacity: 0;
  transform: translateX(-14px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 230, 218, 0.2) transparent;
}
.about.is-open { opacity: 1; transform: none; pointer-events: auto; }
.about-close { position: absolute; top: var(--edge-y); right: var(--edge-x); font-size: 12.5px; }
.about h2 {
  margin: 0 0 26px;
  font: 600 27px/1.05 var(--grot);
  letter-spacing: -0.024em;
  color: var(--ink);
}
.about h3 {
  margin: 26px 0 9px;
  font: 600 13px/1 var(--grot);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.about p, .about li { font: 400 15px/1.55 var(--grot); margin: 0 0 10px; }
.about b { color: var(--ink); font-weight: 600; }
.about ul { list-style: none; margin: 0; padding: 0; }
.about li { padding-left: 14px; position: relative; }
.about li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 1px; background: var(--ink-faint); }
.about .credit { margin-top: 30px; font: 400 12.5px/1.4 var(--mono); color: var(--ink-faint); }

/* ---- era plates over the timeline ---- */

.eras { position: absolute; left: 0; top: 0; right: 0; height: 0; pointer-events: none; z-index: 2; }
.era-plate {
  position: absolute;
  left: 0; top: 0;
  padding: 3px 7px 4px;
  white-space: nowrap;
  font: 600 12.5px/1.2 var(--grot);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.era-plate.is-on { opacity: 1; }
.era-plate .num { font-weight: 400; font-size: 12px; margin-left: 3px; opacity: 0.85; }

/* thin bars in the legend: the period's whole size dim, what stands so far bright */
#legend li .bar {
  grid-column: 2 / 4;
  position: relative;
  display: block;
  height: 3px;
  margin-top: 5px;
}
#legend li .bar i,
#legend li .bar b {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  transform-origin: 0 0;
}
#legend li .bar i { opacity: 0.25; }
#legend li .bar b { transition: transform 0.2s linear; }
#legend.tight li .bar { margin-top: 3px; height: 2px; }

#street-plate small {
  display: block;
  margin-top: 6px;
  font: 400 14px/1.3 var(--grot);
  letter-spacing: 0;
  color: var(--ink-faint);
}

/* names of known buildings on a street that is out of the city */
.street-labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 0.35s ease; }
.street-labels.is-on { opacity: 1; }
.street-label {
  position: absolute;
  left: 0; top: 0;
  margin: -24px 0 0 0;
  padding: 3px 7px 4px;
  white-space: nowrap;
  font: 600 12.5px/1.2 var(--grot);
  color: #05070a;
  background: var(--gold);
  translate: -50% 0;
}

.street-label.is-below { margin: 24px 0 0 0; }

.street-num {
  position: absolute;
  left: 0; top: 0;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  translate: -50% 0;
}

/* ---- a dark band behind the title block, so it reads over a busy map ---- */

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 300px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 7, 10, 0.86) 0%, rgba(5, 7, 10, 0.6) 45%, rgba(5, 7, 10, 0) 100%);
}

/* ---- search ---- */

.find {
  position: relative;
  width: 300px;
  margin-top: 20px;
  pointer-events: auto;
}
.find input {
  width: 100%;
  padding: 6px 24px 6px 1px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font: 500 15px/1.3 var(--grot);
  letter-spacing: -0.01em;
  transition: border-color 0.2s;
}
.find input:focus { border-bottom-color: rgba(216, 174, 92, 0.7); }
.find input::placeholder { color: var(--ink-faint); font-weight: 400; }
.find-x {
  position: absolute;
  right: 0;
  top: 3px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: 400 19px/1 var(--grot);
  cursor: pointer;
}
.find-x:hover { color: var(--ink); }
.find-x[hidden] { display: none; }
.find-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  margin-top: 2px;
  padding: 6px 0 8px;
  max-height: 50vh;
  overflow-y: auto;
  background: var(--ground);
}
.find-list[hidden] { display: none; }
.find-opt {
  display: block;
  width: 100%;
  padding: 6px 1px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--ink-soft);
  font: 500 14px/1.3 var(--grot);
}
.find-opt small {
  margin-left: 7px;
  color: var(--ink-faint);
  font: 400 12.5px/1.3 var(--grot);
}
.find-opt:hover,
.find-opt[aria-selected="true"] { color: var(--ink); }
.find-opt[aria-selected="true"] { font-weight: 700; }
.find-none {
  padding: 6px 1px;
  color: var(--ink-faint);
  font: 400 13.5px/1.3 var(--grot);
}

/* street and building names on the map, and in the panorama */
#map-labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.map-label {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  will-change: transform;
  font: 500 12.5px/1 var(--grot);
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-shadow: 0 0 2px #05070a, 0 0 6px #05070a, 0 0 12px rgba(5, 7, 10, 0.9);
}
.map-label.is-place { font-weight: 600; font-size: 13px; color: var(--ink); }
.map-label.is-num { font: 400 12px/1 var(--mono); }
/* lighter than the base halo, which blotted out buildings underneath; fades
   while the camera moves on its own, class-driven, not a per-frame write */
.map-label.is-street {
  text-shadow: 0 0 4px rgba(5, 7, 10, 0.75);
  transition: opacity 0.3s ease;
}
body.cam-moving .map-label.is-street { opacity: 0; }

/* the easter egg plays over a bare panorama */
body.game-on :is(#topbar, #legend, #timeline, .pano-bar, #found, #hover) { display: none !important; }

.pano-bar {
  position: fixed;
  top: var(--edge-y);
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 18px;
  translate: -50% 0;
  font: 400 13px/1.3 var(--grot);
  color: var(--ink-soft);
  text-shadow: 0 0 6px #05070a;
}
.pano-bar[hidden] { display: none; }
.pano-bar button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 500 14px/1.3 var(--grot);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* the found building's name, over its tallest piece */
#found {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 35;
  pointer-events: none;
  will-change: transform;
}
#found[hidden] { display: none; }
#found::after {
  content: "";
  position: absolute;
  left: -0.5px;
  bottom: 0;
  width: 1px;
  height: 28px;
  background: var(--gold);
}
#found .plate {
  position: absolute;
  left: 0;
  bottom: 28px;
  width: max-content;
  max-width: 300px;
  padding: 10px 13px 11px;
  translate: -50% 0;
  background: var(--tip);
  color: var(--ink);
  font: 400 13.5px/1.45 var(--grot);
}
#found.is-side::after { left: 0; bottom: auto; top: -0.5px; width: var(--stem, 28px); height: 1px; }
#found.is-side.is-left::after { left: calc(-1 * var(--stem, 28px)); }
#found.is-side .plate { left: var(--stem, 28px); bottom: auto; top: var(--dy, -20px); translate: 0 0; }
#found.is-side.is-left .plate { left: auto; right: var(--stem, 28px); }
#found .plate b {
  display: block;
  margin-bottom: 3px;
  color: var(--gold);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
}
#found .plate i { font-style: normal; color: var(--ink-faint); }
#found .plate { pointer-events: auto; }
#found .found-go {
  display: block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 500 13.5px/1.3 var(--grot);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
#found .plate em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* Wikipedia extract, photo, credit and link: a selected building's plate,
   and (#hover) the street row's full hover card — docs/paris-decisions.md */
#found .wiki-extract,
#hover .wiki-extract {
  margin: 8px 0 0;
  font: 400 13px/1.5 var(--grot);
  color: var(--ink);
}
#found .wiki-photo-wrap,
#hover .wiki-photo-wrap { margin-top: 8px; }
#found .wiki-photo,
#hover .wiki-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(280px, 100%);
  max-height: 160px;
}
/* two lines max, with an ellipsis: a safety net on the author field's length */
#found .wiki-credit,
#hover .wiki-credit {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-faint);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
#found .wiki-credit a,
#hover .wiki-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#found .wiki-link,
#hover .wiki-link {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font: 500 13.5px/1.3 var(--grot);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- phone layout: patterns and reasoning in docs/paris-mobile.md ---- */
@media (max-width: 620px) {
  :root {
    --edge-x: 16px;
    --edge-y: 14px;
    --chart-h: calc(144px + env(safe-area-inset-bottom, 0px));
  }

  /* ---- head: split corners — name/year corners, About right, search below (docs/paris-mobile.md) */
  .brand { display: contents; }
  #topbar {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "name   switch clock"
      "search search search"
      ".      .      about";
    align-items: start;
    column-gap: 10px;
    row-gap: 14px;
    padding: calc(var(--edge-y) + env(safe-area-inset-top, 0px)) var(--edge-x) 10px;
  }
  .eyebrow { margin-bottom: 6px; font-size: 12px; }
  .city-name { grid-area: name; font-size: 20px; }
  .relief-note { display: none; }
  .find { grid-area: search; width: 100%; min-width: 0; margin: 0; }
  .find-list { max-height: 45vh; }
  .legend-toggle, .about-btn { margin: 0; }
  .legend-toggle { pointer-events: auto; }
  .about-btn { grid-area: about; justify-self: end; }
  /* a real grid item here, not fixed, so it sits in the header's own free cell */
  #color-switch {
    position: static;
    grid-area: switch;
    transform: none;
    align-self: center;
    justify-self: center;
    gap: 10px;
  }

  .clock { grid-area: clock; position: static; text-align: right; }
  #year { font-size: 24px; }
  #built { display: none; }

  /* the title scrim matches the three-row head above */
  body::before { height: 168px; }

  /* ---- legend: a toggled panel pinned above the timeline, not a rail ---- */
  #legend {
    /* the existing (max-width: 1100px) rule above turns this off; a phone shows it again */
    display: block;
    top: auto;
    left: 0;
    right: 0;
    bottom: var(--chart-h);
    width: auto;
    max-height: min(60vh, calc(100vh - 210px));
    margin: 0;
    padding: 44px 16px 16px;
    background: var(--tip);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
  }
  #legend.is-open { transform: translateY(0); visibility: visible; }
  .legend-close {
    display: block;
    position: absolute;
    top: 6px;
    right: 10px;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font: 400 24px/1 var(--grot);
    cursor: pointer;
  }
  .legend-close:hover { color: var(--ink); }
  #legend h2 { margin-top: 0; }
  #legend li { padding: 11px 0 10px; }

  /* ---- timeline: full width, play/reset float above it — docs/paris-mobile.md ---- */
  #timeline {
    height: var(--chart-h);
    padding: 10px var(--edge-x) calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .transport {
    position: fixed;
    left: var(--edge-x);
    bottom: calc(var(--chart-h) + 10px);
    z-index: 3;
    flex-direction: row;
    width: auto;
    gap: 14px;
  }
  .transport button { padding: 6px 8px; font-size: 20px; }
  /* legend sheet open: hidden rather than drawn under it (contrails' sky-foot idiom) */
  #legend.is-open ~ #timeline .transport { display: none; }

  /* Periods: moved out of the header, next to the timeline (docs/paris-mobile.md) */
  .legend-toggle {
    display: inline-block;
    position: fixed;
    right: var(--edge-x);
    bottom: calc(var(--chart-h) + 10px);
    z-index: 3;
  }
  body.legend-sheet-open .legend-toggle { display: none; }

  /* ---- found / hover cards: fit a narrow screen, carry their own close ---- */
  #found .plate, #hover { max-width: calc(100vw - 32px); }
  #found .plate { padding-right: 34px; }
  .found-close {
    display: block;
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font: 400 22px/1 var(--grot);
    cursor: pointer;
  }
  .found-close:hover { color: var(--ink); }

  /* the street elevation plate, clear of the taller stacked head */
  #street-plate { top: calc(150px + env(safe-area-inset-top, 0px)); font-size: 20px; }

  /* ---- about: clear of the notch and the home indicator ---- */
  .about {
    width: 100vw;
    padding: calc(var(--edge-y) + env(safe-area-inset-top, 0px)) var(--edge-x)
      calc(40px + env(safe-area-inset-bottom, 0px));
  }
  .about-close { top: calc(var(--edge-y) + env(safe-area-inset-top, 0px)); }
}
