:root {
    /* Typography compliance note: IBM Plex Sans** for body copy and implementation notes. */
    --indigo: #07111F;
    --umbra: #02050B;
    --moon: #F1E8D2;
    --silver: #B9C7D6;
    --brass: #B88A3B;
    --violet: #4A5FA8;
    --cyan: #AEE7EA;
    --rose: #B96A6D;
    --phase: 0;
    --px: 0;
    --py: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--moon);
    background: radial-gradient(circle at 72% 28%, rgba(74, 95, 168, .22), transparent 34%), linear-gradient(145deg, var(--umbra), var(--indigo) 42%, #09182a 100%);
    font-family: "IBM Plex Sans", sans-serif;
    overflow-x: hidden;
}

.grain, .eclipse-haze {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 12;
}

.grain {
    opacity: .18;
    background-image: radial-gradient(circle at 20% 30%, rgba(241,232,210,.18) 0 1px, transparent 1.6px), radial-gradient(circle at 70% 60%, rgba(185,199,214,.12) 0 1px, transparent 1.8px);
    background-size: 47px 43px, 73px 61px;
    mix-blend-mode: screen;
}

.eclipse-haze {
    background: radial-gradient(circle at calc(58% + var(--px) * 7%) calc(44% + var(--py) * 7%), rgba(185,106,109,.16), transparent 28%), radial-gradient(circle at 50% 50%, transparent 45%, rgba(2,5,11,.45) 100%);
    opacity: calc(.25 + var(--phase) * .08);
}

.workbench { position: relative; z-index: 2; }

.scene {
    position: relative;
    min-height: 100vh;
    padding: 8vmin;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    border-bottom: 1px solid rgba(185,199,214,.08);
}

.scene::before {
    content: "";
    position: absolute;
    inset: 5vmin;
    border: 1px solid rgba(185,199,214,.12);
    border-radius: 50%;
    transform: rotate(calc(-18deg + var(--phase) * 9deg)) scaleX(1.38);
}

.scene::after {
    content: "";
    position: absolute;
    width: 44vmin;
    height: 44vmin;
    border: 1px dashed rgba(184,138,59,.28);
    border-radius: 50%;
    right: -13vmin;
    top: 12vmin;
}

.scene-copy {
    position: relative;
    z-index: 4;
    max-width: 560px;
    filter: drop-shadow(0 14px 30px rgba(2,5,11,.55));
}

.lower-left { grid-column: 2 / 7; align-self: end; padding-bottom: 10vh; }
.right-column, .upper-right { grid-column: 8 / 12; }
.left-column, .center-left { grid-column: 2 / 7; }
.upper-right { align-self: start; padding-top: 10vh; }

.eyebrow, .phase-tab, .annotation, .orbit-cta, .test-marks, .calendar-tabs { font-family: "Syne", sans-serif; }

.eyebrow {
    margin: 0 0 1rem;
    color: var(--brass);
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .72rem;
}

.wordmark, h2 {
    margin: 0;
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .86;
}

.wordmark {
    font-size: clamp(6rem, 17vw, 17rem);
    background: linear-gradient(90deg, rgba(241,232,210,.08), var(--moon) 45%, var(--cyan) 50%, rgba(241,232,210,.2) 58%);
    background-size: 240% 100%;
    background-position: calc(100% - var(--phase) * 25%) 0;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

h2 { font-size: clamp(4rem, 10vw, 10rem); color: var(--moon); }
h2 span { display: block; font-family: "Fraunces", serif; font-size: .55em; color: var(--silver); letter-spacing: -.035em; }

.bodyline, .scene-copy p:not(.eyebrow) {
    color: rgba(241,232,210,.76);
    font-size: clamp(1rem, 1.45vw, 1.35rem);
    line-height: 1.65;
}

.phase-strip {
    position: fixed;
    z-index: 20;
    left: 50%;
    top: 1.35rem;
    transform: translateX(-50%);
    display: flex;
    gap: .35rem;
    padding: .45rem;
    border: 1px solid rgba(185,199,214,.18);
    border-radius: 999px;
    background: rgba(2,5,11,.48);
    backdrop-filter: blur(14px);
}

.phase-tab {
    border: 0;
    background: transparent;
    color: rgba(185,199,214,.68);
    padding: .65rem .82rem;
    border-radius: 999px;
    letter-spacing: .07em;
    text-transform: uppercase;
    font-size: .64rem;
    cursor: pointer;
    transition: color .5s ease, background .5s ease;
}

.phase-tab span {
    display: inline-block;
    width: .48rem;
    height: .48rem;
    margin-right: .45rem;
    border-radius: 50%;
    border: 1px solid var(--brass);
    box-shadow: inset calc(-5px + var(--phase) * 2px) 0 0 var(--umbra);
}

.phase-tab.active { color: var(--cyan); background: rgba(174,231,234,.08); }

.phase-engine {
    position: fixed;
    z-index: 3;
    width: min(72vmin, 760px);
    height: min(72vmin, 760px);
    left: calc(63vw - var(--phase) * 8vw + var(--px) * 1.5vw);
    top: calc(48vh + (2 - var(--phase)) * 8vh + var(--py) * 1.5vh);
    transform: translate(-50%, -50%) rotate(calc(var(--phase) * -3deg));
    transition: left 1.1s cubic-bezier(.2,.7,.1,1), top 1.1s cubic-bezier(.2,.7,.1,1);
    pointer-events: none;
}

.orbit-svg, .reticle {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
}

.orbit-svg { transform: rotate(calc(var(--phase) * 16deg)); transition: transform 1.1s ease; }
.orbit, .tick-ring line { fill: none; stroke: rgba(185,199,214,.28); stroke-width: 1; }
.orbit-two { stroke: rgba(74,95,168,.34); }
.brass-arc { fill: none; stroke: var(--brass); stroke-width: 2; stroke-dasharray: 5 12; opacity: .75; }
.tick-ring line { stroke: var(--brass); opacity: .6; }

.moon {
    position: absolute;
    inset: 13%;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 35% 28%, #fff8e9, var(--moon) 42%, #d8cfb9 75%, #9e9f9e 100%);
    box-shadow: inset -42px -50px 80px rgba(2,5,11,.38), 0 0 80px rgba(174,231,234,.12), 0 26px 120px rgba(2,5,11,.75);
}

.moon::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 22% 40%, rgba(7,17,31,.12) 0 1.5px, transparent 2px), radial-gradient(circle at 64% 25%, rgba(7,17,31,.10) 0 2px, transparent 3px), radial-gradient(circle at 48% 68%, rgba(7,17,31,.12) 0 1px, transparent 2px);
    background-size: 31px 35px, 57px 61px, 43px 47px;
    opacity: .65;
}

.moon-shadow {
    position: absolute;
    inset: -3%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 43%, rgba(74,95,168,.28), rgba(2,5,11,.98) 58%);
    transform: translateX(calc(-62% + var(--phase) * 31%));
    transition: transform 1s cubic-bezier(.2,.7,.1,1), background 1s ease;
    mix-blend-mode: multiply;
    z-index: 4;
}

.maria {
    position: absolute;
    border-radius: 49% 51% 58% 42%;
    background: rgba(74,95,168,.18);
    border: 1px solid rgba(7,17,31,.08);
}
.maria-one { width: 26%; height: 19%; left: 28%; top: 24%; transform: rotate(-18deg); }
.maria-two { width: 18%; height: 26%; left: 57%; top: 45%; transform: rotate(24deg); }
.maria-three { width: 22%; height: 14%; left: 30%; top: 63%; transform: rotate(9deg); }

.craters {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 43% 38%, transparent 0 3%, rgba(7,17,31,.12) 3.4% 3.8%, transparent 4.2%), radial-gradient(circle at 66% 61%, transparent 0 2%, rgba(7,17,31,.12) 2.3% 2.8%, transparent 3.2%), radial-gradient(circle at 24% 58%, transparent 0 1.5%, rgba(7,17,31,.16) 1.8% 2.2%, transparent 2.6%);
    animation: glint 5s ease-in-out infinite;
}

.aperture-text {
    position: absolute;
    inset: 20%;
    display: grid;
    place-items: center;
    color: rgba(7,17,31,.38);
    font-family: "Syne", sans-serif;
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .72rem;
}
.aperture-text span { position: absolute; transform: rotate(calc(var(--phase) * 12deg)); opacity: calc(.18 + var(--phase) * .1); }
.aperture-text span:nth-child(1) { top: 8%; left: 20%; }
.aperture-text span:nth-child(2) { top: 42%; right: 2%; }
.aperture-text span:nth-child(3) { bottom: 20%; left: 8%; }
.aperture-text span:nth-child(4) { bottom: 4%; right: 18%; }

.reticle {
    border: 1px solid rgba(174,231,234,.14);
    border-radius: 50%;
    transform: scaleX(1.1) rotate(34deg);
}
.reticle::before, .reticle::after { content: ""; position: absolute; background: rgba(174,231,234,.22); }
.reticle::before { width: 1px; height: 100%; left: 50%; top: 0; }
.reticle::after { height: 1px; width: 100%; top: 50%; left: 0; }

.annotation {
    position: absolute;
    z-index: 5;
    color: var(--silver);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    border-top: 1px solid rgba(184,138,59,.55);
    padding-top: .65rem;
}
.pin-a { right: 14vw; bottom: 14vh; }
.pin-b { left: 12vw; top: 24vh; }

.calendar-tabs {
    position: absolute;
    left: 8vmin;
    bottom: 6vmin;
    display: flex;
    gap: .55rem;
}
.calendar-tabs i { width: 2.1rem; height: .52rem; border: 1px solid rgba(184,138,59,.5); border-radius: 999px; background: linear-gradient(90deg, var(--moon) 45%, var(--umbra) 46%); }

.code-vellum, .test-marks, .engraved-notes, .orbit-cta {
    position: absolute;
    z-index: 4;
}
.code-vellum {
    left: 10vw;
    top: 26vh;
    width: 34vw;
    min-height: 42vh;
    border: 1px solid rgba(185,199,214,.18);
    border-radius: 50% 44% 48% 52%;
    background: rgba(241,232,210,.06);
    color: var(--silver);
    transform: rotate(-10deg);
}
.code-vellum * { position: absolute; font-family: "IBM Plex Sans", sans-serif; font-weight: 400; }
.code-vellum em { left: 18%; top: 18%; color: var(--cyan); }
.code-vellum b { right: 16%; top: 38%; color: var(--moon); }
.code-vellum small { left: 22%; bottom: 24%; color: var(--silver); }
.code-vellum strong { right: 20%; bottom: 14%; font-family: "Fraunces", serif; font-size: 5rem; color: rgba(184,138,59,.46); }

.split-blade {
    position: absolute;
    inset: 0 50% 0 0;
    background: linear-gradient(90deg, rgba(241,232,210,.08), rgba(185,199,214,.025));
    border-right: 1px solid rgba(174,231,234,.35);
}
.test-marks { right: 8vw; bottom: 18vh; display: grid; gap: .8rem; color: var(--silver); }
.test-marks span { border-bottom: 1px solid rgba(184,138,59,.38); padding: .35rem 4rem .35rem 0; }

.engraved-notes {
    left: 8vw;
    bottom: 12vh;
    display: grid;
    grid-template-columns: repeat(2, minmax(9rem, 1fr));
    gap: 1rem;
}
.engraved-notes p {
    margin: 0;
    padding: 1rem;
    border: 1px solid rgba(185,199,214,.16);
    border-radius: 999px;
    color: var(--brass);
    font-family: "Syne", sans-serif;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
}

.orbit-cta {
    right: 18vw;
    bottom: 22vh;
    width: 11rem;
    height: 11rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--rose);
    border-radius: 50%;
    color: var(--rose);
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .13em;
    font-size: .72rem;
    background: radial-gradient(circle, rgba(185,106,109,.16), transparent 70%);
}

.scene-eclipse { background: radial-gradient(circle at 70% 42%, rgba(185,106,109,.16), transparent 38%); }

@keyframes glint { 0%, 100% { opacity: .45; } 50% { opacity: .92; } }

@media (max-width: 800px) {
    .phase-strip { max-width: calc(100vw - 1rem); overflow: auto; }
    .phase-tab { white-space: nowrap; }
    .scene { padding: 7rem 1.2rem 4rem; grid-template-columns: 1fr; }
    .lower-left, .right-column, .upper-right, .left-column, .center-left { grid-column: 1; }
    .phase-engine { width: 88vmin; height: 88vmin; left: 66vw; opacity: .75; }
    .code-vellum { width: 70vw; left: 3vw; }
    .engraved-notes { grid-template-columns: 1fr; left: 1.2rem; }
}
