.cosmos-page {
  background: #07090d;
}

.cosmos-page .brand-copy small {
  color: #465463;
}

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

.cosmos-main {
  background: #07090d;
  color: #f5f1e8;
}

.cosmos-stage {
  --journey: 0%;
  position: relative;
  min-height: 620px;
  height: calc(100svh - 88px);
  max-height: 980px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 46%, rgba(51, 78, 95, 0.3), transparent 34%),
    #07090d;
}

#cosmos-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: pan-y;
}

#cosmos-canvas:focus-visible {
  outline: 2px solid rgba(205, 174, 112, 0.88);
  outline-offset: -5px;
}

.cosmos-stage.is-interactive #cosmos-canvas {
  cursor: grab;
}

.cosmos-stage.is-dragging #cosmos-canvas {
  cursor: grabbing;
}

.cosmos-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(7, 9, 13, 0.36), transparent 22%, transparent 65%, rgba(7, 9, 13, 0.76)),
    radial-gradient(ellipse at center, transparent 43%, rgba(2, 3, 6, 0.62) 100%);
}

.cosmos-topline,
.journey-copy,
.drag-hint,
.atom-facts,
.view-switcher,
.cosmos-controls,
.journey-meter {
  position: absolute;
  z-index: 4;
}

.cosmos-topline {
  left: clamp(22px, 5vw, 72px);
  right: clamp(22px, 5vw, 72px);
  top: clamp(22px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cosmos-back,
.phase-count,
.scale-readout {
  color: rgba(247, 244, 238, 0.68);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.cosmos-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: color 220ms ease, transform 300ms var(--ease-spring);
}

.cosmos-back:hover {
  color: #fffdf8;
  transform: translateX(-3px);
}

.phase-count {
  font-variant-numeric: tabular-nums;
}

.phase-meta {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 34px);
}

.scale-readout {
  color: rgba(197, 164, 104, 0.86);
  font-variant-numeric: tabular-nums;
  transition: opacity 260ms ease;
}

.journey-copy {
  left: clamp(22px, 7vw, 104px);
  bottom: clamp(138px, 17vh, 174px);
  width: min(610px, calc(100% - 44px));
  pointer-events: none;
  transition: opacity 420ms ease, transform 600ms var(--ease-out);
}

.journey-copy.is-changing {
  opacity: 0;
  transform: translateY(12px);
}

.scene-kicker {
  margin: 0 0 14px;
  color: #c5a468;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.journey-copy h2 {
  max-width: 720px;
  margin: 0 0 14px;
  color: #fffdf8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.4vw, 74px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.journey-copy > p:last-child {
  max-width: 520px;
  margin: 0;
  color: rgba(247, 244, 238, 0.68);
  font-size: clamp(15px, 1.55vw, 19px);
  line-height: 1.55;
}

.drag-hint {
  left: clamp(22px, 5vw, 72px);
  bottom: 124px;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 13, 19, 0.52);
  color: rgba(247, 244, 238, 0.7);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  pointer-events: none;
  backdrop-filter: blur(12px);
  animation: factIn 700ms var(--ease-out) both;
}

.drag-hint span {
  margin-right: 6px;
  color: #c5a468;
}

.atom-facts {
  top: clamp(84px, 12vh, 126px);
  right: clamp(22px, 5vw, 72px);
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 22px;
  min-width: 210px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(9, 13, 19, 0.46);
  color: rgba(247, 244, 238, 0.68);
  font-size: 11px;
  line-height: 1.2;
  backdrop-filter: blur(14px);
  animation: factIn 700ms var(--ease-out) both;
}

.atom-facts strong {
  grid-row: 1 / 4;
  align-self: center;
  padding-right: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.11);
  color: #fffdf8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.atom-facts span {
  white-space: nowrap;
}

.atom-facts b {
  color: #c5a468;
  font-weight: 800;
}

.view-switcher {
  left: 50%;
  bottom: 126px;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 13, 19, 0.58);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  animation: hintIn 700ms var(--ease-out) both;
}

.view-switcher button {
  min-width: 74px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  background: transparent;
  color: rgba(247, 244, 238, 0.62);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: color 220ms ease, background 220ms ease;
}

.view-switcher button[aria-pressed="true"] {
  background: #c5a468;
  color: #171514;
}

.view-switcher button:focus-visible {
  outline: 2px solid #fffdf8;
  outline-offset: 2px;
}

.cosmos-controls {
  right: clamp(22px, 5vw, 72px);
  bottom: 132px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.cosmos-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(9, 13, 19, 0.58);
  color: rgba(247, 244, 238, 0.76);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 280ms var(--ease-spring);
}

.cosmos-control[hidden],
.drag-hint[hidden],
.atom-facts[hidden],
.view-switcher[hidden] {
  display: none !important;
}

.cosmos-control:hover,
.cosmos-control:focus-visible {
  border-color: rgba(197, 164, 104, 0.58);
  background: rgba(25, 27, 29, 0.76);
  color: #fffdf8;
  outline: 0;
  transform: translateY(-2px);
}

.cosmos-control svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.replay-journey {
  color: #171514;
  border-color: #c5a468;
  background: #c5a468;
}

.replay-journey:hover,
.replay-journey:focus-visible {
  color: #171514;
  background: #d2b57f;
}

.journey-meter {
  left: clamp(22px, 5vw, 72px);
  right: clamp(22px, 5vw, 72px);
  bottom: 35px;
}

.journey-track {
  position: relative;
}

.journey-progress {
  position: relative;
  height: 2px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.16);
}

.journey-progress > span {
  position: relative;
  display: block;
  width: var(--journey);
  height: 100%;
  background: linear-gradient(90deg, #73879e, #b596c1 48%, #c5a468 74%, #69b3a6);
  box-shadow: 0 0 14px rgba(105, 179, 166, 0.55);
  transition: width 140ms linear;
}

.journey-chapters {
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  pointer-events: none;
}

.journey-chapters button {
  position: absolute;
  left: var(--chapter);
  top: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.journey-chapters button::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: #0b0f15;
  transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.journey-chapters button.is-reached::after,
.journey-chapters button:hover::after,
.journey-chapters button:focus-visible::after {
  border-color: #e7d8b8;
  background: #c5a468;
  box-shadow: 0 0 12px rgba(197, 164, 104, 0.72);
  transform: scale(1.24);
}

.journey-chapters button:focus-visible {
  outline: 1px solid rgba(255, 253, 248, 0.9);
  outline-offset: -2px;
}

.journey-progress > span::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e7d8b8;
  box-shadow: 0 0 16px rgba(231, 216, 184, 0.88);
  transform: translateY(-50%);
}

.journey-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  color: rgba(247, 244, 238, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cosmos-note {
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #07090d;
  color: rgba(247, 244, 238, 0.64);
  font-size: 11px;
  text-align: center;
}

.cosmos-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #172332, #07090d 62%);
}

.no-webgl #cosmos-canvas { display: none; }
.no-webgl .cosmos-fallback { display: grid; }

.fallback-stars,
.fallback-stars::before,
.fallback-stars::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    radial-gradient(circle at 12% 20%, white 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 15%, #d9c7aa 0 1px, transparent 1.5px),
    radial-gradient(circle at 34% 72%, #a9ccda 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 66%, white 0 1px, transparent 1.5px);
  background-size: 180px 150px, 220px 190px, 260px 210px, 310px 230px;
  opacity: 0.7;
}

.fallback-atom {
  position: relative;
  width: min(58vw, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.fallback-atom i {
  position: absolute;
  inset: 17%;
  border: 1px solid rgba(197, 164, 104, 0.68);
  border-radius: 50%;
}

.fallback-atom i:nth-child(1) { transform: rotate(25deg) scaleY(0.34); }
.fallback-atom i:nth-child(2) { transform: rotate(-35deg) scaleY(0.34); }
.fallback-atom i:nth-child(3) { transform: rotate(90deg) scaleY(0.34); }

.fallback-atom span {
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f1dcaf, #9e7743 70%);
  box-shadow: 0 0 50px rgba(197, 164, 104, 0.55);
}

@keyframes hintIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes factIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .cosmos-stage {
    min-height: 540px;
    height: calc(100svh - 76px);
    max-height: none;
  }

  .cosmos-topline { top: 20px; }

  .journey-copy {
    left: 22px;
    bottom: 148px;
    width: calc(100% - 44px);
  }

  .journey-copy h2 {
    max-width: 540px;
    font-size: clamp(43px, 12vw, 66px);
  }

  .journey-copy > p:last-child {
    max-width: 440px;
  }

  .cosmos-controls {
    right: 22px;
    bottom: 84px;
  }

  .pause-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pause-toggle {
    width: 42px;
    padding: 0;
  }

  .drag-hint {
    left: auto;
    right: 22px;
    bottom: 89px;
    max-width: calc(100% - 190px);
    animation: none;
    transform: none;
  }

  .view-switcher {
    left: 22px;
    bottom: 84px;
    transform: none;
    animation: none;
  }

  .view-switcher button {
    min-width: 60px;
    padding-inline: 10px;
  }

  .atom-facts {
    top: 70px;
    right: 22px;
  }

  .journey-meter {
    left: 22px;
    right: 22px;
    bottom: 22px;
  }
}

@media (max-width: 520px) {
  .phase-count { font-size: 10px; }

  .journey-copy {
    bottom: 154px;
  }

  .scene-kicker { font-size: 10px; }

  .journey-copy h2 {
    font-size: clamp(40px, 13vw, 54px);
    line-height: 1.02;
  }

  .journey-copy > p:last-child {
    font-size: 14px;
  }

  .cosmos-controls { bottom: 88px; }

  .replay-journey span { display: none; }
  .replay-journey { width: 42px; padding: 0; }

  .drag-hint {
    max-width: calc(100% - 188px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .scale-readout {
    max-width: 128px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .atom-facts {
    left: 22px;
    right: 22px;
    top: 64px;
    grid-template-columns: auto repeat(3, 1fr);
    min-width: 0;
    gap: 8px;
    padding: 10px 12px;
    font-size: 9px;
  }

  .atom-facts strong {
    grid-row: auto;
    padding-right: 9px;
    font-size: 14px;
  }

  .atom-facts span {
    display: grid;
    gap: 2px;
    white-space: normal;
    text-align: center;
  }

  .journey-labels {
    justify-content: space-between;
  }

  .journey-labels span:nth-child(n + 2):nth-child(-n + 5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-copy,
  .cosmos-control,
  .journey-progress > span,
  .cosmos-back {
    transition-duration: 0.01ms !important;
  }

  .atom-facts,
  .view-switcher {
    animation: none !important;
  }
}
