:root {
  /* Fonts are loaded from Google Fonts with system fallbacks. */
  --night: #0A1020;
  --ink: #111C35;
  --teal: #1D6F78;
  --cyan: #48BFC7;
  --mint: #A7F3D0;
  --parchment: #F4EFD8;
  --peach: #FFB38A;
  --violet: #6B5DD3;
  --display: "Space Grotesk", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", Inter, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; overflow: hidden; background: var(--night); color: var(--parchment); }

body { font-family: var(--body); }

button { font: inherit; color: inherit; }

.observatory {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(107, 93, 211, .24), transparent 26%),
    radial-gradient(circle at 18% 76%, rgba(72, 191, 199, .2), transparent 28%),
    linear-gradient(135deg, #0A1020 0%, #111C35 58%, #0A1020 100%);
}

.sky-noise, .observatory::before, .observatory::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sky-noise {
  opacity: .42;
  background-image:
    radial-gradient(circle, rgba(244,239,216,.72) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(167,243,208,.55) 0 1px, transparent 1.5px);
  background-size: 91px 83px, 137px 121px;
  background-position: 12px 9px, 44px 38px;
}

.observatory::before {
  border-left: 1px solid rgba(244,239,216,.12);
  border-right: 1px solid rgba(244,239,216,.12);
  left: 50%;
  width: 10vw;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(244,239,216,.05), transparent);
}

.observatory::after {
  background: repeating-linear-gradient(90deg, transparent 0 calc(8.333vw - 1px), rgba(244,239,216,.045) calc(8.333vw - 1px) 8.333vw);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent);
}

.spread {
  position: absolute;
  inset: clamp(18px, 3vw, 42px) clamp(18px, 4vw, 58px) 88px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 2vw, 30px);
  opacity: 0;
  transform: translateY(28px) scale(.985) rotate(-.25deg);
  pointer-events: none;
  transition: opacity .55s ease, transform .65s cubic-bezier(.2,.8,.2,1);
}

.spread.is-active { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); pointer-events: auto; }

.page {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(244,239,216,.14);
  background: linear-gradient(155deg, rgba(17,28,53,.75), rgba(10,16,32,.42));
  box-shadow: 0 24px 80px rgba(0,0,0,.34), inset 0 0 60px rgba(72,191,199,.05);
  padding: clamp(22px, 4vw, 58px);
  overflow: hidden;
}

.left-page { grid-column: 1 / span 6; }
.right-page { grid-column: 7 / span 6; }
.boot-page { grid-column: 1 / span 7; background: transparent; border-color: transparent; box-shadow: none; }
.empty-sky { grid-column: 8 / span 5; transform: rotate(.8deg); }
.map-page { grid-column: 1 / -1; }

.folio, .caption, .margin-note, .lane-label, .terminal-lines, .catalog-grid, .command-card, .return-line, .boot-prompt, .command-index { font-family: var(--mono); }

.folio {
  margin: 0 0 28px;
  color: var(--mint);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, .wordmark {
  font-family: var(--display);
  margin: 0;
  letter-spacing: -.055em;
  line-height: .9;
}

h1 { max-width: 760px; font-size: clamp(54px, 8vw, 132px); color: var(--parchment); }
h2 { font-size: clamp(44px, 6vw, 94px); color: var(--accent); }

.boot-prompt {
  position: absolute;
  left: clamp(18px, 4vw, 70px);
  bottom: clamp(70px, 14vh, 150px);
  font-size: clamp(16px, 2vw, 30px);
  color: var(--mint);
  text-shadow: 0 0 18px rgba(167,243,208,.38);
}

.prompt-mark { color: var(--peach); }
.cursor { display: inline-block; width: .62em; height: 1.05em; margin-left: .22em; background: var(--peach); vertical-align: -.18em; animation: blink 1s steps(1) infinite; }
.boot-note { position: absolute; left: 9vw; bottom: 7vh; max-width: 320px; color: rgba(244,239,216,.67); font-size: 15px; }

.finder-scope { position: absolute; inset: 19% 14% auto auto; width: min(28vw, 340px); aspect-ratio: 1; border: 1px dashed rgba(167,243,208,.52); border-radius: 50%; }
.finder-scope::before, .finder-scope::after { content: ""; position: absolute; background: rgba(244,239,216,.28); }
.finder-scope::before { left: 50%; top: 8%; bottom: 8%; width: 1px; }
.finder-scope::after { top: 50%; left: 8%; right: 8%; height: 1px; }

.hover-label { position: absolute; right: 38px; bottom: 44px; font-family: var(--mono); color: var(--cyan); opacity: .68; transition: color .2s ease, transform .2s ease; }
.hover-label:hover { color: var(--peach); transform: translateY(-5px); }

.editorial-terminal { transform: rotate(-.8deg); }
.star-catalog { transform: rotate(.65deg); padding-top: clamp(46px, 8vw, 100px); }
.star-catalog p, .map-lead, .pullquote { font-size: clamp(18px, 2vw, 28px); line-height: 1.35; color: rgba(244,239,216,.78); max-width: 650px; }
.terminal-lines { margin-top: 34px; color: rgba(167,243,208,.84); font-size: clamp(13px, 1.3vw, 18px); }
.terminal-lines span { color: var(--peach); margin-right: 18px; }
.catalog-grid { display: grid; grid-template-columns: auto 1fr; gap: 14px 26px; margin-top: 38px; color: var(--parchment); }
.catalog-grid span:nth-child(odd) { color: var(--mint); }
.margin-note { position: absolute; right: 24px; top: 22px; color: var(--peach); }
.rotate-left { transform: rotate(3deg); }

.spread-catch { grid-template-columns: repeat(12, 1fr); }
.catch-copy { grid-column: 1 / span 5; }
.gutter-lane { grid-column: 6 / span 2; border-left: 1px dashed rgba(255,179,138,.5); border-right: 1px dashed rgba(255,179,138,.5); position: relative; }
.lane-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(90deg); white-space: nowrap; color: var(--peach); }
.catch-notes { grid-column: 8 / span 5; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
blockquote { margin: 10vh 0 0; font-family: var(--display); font-size: clamp(36px, 5.4vw, 86px); line-height: .95; letter-spacing: -.045em; color: var(--parchment); }
.caption { color: rgba(244,239,216,.68); }
.command-card { width: max-content; max-width: 90%; border: 1px solid rgba(167,243,208,.34); background: rgba(29,111,120,.22); padding: 16px 20px; color: var(--mint); transform: rotate(-1deg); transition: transform .22s ease, border-color .22s ease; }
.command-card.offset { align-self: flex-end; transform: rotate(1.8deg); color: var(--peach); }
.command-card:hover { transform: translateY(-6px) rotate(0deg); border-color: var(--peach); }

.map-page { padding: clamp(34px, 6vw, 80px); background: radial-gradient(circle at 50% 48%, rgba(107,93,211,.22), transparent 32%), linear-gradient(155deg, rgba(17,28,53,.86), rgba(10,16,32,.52)); }
.map-page::before { content: ""; position: absolute; inset: 12% 10%; border: 1px dashed rgba(72,191,199,.42); border-radius: 50%; transform: rotate(-8deg); }
.map-page::after { content: "✦  :  *  ::  ✦  .  *  :"; position: absolute; left: 20%; right: 12%; top: 48%; color: rgba(244,239,216,.42); font-family: var(--mono); letter-spacing: 1.1vw; }
.map-panel { position: absolute; padding: 14px 18px; border: 1px solid rgba(244,239,216,.18); background: rgba(10,16,32,.72); font-family: var(--mono); color: var(--mint); }
.panel-a { right: 9%; top: 14%; }
.panel-b { left: 10%; bottom: 18%; color: var(--peach); }
.panel-c { right: 16%; bottom: 13%; color: var(--cyan); }

.return-page { display: flex; flex-direction: column; justify-content: center; }
.wordmark { font-size: clamp(62px, 11vw, 170px); color: var(--parchment); }
.wordmark span { display: inline-block; margin-right: .04em; padding: 0 .035em; background: linear-gradient(to top, rgba(72,191,199,.2) 0 45%, transparent 45%); }
.wordmark em { font-style: normal; color: var(--mint); font-size: .48em; letter-spacing: -.04em; }
.return-line { color: var(--mint); font-size: clamp(15px, 1.8vw, 24px); }
.constellation-page { display: flex; align-items: flex-end; transform: rotate(.7deg); }
.pullquote { font-family: var(--display); color: var(--peach); }

.arc-stage { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.arc { fill: none; stroke: var(--violet); stroke-width: 2; stroke-dasharray: 5 12; opacity: .42; transition: opacity .4s ease, stroke .4s ease; }
.arc-two { stroke: var(--cyan); opacity: .34; }
.arc-three { stroke: var(--peach); opacity: .22; }

.blob-field { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; pointer-events: auto; border: 0; cursor: pointer; font-family: var(--mono); font-size: 11px; color: #0A1020; display: grid; place-items: center; box-shadow: 0 0 28px rgba(72,191,199,.32); transition: transform .35s cubic-bezier(.2,.9,.2,1), filter .25s ease; }
.blob::before { content: ""; position: absolute; inset: 18%; border: 1px solid rgba(10,16,32,.18); border-radius: 45% 55% 48% 52%; }
.blob:hover { filter: brightness(1.12); transform: translate(var(--x), var(--y)) scale(1.12) rotate(7deg); }
.blob-input { width: 74px; height: 62px; border-radius: 51% 49% 42% 58%; background: var(--mint); --x: 10vw; --y: 70vh; transform: translate(var(--x), var(--y)); }
.blob-output { width: 92px; height: 76px; border-radius: 58% 42% 57% 43%; background: var(--cyan); --x: 72vw; --y: 28vh; transform: translate(var(--x), var(--y)); }
.blob-cache { width: 64px; height: 68px; border-radius: 44% 56% 61% 39%; background: var(--peach); --x: 44vw; --y: 47vh; transform: translate(var(--x), var(--y)); }
.blob-dream { width: 80px; height: 70px; border-radius: 60% 40% 45% 55%; background: var(--violet); color: var(--parchment); --x: 82vw; --y: 66vh; transform: translate(var(--x), var(--y)); }
.blob-return { width: 68px; height: 58px; border-radius: 48% 52% 59% 41%; background: var(--parchment); --x: 22vw; --y: 23vh; transform: translate(var(--x), var(--y)); }
.observatory.is-tossing .blob { animation: squash .62s ease; }

.command-index {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(244,239,216,.16);
  background: rgba(10,16,32,.76);
  backdrop-filter: blur(14px);
  z-index: 20;
}
.command-token { border: 1px solid rgba(72,191,199,.28); background: rgba(17,28,53,.72); color: var(--mint); padding: 9px 13px; cursor: pointer; transition: transform .2s ease, border-color .2s ease, color .2s ease; }
.command-token:hover, .command-token.is-active { transform: translateY(-3px); border-color: var(--peach); color: var(--peach); }
.live-command { margin-left: 10px; color: rgba(244,239,216,.78); min-width: 210px; }
.registration { position: absolute; z-index: 10; color: rgba(255,179,138,.7); font-size: 22px; }
.registration-a { left: 22px; top: 18px; }
.registration-b { right: 24px; bottom: 88px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes squash { 0%, 100% { border-radius: 51% 49% 42% 58%; } 45% { border-radius: 62% 38% 34% 66%; } }

@media (max-width: 760px) {
  html, body { overflow: auto; }
  .observatory { min-height: 100vh; height: auto; overflow: hidden; }
  .spread { position: relative; inset: auto; min-height: 100vh; padding: 20px; grid-template-columns: 1fr; opacity: 1; transform: none; pointer-events: auto; display: none; }
  .spread.is-active { display: grid; }
  .page, .left-page, .right-page, .boot-page, .empty-sky, .catch-copy, .catch-notes, .gutter-lane, .map-page { grid-column: 1; }
  .gutter-lane { min-height: 120px; }
  .command-index { width: calc(100vw - 24px); overflow-x: auto; justify-content: flex-start; }
  .live-command { min-width: 180px; }
}
