:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-elevated: #0b0d0c;
  --bg-soft: #111311;
  --ink: #f7efe1;
  --ink-muted: #bdb2a3;
  --ink-faint: #7d766e;
  --line: rgba(213, 168, 74, 0.24);
  --line-strong: rgba(221, 177, 91, 0.44);
  --copper: #c8733c;
  --copper-strong: #e28b4f;
  --teal: #62c4b7;
  --gold: #d5a84a;
  --crimson: #d5504d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --radius: 8px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 14%, rgba(98, 196, 183, 0.12), transparent 30%),
    radial-gradient(circle at 16% 72%, rgba(200, 115, 60, 0.12), transparent 30%),
    linear-gradient(180deg, #080705, #030303 58%, #060504);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

.app[data-mode="intro"] .experience,
.app[data-mode="experience"] .intro {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(20px, 4vw, 48px);
  isolation: isolate;
}

.intro::before {
  position: absolute;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    linear-gradient(90deg, rgba(3, 3, 3, 0.94) 0%, rgba(3, 3, 3, 0.72) 35%, rgba(3, 3, 3, 0.2) 64%, rgba(3, 3, 3, 0.72) 100%),
    linear-gradient(180deg, rgba(3, 3, 3, 0.08), rgba(3, 3, 3, 0.72) 78%, #050505 100%);
}

.intro-collage {
  position: absolute;
  inset: 0;
  z-index: -4;
  overflow: hidden;
}

.intro-image {
  position: absolute;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.08);
}

.intro-cosmos {
  top: -10%;
  left: -8%;
  width: 62%;
  height: 56%;
  opacity: 0.64;
}

.intro-relief {
  top: 18%;
  left: -5%;
  width: 25%;
  height: 57%;
  opacity: 0.76;
  mask-image: linear-gradient(90deg, #000 0%, #000 56%, transparent 100%);
}

.intro-harbor {
  right: -4%;
  bottom: 8%;
  width: 52%;
  height: 50%;
  opacity: 0.62;
  mask-image: linear-gradient(90deg, transparent 0%, #000 26%, #000 100%);
}

.atlas-disc {
  position: absolute;
  top: 6%;
  right: 16%;
  width: min(34vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(213, 168, 74, 0.24);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 9%, rgba(213, 168, 74, 0.08) 9.5% 10%),
    conic-gradient(from 15deg, transparent, rgba(213, 168, 74, 0.24), transparent 48%, rgba(98, 196, 183, 0.14), transparent);
  opacity: 0.62;
  transform: rotate(-12deg);
}

.atlas-thread {
  position: absolute;
  right: 2%;
  bottom: 24%;
  width: 64%;
  height: 28%;
  border-bottom: 2px solid rgba(241, 210, 148, 0.74);
  border-radius: 50%;
  transform: rotate(-8deg);
  filter: drop-shadow(0 0 18px rgba(213, 168, 74, 0.2));
}

.atlas-thread span {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid #f0cc83;
  border-radius: 50%;
  background: #080706;
}

.atlas-thread span:nth-child(1) {
  left: 26%;
  bottom: -9px;
}

.atlas-thread span:nth-child(2) {
  left: 44%;
  bottom: -2px;
}

.atlas-thread span:nth-child(3) {
  left: 62%;
  bottom: 28px;
}

.atlas-thread span:nth-child(4) {
  right: 7%;
  bottom: 86px;
  border-color: var(--crimson);
}

.intro-topbar,
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-sigil {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, var(--gold) 48% 52%, transparent 53%),
    linear-gradient(0deg, transparent 47%, var(--gold) 48% 52%, transparent 53%),
    radial-gradient(circle, transparent 34%, rgba(213, 168, 74, 0.42) 35% 40%, transparent 41%);
  box-shadow: 0 0 24px rgba(213, 168, 74, 0.2);
}

.credit {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.credit strong {
  color: var(--copper-strong);
  font-weight: 650;
}

.intro-copy {
  width: min(940px, 100%);
  margin-top: clamp(58px, 7vh, 86px);
  margin-bottom: clamp(36px, 7vh, 92px);
}

.intro-copy h1 {
  max-width: 920px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 6.2vw, 6.6rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
}

.intro-copy p {
  max-width: 620px;
  margin: 20px 0 0;
  color: #e5dbca;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
}

.intro-copy p::after {
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 18px;
  content: "";
  background: var(--copper-strong);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 26px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button svg,
.icon-button svg,
.tool-button svg,
.control-button svg,
.play-button svg,
.secondary-actions svg,
.search-box svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button:hover,
.icon-button:hover,
.tool-button:hover,
.control-button:hover,
.secondary-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 139, 79, 0.72);
}

.button.primary {
  background: linear-gradient(180deg, #d7854c, #94451f);
  border-color: #ed9a60;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22), 0 16px 40px rgba(156, 74, 30, 0.28);
  animation: ctaBreath 4200ms ease-in-out infinite;
}

.button.ghost {
  background: rgba(5, 5, 5, 0.42);
}

.preview-band {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  margin-top: auto;
}

.preview-label {
  display: grid;
  gap: 6px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.preview-label strong {
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.preview-events {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
}

.preview-event {
  min-width: 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
  animation: previewRise 680ms ease both;
}

.preview-event:nth-child(2) {
  animation-delay: 70ms;
}

.preview-event:nth-child(3) {
  animation-delay: 140ms;
}

.preview-event:nth-child(4) {
  animation-delay: 210ms;
}

.preview-event:nth-child(5) {
  animation-delay: 280ms;
}

.preview-event:nth-child(6) {
  animation-delay: 350ms;
}

.preview-event img {
  width: 100%;
  aspect-ratio: 1.45;
  border: 1px solid rgba(213, 168, 74, 0.2);
  border-radius: var(--radius);
  object-fit: cover;
  filter: saturate(0.82);
  transition: border-color 180ms ease, filter 180ms ease, transform 240ms ease;
}

.preview-event:hover img {
  border-color: rgba(98, 196, 183, 0.5);
  filter: saturate(1) contrast(1.06);
  transform: translateY(-2px);
}

.preview-event span,
.preview-event strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-event span {
  margin-top: 10px;
  color: var(--gold);
  font-size: 0.76rem;
}

.preview-event strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
}

.experience {
  display: grid;
  grid-template-columns: 350px minmax(420px, 1fr) 370px;
  grid-template-rows: 62px minmax(0, 1fr) 96px;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(213, 168, 74, 0.08) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(213, 168, 74, 0.08) 0 1px, transparent 1px),
    #050606;
  background-size: 96px 96px;
}

.experience.focused {
  grid-template-columns: 1fr;
  grid-template-rows: 62px minmax(0, 1fr);
}

.experience.focused .timeline-rail,
.experience.focused .dossier,
.experience.focused .era-scrubber {
  display: none;
}

.experience.focused .event-stage {
  grid-column: 1 / -1;
  border-right: 0;
}

.app-topbar {
  grid-column: 1 / -1;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.88);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-button,
.tool-button,
.control-button,
.secondary-actions button,
.filter-button,
.timeline-event,
.era-button {
  border: 1px solid rgba(213, 168, 74, 0.18);
  border-radius: var(--radius);
  background: rgba(9, 10, 9, 0.72);
  color: var(--ink-muted);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
}

.timeline-rail,
.dossier {
  min-height: 0;
  border-color: var(--line);
  background: rgba(7, 8, 7, 0.84);
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  padding: 18px 16px 0;
  border-right: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(213, 168, 74, 0.2);
  border-radius: var(--radius);
  padding: 0 12px;
  background: rgba(2, 3, 3, 0.7);
  color: var(--ink-faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.94rem;
}

.search-box input::placeholder {
  color: #8f8579;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 24px), transparent 100%);
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 0.88rem;
}

.filter-button.active {
  border-color: rgba(226, 139, 79, 0.82);
  background: rgba(200, 115, 60, 0.2);
  color: var(--ink);
}

.timeline-list {
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px 28px 0;
  scrollbar-color: rgba(213, 168, 74, 0.42) rgba(255, 255, 255, 0.03);
}

.timeline-group {
  margin: 0 0 22px;
}

.timeline-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
  color: var(--teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-group-header h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-group-header span {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.timeline-event {
  display: grid;
  width: 100%;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 5px;
  padding: 0 10px;
  text-align: left;
}

.timeline-event time {
  color: var(--gold);
  font-size: 0.78rem;
}

.timeline-event strong {
  overflow: hidden;
  color: #ddd4c5;
  font-size: 0.88rem;
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-event.active {
  border-color: rgba(226, 139, 79, 0.92);
  background: linear-gradient(90deg, rgba(98, 196, 183, 0.16), rgba(200, 115, 60, 0.12));
  color: var(--ink);
  box-shadow: inset 3px 0 var(--copper-strong);
}

.experience.is-playing .timeline-event.active {
  animation: activeEventBeat 2200ms ease-in-out infinite;
}

.timeline-empty {
  border: 1px dashed rgba(213, 168, 74, 0.25);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--ink-muted);
}

.event-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.stage-toolbar {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.stage-toolbar span,
.stage-tool-buttons {
  pointer-events: auto;
}

.stage-toolbar span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(213, 168, 74, 0.24);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(3, 4, 4, 0.64);
  color: var(--ink);
  font-size: 0.95rem;
}

.stage-tool-buttons {
  display: flex;
  gap: 8px;
}

.tool-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.stage-image-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.stage-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.08) brightness(0.78);
  transform: scale(1.02);
  transition: opacity 260ms ease, transform 900ms ease;
}

.stage-image-wrap.is-changing .stage-image {
  opacity: 0.56;
  transform: scale(1.06);
}

.stage-image-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.08), rgba(5, 5, 5, 0.18) 40%, rgba(5, 5, 5, 0.94) 100%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.72), transparent 32%, rgba(5, 5, 5, 0.08) 68%, rgba(5, 5, 5, 0.64));
}

.map-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.74;
  mix-blend-mode: screen;
}

.map-overlay svg {
  width: 100%;
  height: 100%;
}

.map-overlay path {
  fill: none;
  stroke: rgba(240, 199, 126, 0.78);
  stroke-dasharray: 2 4;
  stroke-linecap: round;
  stroke-width: 0.42;
}

.experience.is-playing .map-overlay path {
  animation: routeTrace 3600ms linear infinite;
}

.experience.is-playing .stage-image {
  animation: cinematicDrift 16000ms ease-in-out infinite alternate;
}

.experience.is-playing .map-overlay circle {
  animation: mapPulse 2400ms ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.map-overlay circle {
  fill: rgba(10, 12, 11, 0.84);
  stroke: rgba(240, 199, 126, 0.94);
  stroke-width: 0.6;
}

.stage-text {
  position: absolute;
  right: 8%;
  bottom: 9%;
  left: 7%;
  z-index: 3;
  max-width: 680px;
}

.stage-image-wrap.is-changing .stage-text {
  animation: stageTextIn 520ms ease both;
}

.stage-era,
.dossier-head span {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-text h2,
.dossier h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 5.5rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

.event-year,
.dossier-year {
  margin: 12px 0 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
}

.event-year::after {
  display: block;
  width: 86px;
  height: 2px;
  margin-top: 16px;
  content: "";
  background: var(--copper-strong);
}

.event-summary {
  max-width: 650px;
  margin: 24px 0 0;
  color: #eee5d7;
  font-size: clamp(1.05rem, 1.3vw, 1.24rem);
}

.dossier {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 26px 22px;
  scrollbar-color: rgba(213, 168, 74, 0.42) rgba(255, 255, 255, 0.03);
}

.dossier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dossier-head p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.dossier-path {
  margin: 18px 0 0;
  color: var(--teal);
  font-size: 0.9rem;
}

.dossier h2 {
  font-size: clamp(2.25rem, 3vw, 3.2rem);
}

.dossier-year {
  font-size: 1.6rem;
}

.reading-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin-top: 26px;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.reading-meter div {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.reading-meter div span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper-strong), var(--gold));
  transition: width 260ms ease;
}

.experience.is-playing .reading-meter div span {
  background: linear-gradient(90deg, var(--copper-strong), var(--gold), var(--teal));
  background-size: 220% 100%;
  animation: meterFlow 2600ms linear infinite;
}

.dossier-copy {
  margin: 24px 0 0;
  color: #e8dfd1;
  font-size: 0.99rem;
}

.dossier-insight {
  margin-top: 20px;
  border-left: 3px solid var(--teal);
  padding: 2px 0 2px 14px;
}

.dossier-insight span {
  display: block;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dossier-insight p {
  margin: 8px 0 0;
  color: #f0e6d6;
  font-size: 0.98rem;
}

.fact-list {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(213, 168, 74, 0.22);
}

.fact-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
}

.fact-list dt {
  color: var(--gold);
  font-size: 0.88rem;
}

.fact-list dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.player-controls {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 28px;
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
}

.play-button {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid rgba(226, 139, 79, 0.64);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e7b16c, #a35b29 72%);
  box-shadow: 0 14px 42px rgba(200, 115, 60, 0.26);
  cursor: pointer;
}

.play-button.is-playing {
  animation: playPulse 1800ms ease-in-out infinite;
}

.play-button.is-playing::before {
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(226, 139, 79, 0.26);
  border-radius: 50%;
  content: "";
  animation: playOrbit 3200ms linear infinite;
}

.play-button svg {
  width: 26px;
  height: 26px;
  fill: var(--ink);
  stroke: none;
}

.secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
}

.secondary-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
}

.era-scrubber {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(9, minmax(90px, 1fr));
  gap: 0;
  align-items: stretch;
  border-top: 1px solid var(--line-strong);
  background: rgba(6, 7, 6, 0.94);
}

.era-button {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  border-width: 0;
  border-right: 1px solid rgba(213, 168, 74, 0.12);
  border-radius: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.era-button::before {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(213, 168, 74, 0.38);
  border-radius: 50%;
  content: "";
  background: rgba(213, 168, 74, 0.08);
}

.era-button.active {
  color: var(--teal);
}

.era-button.active::before {
  border-color: var(--teal);
  background: rgba(98, 196, 183, 0.24);
  box-shadow: 0 0 30px rgba(98, 196, 183, 0.24);
}

.era-button span {
  max-width: 100%;
  overflow: hidden;
  padding: 0 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  border: 1px solid rgba(98, 196, 183, 0.34);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(6, 8, 7, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1260px) {
  .experience {
    grid-template-columns: 310px minmax(360px, 1fr) 330px;
  }

  .timeline-event {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .top-actions span {
    display: none;
  }
}

@media (max-width: 1020px) {
  body {
    overflow: auto;
  }

  .preview-band {
    grid-template-columns: 1fr;
    margin-top: clamp(34px, 6vh, 52px);
  }

  .preview-events {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(160px, 1fr));
  }

  .experience {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 62px;
    background: #050505;
  }

  .timeline-rail {
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .event-stage {
    min-height: 72vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 72px;
  }

  .event-stage,
  .stage-image-wrap {
    position: relative;
  }

  .stage-image-wrap {
    min-height: 72vh;
  }

  .dossier {
    display: block;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 72px;
  }

  .era-scrubber {
    display: flex;
    min-height: 94px;
    overflow-x: auto;
  }

  .era-button {
    min-width: 148px;
  }
}

@media (max-width: 720px) {
  .intro {
    padding: 18px;
  }

  .intro-topbar,
  .app-topbar {
    align-items: flex-start;
  }

  .brand-mark {
    font-size: 0.86rem;
  }

  .credit {
    font-size: 0.86rem;
    text-align: right;
  }

  .intro-copy {
    margin-top: clamp(58px, 10vh, 82px);
    margin-bottom: 36px;
  }

  .intro-copy h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .intro-actions,
  .top-actions {
    width: 100%;
  }

  .button {
    flex: 1 1 180px;
  }

  .intro-relief {
    width: 42%;
    opacity: 0.5;
  }

  .intro-harbor {
    width: 86%;
    opacity: 0.5;
  }

  .atlas-disc {
    right: -10%;
    width: 78vw;
  }

  .app-topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .event-stage,
  .dossier {
    scroll-margin-top: 168px;
  }

  .icon-button {
    flex: 1 1 120px;
  }

  .timeline-rail {
    padding: 14px 12px 0;
  }

  .timeline-event {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .stage-toolbar {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .stage-text {
    right: 20px;
    bottom: 34px;
    left: 20px;
  }

  .stage-text h2 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .event-summary {
    font-size: 1rem;
  }

  .dossier {
    padding: 22px 18px;
  }

  .fact-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .player-controls {
    grid-template-columns: 1fr;
  }

  .play-button {
    justify-self: center;
    order: -1;
  }
}

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

@keyframes ctaBreath {
  0%,
  100% {
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.22), 0 16px 40px rgba(156, 74, 30, 0.24);
  }
  50% {
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.28), 0 20px 54px rgba(226, 139, 79, 0.34);
  }
}

@keyframes previewRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes routeTrace {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -36;
  }
}

@keyframes cinematicDrift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.6%, -1.2%, 0);
  }
}

@keyframes mapPulse {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.85);
  }
}

@keyframes stageTextIn {
  from {
    opacity: 0.7;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes activeEventBeat {
  0%,
  100% {
    border-color: rgba(226, 139, 79, 0.9);
    box-shadow: inset 3px 0 var(--copper-strong), 0 0 0 rgba(98, 196, 183, 0);
  }
  50% {
    border-color: rgba(98, 196, 183, 0.82);
    box-shadow: inset 3px 0 var(--teal), 0 0 24px rgba(98, 196, 183, 0.12);
  }
}

@keyframes meterFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 220% 0;
  }
}

@keyframes playPulse {
  0%,
  100% {
    box-shadow: 0 14px 42px rgba(200, 115, 60, 0.26), 0 0 0 0 rgba(226, 139, 79, 0.22);
  }
  50% {
    box-shadow: 0 18px 54px rgba(200, 115, 60, 0.34), 0 0 0 12px rgba(226, 139, 79, 0);
  }
}

@keyframes playOrbit {
  from {
    opacity: 0.9;
    transform: rotate(0deg) scale(0.95);
  }
  to {
    opacity: 0.2;
    transform: rotate(360deg) scale(1.12);
  }
}
