:root {
  --black: #08090D;
  --midnight: #111827;
  --chrome: #D7DDE4;
  --flare: #F7FBFF;
  --pewter: #7F8792;
  --gold: #BFA45A;
  --violet: #45335F;
  --blue: #7EC8FF;
  --burgundy: #6B1E2D;
  --soft: #AEB7C2;
  --display: "Cinzel Decorative", serif;
  --title: "Cormorant SC", serif;
  --body: "Spectral", serif;
  --mono: "Space Mono", monospace;
}

/* Design compliance typography tokens: Space Mono** Mono* in 400/700 */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--chrome);
  background: radial-gradient(circle at 20% 10%, rgba(69, 51, 95, 0.45), transparent 34%), linear-gradient(140deg, var(--black), var(--midnight) 48%, #07080c);
  font-family: var(--body);
  overflow-x: hidden;
}

.site-shell { position: relative; min-height: 100vh; isolation: isolate; }

#starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; background: transparent; }

.site-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(rgba(215, 221, 228, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(215, 221, 228, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle, black, transparent 78%);
}

.brass-tabs {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 20;
  display: grid;
  gap: 8px;
}

.brass-tabs a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--mono);
  border: 1px solid rgba(191, 164, 90, 0.65);
  background: linear-gradient(135deg, rgba(8, 9, 13, 0.8), rgba(69, 51, 95, 0.36));
  box-shadow: inset 0 0 18px rgba(247, 251, 255, 0.08), 0 0 22px rgba(191, 164, 90, 0.12);
}

.panel {
  min-height: 100vh;
  position: relative;
  display: grid;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  border-bottom: 1px solid rgba(215, 221, 228, 0.16);
}

.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 28vw;
  height: 28vw;
  border: 1px solid rgba(215, 221, 228, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.panel::before { top: -12vw; left: -9vw; box-shadow: inset 0 0 60px rgba(126, 200, 255, 0.08); }
.panel::after { right: -10vw; bottom: -13vw; box-shadow: inset 0 0 70px rgba(191, 164, 90, 0.08); }

.rail {
  position: absolute;
  height: 2px;
  width: 130vw;
  left: -15vw;
  top: 50%;
  background: linear-gradient(90deg, transparent, var(--pewter), var(--flare), var(--gold), transparent);
  box-shadow: 0 0 24px rgba(247, 251, 255, 0.28);
  transform: rotate(24deg);
  opacity: 0.55;
}
.rail-two { transform: rotate(-20deg); top: 42%; }
.rail-three { transform: rotate(18deg); top: 56%; }

.hero-panel { grid-template-columns: 0.8fr 1.2fr; grid-template-rows: auto 1fr auto; }

.seal {
  width: clamp(108px, 13vw, 164px);
  height: clamp(108px, 13vw, 164px);
  border-radius: 50%;
  border: 2px double var(--gold);
  display: grid;
  place-items: center;
  align-self: start;
  background: radial-gradient(circle, rgba(247, 251, 255, 0.11), rgba(69, 51, 95, 0.35) 44%, rgba(8, 9, 13, 0.88));
  box-shadow: inset 0 0 28px rgba(215, 221, 228, 0.2), 0 0 34px rgba(191, 164, 90, 0.22);
}

.seal-kanji { font-family: var(--title); font-size: clamp(30px, 4vw, 56px); color: var(--flare); letter-spacing: 0.12em; }
.seal-mark { position: absolute; margin-top: 82px; color: var(--gold); font-family: var(--mono); }

.constellation-map { grid-column: 1 / 3; grid-row: 1 / 4; align-self: center; justify-self: center; width: min(76vw, 950px); opacity: 0.9; }
.constellation-map svg { width: 100%; overflow: visible; filter: drop-shadow(0 0 22px rgba(126, 200, 255, 0.18)); }
.proof-path { fill: none; stroke: var(--chrome); stroke-width: 1.6; stroke-dasharray: 9 8; stroke-linecap: round; animation: drawPath 5s ease-in-out infinite alternate; }
.proof-path.ghost { stroke: var(--violet); stroke-width: 1; opacity: 0.7; animation-delay: -1s; }
.stars circle { fill: var(--flare); filter: url(#engrave); animation: starPulse 3.8s ease-in-out infinite; }
.stars circle:nth-child(3n) { fill: var(--blue); animation-delay: -1.4s; }
.stars circle:nth-child(4n) { fill: var(--gold); animation-delay: -2.2s; }
.labels text { font-family: var(--mono); fill: var(--soft); font-size: 15px; letter-spacing: 0.08em; }

.hero-title {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  max-width: 760px;
  text-align: right;
  padding: clamp(22px, 4vw, 48px);
}

.eyebrow, .step {
  margin: 0 0 12px;
  font-family: var(--mono);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

h1, h2 { margin: 0; }

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(56px, 10.5vw, 158px);
  letter-spacing: 0.08em;
  line-height: 0.86;
  background: linear-gradient(110deg, var(--pewter), var(--flare) 36%, var(--soft) 58%, var(--gold) 82%, var(--chrome));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 0 rgba(8, 9, 13, 0.9), 0 0 36px rgba(247, 251, 255, 0.22);
}

.hero-copy { margin: 24px 0 0 auto; max-width: 560px; font-size: clamp(18px, 2vw, 25px); line-height: 1.42; color: var(--chrome); }

.resolve-block {
  position: relative;
  border: 1px solid rgba(215, 221, 228, 0.28);
  background: linear-gradient(135deg, rgba(8, 9, 13, 0.7), rgba(17, 24, 39, 0.58));
  box-shadow: inset 0 0 0 1px rgba(247, 251, 255, 0.05), 0 20px 80px rgba(0, 0, 0, 0.42);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.resolve-block::before, .resolve-block::after { content: "⌜"; position: absolute; color: var(--gold); font-family: var(--title); font-size: 42px; line-height: 1; }
.resolve-block::before { top: 8px; left: 10px; }
.resolve-block::after { content: "⌟"; right: 10px; bottom: 6px; }

.skeleton-lines { position: absolute; inset: 18px; display: grid; align-content: center; gap: 14px; opacity: 1; transition: opacity 1s ease; pointer-events: none; }
.skeleton-lines span { height: 12px; border-radius: 999px; background: linear-gradient(90deg, rgba(127, 135, 146, 0.08), rgba(247, 251, 255, 0.38), rgba(127, 135, 146, 0.08)); background-size: 240% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-lines span:nth-child(2) { width: 72%; justify-self: end; }
.skeleton-lines span:nth-child(3) { width: 48%; }
.resolved .skeleton-lines { opacity: 0; }
.resolve-block > *:not(.skeleton-lines) { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1s ease; }
.resolved > *:not(.skeleton-lines) { opacity: 1; transform: none; }

.orrery-panel { grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1fr) minmax(260px, 0.75fr); align-items: center; gap: clamp(20px, 4vw, 58px); }

.plaque { padding: clamp(26px, 4vw, 48px); max-width: 480px; }
.premise-plaque { justify-self: start; align-self: start; margin-top: 8vh; }
.inference-plaque { justify-self: end; align-self: end; margin-bottom: 8vh; }
.plaque h2, .conclusion-vault h2 { font-family: var(--title); color: var(--flare); font-size: clamp(32px, 4vw, 64px); line-height: 0.94; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 0 20px rgba(247, 251, 255, 0.14); }
.plaque p:not(.step), .conclusion-vault p:not(.step) { color: var(--soft); font-size: clamp(17px, 1.4vw, 21px); line-height: 1.55; }

.logic-orrery { position: relative; width: min(46vw, 560px); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; filter: drop-shadow(0 0 30px rgba(126, 200, 255, 0.14)); }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(215, 221, 228, 0.44); box-shadow: inset 0 0 38px rgba(247, 251, 255, 0.06), 0 0 22px rgba(191, 164, 90, 0.08); }
.ring::before, .ring::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 18px var(--blue); }
.ring::before { top: 10%; left: 23%; }
.ring::after { right: 12%; bottom: 25%; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.ring span { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-family: var(--mono); color: var(--pewter); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }
.ring-a { width: 100%; height: 100%; animation: rotateCW 36s linear infinite; }
.ring-b { width: 72%; height: 72%; animation: rotateCCW 28s linear infinite; border-color: rgba(191, 164, 90, 0.5); }
.ring-c { width: 45%; height: 45%; animation: rotateCW 18s linear infinite; border-color: rgba(107, 30, 45, 0.75); }
.core-seal { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; color: var(--flare); font: 700 42px var(--mono); border: 1px double var(--gold); background: radial-gradient(circle, rgba(126, 200, 255, 0.18), rgba(8, 9, 13, 0.92)); box-shadow: inset 0 0 24px rgba(247, 251, 255, 0.12), 0 0 42px rgba(126, 200, 255, 0.22); }
.node { position: absolute; width: 7px; height: 7px; background: var(--flare); transform: rotate(45deg); box-shadow: 0 0 16px var(--flare); }
.n1 { top: 18%; right: 20%; }.n2 { bottom: 14%; left: 30%; background: var(--gold); }.n3 { top: 49%; left: 7%; background: var(--blue); }.n4 { bottom: 34%; right: 8%; }

.vault-panel { place-items: center; text-align: center; }
.vault-ornament { position: absolute; top: 10vh; left: 14vw; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--burgundy); color: var(--gold); font: 700 46px var(--mono); box-shadow: 0 0 40px rgba(107, 30, 45, 0.35), inset 0 0 26px rgba(191, 164, 90, 0.1); }
.conclusion-vault { width: min(900px, 88vw); padding: clamp(34px, 6vw, 74px); }
.conclusion-vault h2 { font-family: var(--display); background: linear-gradient(110deg, var(--flare), var(--chrome), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.theorem-stamp { display: inline-block; margin-top: 22px; padding: 14px 22px; color: var(--gold); text-decoration: none; font-family: var(--title); font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; border: 1px solid var(--gold); background: linear-gradient(135deg, rgba(107, 30, 45, 0.48), rgba(8, 9, 13, 0.72)); box-shadow: inset 0 0 18px rgba(247, 251, 255, 0.08); }
.final-coordinates { position: absolute; right: 30px; bottom: 28px; display: flex; gap: 18px; color: var(--pewter); font-family: var(--mono); font-size: 12px; }

@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes drawPath { from { stroke-dashoffset: 180; } to { stroke-dashoffset: 0; } }
@keyframes starPulse { 0%, 100% { opacity: 0.45; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.25); } }
@keyframes rotateCW { to { transform: rotate(360deg); } }
@keyframes rotateCCW { to { transform: rotate(-360deg); } }

@media (max-width: 900px) {
  .hero-panel, .orrery-panel { grid-template-columns: 1fr; gap: 28px; }
  .constellation-map { grid-column: 1; grid-row: 2; width: 98vw; }
  .hero-title { grid-column: 1; grid-row: 3; text-align: left; justify-self: stretch; }
  .hero-copy { margin-left: 0; }
  .logic-orrery { width: min(82vw, 520px); }
  .premise-plaque, .inference-plaque { margin: 0; justify-self: stretch; }
  .brass-tabs { right: 12px; top: 12px; }
}
