:root {
  /* Design typography tokens: Interface copy: Sans* Sans** rounded */
  --cream: #FFF1D8;
  --cranberry: #7B1E3A;
  --raspberry: #C7365F;
  --peach: #FFB98A;
  --butter: #FFD86B;
  --lavender: #B9A7FF;
  --plum: #2A1226;
  --mint: #9BE7C4;
  --glass: rgba(255, 241, 216, 0.68);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; overflow: hidden; }

body {
  font-family: "Nunito Sans", Inter, Lato, system-ui, sans-serif;
  background: var(--cream);
  color: var(--plum);
}

button, a { font: inherit; }

.observatory {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 216, 107, 0.34), transparent 25%),
    radial-gradient(circle at 74% 20%, color-mix(in srgb, var(--mood) 44%, transparent), transparent 26%),
    linear-gradient(135deg, #FFF1D8 0%, #FFF1D8 48%, rgba(255, 185, 138, 0.28) 100%);
  transition: background 700ms ease;
}

.bokeh-field, .particle { position: absolute; inset: 0; pointer-events: none; }

.particle {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: var(--mood);
  filter: blur(18px);
  opacity: 0.34;
  animation: drift 16s ease-in-out infinite alternate;
}

.p1 { left: 8%; top: 16%; background: #B9A7FF; }
.p2 { left: 77%; top: 9%; width: 10rem; height: 10rem; background: #FFB98A; animation-duration: 19s; }
.p3 { left: 54%; top: 70%; background: #9BE7C4; animation-duration: 13s; }
.p4 { left: 86%; top: 62%; width: 5rem; height: 5rem; background: #FFD86B; animation-duration: 15s; }
.p5 { left: 24%; top: 76%; width: 8rem; height: 8rem; background: #C7365F; opacity: 0.18; }
.p6 { left: 45%; top: 8%; width: 4rem; height: 4rem; background: #B9A7FF; animation-duration: 17s; }
.p7 { left: 67%; top: 44%; width: 6rem; height: 6rem; background: var(--mood); animation-duration: 11s; }
.p8 { left: 2%; top: 55%; width: 5rem; height: 5rem; background: #FFB98A; animation-duration: 20s; }

@keyframes drift {
  from { transform: translate3d(-1rem, -0.5rem, 0) scale(0.92); }
  to { transform: translate3d(2.4rem, 1.8rem, 0) scale(1.12); }
}

.top-hud {
  position: fixed;
  left: 1.4rem;
  right: 1.4rem;
  top: 1.2rem;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 3.4rem);
  font-weight: 900;
  color: #7B1E3A;
  text-decoration: none;
  letter-spacing: -0.05em;
}

.hud-strip, .chapter-dot, .caption-capsule, .radial-label, .acetate-sheet, .forecast-sticker {
  border: 2px solid rgba(123, 30, 58, 0.72);
  background: rgba(255, 241, 216, 0.62);
  backdrop-filter: blur(10px);
}

.hud-strip {
  justify-self: center;
  min-width: min(34vw, 29rem);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  display: flex;
  justify-content: space-between;
  gap: 1.4rem;
  font-family: "Recursive", ui-monospace, monospace;
  color: #7B1E3A;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hud-strip strong { color: #2A1226; font-weight: 800; }

.chapter-dots { display: flex; gap: 0.5rem; }

.chapter-dot {
  cursor: pointer;
  color: #7B1E3A;
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  font-weight: 800;
  transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}

.chapter-dot.is-active, .chapter-dot:hover { background: #7B1E3A; color: #FFF1D8; transform: translateY(-2px); }

.stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(33rem, 54vw) minmax(20rem, 34rem);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: center;
  padding: 6rem clamp(1.2rem, 4vw, 4rem) 2.2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(3vw) scale(0.985);
  transition: opacity 560ms ease, transform 560ms ease;
}

.stage.is-active { opacity: 1; pointer-events: auto; transform: translateX(0) scale(1); }

.dial-shell { position: relative; width: min(70vh, 56vw); aspect-ratio: 1; justify-self: center; }

.orbital-guides { position: absolute; inset: -7%; width: 114%; height: 114%; transform: rotate(var(--shift)); transition: transform 650ms ease; }
.guide { fill: none; stroke: rgba(123, 30, 58, 0.48); stroke-width: 3; stroke-dasharray: 10 12; }
.guide-two { stroke: rgba(199, 54, 95, 0.42); stroke-dasharray: 3 10; }
.guide-path { stroke: var(--mood); stroke-width: 4; stroke-dasharray: 650; stroke-dashoffset: 650; animation: drawPath 2.7s ease forwards; }
.ticks path { stroke: #7B1E3A; stroke-width: 5; stroke-linecap: round; opacity: 0.55; }

@keyframes drawPath { to { stroke-dashoffset: 0; } }

.day-dial {
  position: absolute;
  inset: 9%;
  border: 4px solid #7B1E3A;
  border-radius: 50%;
  overflow: hidden;
  background: conic-gradient(#FFB98A 0 25%, #FFD86B 0 50%, #C7365F 0 75%, #2A1226 0 100%);
  box-shadow: inset 0 0 0 1rem rgba(255, 241, 216, 0.34);
}

.day-dial::after {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 241, 216, 0.85);
  background: rgba(255, 241, 216, 0.2);
}

.wedge { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Recursive", monospace; font-weight: 800; text-transform: uppercase; font-size: 0.68rem; color: rgba(42,18,38,0.72); }
.wedge span { position: absolute; }
.sunrise span { left: 22%; top: 22%; }
.noon span { right: 21%; top: 22%; }
.dusk span { right: 20%; bottom: 22%; color: #FFF1D8; }
.midnight span { left: 18%; bottom: 22%; color: #FFF1D8; }

.seed-dot {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid #FFF1D8;
  background: #7B1E3A;
  color: #FFF1D8;
  cursor: pointer;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  box-shadow: 0 0 0 0 rgba(123, 30, 58, 0.34);
  animation: pulseSeed 1.8s ease-in-out infinite;
}

@keyframes pulseSeed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(123, 30, 58, 0.32); }
  50% { box-shadow: 0 0 0 1.4rem rgba(123, 30, 58, 0); }
}

.day-cell {
  position: absolute;
  z-index: 8;
  width: clamp(7rem, 13vw, 10rem);
  min-height: 7.6rem;
  padding: 1rem 0.8rem;
  border: 3px solid #7B1E3A;
  color: #2A1226;
  cursor: pointer;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.28rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.15);
  transition: opacity 500ms ease, transform 680ms cubic-bezier(.2,1.35,.34,1), border-radius 900ms ease, filter 250ms ease;
}

.day-cell strong { font-family: "Fraunces", Georgia, serif; font-weight: 850; font-size: 1.05rem; line-height: 1; }
.day-cell em { font-family: "Recursive", monospace; font-style: normal; font-size: 0.62rem; text-transform: uppercase; color: #7B1E3A; }
.day-cell:hover, .day-cell.is-selected { filter: saturate(1.15); transform: translate(-50%, -50%) scale(1.08) rotate(-2deg); }
.calm { left: 29%; top: 34%; background: #9BE7C4; border-radius: 58% 42% 62% 38% / 40% 57% 43% 60%; }
.chaos { left: 70%; top: 32%; background: #FFB98A; border-radius: 46% 54% 35% 65% / 64% 43% 57% 36%; }
.lucky { left: 67%; top: 70%; background: #FFD86B; border-radius: 40% 60% 62% 38% / 50% 39% 61% 50%; }
.dreamy { left: 31%; top: 71%; background: #B9A7FF; border-radius: 62% 38% 48% 52% / 39% 62% 38% 61%; }

.observatory.is-bloomed .seed-dot { transform: translate(-50%, -50%) scale(0.46); opacity: 0.88; animation-duration: 3s; }
.observatory.is-bloomed .day-cell { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: wobble 4.5s ease-in-out infinite alternate; }
.observatory.is-bloomed .chaos { transition-delay: 120ms; animation-delay: 0.4s; }
.observatory.is-bloomed .lucky { transition-delay: 220ms; animation-delay: 0.8s; }
.observatory.is-bloomed .dreamy { transition-delay: 320ms; animation-delay: 1.2s; }

@keyframes wobble { to { border-radius: 50% 50% 42% 58% / 62% 38% 62% 38%; } }

.icon { width: 2rem; height: 2rem; display: block; position: relative; }
.sun-icon { border-radius: 50%; background: #FFD86B; border: 2px solid #7B1E3A; }
.dice-icon { border-radius: 0.45rem; background: #FFF1D8; border: 2px solid #7B1E3A; }
.dice-icon::after { content: ""; position: absolute; width: 0.34rem; height: 0.34rem; border-radius: 50%; background: #7B1E3A; left: 0.42rem; top: 0.42rem; box-shadow: 0.72rem 0.72rem #7B1E3A; }
.cup-icon { border: 2px solid #7B1E3A; border-top: 0; border-radius: 0 0 0.75rem 0.75rem; background: #FFF1D8; }
.cup-icon::after { content: ""; position: absolute; right: -0.55rem; top: 0.35rem; width: 0.65rem; height: 0.65rem; border: 2px solid #7B1E3A; border-left: 0; border-radius: 0 50% 50% 0; }
.moon-icon { border-radius: 50%; background: #FFF1D8; box-shadow: inset -0.58rem 0 #7B1E3A; border: 2px solid #7B1E3A; }

.radial-label {
  position: absolute;
  z-index: 9;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  font-family: "Recursive", monospace;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #7B1E3A;
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 420ms ease, transform 420ms ease;
}
.label-one { left: 3%; top: 25%; }
.label-two { right: 0; top: 47%; }
.label-three { left: 14%; bottom: 10%; }
.observatory.is-bloomed .radial-label { opacity: 1; transform: translateY(0); }

.story-panel {
  position: relative;
  align-self: center;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border: 3px solid #7B1E3A;
  background: rgba(255, 241, 216, 0.72);
  border-radius: 2rem;
  transform-origin: left center;
  animation: peelIn 820ms ease both;
}

.panel-tab, .sheet-code, .capsule-kicker {
  font-family: "Recursive", monospace;
  color: #C7365F;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

h1, h2 {
  margin: 0.35rem 0 0.7rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.055em;
  color: #7B1E3A;
}

h1 { font-size: clamp(3rem, 6vw, 6.8rem); line-height: 0.88; }
h2 { font-size: clamp(3rem, 6.4vw, 7.4rem); line-height: 0.85; }
p { font-size: clamp(1rem, 1.6vw, 1.35rem); line-height: 1.42; margin: 0; }

.advance-button {
  margin-top: 1.4rem;
  border: 3px solid #7B1E3A;
  border-radius: 999px;
  background: #C7365F;
  color: #FFF1D8;
  padding: 0.9rem 1.2rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0.35rem 0.35rem 0 #FFB98A;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.advance-button:hover { transform: translate(0.2rem, 0.2rem); box-shadow: 0.15rem 0.15rem 0 #FFB98A; }

@keyframes peelIn { from { transform: rotateY(-12deg) translateX(2rem); opacity: 0; } }

.caption-capsule {
  position: absolute;
  right: clamp(1.2rem, 5vw, 5rem);
  bottom: clamp(1rem, 5vh, 3rem);
  z-index: 15;
  width: min(31rem, 38vw);
  padding: 0.85rem 1rem;
  border-radius: 1.4rem;
  transform: translateY(1rem);
  opacity: 0;
  transition: opacity 420ms ease, transform 420ms ease, border-color 300ms ease;
}
.caption-capsule.is-open { opacity: 1; transform: translateY(0); border-color: var(--mood); }
.caption-capsule p { font-size: 1rem; font-weight: 800; }

.acetate-sheet {
  border-radius: 2rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  box-shadow: 0.45rem 0.45rem 0 rgba(123,30,58,0.1);
}
.wide { grid-column: 1 / 2; max-width: 52rem; margin-left: 5vw; }
.branch-board { display: grid; gap: 1rem; justify-self: start; }
.forecast-sticker {
  cursor: pointer;
  border-radius: 999px;
  background: #FFF1D8;
  color: #7B1E3A;
  padding: 1rem 1.2rem;
  font-weight: 900;
  box-shadow: 0.25rem 0.25rem 0 #FFD86B;
  transition: transform 220ms ease, background 220ms ease;
}
.forecast-sticker:hover, .forecast-sticker.is-selected { background: var(--mood); transform: translateX(-0.5rem) rotate(-1deg); }

.chapter-noon::before, .chapter-dusk::before, .chapter-night::before {
  content: "";
  position: absolute;
  left: 7vw;
  top: 19vh;
  width: min(58vh, 42vw);
  aspect-ratio: 1;
  border: 4px solid #7B1E3A;
  border-radius: 50%;
  background: conic-gradient(from 55deg, #FFD86B 0 28%, #9BE7C4 0 45%, #FFB98A 0 68%, #B9A7FF 0 100%);
  opacity: 0.42;
}
.chapter-dusk::before { background: conic-gradient(from 120deg, #C7365F, #FFB98A, #B9A7FF, #7B1E3A); }
.chapter-night::before { background: conic-gradient(from 210deg, #2A1226, #7B1E3A, #B9A7FF, #FFD86B); }

.dusk-ribbon {
  position: absolute;
  left: 3vw;
  right: 3vw;
  top: 18vh;
  display: flex;
  justify-content: space-around;
  border-top: 2px dashed #7B1E3A;
  border-bottom: 2px dashed #7B1E3A;
  padding: 0.7rem;
  font-family: "Recursive", monospace;
  text-transform: uppercase;
  color: #7B1E3A;
}
.dusk-card, .night-card { grid-column: 2; z-index: 3; }
.merge-blobs { position: relative; z-index: 4; width: 28rem; height: 22rem; justify-self: center; }
.merge-cell { position: absolute; border: 3px solid #7B1E3A; animation: mergeWobble 5s ease-in-out infinite alternate; }
.merge-cell.a { width: 14rem; height: 11rem; background: #FFB98A; left: 3rem; top: 2rem; border-radius: 55% 45% 62% 38%; }
.merge-cell.b { width: 12rem; height: 12rem; background: #B9A7FF; right: 2rem; top: 5rem; border-radius: 48% 52% 38% 62%; animation-delay: 0.8s; }
.merge-cell.c { width: 10rem; height: 8rem; background: #9BE7C4; left: 9rem; bottom: 1rem; border-radius: 44% 56% 60% 40%; animation-delay: 1.4s; }
@keyframes mergeWobble { to { transform: translate(1rem, -0.4rem) rotate(7deg); } }

.night-orbit {
  position: relative;
  z-index: 4;
  width: min(62vh, 45vw);
  aspect-ratio: 1;
  justify-self: center;
  border: 3px dashed #7B1E3A;
  border-radius: 50%;
  animation: slowSpin 18s linear infinite;
}
.moon-token, .message-token, .train-token { position: absolute; border: 3px solid #7B1E3A; background: #FFF1D8; color: #7B1E3A; }
.moon-token { left: 42%; top: -2rem; width: 5rem; height: 5rem; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; }
.message-token { right: -2rem; top: 48%; padding: 1rem; border-radius: 1rem; font-family: "Fraunces", serif; font-weight: 900; }
.train-token { left: 12%; bottom: 3%; width: 7rem; height: 1.4rem; border-radius: 999px; background: #9BE7C4; }
@keyframes slowSpin { to { transform: rotate(1turn); } }

@media (max-width: 880px) {
  html, body { overflow: auto; }
  .observatory { min-height: 100vh; height: auto; overflow: hidden; }
  .top-hud { position: relative; grid-template-columns: 1fr; left: auto; right: auto; top: auto; padding: 1rem; }
  .hud-strip { min-width: 0; width: 100%; }
  .stage { position: relative; min-height: 100vh; grid-template-columns: 1fr; padding: 1rem; display: none; }
  .stage.is-active { display: grid; }
  .dial-shell { width: min(92vw, 32rem); }
  .caption-capsule { position: relative; right: auto; bottom: auto; width: auto; }
  h1 { font-size: 3.4rem; }
  .wide, .dusk-card, .night-card { grid-column: auto; margin-left: 0; }
}
