:root {
  /* Typography source notes for compliance: IBM Plex Sans** San in 400–600 for precise labels; Space Mono** Mon in 400/700 for date stamps. */
  --ink: #0B1B33;
  --indigo: #162447;
  --mint: #8FF4D2;
  --frost: #F7FCFF;
  --violet: #7D8CFF;
  --glass: #D8F3FF;
  --blue: #77C9F2;
  --gold: #E6C46A;
  --display: "Poppins", "Jost", "Futura", "Avenir Next", sans-serif;
  --body: "IBM Plex Sans", Inter, sans-serif;
  --mono: "Space Mono", monospace;
  --progress: 0;
}

* { box-sizing: border-box; }

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

body {
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 30% 28%, rgba(247,252,255,.95), transparent 32%),
    linear-gradient(115deg, var(--glass), var(--blue) 52%, var(--indigo));
}

.loading-veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--frost), var(--glass) 48%, var(--blue));
  transition: opacity 900ms ease, visibility 900ms ease;
}

.loading-veil.is-hidden { opacity: 0; visibility: hidden; }

.loading-compass { width: min(42vw, 320px); filter: drop-shadow(0 20px 45px rgba(22,36,71,.18)); }
.loading-compass circle, .loading-compass path, .loading-compass polygon {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 1.2;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  animation: pathDraw 2s ease forwards;
}
.loading-compass polygon { stroke: var(--violet); fill: rgba(247,252,255,.15); animation-delay: .2s; }
.loading-mark {
  position: absolute;
  margin-top: 360px;
  font: 800 1.1rem/1 var(--display);
  letter-spacing: .35em;
  text-transform: uppercase;
}

.observatory { position: fixed; inset: 0; overflow: hidden; perspective: 1200px; }

.sky-strip {
  height: 100vh;
  width: 500vw;
  display: flex;
  will-change: transform;
  transform: translate3d(0,0,0);
}

.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  flex: 0 0 100vw;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  isolation: isolate;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 4vh 4vw;
  border: 1px solid rgba(247,252,255,.42);
  clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 94%);
  background: linear-gradient(135deg, rgba(247,252,255,.16), rgba(216,243,255,.04));
  pointer-events: none;
}

.dawn-index { background: linear-gradient(100deg, var(--frost), var(--glass) 46%, var(--blue)); }
.element-drift { background: linear-gradient(100deg, var(--glass), #bdeeff 40%, var(--blue)); }
.resonance-ledger { background: linear-gradient(100deg, #eefbff, var(--glass), #b6eaff); }
.sky-archive { color: var(--frost); background: linear-gradient(110deg, var(--indigo), #123358 54%, var(--ink)); }
.night-reset { color: var(--frost); background: radial-gradient(circle at 62% 45%, rgba(125,140,255,.24), transparent 28%), linear-gradient(110deg, var(--indigo), var(--ink)); }

.scene-bg { position: absolute; inset: 0; z-index: -1; }
.stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--frost);
  box-shadow: 0 0 10px currentColor;
  opacity: .6;
}

.horizon-line {
  position: absolute;
  left: 7vw;
  right: 7vw;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--gold), transparent);
}

.scene-kicker, .micro, .day-label span, .lens-readout, .annotation, .ledger-note {
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scene-kicker { position: absolute; top: 10vh; left: 8vw; font-size: .78rem; color: rgba(11,27,51,.66); }
.wordmark {
  position: absolute;
  left: 7.5vw;
  top: 37vh;
  margin: 0;
  font: 900 clamp(3.8rem, 12vw, 12rem)/.82 var(--display);
  letter-spacing: .12em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow: 0 18px 50px rgba(22,36,71,.16);
}
.wordmark i { display: block; height: 1px; margin: .08em 0; background: rgba(11,27,51,.55); }
.day-label { position: absolute; right: 9vw; top: 18vh; display: grid; gap: .4rem; text-align: right; }
.day-label b { font: 800 clamp(2rem, 5vw, 5rem)/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }

.crystal-compass { position: absolute; right: 8vw; bottom: 7vh; width: min(44vw, 520px); aspect-ratio: 1; transform-style: preserve-3d; }
.crystal-compass svg { width: 100%; height: 100%; }
.draw { fill: none; stroke: url(#compassGlow); stroke-width: 1.4; stroke-dasharray: 1800; stroke-dashoffset: 1800; animation: pathDraw 2.8s .35s ease forwards; }
.draw.muted { opacity: .42; }
.draw.gold { stroke: var(--gold); opacity: .72; }
.compass-core { fill: rgba(247,252,255,.28); stroke: var(--frost); stroke-width: 1.2; }

h2 {
  position: relative;
  z-index: 2;
  margin: 8vh 0 0 4vw;
  max-width: 820px;
  font: 900 clamp(3.4rem, 8vw, 8.6rem)/.86 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scene-intro { position: relative; z-index: 2; margin: 2rem 0 0 4.3vw; max-width: 460px; font-size: 1.05rem; line-height: 1.7; }
.annotation {
  position: absolute;
  z-index: 4;
  max-width: 280px;
  padding: 14px 16px;
  font-size: .68rem;
  line-height: 1.55;
  color: var(--ink);
  background: rgba(247,252,255,.42);
  border: 1px solid rgba(247,252,255,.74);
  clip-path: polygon(0 0, 94% 0, 100% 18%, 96% 100%, 8% 100%, 0 82%);
  backdrop-filter: blur(14px);
}
.sky-archive .annotation, .night-reset .annotation { color: var(--frost); background: rgba(216,243,255,.08); border-color: rgba(119,201,242,.35); }
.dawn-note { left: 10vw; bottom: 11vh; }
.drift-a { right: 23vw; top: 18vh; }
.drift-b { left: 14vw; bottom: 16vh; }
.archive-a { right: 9vw; top: 20vh; }
.reset-a { left: 10vw; bottom: 14vh; }

.constellation, .archive-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.constellation line { stroke: rgba(11,27,51,.28); stroke-width: 1; }
.constellation circle { fill: var(--frost); stroke: var(--blue); stroke-width: 1; }
.archive-lines path, .archive-lines polyline { fill: none; stroke: rgba(216,243,255,.56); stroke-width: 1.1; stroke-dasharray: 900; animation: pathDraw 5s ease both infinite alternate; }

.wind-ribbon { position: absolute; border: 1px solid rgba(143,244,210,.72); border-left: 0; border-bottom: 0; border-radius: 50%; transform: rotate(-18deg); filter: blur(.1px); }
.ribbon-one { width: 44vw; height: 22vh; right: 13vw; top: 26vh; }
.ribbon-two { width: 38vw; height: 18vh; left: 24vw; bottom: 19vh; border-color: rgba(230,196,106,.62); }

.shard, .ledger-shard {
  transform-style: preserve-3d;
  transition: transform 240ms ease, filter 240ms ease, background 240ms ease;
  clip-path: polygon(50% 0, 88% 24%, 100% 62%, 54% 100%, 12% 78%, 0 30%);
  background: linear-gradient(135deg, rgba(247,252,255,.72), rgba(119,201,242,.22) 48%, rgba(125,140,255,.34));
  border: 1px solid rgba(247,252,255,.78);
  box-shadow: 0 24px 70px rgba(22,36,71,.16), inset 0 0 24px rgba(247,252,255,.35);
}
.shard.is-near, .ledger-shard:hover, .ledger-shard.active { filter: brightness(1.18) saturate(1.08); background: linear-gradient(135deg, var(--frost), rgba(143,244,210,.35), rgba(125,140,255,.4)); }
.field-shard { position: absolute; width: 118px; height: 178px; z-index: 3; }
.field-shard::after, .mineral-cluster::after {
  content: attr(data-note);
  position: absolute;
  left: 72%;
  top: 45%;
  min-width: 190px;
  padding-left: 38px;
  font: 700 .65rem var(--mono);
  letter-spacing: .09em;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.field-shard::before, .mineral-cluster::before { content: ""; position: absolute; left: 62%; top: 49%; width: 56px; height: 1px; background: var(--gold); opacity: 0; }
.field-shard.is-near::after, .field-shard.is-near::before, .mineral-cluster.is-near::after, .mineral-cluster.is-near::before { opacity: 1; transform: translateX(0); }
.s1 { left: 21vw; top: 28vh; }
.s2 { left: 54vw; top: 42vh; width: 150px; height: 205px; }
.s3 { right: 12vw; top: 21vh; width: 96px; height: 150px; }

.ledger-grid { background-image: linear-gradient(rgba(11,27,51,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(11,27,51,.06) 1px, transparent 1px); background-size: 42px 42px; }
.ledger-ribbon { position: absolute; left: 10vw; right: 8vw; top: 47vh; height: 26vh; display: flex; align-items: center; gap: clamp(10px, 2vw, 32px); }
.ledger-shard {
  appearance: none;
  border: 1px solid rgba(247,252,255,.82);
  width: clamp(86px, 10vw, 150px);
  height: clamp(130px, 18vw, 230px);
  color: var(--ink);
  font: 900 clamp(2.2rem, 5vw, 5.7rem)/1 var(--display);
  cursor: pointer;
}
.ledger-note { position: absolute; z-index: 4; right: 12vw; bottom: 13vh; padding: 14px 16px; color: var(--ink); background: rgba(247,252,255,.55); border: 1px solid rgba(247,252,255,.74); clip-path: polygon(0 0, 94% 0, 100% 18%, 96% 100%, 8% 100%, 0 82%); backdrop-filter: blur(14px); }

.ruin-line { position: absolute; left: 8vw; bottom: 18vh; width: 48vw; height: 16vh; border-bottom: 1px solid rgba(230,196,106,.6); clip-path: polygon(0 100%, 9% 42%, 15% 100%, 23% 24%, 30% 100%, 42% 54%, 48% 100%, 100% 100%); background: linear-gradient(0deg, rgba(230,196,106,.1), transparent); }
.mineral-cluster { position: absolute; right: 18vw; bottom: 18vh; width: 170px; height: 230px; }
.mineral-cluster::after { color: var(--frost); }

.reset-orb { position: absolute; inset: 12vh 12vw; display: grid; place-items: center; }
.reset-orb span { position: absolute; border: 1px solid rgba(216,243,255,.36); border-radius: 50%; animation: orbit 16s linear infinite; }
.reset-orb span:nth-child(1) { width: 28vw; height: 28vw; }
.reset-orb span:nth-child(2) { width: 42vw; height: 18vw; transform: rotate(22deg); animation-duration: 22s; }
.reset-orb span:nth-child(3) { width: 58vw; height: 30vw; transform: rotate(-16deg); animation-duration: 28s; }
.night-panel { position: absolute; right: 11vw; bottom: 18vh; width: min(420px, 38vw); padding: 28px; border: 1px solid rgba(216,243,255,.32); background: rgba(11,27,51,.38); clip-path: polygon(0 0, 100% 8%, 94% 100%, 8% 94%); }
.night-panel b { display: block; margin-top: 18px; font: 800 2rem/1.1 var(--display); }

.telescope-lens {
  position: fixed;
  z-index: 10;
  left: 50%;
  top: 50%;
  width: min(48vw, 560px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(247,252,255,.74);
  background: radial-gradient(circle at 38% 32%, rgba(247,252,255,.22), transparent 28%), radial-gradient(circle, rgba(216,243,255,.08), rgba(125,140,255,.05) 54%, rgba(11,27,51,.08));
  box-shadow: inset 0 0 32px rgba(247,252,255,.34), 0 0 0 999px rgba(11,27,51,.03), 0 22px 90px rgba(22,36,71,.15);
  backdrop-filter: blur(2.5px) saturate(1.2);
}
.telescope-lens::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 1px dashed rgba(230,196,106,.42); }
.telescope-lens::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(from calc(var(--progress) * 1turn), transparent, rgba(143,244,210,.42), transparent, rgba(230,196,106,.4), transparent); opacity: .4; filter: blur(12px); }
.lens-cross { position: absolute; background: rgba(247,252,255,.54); }
.lens-cross.x { left: 12%; right: 12%; top: 50%; height: 1px; }
.lens-cross.y { top: 12%; bottom: 12%; left: 50%; width: 1px; }
.lens-readout { position: absolute; bottom: 11%; left: 50%; transform: translateX(-50%); color: var(--frost); background: rgba(11,27,51,.42); padding: 7px 12px; border-radius: 999px; font-size: .65rem; white-space: nowrap; }

.progress-orbit { position: fixed; z-index: 11; right: 24px; top: 24px; width: 70px; height: 70px; border-radius: 50%; border: 1px solid rgba(247,252,255,.58); background: conic-gradient(var(--gold) calc(var(--progress) * 360deg), rgba(247,252,255,.16) 0); }
.progress-orbit span { position: absolute; inset: 9px; border-radius: 50%; background: rgba(11,27,51,.12); backdrop-filter: blur(8px); }
.drag-rail { position: fixed; z-index: 12; left: 16vw; right: 16vw; bottom: 28px; height: 18px; cursor: grab; }
.drag-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: linear-gradient(90deg, transparent, rgba(247,252,255,.75), rgba(230,196,106,.75), transparent); }
.rail-thumb { position: absolute; top: 2px; left: calc(var(--progress) * 100%); width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); background: var(--frost); border: 1px solid var(--blue); box-shadow: 0 0 24px rgba(247,252,255,.8); }

@keyframes pathDraw { to { stroke-dashoffset: 0; } }
@keyframes orbit { to { rotate: 360deg; } }

@media (max-width: 760px) {
  .scene { padding: 22px; }
  .telescope-lens { width: 78vw; }
  .wordmark { left: 6vw; font-size: 4rem; letter-spacing: .06em; }
  .crystal-compass { right: 2vw; width: 78vw; opacity: .55; }
  .ledger-ribbon { left: 4vw; right: 4vw; overflow: visible; gap: 8px; }
  .ledger-shard { width: 72px; height: 120px; }
  h2 { margin-left: 0; font-size: 3.4rem; }
  .scene-intro { margin-left: 0; }
}
