/* Virtual journey demo. Tokens follow DESIGN.md. */
:root {
  --color-obsidian: #0D0D0D;
  --color-graphite: #252525;
  --color-ivory: #F7F4EE;
  --color-champagne: #D6C3A5;
  --color-platinum: #B8BCC1;
  --color-linen: #F2EDE4;

  --background-dark: var(--color-obsidian);
  --surface-dark: var(--color-graphite);
  --text-inverse: var(--color-ivory);
  --text-primary: var(--color-obsidian);
  --text-muted-inverse: rgba(247, 244, 238, 0.68);
  --accent-primary: var(--color-champagne);
  --border-subtle-inverse: rgba(247, 244, 238, 0.16);
  --border-strong: var(--color-platinum);
  --focus-ring-inverse: var(--color-champagne);
  --glass: rgba(13, 13, 13, 0.78);

  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-body: "Inter", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-h1: clamp(2.75rem, 1.6rem + 4.6vw, 6rem);
  --text-h2: clamp(2.25rem, 1.6rem + 2.6vw, 4rem);
  --text-h3: clamp(1.625rem, 1.4rem + 0.9vw, 2.25rem);
  --text-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  --text-small: 0.875rem;
  --text-eyebrow: 0.75rem;

  --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --radius-sm: 2px; --radius-md: 4px; --radius-lg: 8px;
  --ease-luxe: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms; --duration-base: 400ms; --duration-slow: 800ms; --duration-cinematic: 1600ms;

  --top-h: 76px;
  --dock-h: 92px;
  --card-w: min(400px, 32vw);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--background-dark);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring-inverse); outline-offset: 3px; }

.eyebrow {
  margin: 0;
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--accent-primary);
}

/* ---------- Map and atmosphere ---------- */
#map { position: fixed; inset: 0; background: #1A201E; }
/* The hidden scout map that loads tiles ahead of the camera */
.scout { position: fixed; inset: 0; z-index: -1; visibility: hidden; pointer-events: none; }
/* Edge scrims only where text sits; full-screen overlays above WebGL cost frames */
.scrim { position: fixed; left: 0; right: 0; pointer-events: none; }
.scrim-top { top: 0; height: 150px; background: linear-gradient(to bottom, rgba(13, 13, 13, 0.62), rgba(13, 13, 13, 0)); }
.scrim-bottom { bottom: 0; height: 240px; background: linear-gradient(to top, rgba(13, 13, 13, 0.82), rgba(13, 13, 13, 0)); }

.maplibregl-ctrl-attrib { font-family: var(--font-body); font-size: 10px; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--dock-h) + 4px); }
.maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(13, 13, 13, 0.6); color: var(--text-muted-inverse); }
.maplibregl-ctrl-attrib a { color: var(--text-muted-inverse); }
.maplibregl-ctrl-attrib-button { filter: invert(1); opacity: 0.7; }

/* ---------- Top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  height: var(--top-h);
  display: flex; align-items: center; gap: var(--space-5);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text-inverse); }
.brand-mark { width: 30px; height: 26px; color: var(--accent-primary); }
.brand-word { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.22em; }
.top-name {
  margin: 0 auto 0 var(--space-5);
  padding-left: var(--space-5);
  border-left: 1px solid var(--border-subtle-inverse);
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-display); font-size: 1.25rem; line-height: 1.1;
}
.top-name .eyebrow { font-family: var(--font-body); font-size: 0.6875rem; }
.top-actions { display: flex; gap: var(--space-2); margin-left: auto; }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border-subtle-inverse);
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.4);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-luxe), border-color var(--duration-fast) var(--ease-luxe), color var(--duration-fast) var(--ease-luxe);
}
.icon-btn:hover { background: var(--color-ivory); color: var(--text-primary); border-color: var(--color-ivory); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="false"] { color: var(--text-muted-inverse); }
#btn-sound .i-off, #btn-sound[aria-pressed="false"] .i-on { display: none; }
#btn-sound[aria-pressed="false"] .i-off { display: block; }
.icon-btn-main { width: 52px; height: 52px; border-color: rgba(247, 244, 238, 0.4); }
/* Close: solid, so the way back is always the easiest thing to find */
.icon-btn-close { margin-inline-start: var(--space-2); background: var(--color-obsidian); border-color: rgba(247, 244, 238, 0.45); color: var(--color-ivory); }
.icon-btn-close svg { stroke-width: 1.5; }
#btn-play .i-play, #btn-play.is-paused .i-pause { display: none; }
#btn-play.is-paused .i-play { display: block; }

/* ---------- Clock ---------- */
.clock {
  position: fixed; z-index: 10;
  left: var(--gutter); top: calc(var(--top-h) + var(--space-5));
  display: flex; flex-direction: column; gap: 0.25rem;
  pointer-events: none;
  opacity: 0; transition: opacity var(--duration-slow) var(--ease-luxe);
}
.is-running .clock { opacity: 1; }
.clock-time {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(3rem, 2rem + 3vw, 5.25rem); line-height: 0.9;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
}
.clock-place { font-size: var(--text-small); color: var(--text-muted-inverse); letter-spacing: 0.02em; max-width: 28ch; }

/* ---------- Story card ---------- */
.card {
  position: fixed; z-index: 12;
  right: var(--gutter); top: calc(var(--top-h) + var(--space-3));
  width: var(--card-w);
  max-height: calc(100svh - var(--top-h) - var(--dock-h) - var(--space-6));
  display: flex; flex-direction: column;
  background: rgba(13, 13, 13, 0.88);
  border: 1px solid var(--border-subtle-inverse);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0; transform: translateX(16px); pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-luxe), transform var(--duration-slow) var(--ease-luxe);
}
.card.is-open { opacity: 1; transform: none; pointer-events: auto; }
.card-media { position: relative; aspect-ratio: 16 / 9; flex: none; overflow: hidden; background: var(--surface-dark); }
.card-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s var(--ease-in-out);
}
.card-img.is-on { opacity: 1; animation: drift 10s linear both; }
.card-video.is-on { animation: none; }
@keyframes drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1%, -0.6%); } }
.card-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, rgba(13, 13, 13, 0.7), rgba(13, 13, 13, 0));
  pointer-events: none;
}
.card-segs { position: absolute; z-index: 1; left: var(--space-4); right: var(--space-4); top: var(--space-3); display: flex; gap: 4px; }
.card-segs span { flex: 1; height: 1px; background: rgba(247, 244, 238, 0.35); }
.card-segs span.is-on { background: var(--color-ivory); }
.card-credit {
  position: absolute; z-index: 1; left: var(--space-4); right: var(--space-4); bottom: var(--space-2);
  margin: 0; font-size: 0.6875rem; line-height: 1.3; color: var(--text-muted-inverse);
}
.card-body { padding: var(--space-5); overflow-y: auto; scrollbar-width: thin; }
.card-title { margin: var(--space-2) 0 var(--space-3); font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); line-height: 1.1; }
.card-meta { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-small); color: var(--text-muted-inverse); }
.card-meta li { display: flex; align-items: center; gap: 0.4rem; }
.card-meta li[hidden] { display: none; }
.card-meta svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent-primary); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.card-summary { margin: 0 0 var(--space-4); font-size: 0.9375rem; line-height: 1.6; }
.card-details { list-style: none; margin: 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--border-subtle-inverse); display: grid; gap: var(--space-2); font-size: var(--text-small); color: var(--text-muted-inverse); }
.card-details li { position: relative; padding-left: 1.1rem; }
.card-details li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 5px; height: 5px; border: 1px solid var(--accent-primary); transform: rotate(45deg);
}

/* ---------- Captions ---------- */
.caption {
  position: fixed; z-index: 14;
  left: var(--gutter); right: calc(var(--card-w) + var(--gutter) * 2);
  bottom: calc(var(--dock-h) + var(--space-5));
  display: flex; justify-content: center;
  pointer-events: none;
  opacity: 0; transition: opacity var(--duration-base) var(--ease-luxe);
}
.caption.is-on { opacity: 1; }
.captions-off .caption { display: none; }
.caption p {
  margin: 0; max-width: 54ch;
  padding: 0.6rem 1rem;
  background: rgba(13, 13, 13, 0.66);
  border-radius: var(--radius-sm);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.1875rem); line-height: 1.5; text-align: center;
}
.caption .w { color: rgba(247, 244, 238, 0.5); transition: color 160ms linear; }
.caption .w.is-said { color: var(--color-ivory); }

/* ---------- Chapter title moment ---------- */
.chapter {
  position: fixed; inset: 0; z-index: 20;
  pointer-events: none;
  opacity: 0; transition: opacity 900ms var(--ease-in-out);
  background: var(--background-dark);
}
.chapter.is-on { opacity: 1; }
.chapter-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chapter.is-on .chapter-img { animation: chapter-zoom 6s linear both; }
#chapter-video { animation: none; }
@keyframes chapter-zoom { from { transform: scale(1.0); } to { transform: scale(1.05); } }
.chapter::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(13, 13, 13, 0.6), rgba(13, 13, 13, 0) 18%),
    linear-gradient(to top right, rgba(13, 13, 13, 0.82), rgba(13, 13, 13, 0.2) 55%, rgba(13, 13, 13, 0.05));
}
.chapter-text {
  position: absolute; z-index: 1;
  left: var(--gutter); bottom: calc(var(--dock-h) + var(--space-7));
  max-width: min(58rem, 70vw);
}
.chapter-title {
  margin: var(--space-3) 0 var(--space-3);
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-h1); line-height: 0.98; letter-spacing: -0.01em;
}
.chapter-sub { margin: 0; color: var(--text-muted-inverse); font-size: var(--text-lead); }
.chapter.is-on .chapter-text > * { animation: rise 1.1s var(--ease-luxe) both; }
.chapter.is-on .chapter-title { animation-delay: 120ms; }
.chapter.is-on .chapter-sub { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Dock: controls and the day ruler ---------- */
.dock {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
  height: var(--dock-h);
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  display: flex; align-items: center; gap: var(--space-6);
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--duration-slow) var(--ease-luxe), transform var(--duration-slow) var(--ease-luxe);
}
.is-running .dock { opacity: 1; transform: none; }
.controls { display: flex; align-items: center; gap: var(--space-3); }

.ruler { position: relative; flex: 1; height: 56px; }
.ruler-track { position: absolute; left: 0; right: 0; top: 22px; height: 1px; background: rgba(247, 244, 238, 0.22); }
.ruler-done { position: absolute; left: 0; top: 0; height: 1px; width: 0; background: var(--accent-primary); }
.ruler-marks { position: absolute; inset: 0; }
.ruler-seg { position: absolute; top: 21px; height: 3px; background: rgba(247, 244, 238, 0.32); }
.ruler-mark {
  position: absolute; top: 2px;
  width: 40px; height: 40px; margin-left: -20px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.ruler-mark i {
  width: 9px; height: 9px; transform: rotate(45deg);
  border: 1px solid var(--color-ivory); background: var(--color-obsidian);
  transition: background var(--duration-fast) var(--ease-luxe), border-color var(--duration-fast) var(--ease-luxe), transform var(--duration-base) var(--ease-luxe);
}
.ruler-mark.is-past i { background: var(--accent-primary); border-color: var(--accent-primary); }
.ruler-mark.is-now i { transform: rotate(45deg) scale(1.45); background: var(--color-ivory); }
.ruler-mark:hover i, .ruler-mark:focus-visible i { background: var(--color-ivory); }
.ruler-mark .tip {
  position: absolute; bottom: 44px; left: 50%; transform: translate(-50%, 4px);
  white-space: nowrap; padding: 0.45rem 0.7rem;
  background: var(--color-ivory); color: var(--text-primary);
  border-radius: var(--radius-sm); font-size: 0.8125rem; line-height: 1.3;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-luxe), transform var(--duration-fast) var(--ease-luxe);
}
.ruler-mark .tip b { font-weight: 500; margin-right: 0.4rem; }
.ruler-mark:hover .tip, .ruler-mark:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.ruler-mark:first-child .tip { left: 0; transform: translate(-12px, 4px); }
.ruler-mark:first-child:hover .tip, .ruler-mark:first-child:focus-visible .tip { transform: translate(-12px, 0); }
.ruler-needle {
  position: absolute; top: 13px; width: 1px; height: 19px; margin-left: -0.5px;
  background: var(--accent-primary); pointer-events: none;
}
.ruler-hours { position: absolute; left: 0; right: 0; top: 36px; height: 16px; font-size: 0.6875rem; color: var(--text-muted-inverse); font-variant-numeric: tabular-nums; }
.ruler-hours span { position: absolute; transform: translateX(-50%); }
.ruler-hours span:first-child { transform: none; }
.ruler-hours span:last-child { transform: translateX(-100%); }

/* ---------- Map pins and popups ---------- */
.pop .maplibregl-popup-content {
  padding: 0.75rem 0.9rem;
  background: rgba(13, 13, 13, 0.86);
  color: var(--text-inverse);
  border: 1px solid var(--border-subtle-inverse);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(13, 13, 13, 0.25);
  font-family: var(--font-body);
  animation: pop-in 700ms var(--ease-luxe) both;
}
.pop.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: rgba(13, 13, 13, 0.86); }
.pop.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: rgba(13, 13, 13, 0.86); }
.pop.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: rgba(13, 13, 13, 0.86); }
.pop.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: rgba(13, 13, 13, 0.86); }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pop-row { display: flex; gap: 0.75rem; align-items: center; }
.pop-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.pop-time { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-primary); }
.pop-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.1; margin: 2px 0; }
.pop-len { font-size: 0.75rem; color: var(--text-muted-inverse); }
.pop-poi .maplibregl-popup-content { padding: 0.5rem 0.7rem; }
.pop-poi .pop-title { font-size: 1.0625rem; }

.vehicle-fallback {
  width: 18px; height: 18px; transform: rotate(45deg);
  background: var(--color-ivory); border: 1px solid var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(214, 195, 165, 0.25), 0 0 24px rgba(214, 195, 165, 0.8);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px;
  border-radius: var(--radius-md);
  font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.02em; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background var(--duration-fast) var(--ease-luxe), color var(--duration-fast) var(--ease-luxe), border-color var(--duration-fast) var(--ease-luxe);
}
.btn-light { background: var(--color-ivory); color: var(--text-primary); border: 1px solid var(--color-ivory); }
.btn-light:hover:not(:disabled) { background: var(--color-champagne); border-color: var(--color-champagne); }
.btn-light:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text-inverse); border: 1px solid var(--color-ivory); }
.btn-ghost:hover { background: var(--color-ivory); color: var(--text-primary); }
.btn-premium { background: var(--color-champagne); color: var(--text-primary); border: 1px solid var(--color-champagne); }
.btn-premium:hover { background: var(--color-ivory); border-color: var(--color-ivory); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
  background: var(--background-dark);
  transition: opacity 900ms var(--ease-in-out), visibility 0s linear 900ms;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-gem { width: 88px; height: 77px; overflow: visible; margin-bottom: var(--space-2); }
.loader-lines path {
  stroke: rgba(214, 195, 165, 0.6); stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: gem-draw 1.4s var(--ease-luxe) forwards;
}
.loader-lines path:nth-child(2) { animation-delay: 0.25s; }
.loader-lines path:nth-child(3) { animation-delay: 0.4s; }
.loader-lines path:nth-child(4) { animation-delay: 0.55s; }
@keyframes gem-draw { to { stroke-dashoffset: 0; } }
/* A short stroke of light, a seventh of the outline, travelling round it */
.loader-sweep {
  stroke: var(--color-ivory); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 14 86; stroke-dashoffset: 0; opacity: 0;
  animation: gem-sweep 2.6s linear 1.3s infinite, gem-sweep-in 0.8s ease 1.3s forwards;
}
@keyframes gem-sweep { to { stroke-dashoffset: -100; } }
@keyframes gem-sweep-in { to { opacity: 1; } }
.loader-name {
  margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1;
  opacity: 0; animation: rise 1.1s var(--ease-luxe) 0.5s both;
}
.loader-bar { width: 168px; height: 1px; background: rgba(247, 244, 238, 0.14); overflow: hidden; opacity: 0; animation: rise 1.1s var(--ease-luxe) 0.7s both; }
.loader-bar span {
  display: block; height: 100%; background: var(--accent-primary);
  transform: scaleX(var(--p, 0.06)); transform-origin: left center;
  transition: transform 1.1s var(--ease-luxe);
}
[dir="rtl"] .loader-bar span { transform-origin: right center; }
.loader-status {
  margin: 0; min-height: 1.2em;
  font-size: var(--text-eyebrow); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted-inverse);
  opacity: 0; animation: rise 1.1s var(--ease-luxe) 0.8s both;
}

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end;
  padding: calc(var(--top-h) + var(--space-5)) var(--gutter) clamp(2rem, 8vh, 6rem);
  background: linear-gradient(to right, rgba(13, 13, 13, 0.9), rgba(13, 13, 13, 0.62) 42%, rgba(13, 13, 13, 0.08) 80%);
  transition: opacity var(--duration-cinematic) var(--ease-in-out);
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro-inner { max-width: 40rem; }
.intro h1 {
  margin: var(--space-4) 0 var(--space-5);
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-h1); line-height: 0.98; letter-spacing: -0.01em;
}
.intro-lead { margin: 0 0 var(--space-5); max-width: 34rem; font-size: var(--text-lead); line-height: 1.55; color: rgba(247, 244, 238, 0.86); }
.intro-facts { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: flex; flex-wrap: wrap; }
.intro-facts li { padding: 0 var(--space-5); border-left: 1px solid var(--border-subtle-inverse); font-size: var(--text-small); color: var(--text-muted-inverse); }
.intro-facts li:first-child { padding-left: 0; border-left: 0; }
.intro-facts b { display: block; font-weight: 500; color: var(--text-inverse); font-size: 0.9375rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.intro-note { margin: var(--space-4) 0 0; font-size: var(--text-small); color: var(--text-muted-inverse); }
.intro-inner > * { opacity: 0; }
/* The intro rises in once the loader has gone */
.is-ready .intro-inner > * { opacity: 1; animation: rise 1.2s var(--ease-luxe) both; }
.is-ready .intro-inner > :nth-child(2) { animation-delay: 350ms; }
.is-ready .intro-inner > :nth-child(3) { animation-delay: 450ms; }
.is-ready .intro-inner > :nth-child(4) { animation-delay: 550ms; }
.is-ready .intro-inner > :nth-child(5) { animation-delay: 650ms; }
.is-ready .intro-inner > :nth-child(6) { animation-delay: 750ms; }

/* ---------- End ---------- */
.end {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center;
  padding: calc(var(--top-h) + var(--space-5)) var(--gutter) var(--space-7);
  overflow-y: auto;
  background: var(--background-dark);
  animation: fade-in var(--duration-cinematic) var(--ease-in-out) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.end-img { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.end::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(to right, rgba(13, 13, 13, 0.94), rgba(13, 13, 13, 0.72) 50%, rgba(13, 13, 13, 0.3));
}
.end-inner { position: relative; z-index: 1; max-width: 46rem; }
.end h2 { margin: var(--space-4) 0 var(--space-6); font-family: var(--font-display); font-weight: 400; font-size: var(--text-h2); line-height: 1.05; }
.end-list {
  list-style: none; margin: 0 0 var(--space-6); padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-6);
  font-size: 0.9375rem;
}
.end-list li { display: flex; gap: var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle-inverse); }
.end-list time { flex: none; width: 3.2rem; color: var(--text-muted-inverse); font-variant-numeric: tabular-nums; }
.end-price { margin: 0 0 var(--space-5); font-size: var(--text-lead); }
.end-price span { display: block; font-size: var(--text-small); color: var(--text-muted-inverse); }
.end-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Credits ---------- */
.credits {
  width: min(44rem, calc(100vw - 2rem)); max-height: min(80vh, 48rem);
  padding: 0; border: 1px solid var(--border-subtle-inverse); border-radius: var(--radius-lg);
  background: var(--color-obsidian); color: var(--text-inverse);
  box-shadow: 0 12px 40px rgba(13, 13, 13, 0.3);
}
.credits::backdrop { background: rgba(13, 13, 13, 0.6); }
.credits-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle-inverse); }
.credits-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; }
.credits-body { padding: var(--space-5); overflow-y: auto; max-height: calc(min(80vh, 48rem) - 80px); font-size: var(--text-small); color: var(--text-muted-inverse); }
.credits-body h3 { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-eyebrow); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-primary); }
.credits-body h3:first-child { margin-top: 0; }
.credits-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.credits-body a { color: var(--text-inverse); text-underline-offset: 3px; }

.noscript { position: fixed; inset: auto 1rem 1rem; z-index: 50; }

/* ---------- Short screens ---------- */
@media (min-width: 901px) and (max-height: 900px) {
  .card-media { aspect-ratio: 2 / 1; }
  .card-body { padding: 1.25rem 1.5rem; }
  .card-details { display: none; }
}

/* ---------- The site's cookie notice (assets/js/consent.js), as styled in site.css ---------- */
.dt-consent {
  position: fixed; z-index: 65; inset-inline: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  max-width: 26rem; padding: 1.5rem; background: var(--background-dark); color: var(--text-inverse);
  border: 1px solid var(--border-subtle-inverse); border-top-color: var(--accent-primary);
  border-radius: var(--radius-md); box-shadow: 0 12px 40px rgba(13, 13, 13, 0.08);
  opacity: 0; transform: translateY(16px); transition: opacity var(--duration-base) var(--ease-luxe), transform var(--duration-base) var(--ease-luxe);
}
.dt-consent.is-in { opacity: 1; transform: translateY(0); }
.dt-consent-text { margin: 0.75rem 0 0; font-size: var(--text-small); line-height: 1.6; }
.dt-consent-text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--border-subtle-inverse); }
.dt-consent-text a:hover { text-decoration-color: var(--accent-primary); }
.dt-consent-status { margin: 0.75rem 0 0; font-size: var(--text-small); line-height: 1.5; color: var(--text-muted-inverse); }
.dt-consent-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.dt-consent-actions .btn { flex: 1 1 8rem; padding: 0 1.25rem; }
.btn-primary-dark { background: var(--color-ivory); color: var(--text-primary); border: 1px solid var(--color-ivory); }
.btn-primary-dark:hover { background: var(--color-champagne); border-color: var(--color-champagne); }
.btn-secondary-dark { background: transparent; color: var(--text-inverse); border: 1px solid rgba(247, 244, 238, 0.55); }
.btn-secondary-dark:hover { background: var(--color-ivory); color: var(--text-primary); border-color: var(--color-ivory); }
@media (min-width: 768px) { .dt-consent { inset-inline: 1.5rem; bottom: calc(1.5rem + env(safe-area-inset-bottom)); } }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  :root { --card-w: 100vw; --dock-h: 128px; --top-h: 64px; }
  .top-name { display: none; }
  .brand-word { display: none; }
  .clock { top: calc(var(--top-h) + 4px); }
  .clock-time { font-size: 2.75rem; }
  .card {
    left: 0; right: 0; top: auto; bottom: var(--dock-h);
    width: auto; max-height: 40svh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 0; border-right: 0;
    transform: translateY(16px);
    flex-direction: row;
  }
  .card-media { width: 38%; aspect-ratio: auto; }
  .card-body { padding: var(--space-4); }
  .card-title { font-size: 1.5rem; margin: 0.35rem 0 0.5rem; }
  .card-summary { font-size: var(--text-small); margin: 0; }
  .card-details, .card-credit { display: none; }
  .card-meta { margin-bottom: var(--space-2); gap: 0.25rem var(--space-4); }
  .caption { left: var(--space-4); right: var(--space-4); top: calc(var(--top-h) + 92px); bottom: auto; }
  .dock { flex-direction: column; align-items: stretch; justify-content: center; gap: 0.25rem; background: linear-gradient(to top, rgba(13, 13, 13, 0.92), rgba(13, 13, 13, 0.7)); }
  .controls { justify-content: center; }
  .ruler { flex: none; }
  .ruler-mark .tip { display: none; }
  .chapter-text { max-width: none; right: var(--gutter); bottom: calc(var(--dock-h) + var(--space-5)); }
  .intro { align-items: flex-end; background: linear-gradient(to top, rgba(13, 13, 13, 0.94) 30%, rgba(13, 13, 13, 0.45) 75%, rgba(13, 13, 13, 0.2)); }
  .intro-facts li { padding: 0 var(--space-4); }
  .end { align-items: flex-start; }
  .end-list { grid-template-columns: 1fr; }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--dock-h) + 40svh + 4px); }
}
@media (max-width: 480px) {
  .card-media { display: none; }
  .intro-facts { gap: var(--space-2) 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dt-consent, .dt-consent.is-in { transform: none; }
  /* The diamond is simply there, breathing gently, instead of drawing and sweeping */
  .loader-lines path { stroke-dashoffset: 0; animation: none; }
  .loader-sweep { display: none; }
  .loader-gem { animation: gem-breathe 2.4s ease-in-out infinite !important; animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
  @keyframes gem-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 200ms !important; }
  .card-img.is-on, .chapter.is-on .chapter-img { animation: none; }
  .card, .dock { transform: none; }
}
