:root {
  /* Design font token: Grotesk** */
  --observatory: #071018;
  --indigo: #101B33;
  --vellum: #E7D6B4;
  --brass: #B68A3A;
  --oxide: #A63D2F;
  --cyan: #48D8C8;
  --violet: #6D5A8D;
  --brown: #21160F;
  --progress: 0;
  --plate: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #071018;
  color: #E7D6B4;
  font-family: 'Space Grotesk', Inter, sans-serif;
  overflow-x: hidden;
}

button { font: inherit; }

.chronograph { min-height: 520vh; background: #071018; }

.atlas-surface {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 31% 52%, rgba(72,216,200,.14), transparent 6%),
    radial-gradient(circle at 72% 34%, rgba(109,90,141,.18), transparent 24%),
    radial-gradient(circle at 58% 70%, rgba(166,61,47,.12), transparent 18%),
    linear-gradient(135deg, #071018 0%, #101B33 52%, #071018 100%);
  transition: filter .6s ease;
}

.atlas-surface::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    repeating-linear-gradient(0deg, transparent 0 37px, rgba(231,214,180,.035) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 53px, rgba(72,216,200,.025) 54px 55px);
  transform: rotate(calc((var(--progress) * 12deg) - 4deg));
  transform-origin: 31% 52%;
  opacity: .55;
}

.grain, .scratch-field, .radial-grid { position: absolute; inset: 0; pointer-events: none; }

.grain {
  opacity: .23;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(231,214,180,.18) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 40%, rgba(231,214,180,.13) 0 1px, transparent 1px),
    radial-gradient(circle at 36% 80%, rgba(72,216,200,.11) 0 1px, transparent 1px);
  background-size: 19px 23px, 31px 29px, 43px 41px;
  mix-blend-mode: screen;
}

.scratch-field {
  background:
    linear-gradient(112deg, transparent 20%, rgba(231,214,180,.09) 20.2%, transparent 20.6%),
    linear-gradient(78deg, transparent 62%, rgba(231,214,180,.05) 62.1%, transparent 62.5%),
    linear-gradient(164deg, transparent 42%, rgba(182,138,58,.08) 42.1%, transparent 42.4%);
  opacity: .45;
}

.radial-grid {
  background:
    repeating-radial-gradient(circle at 31% 52%, rgba(231,214,180,.13) 0 1px, transparent 1px 64px),
    conic-gradient(from 18deg at 31% 52%, rgba(182,138,58,.2), transparent 12deg, rgba(72,216,200,.12) 22deg, transparent 35deg, rgba(109,90,141,.16) 47deg, transparent 65deg);
  opacity: .34;
}

.axis { position: absolute; background: rgba(182,138,58,.5); box-shadow: 0 0 22px rgba(182,138,58,.28); }
.axis span { position: absolute; color: #B68A3A; font: 500 11px 'IBM Plex Mono', monospace; letter-spacing: .16em; text-transform: uppercase; opacity: .9; }
.axis.horizontal { left: 6vw; right: 6vw; top: 52vh; height: 1px; }
.axis.horizontal span { left: 2vw; top: 12px; }
.axis.vertical { top: 8vh; bottom: 8vh; left: 31vw; width: 1px; }
.axis.vertical span { transform: rotate(-90deg); transform-origin: left top; left: -12px; bottom: 4vh; width: 260px; }

.diagonal-rule { position: absolute; width: 88vw; height: 1px; left: 6vw; top: 45vh; background: linear-gradient(90deg, transparent, rgba(231,214,180,.35), transparent); transform-origin: 32% 50%; }
.rule-one { transform: rotate(-18deg); }
.rule-two { transform: rotate(29deg); opacity: .45; }

.graph-plate { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ticks path { stroke: rgba(231,214,180,.34); stroke-width: 1; fill: none; stroke-dasharray: 8 12; }
.contours path { fill: rgba(109,90,141,.045); stroke: #6D5A8D; stroke-width: 1.5; stroke-dasharray: 6 10; opacity: calc(.08 + (var(--plate) * .16)); filter: drop-shadow(0 0 10px rgba(109,90,141,.28)); }
.routes .route { fill: none; stroke: #48D8C8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: calc(900 - (var(--draw, .08) * 900)); filter: url(#cyanGlow); opacity: .88; transition: stroke-dashoffset 1s ease, opacity .5s ease; }
.routes .rupture { stroke: #A63D2F; stroke-width: 2.5; filter: drop-shadow(0 0 8px rgba(166,61,47,.55)); }
.routes .violet { stroke: #6D5A8D; opacity: .58; filter: drop-shadow(0 0 8px rgba(109,90,141,.45)); }
.node { opacity: calc(.2 + (var(--draw, .08) * .8)); transition: opacity .5s ease, transform .5s ease; transform-origin: center; }
.node circle { fill: #071018; stroke: #48D8C8; stroke-width: 3; filter: url(#cyanGlow); }
.node text { fill: #E7D6B4; font: 600 12px 'IBM Plex Mono', monospace; letter-spacing: .12em; }
.node.red circle { stroke: #A63D2F; }
.node.brass circle { stroke: #B68A3A; }
.node.violet circle { stroke: #6D5A8D; }
.node.active { transform: scale(1.25); }
.constellation circle { fill: #E7D6B4; opacity: .8; }
.constellation path { fill: none; stroke: rgba(231,214,180,.45); stroke-dasharray: 2 8; }

.date-wheel {
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  top: clamp(18px, 5vh, 56px);
  width: 172px;
  height: 172px;
  border: 1px solid rgba(182,138,58,.65);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33,22,15,.88), rgba(16,27,51,.45) 56%, transparent 58%), conic-gradient(from 15deg, rgba(182,138,58,.38), transparent, rgba(72,216,200,.25), transparent, rgba(182,138,58,.38));
  box-shadow: inset 0 0 25px rgba(182,138,58,.18), 0 0 35px rgba(0,0,0,.45);
  transform: rotate(calc(var(--progress) * 270deg));
  cursor: grab;
}
.date-wheel span { position: absolute; left: 50%; top: 50%; color: #E7D6B4; font: 500 10px 'IBM Plex Mono', monospace; transform: rotate(var(--a)) translate(73px) rotate(calc(var(--a) * -1)); transform-origin: 0 0; }
.wheel-core { position: absolute; inset: 53px; display: grid; place-items: center; border-radius: 50%; color: #48D8C8; border: 1px solid #B68A3A; font: 700 24px 'Cormorant Garamond', serif; background: #21160F; }

.atlas-tabs { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; z-index: 8; }
.atlas-tabs button { color: rgba(231,214,180,.7); background: rgba(16,27,51,.58); border: 1px solid rgba(182,138,58,.35); padding: 9px 12px; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; cursor: pointer; }
.atlas-tabs button.active { color: #48D8C8; border-color: #48D8C8; box-shadow: 0 0 18px rgba(72,216,200,.24); }

.plate { position: absolute; width: min(620px, 76vw); opacity: 0; transform: translateY(24px) rotate(-1deg); transition: opacity .7s ease, transform .7s ease; pointer-events: none; z-index: 5; }
.plate.active { opacity: 1; transform: translateY(0) rotate(0deg); pointer-events: auto; }
.plate-origin { left: 9vw; top: 13vh; }
.plate-drift { left: 43vw; top: 11vh; }
.plate-contours { left: 10vw; bottom: 10vh; }
.plate-witness { right: 8vw; top: 22vh; }
.plate-echo { left: 12vw; top: 14vh; }
.plate-label { margin: 0 0 12px; color: #B68A3A; font: 600 12px 'Space Grotesk', sans-serif; letter-spacing: .24em; text-transform: uppercase; }
h1, h2 { margin: 0; color: #E7D6B4; font-family: 'Cormorant Garamond', serif; font-weight: 600; line-height: .88; text-shadow: 0 0 26px rgba(231,214,180,.08); }
h1 { font-size: clamp(76px, 11vw, 168px); max-width: 900px; }
h2 { font-size: clamp(46px, 6.5vw, 104px); max-width: 760px; }
.statement { max-width: 510px; color: rgba(231,214,180,.82); font: 400 clamp(18px, 2vw, 25px)/1.25 'Cormorant Garamond', serif; }
.coordinate { display: inline-grid; gap: 4px; margin-top: 24px; padding: 14px 18px; border: 1px solid rgba(72,216,200,.52); color: #48D8C8; background: rgba(7,16,24,.72); box-shadow: 0 0 24px rgba(72,216,200,.18); font-family: 'IBM Plex Mono', monospace; }
.coordinate span { font-size: 10px; letter-spacing: .18em; color: #B68A3A; }

.thread-spool { width: 96px; height: 96px; border-radius: 50%; border: 2px dashed #B68A3A; display: grid; place-items: center; margin-top: 28px; color: #B68A3A; font: 600 10px 'IBM Plex Mono', monospace; text-transform: uppercase; background: radial-gradient(circle, #21160F, transparent 70%); cursor: grab; }
.thread-spool.pulled { box-shadow: 0 0 30px rgba(72,216,200,.4); border-color: #48D8C8; color: #48D8C8; }

.vellum-stack { position: relative; width: min(520px, 74vw); height: 320px; }
.source-card { position: absolute; width: 285px; min-height: 124px; padding: 22px; background: linear-gradient(135deg, rgba(231,214,180,.94), rgba(231,214,180,.72)); color: #21160F; border: 1px solid rgba(33,22,15,.35); box-shadow: 0 24px 55px rgba(0,0,0,.38); clip-path: polygon(0 0, 92% 0, 100% 13%, 100% 100%, 8% 100%, 0 90%); transform: translateY(30px); opacity: .15; transition: transform .7s ease, opacity .7s ease; }
.plate.active .source-card { transform: translateY(0); opacity: .96; }
.source-card span { font: 700 11px 'IBM Plex Mono', monospace; color: #A63D2F; letter-spacing: .18em; }
.source-card p { font: 500 24px/1.05 'Cormorant Garamond', serif; margin: 14px 0 0; }
.source-card:nth-child(1) { left: 0; top: 0; }
.source-card.tilted { left: 145px; top: 82px; transform: rotate(5deg) translateY(30px); }
.plate.active .source-card.tilted { transform: rotate(5deg) translateY(0); transition-delay: .15s; }
.source-card.redacted { left: 52px; top: 185px; transform: rotate(-4deg) translateY(30px); }
.plate.active .source-card.redacted { transform: rotate(-4deg) translateY(0); transition-delay: .28s; }

.stamp-button { margin-top: 25px; padding: 15px 24px; color: #A63D2F; background: rgba(231,214,180,.9); border: 3px double #A63D2F; text-transform: uppercase; letter-spacing: .18em; font: 700 12px 'Space Grotesk', sans-serif; transform: rotate(-3deg); cursor: pointer; box-shadow: 0 14px 28px rgba(0,0,0,.34); }
.stamp-button.stamped { background: #A63D2F; color: #E7D6B4; border-color: #21160F; }

.loupe { position: absolute; width: 132px; height: 132px; border: 2px solid #B68A3A; border-radius: 50%; left: 62vw; top: 58vh; z-index: 6; display: grid; place-items: center; color: #B68A3A; font: 700 11px 'IBM Plex Mono', monospace; letter-spacing: .15em; background: radial-gradient(circle, rgba(72,216,200,.1), rgba(7,16,24,.28)); backdrop-filter: blur(1px); box-shadow: inset 0 0 18px rgba(231,214,180,.12), 0 16px 30px rgba(0,0,0,.35); transform: translate(calc(var(--progress) * -22vw), calc(var(--progress) * -28vh)); }
.loupe::after { content: ""; position: absolute; width: 48px; height: 8px; background: #B68A3A; right: -34px; bottom: 8px; transform: rotate(42deg); border-radius: 8px; }
.red-pencil { position: absolute; width: 175px; height: 8px; right: 16vw; bottom: 22vh; background: linear-gradient(90deg, #A63D2F, #A63D2F 75%, #E7D6B4 76%, #21160F 100%); transform: rotate(calc(-25deg + var(--progress) * 20deg)); box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.catalog-readout { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: rgba(231,214,180,.76); font: 500 12px 'IBM Plex Mono', monospace; letter-spacing: .16em; border-top: 1px solid rgba(182,138,58,.4); padding-top: 10px; z-index: 9; }
.scroll-spacer { position: relative; z-index: -1; }
.scroll-spacer > div { height: 104vh; }

body.plate-1 .atlas-surface { filter: saturate(1.08); }
body.plate-2 .contours path { animation: contourPulse 4s ease-in-out infinite; }
body.plate-3 .vellum-stack { animation: vellumLift 3s ease-in-out infinite alternate; }
body.plate-4 .constellation path { stroke: #48D8C8; filter: url(#cyanGlow); }

@keyframes contourPulse { 50% { opacity: .8; transform: scale(1.025); } }
@keyframes vellumLift { to { transform: translateY(-8px); } }

@media (max-width: 760px) {
  .date-wheel { width: 116px; height: 116px; }
  .date-wheel span { display: none; }
  .wheel-core { inset: 35px; font-size: 18px; }
  .atlas-tabs { top: auto; bottom: 62px; left: 12px; grid-template-columns: repeat(5, auto); transform: none; }
  .atlas-tabs button { padding: 7px; font-size: 9px; }
  .plate { width: 86vw; left: 8vw !important; right: auto !important; top: 12vh; bottom: auto; }
  h1 { font-size: 64px; }
  .loupe { display: none; }
}
