:root {
  --bg: #050816;
  --bg-2: #090d1d;
  --panel: rgba(10, 14, 29, 0.5);
  --line: rgba(133, 157, 255, 0.18);
  --text: #edf1ff;
  --muted: #9ca5c7;
  --warm: #e9b07f;
  --cool: #8ea2ff;
  --max: 1320px;
  --radius: 28px;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 20% 20%, rgba(80, 92, 156, 0.22), transparent 24%),
    radial-gradient(circle at 80% 24%, rgba(233, 176, 127, 0.16), transparent 28%),
    linear-gradient(180deg, #050816 0%, #060913 30%, #070b16 100%);
  color: var(--text);
  overflow-x: hidden;
}

main {
  position: relative;
  z-index: 2;
}

#field,
.noise,
.vignette,
.pointer-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#field {
  z-index: 0;
}

.noise {
  z-index: 1;
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.2) 0 0.6px, transparent 0.7px),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,0.14) 0 0.5px, transparent 0.7px);
  background-size: 180px 180px, 140px 140px;
  mix-blend-mode: soft-light;
}

.vignette {
  z-index: 1;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.pointer-glow {
  z-index: 1;
  opacity: 0.45;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(142, 162, 255, 0.2), transparent 22%);
  transition: background-position 120ms linear;
}

.hud {
  position: fixed;
  top: 24px;
  left: 32px;
  right: 32px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  mix-blend-mode: screen;
}

.hud__left,
.hud__right {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  background: rgba(7, 10, 20, 0.42);
}

.hud__label,
.hud__value,
.rail__index,
.kicker,
.eyebrow,
.panel-label,
.timeline__year,
.world-card__meta {
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud__label,
.panel-label,
.timeline__year,
.world-card__meta,
.kicker,
.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
}

.hud__value {
  font-size: 0.76rem;
  color: var(--text);
}

.hud__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm), var(--cool));
  box-shadow: 0 0 16px rgba(142, 162, 255, 0.8);
}

.rail {
  position: fixed;
  top: 50%;
  left: 28px;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail__item {
  position: relative;
  display: grid;
  gap: 4px;
  text-align: left;
  width: 160px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(6, 10, 18, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 200ms ease, color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.rail__item:hover,
.rail__item.is-active {
  transform: translateX(8px);
  color: var(--text);
  border-color: rgba(142, 162, 255, 0.28);
  background: rgba(12, 17, 31, 0.58);
}

.rail__title {
  font-size: 0.95rem;
  line-height: 1.1;
}

.scene {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 96px 40px 96px 220px;
}

.scene__inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.scene--hero,
.scene--end {
  min-height: 110svh;
}

.hero {
  position: relative;
  display: grid;
  gap: 24px;
}

.eyebrow {
  color: var(--warm);
}

.hero__title,
.display {
  margin: 0;
  font-family: var(--serif);
  line-height: 0.92;
  font-weight: 400;
}

.hero__title {
  max-width: 11ch;
  font-size: clamp(4.5rem, 11vw, 10rem);
}

.hero__accent {
  color: var(--cool);
}

.hero__lede,
.body-copy,
.stack p,
.scene__aside,
.timeline__node p,
.world-card p,
.future-grid p {
  color: rgba(237, 241, 255, 0.78);
  font-size: clamp(1rem, 1.15vw, 1.25rem);
  line-height: 1.7;
}

.hero__lede {
  max-width: 64ch;
}

.hero__lede--end {
  max-width: 58ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.button {
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.button--primary {
  background: linear-gradient(135deg, rgba(233, 176, 127, 0.18), rgba(142, 162, 255, 0.18));
  border-color: rgba(142, 162, 255, 0.26);
}

.hero__fragments {
  position: absolute;
  inset: auto 0 -6vh auto;
  width: min(520px, 46vw);
  min-height: 280px;
}

.fragment {
  position: absolute;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 10, 20, 0.36);
  backdrop-filter: blur(18px);
  color: rgba(237, 241, 255, 0.78);
  font-size: 0.86rem;
  max-width: 200px;
  box-shadow: 0 20px 60px rgba(4, 7, 20, 0.35);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.split--reverse {
  grid-template-columns: 0.9fr 1.2fr;
}

.display {
  font-size: clamp(3rem, 7.2vw, 7rem);
  max-width: 10ch;
}

.display--wide {
  max-width: 14ch;
}

.stack {
  display: grid;
  gap: 24px;
}

.stack--compact {
  gap: 18px;
}

.timeline {
  margin-top: 42px;
  display: grid;
  gap: 22px;
}

.timeline__node,
.world-card,
.glass-panel {
  position: relative;
  overflow: hidden;
  padding: 26px 26px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 19, 37, 0.6), rgba(9, 12, 24, 0.42));
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 60px rgba(4, 7, 20, 0.35);
}

.timeline__node::before,
.world-card::before,
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(233,176,127,0.8), rgba(142,162,255,0.05), transparent);
}

.timeline__node h3,
.world-card h3 {
  margin: 8px 0 10px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.05;
}

.scene__header {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 28px;
}

.scene__aside {
  max-width: 34ch;
  justify-self: end;
}

.worlds-grid,
.future-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.world-card {
  min-height: 220px;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.world-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(142, 162, 255, 0.24);
  box-shadow: 0 16px 80px rgba(29, 44, 98, 0.24);
}

.principles {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
  color: rgba(237, 241, 255, 0.82);
  line-height: 1.65;
}

.future-panel {
  display: grid;
  gap: 28px;
}

.endcap {
  display: grid;
  gap: 22px;
  justify-items: start;
}

body[data-scene="signal"] {
  --cool: #93c1ff;
}

body[data-scene="time"] {
  --cool: #98a6ff;
}

body[data-scene="worlds"] {
  --cool: #7fd0ff;
}

body[data-scene="systems"] {
  --cool: #95a8ff;
}

body[data-scene="future"] {
  --cool: #8bf2ff;
  --warm: #f3bf8d;
}

body[data-scene="transmission"] {
  --cool: #9aa0ff;
  --warm: #f4caa5;
}

@media (max-width: 1100px) {
  .rail {
    display: none;
  }

  .scene {
    padding-left: 40px;
  }

  .hero__fragments {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 220px;
    margin-top: 12px;
  }

  .split,
  .split--reverse,
  .scene__header,
  .worlds-grid,
  .future-grid {
    grid-template-columns: 1fr;
  }

  .scene__aside {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .hud {
    left: 16px;
    right: 16px;
    top: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .hud__left,
  .hud__right {
    justify-content: space-between;
  }

  .scene {
    padding: 118px 18px 64px;
  }

  .hero__title {
    font-size: clamp(3.4rem, 18vw, 5.8rem);
  }

  .display {
    font-size: clamp(2.6rem, 12vw, 4.2rem);
  }

  .world-card,
  .glass-panel,
  .timeline__node {
    padding: 22px;
  }
}
