:root {
    --night: #071018;
    --slate: #20313A;
    --vellum: #F4EBD7;
    --cyan: #8DEBFF;
    --violet: #6F58D9;
    --brass: #C89B3C;
    --peach: #FFB38A;
    --scene-tilt: -4deg;
}

/* Typography compliance note: IBM Plex Mono is used very sparingly for proof coordinates; Inter** Inter\*\* Inte* supports concise explanatory copy. */

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: #071018;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #F4EBD7;
    font-family: "Inter", sans-serif;
    background:
        radial-gradient(circle at 50% 28%, rgba(111, 88, 217, 0.2), transparent 34rem),
        radial-gradient(circle at 16% 72%, rgba(141, 235, 255, 0.1), transparent 28rem),
        linear-gradient(120deg, #071018 0%, #0a151e 48%, #20313A 140%);
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.observatory-grain,
.dome-shadow,
.starfield,
.orrery-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.observatory-grain {
    z-index: 30;
    opacity: 0.13;
    mix-blend-mode: screen;
    background-image:
        radial-gradient(circle at 20% 30%, #F4EBD7 0 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, #8DEBFF 0 1px, transparent 1px);
    background-size: 37px 37px, 53px 53px;
}

.dome-shadow {
    z-index: 2;
    background:
        radial-gradient(ellipse at 50% -12%, transparent 18%, rgba(7, 16, 24, 0.3) 48%, rgba(7, 16, 24, 0.88) 100%),
        linear-gradient(90deg, rgba(7, 16, 24, 0.72), transparent 28%, transparent 72%, rgba(7, 16, 24, 0.72));
}

.starfield {
    z-index: 1;
    opacity: 0.72;
}

.site-header {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px clamp(22px, 4vw, 60px);
    color: rgba(244, 235, 215, 0.82);
}

.wordmark {
    font-family: "Fraunces", serif;
    font-variation-settings: "SOFT" 20, "WONK" 1;
    font-size: clamp(1.15rem, 2.1vw, 1.8rem);
    letter-spacing: 0.03em;
    text-shadow: 0 0 22px rgba(141, 235, 255, 0.24);
}

.header-instrument {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 500 0.72rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 235, 215, 0.68);
}

.pin {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8DEBFF;
    box-shadow: 0 0 18px #8DEBFF;
}

.orbit-nav {
    position: fixed;
    z-index: 42;
    right: clamp(18px, 3vw, 44px);
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    gap: 18px;
}

.nav-dot {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(200, 155, 60, 0.42);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(32, 49, 58, 0.38);
    color: rgba(244, 235, 215, 0.56);
    font: 500 0.62rem/1 "IBM Plex Mono", monospace;
    transition: border-color 500ms ease, color 500ms ease, box-shadow 500ms ease, transform 500ms ease;
}

.nav-dot.active {
    border-color: #8DEBFF;
    color: #8DEBFF;
    box-shadow: inset 0 0 16px rgba(141, 235, 255, 0.2), 0 0 22px rgba(141, 235, 255, 0.16);
    transform: rotate(22deg) scale(1.14);
}

.orrery-stage {
    z-index: 10;
    display: grid;
    place-items: center;
    transform: translate(var(--parallax-x, 0px), var(--parallax-y, 0px));
    transition: filter 900ms ease;
}

.orrery {
    width: min(76vmin, 760px);
    height: min(76vmin, 760px);
    overflow: visible;
    filter: drop-shadow(0 0 34px rgba(141, 235, 255, 0.12));
}

.ring ellipse {
    fill: none;
    stroke: url(#brass);
    stroke-width: 1.4;
    stroke-dasharray: 9 13;
    transform-origin: 360px 360px;
}

.ring-one { transform-origin: 360px 360px; animation: rotateSlow 34s linear infinite; }
.ring-two { transform-origin: 360px 360px; animation: rotateSlow 48s linear infinite reverse; }
.ring-three { transform-origin: 360px 360px; animation: rotateSlow 62s linear infinite; }
.ring-two ellipse { transform: rotate(38deg); stroke-dasharray: 2 9; opacity: 0.62; }
.ring-three ellipse { transform: rotate(-21deg); opacity: 0.48; }

.core-halo { opacity: 0.48; transform-origin: 360px 360px; transition: opacity 900ms ease, transform 900ms ease; }
.aperture { transform-origin: 360px 360px; animation: shutter 18s ease-in-out infinite; opacity: 0.24; transition: opacity 900ms ease, transform 900ms ease; }
.aperture path { fill: none; stroke: #F4EBD7; stroke-width: 1; stroke-linejoin: round; }
.proof-rays { opacity: 0.2; transition: opacity 900ms ease; }
.proof-rays line { stroke: #8DEBFF; stroke-width: 1.2; stroke-dasharray: 4 12; filter: url(#softGlow); }
.question-star { fill: #8DEBFF; filter: url(#softGlow); transform-origin: 476px 276px; animation: sparkPulse 2.8s ease-in-out infinite; transition: transform 900ms ease, opacity 900ms ease; }
.premise { fill: #F4EBD7; stroke: #C89B3C; stroke-width: 2; filter: url(#softGlow); opacity: 0.72; transition: opacity 900ms ease, transform 900ms ease; }
.eclipse-moon { fill: #071018; stroke: #6F58D9; stroke-width: 1.2; opacity: 0; transform: translateX(-90px); transition: opacity 900ms ease, transform 900ms ease; }
.dawn-disc { fill: #FFB38A; opacity: 0; filter: blur(1px); transform-origin: 360px 360px; transform: scale(0.55); transition: opacity 1100ms ease, transform 1100ms ease; }
.coordinate-labels text { fill: rgba(244, 235, 215, 0.42); font: 500 14px "IBM Plex Mono", monospace; letter-spacing: 0.08em; }

body.state-alignment .premise { opacity: 1; transform: scale(1.45); }
body.state-alignment .ring ellipse { stroke-dasharray: 18 7; }
body.state-eclipse .eclipse-moon { opacity: 0.86; transform: translateX(0); }
body.state-eclipse .core-halo { opacity: 0.22; transform: scale(0.92); }
body.state-eclipse .question-star { opacity: 0.38; }
body.state-transit .proof-rays { opacity: 0.95; }
body.state-transit .aperture { opacity: 0.55; transform: rotate(28deg) scale(1.08); }
body.state-dawn .dawn-disc { opacity: 0.28; transform: scale(1.8); }
body.state-dawn .core-halo { opacity: 0.75; transform: scale(1.2); }
body.state-dawn .ring-one { animation-duration: 80s; }

.inference-orrery {
    position: relative;
    z-index: 20;
}

.scene {
    min-height: 100vh;
    position: relative;
    display: grid;
    align-items: center;
    padding: clamp(96px, 12vh, 150px) clamp(24px, 8vw, 118px);
    transform: rotate(var(--scene-tilt));
}

.scene > * { transform: rotate(calc(var(--scene-tilt) * -1)); }
.scene-spark { --scene-tilt: -3deg; }
.scene-alignment { --scene-tilt: 4deg; }
.scene-eclipse { --scene-tilt: -6deg; }
.scene-transit { --scene-tilt: 5deg; }
.scene-dawn { --scene-tilt: -2deg; }

.scene-copy {
    width: min(620px, 82vw);
    opacity: 0.38;
    transform: rotate(calc(var(--scene-tilt) * -1)) translateY(28px);
    transition: opacity 850ms ease, transform 850ms ease;
}

.scene.active .scene-copy {
    opacity: 1;
    transform: rotate(calc(var(--scene-tilt) * -1)) translateY(0);
}

.scene:nth-child(even) .scene-copy { margin-left: auto; }

.kicker {
    margin: 0 0 18px;
    color: #8DEBFF;
    font: 500 0.76rem/1.5 "IBM Plex Mono", monospace;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1, h2 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-variation-settings: "SOFT" 35, "WONK" 1;
    font-weight: 650;
    line-height: 0.94;
    letter-spacing: -0.055em;
    color: #F4EBD7;
    text-shadow: 0 0 34px rgba(244, 235, 215, 0.1), 0 0 60px rgba(111, 88, 217, 0.13);
}

h1 { font-size: clamp(4.1rem, 11.5vw, 10.5rem); max-width: 930px; }
h2 { font-size: clamp(3.2rem, 8.4vw, 8.2rem); max-width: 940px; }

.scene-copy p:not(.kicker) {
    max-width: 560px;
    margin: 26px 0 0;
    color: rgba(244, 235, 215, 0.73);
    font-size: clamp(1rem, 1.45vw, 1.28rem);
    line-height: 1.72;
}

.trace-link {
    display: inline-flex;
    margin-top: 32px;
    padding: 12px 18px;
    border: 1px solid rgba(141, 235, 255, 0.38);
    border-radius: 999px;
    color: #8DEBFF;
    background: rgba(32, 49, 58, 0.36);
    box-shadow: inset 0 0 20px rgba(141, 235, 255, 0.08);
    font: 600 0.78rem/1 "Inter", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vellum-note,
.tangent,
.eclipse-card,
.proof-strip,
.dawn-manuscript {
    position: absolute;
    border: 1px solid rgba(200, 155, 60, 0.35);
    background: linear-gradient(145deg, rgba(244, 235, 215, 0.1), rgba(32, 49, 58, 0.36));
    color: rgba(244, 235, 215, 0.76);
    box-shadow: 0 20px 80px rgba(7, 16, 24, 0.45);
    backdrop-filter: blur(10px);
}

.vellum-note {
    right: 12vw;
    bottom: 15vh;
    width: 270px;
    padding: 22px;
    transform: rotate(7deg);
    font-size: 0.92rem;
    line-height: 1.55;
}

.vellum-note span,
.eclipse-card span,
.proof-strip span,
.dawn-manuscript span {
    display: block;
    margin-bottom: 10px;
    color: #FFB38A;
    font: 500 0.7rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tangent {
    left: 10vw;
    bottom: 12vh;
    max-width: 310px;
    padding: 18px 20px;
    border-radius: 0 38px 38px 38px;
    font: 0.92rem/1.55 "Inter", sans-serif;
}

.tangent b { color: #8DEBFF; font-family: "IBM Plex Mono", monospace; }

.premise-map {
    position: absolute;
    left: 11vw;
    top: 22vh;
    width: 260px;
    height: 190px;
    border: 1px solid rgba(141, 235, 255, 0.2);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.premise-map span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F4EBD7;
    box-shadow: 0 0 16px #8DEBFF;
}

.premise-map span:nth-child(1) { left: 32px; top: 84px; }
.premise-map span:nth-child(2) { left: 118px; top: 28px; }
.premise-map span:nth-child(3) { left: 202px; top: 102px; }
.premise-map span:nth-child(4) { left: 84px; top: 152px; }
.premise-map span:nth-child(5) { left: 170px; top: 54px; background: #C89B3C; }

.eclipse-card {
    right: 14vw;
    top: 21vh;
    width: min(350px, 74vw);
    padding: 24px;
    border-radius: 50% 50% 42% 58%;
}

.eclipse-card p,
.dawn-manuscript p { margin: 0; line-height: 1.55; }

.proof-strip {
    left: 10vw;
    bottom: 19vh;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-radius: 999px;
}

.proof-strip span { margin: 0; color: #8DEBFF; }
.proof-strip i { width: clamp(34px, 7vw, 92px); height: 1px; background: linear-gradient(90deg, #8DEBFF, #C89B3C); box-shadow: 0 0 12px rgba(141, 235, 255, 0.6); }
.proof-strip strong { color: #F4EBD7; font: 500 0.72rem/1 "IBM Plex Mono", monospace; letter-spacing: 0.16em; text-transform: uppercase; }

.dawn-manuscript {
    right: 13vw;
    bottom: 13vh;
    width: min(420px, 78vw);
    padding: 28px;
    border-color: rgba(255, 179, 138, 0.45);
    background: linear-gradient(145deg, rgba(255, 179, 138, 0.16), rgba(244, 235, 215, 0.08));
}

@keyframes rotateSlow { to { transform: rotate(360deg); } }
@keyframes shutter { 0%, 100% { transform: rotate(0deg) scale(0.96); } 50% { transform: rotate(18deg) scale(1.04); } }
@keyframes sparkPulse { 0%, 100% { transform: scale(0.82); opacity: 0.72; } 50% { transform: scale(1.45); opacity: 1; } }

@media (max-width: 760px) {
    .site-header { padding: 18px; }
    .header-instrument { display: none; }
    .orbit-nav { right: 12px; gap: 10px; }
    .nav-dot { width: 28px; height: 28px; }
    .orrery { width: 118vmin; height: 118vmin; opacity: 0.58; }
    .scene { padding: 92px 22px; }
    .scene-copy, .scene-copy p:not(.kicker) { width: auto; max-width: calc(100vw - 58px); }
    .vellum-note, .tangent, .eclipse-card, .proof-strip, .dawn-manuscript, .premise-map { display: none; }
}
