/* Deutschland Zeitreise — interface. The scene is the hero; the UI stays quiet. */

:root {
  --accent: #f5c56b;
  --ink: #f3f1ec;
  --ink-soft: rgba(243, 241, 236, 0.72);
  --ink-faint: rgba(243, 241, 236, 0.4);
  --hair: rgba(243, 241, 236, 0.22);
  --night: #04060c;
  --scrim: rgba(4, 6, 12, 0.78);
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#ui button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
#ui button:disabled { cursor: default; }
#ui :focus { outline: none; }
#ui :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
#ui [hidden] { display: none !important; }

/* ---------- scrims ---------- */
.scrim { position: absolute; pointer-events: none; transition: opacity 0.9s var(--ease); }
.scrim-left {
  inset: 0 auto 0 0;
  width: 62%;
  background: linear-gradient(90deg, rgba(4, 6, 12, 0.9) 0%, rgba(4, 6, 12, 0.8) 38%, rgba(4, 6, 12, 0.45) 68%, rgba(4, 6, 12, 0) 100%);
}
.scrim-bottom {
  inset: auto 0 0 0;
  height: 13rem;
  background: linear-gradient(0deg, rgba(4, 6, 12, 0.82) 0%, rgba(4, 6, 12, 0.4) 50%, rgba(4, 6, 12, 0) 100%);
}
.scrim-top {
  inset: 0 0 auto 0;
  height: 7rem;
  background: linear-gradient(180deg, rgba(4, 6, 12, 0.55) 0%, rgba(4, 6, 12, 0) 100%);
}

/* everything but the intro waits behind it */
#ui.is-intro .topbar,
#ui.is-intro .panel-inner,
#ui.is-intro .timeline,
#ui.is-intro .scrim-left,
#ui.is-intro .hotspots { opacity: 0; pointer-events: none; }
#ui.is-intro .topbar button,
#ui.is-intro .timeline button { pointer-events: none; }

/* ---------- top bar ---------- */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  transition: opacity 0.9s var(--ease) 0.2s;
}
.wordmark {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.controls { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.75rem); }

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft) !important;
  transition: color 0.2s;
}
.tbtn-label { border-bottom: 1px solid var(--hair); padding-bottom: 0.1rem; transition: border-color 0.2s; }
.tbtn:hover, .tbtn.is-on, .tbtn.sound:not(.is-muted) { color: var(--ink) !important; }
.tbtn:hover .tbtn-label { border-bottom-color: currentColor; }
.tbtn.is-on .tbtn-label { border-bottom-color: var(--accent); }

.lang { display: inline-flex; align-items: center; gap: 0.15rem; }
.lang-btn {
  min-width: 2.25rem;
  min-height: 2.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-faint) !important;
  transition: color 0.2s;
}
.lang-btn:hover { color: var(--ink) !important; }
.lang-btn.is-active { color: var(--ink) !important; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; text-decoration-color: var(--accent); }

/* tiny level meter */
.level { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.85rem; }
.level i {
  display: block;
  width: 2px;
  height: 100%;
  background: currentColor;
  transform-origin: 50% 100%;
  transform: scaleY(0.35);
  animation: level 1.1s ease-in-out infinite alternate;
}
.level i:nth-child(1) { animation-duration: 0.9s; animation-delay: -0.3s; }
.level i:nth-child(2) { animation-duration: 1.3s; animation-delay: -0.8s; }
.level i:nth-child(3) { animation-duration: 0.75s; animation-delay: -0.1s; }
.level i:nth-child(4) { animation-duration: 1.15s; animation-delay: -0.55s; }
.sound.is-muted .level i { animation: none; transform: scaleY(0.14); opacity: 0.6; }
@keyframes level { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

.tour-icon {
  width: 0.6rem;
  height: 0.7rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.tour.is-on .tour-icon {
  clip-path: none;
  background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66% 100%);
}

/* ---------- era panel ---------- */
.panel {
  position: absolute;
  left: var(--gutter);
  top: 4.5rem;
  bottom: 8.5rem;
  width: min(30rem, calc(100% - 2 * var(--gutter)));
  display: flex;
  align-items: center;
  pointer-events: none;
  will-change: opacity;
}
.panel-inner {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-shadow: 0 1px 2px rgba(4, 6, 12, 0.7), 0 0 0.9rem rgba(4, 6, 12, 0.55);
  transition: opacity 0.17s linear;
}
.panel-inner.is-swapping { opacity: 0; }
#ui:not(.is-intro) .panel-inner:not(.is-swapping) { transition: opacity 0.32s linear; }

.panel-inner > * { flex: 0 0 auto; max-width: 100%; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.badge::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}
[data-kind='projection'] .badge::before,
[data-kind='speculation'] .badge::before { background: none; border: 1px dashed var(--accent); width: 0.6rem; height: 0.6rem; }

.year {
  font-size: clamp(5rem, 13vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  margin: 0 0 0.12em -0.04em;
  color: var(--accent);
  font-variant-numeric: lining-nums;
  white-space: nowrap;
  text-shadow: 0 0 2.5rem rgba(4, 6, 12, 0.35);
}
.year[data-era='gutenberg'] { letter-spacing: 0; line-height: 0.95; }
.year[data-era='y2077'] { font-size: clamp(4rem, 10vw, 8.25rem); letter-spacing: -0.04em; line-height: 0.95; }
.year[data-era='empire'] { letter-spacing: -0.01em; }

.span { margin: 0 0 0.35rem; font-size: 1rem; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.title { margin: 0 0 0.6rem; font-size: clamp(1.45rem, 2.2vw, 1.9rem); font-weight: 600; line-height: 1.15; text-wrap: balance; }
.lead { margin: 0 0 0.7rem; font-size: 1.125rem; font-weight: 500; line-height: 1.4; text-wrap: pretty; }
.body { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; hyphens: auto; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.2rem 0 0;
  border-top: 1px solid var(--hair);
}
.fact { padding: 0.7rem 0.9rem 0 0.9rem; border-left: 1px solid var(--hair); }
.fact:first-child { padding-left: 0; border-left: 0; }
.fact-value { font-size: 1.5rem; font-weight: 600; line-height: 1.15; font-variant-numeric: lining-nums; }
.fact-label { margin: 0.25rem 0 0; font-size: 0.8rem; line-height: 1.35; opacity: 0.7; hyphens: auto; }

.note {
  margin: 1.1rem 0 0;
  padding-left: 0.8rem;
  border-left: 1px solid var(--accent);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* tabs + scrolling region */
.tabs { display: flex; flex-wrap: wrap; gap: 0.15rem 1.1rem; margin: 0 0 0.7rem; pointer-events: auto; }
.tab {
  appearance: none; background: none; border: 0; margin: 0; padding: 0.3rem 0 0.25rem;
  font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); text-shadow: inherit;
  border-bottom: 1px solid transparent; cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.panel-inner > .region {
  flex: 0 1 auto; min-height: 0; width: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  pointer-events: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin; scrollbar-color: var(--hair) transparent;
}
.region:focus-visible { outline: 1px solid var(--hair); outline-offset: 4px; }
.issues { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.issue { padding: 0.6rem 0; border-bottom: 1px solid var(--hair); font-size: 0.95rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; hyphens: auto; }
.issue:last-child { border-bottom: 0; }
.honest-text { margin: 0; font-size: 1.0625rem; line-height: 1.55; color: var(--ink); text-wrap: pretty; hyphens: auto; }
.honest-source { margin: 0.8rem 0 0; padding-left: 0.8rem; border-left: 1px solid var(--accent); font-size: 0.8rem; line-height: 1.4; color: var(--ink-soft); }

@media (max-height: 820px) and (min-width: 761px) {
  .panel-inner.is-tabbed .lead { display: none; }
  .panel { top: 4rem; bottom: 7.25rem; }
  #ui[data-era='now'] .year, #ui[data-era='y2030'] .year { font-size: clamp(3.5rem, min(11vw, 13.5vh), 7rem); }
  #ui[data-era='y2077'] .year[data-era='y2077'] { font-size: clamp(3rem, min(9vw, 11vh), 5.5rem); }
  .tabs { gap: 0.1rem 0.85rem; margin-bottom: 0.55rem; }
  .tab { font-size: 0.8125rem; }
  .fact-value { font-size: 1.3rem; }
  .year { font-size: clamp(4rem, min(13vw, 17vh), 9rem); }
  .year[data-era='y2077'] { font-size: clamp(3.25rem, min(10vw, 13vh), 6.75rem); }
  .lead { font-size: 1.05rem; }
  .body { font-size: 0.95rem; }
  .facts { margin-top: 0.9rem; }
  .note { margin-top: 0.8rem; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .note { display: none; }
  .body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- timeline ---------- */
.timeline {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 var(--gutter) max(1rem, env(safe-area-inset-bottom));
  transition: opacity 0.9s var(--ease) 0.35s;
}
.hint {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-soft);
  transition: opacity 0.6s var(--ease);
}
.hint.is-gone { opacity: 0; }

.timeline-row { display: flex; align-items: flex-start; gap: clamp(1.5rem, 4vw, 3.5rem); }

.step {
  flex: none;
  min-height: 2.75rem;
  margin-top: -0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-decoration-color: var(--hair);
  transition: color 0.2s, opacity 0.2s, text-decoration-color 0.2s;
}
.step:hover { color: var(--ink) !important; text-decoration-color: currentColor; }
.step:disabled { opacity: 0.3; }

.track {
  position: relative;
  flex: 1 1 auto;
  height: 4rem;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.track.is-dragging { cursor: grabbing; }
.line, .fill, .thumb-rail { position: absolute; top: 1rem; left: 0; pointer-events: none; }
.line-solid { height: 0; border-top: 1px solid var(--ink-faint); }
.line-dashed { height: 0; border-top: 1px dashed rgba(243, 241, 236, 0.6); }
.fill {
  width: 100%;
  height: 2px;
  margin-top: -0.5px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: background-color 0.4s;
  will-change: transform;
}
.thumb-rail { width: 100%; height: 0; will-change: transform; }
.thumb {
  position: absolute;
  left: -0.5rem;
  top: -0.5rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(4, 6, 12, 0.55), 0 0 1rem var(--accent);
  transition: background-color 0.4s, box-shadow 0.4s;
}

.stop {
  position: absolute;
  top: 0;
  width: 3.5rem;
  height: 4rem;
  margin-left: -1.75rem !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  color: var(--ink-soft) !important;
  transition: color 0.2s;
}
.stop-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.75rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: var(--night);
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}
.stop.is-passed .stop-dot { background: currentColor; }
.stop.is-future .stop-dot { border-style: dashed; }
.stop-label {
  margin-top: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  transition: opacity 0.2s;
}
.stop:hover { color: var(--ink) !important; }
.stop:hover .stop-dot { transform: scale(1.5); }
.stop.is-active { color: var(--ink) !important; }
.stop.is-active .stop-label { font-weight: 600; color: var(--accent); }
.stop.is-active .stop-dot { opacity: 0; }

/* ---------- hotspots ---------- */
.hotspots { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.9s var(--ease) 0.4s; }
.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  will-change: transform, opacity;
}
.hotspot.is-open { z-index: 2; }
.hotspot-btn {
  position: absolute;
  left: -1.375rem;
  top: -1.375rem;
  width: 2.75rem;
  height: 2.75rem;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  pointer-events: none !important;
}
.hotspot.is-live .hotspot-btn { pointer-events: auto !important; }
.hotspot-ring {
  position: relative;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: rgba(4, 6, 12, 0.35);
  box-shadow: 0 0 0 1px rgba(4, 6, 12, 0.4);
  transition: transform 0.25s var(--ease), background-color 0.25s;
}
.hotspot-ring::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: pulse 2.6s var(--ease) infinite;
}
.hotspot-btn:hover .hotspot-ring,
.hotspot.is-open .hotspot-ring { transform: scale(1.25); background: var(--accent); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

.hotspot-card {
  position: absolute;
  left: 1.5rem;
  top: -0.9rem;
  width: min(17rem, 70vw);
  padding: 0.65rem 0.85rem 0.75rem;
  background: rgba(4, 6, 12, 0.9);
  border-left: 1px solid var(--accent);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-0.35rem);
  transition: opacity 0.18s linear, transform 0.25s var(--ease), visibility 0s linear 0.18s;
  pointer-events: none;
}
.hotspot.flip-x .hotspot-card { left: auto; right: 1.5rem; border-left: 0; border-right: 1px solid var(--accent); transform: translateX(0.35rem); }
.hotspot.flip-y .hotspot-card { top: auto; bottom: -0.9rem; }
.hotspot.is-open .hotspot-card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
  pointer-events: auto;
}
.hotspot-title { display: block; margin-bottom: 0.2rem; font-size: 1rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.hotspot-text { display: block; }

/* ---------- intro ---------- */
.intro {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 2rem var(--gutter);
  pointer-events: auto;
  /* No backdrop-filter: blurring a full-screen WebGL canvas every frame is very costly on integrated GPUs.
     The engine renders the scene at low resolution behind the intro instead, which reads as soft focus. */
  background: radial-gradient(ellipse at 50% 45%, rgba(4, 6, 12, 0.56) 0%, rgba(4, 6, 12, 0.8) 100%);
  transition: opacity 1s var(--ease);
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro.is-leaving button { pointer-events: none !important; }
.intro-box {
  width: min(44rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: rise 1.2s var(--ease) both;
}
.intro-title {
  margin: 0;
  font-size: clamp(3.25rem, 11.5vw, 8.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.intro-flag { width: clamp(6rem, 16vw, 10rem); margin: 1.4rem 0 1.3rem; outline: 1px solid rgba(243, 241, 236, 0.12); }
.intro-flag i { display: block; height: 2px; }
.intro-flag i:nth-child(1) { background: #000; }
.intro-flag i:nth-child(2) { background: #dd0000; }
.intro-flag i:nth-child(3) { background: #ffcc00; }
.intro-line { margin: 0 0 2rem; max-width: 30rem; font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.4; color: var(--ink); text-wrap: balance; }

#ui .start {
  min-height: 3.25rem;
  padding: 0.8rem 1.75rem;
  background: #ffcc00;
  color: #0b0c10;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 2px;
  transition: background-color 0.3s, color 0.3s, transform 0.2s var(--ease);
}
#ui .start:not(:disabled):hover { background: #ffd83d; transform: translateY(-1px); }
#ui .start:not(:disabled):active { transform: none; }
#ui .start:disabled {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.start.is-loading .start-label::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75%, 100% { content: '...'; }
}
.intro-note { margin: 1rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.intro-foot { margin-top: 1.5rem; margin-left: -0.6rem; }
@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .scrim-left { display: none; }
  .scrim-bottom {
    height: 78%;
    background: linear-gradient(0deg, rgba(4, 6, 12, 0.92) 0%, rgba(4, 6, 12, 0.8) 45%, rgba(4, 6, 12, 0.35) 80%, rgba(4, 6, 12, 0) 100%);
  }
  .topbar { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .wordmark { font-size: 0.9rem; }
  .controls { gap: 0.85rem; }
  .tbtn { font-size: 0.875rem; }

  .panel {
    top: 3.6rem;
    bottom: 6.6rem;
    width: auto;
    right: var(--gutter);
    align-items: flex-end;
  }
  .badge { margin-bottom: 0.35rem; font-size: 0.875rem; }
  .year { font-size: clamp(3.5rem, 22vw, 6rem); }
  .year[data-era='y2077'] { font-size: clamp(2.75rem, 17vw, 4.75rem); }
  .span { font-size: 0.9rem; margin-bottom: 0.2rem; }
  .title { font-size: 1.3rem; margin-bottom: 0.35rem; }
  .lead { display: none; }
  .body {
    font-size: 0.9375rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .facts { display: flex; flex-wrap: wrap; margin-top: 0.7rem; }
  .fact { flex: 1 1 30%; min-width: 6.5rem; padding: 0.5rem 0.6rem 0; }
  .fact-value { font-size: 1.15rem; }
  .fact-label { font-size: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .note { display: none; }
  .tabs { gap: 0.1rem 0.9rem; margin: 0.2rem 0 0.5rem; }
  .tab { font-size: 0.8125rem; padding: 0.35rem 0 0.3rem; }
  .panel-inner > .region { max-height: 42vh; }
  .panel-inner.is-tabbed .body { display: block; }
  .issue { font-size: 0.9rem; padding: 0.5rem 0; }
  .honest-text { font-size: 0.9375rem; }

  .hint { font-size: 0.8rem; margin-bottom: 0.1rem; }
  .timeline-row { gap: 1.35rem; }
  .step { font-size: 0.875rem; }
  .track { height: 3.5rem; }
  .stop { width: 2.25rem; margin-left: -1.125rem !important; height: 3.5rem; }
  .stop-label { opacity: 0; font-size: 0.8rem; }
  .stop.is-active .stop-label { opacity: 1; }

  .intro-line { margin-bottom: 1.5rem; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .facts { display: none; }
  .body { -webkit-line-clamp: 3; }
}
@media (max-width: 420px) {
  .wordmark { max-width: 6.5rem; white-space: normal; line-height: 1.1; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #ui *, #ui *::before, #ui *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .level i { transform: scaleY(0.7); }
  .level i:nth-child(odd) { transform: scaleY(0.4); }
  .hotspot-ring::after { opacity: 0.5; transform: scale(1.8); }
  .start.is-loading .start-label::after { content: '...'; }
}

/* ---------- fixes after review ---------- */
/* Active tab marker: needs #ui specificity to win over the button reset. */
#ui .tab.is-active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
/* A text region taller than the panel fades out at the bottom instead of cutting a line in half; it scrolls. */
.panel-inner > .region {
  padding-bottom: 1.5rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5rem), transparent);
}
/* Short desktop windows: give the text a little more room so an era's closing note stays readable. */
@media (max-height: 820px) and (min-width: 761px) {
  .panel { top: 3.5rem; bottom: 6.4rem; }
  .year { font-size: clamp(3.75rem, min(12vw, 14vh), 8rem); }
  .facts { margin-top: 0.7rem; }
  .note { margin-top: 0.6rem; }
}
@media (max-height: 820px) and (min-width: 761px) {
  .title { margin-bottom: 0.45rem; }
  .lead { margin-bottom: 0.55rem; }
  .fact-label { font-size: 0.75rem; }
}
