/* =====================================================================
   mechanic.party — celestial mechanic's workshop
   Anti-design × art-deco, immersive scroll, path-draw SVG, no gradients
   Palette: #0B0B0F #12111E #D4A843 #C4957A #F0EDE5 #8A8579 #E8C55A #5B7A6A
   ===================================================================== */

:root {
    --void-black: #0B0B0F;
    --deep-indigo: #12111E;
    --celestial-gold: #D4A843;
    --dust-rose: #C4957A;
    --chalk-white: #F0EDE5;
    --tarnished-silver: #8A8579;
    --stellar-amber: #E8C55A;
    --oxidized-copper: #5B7A6A;

    --offset-1: 8vw;
    --offset-2: 12vw;
    --offset-3: 18vw;

    --display-font: 'Poiret One', 'Inter', sans-serif;
    --secondary-font: 'Josefin Sans', 'Inter', sans-serif;
    --body-font: 'Lora', 'Inter', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background: var(--void-black);
    color: var(--chalk-white);
    font-family: var(--body-font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    position: relative;
    line-height: 1.8;
}

/* SVG defs holder, hidden but kept in flow for filter references */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ====================================================================
   Fixed UI: roman numeral zone indicator (top-left)
   ==================================================================== */
.zone-indicator {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    mix-blend-mode: normal;
}

.zone-numeral {
    font-family: var(--display-font);
    font-size: 28px;
    line-height: 1;
    letter-spacing: 0.15em;
    color: var(--celestial-gold);
    text-transform: uppercase;
    transition: color 0.4s ease;
}

.zone-label {
    font-family: var(--secondary-font);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.28em;
    color: var(--tarnished-silver);
    text-transform: uppercase;
    transition: color 0.4s ease;
    max-width: 14ch;
}

/* ====================================================================
   Fixed UI: scroll progress on right margin
   ==================================================================== */
.scroll-progress {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: 24px;
    width: 2px;
    z-index: 100;
    pointer-events: none;
}

.progress-track {
    position: absolute;
    inset: 0;
    background: var(--tarnished-silver);
    opacity: 0.18;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--celestial-gold);
    will-change: height;
}

/* ====================================================================
   Main field: continuous celestial descent
   ==================================================================== */
.celestial-field {
    position: relative;
    width: 100%;
}

.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.zone-edge-tick {
    position: absolute;
    top: 24px;
    right: 60px;
    font-family: var(--secondary-font);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--tarnished-silver);
    z-index: 4;
}

/* Noise overlay — pseudo-element to keep it cheap and contained */
.noise-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.noise-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--void-black);
    filter: url(#noise);
    opacity: 0.06;
    pointer-events: none;
}

.noise-indigo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--deep-indigo);
    pointer-events: none;
}

.noise-intense::after {
    filter: url(#noise-fine);
    opacity: 0.14;
}

/* ====================================================================
   ZONE 1 — THE OBSERVATORY (0-100vh)
   ==================================================================== */
.zone-observatory {
    height: 100vh;
    background: var(--void-black);
}

.observatory-constellation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.star-node {
    opacity: 0;
    animation: starTwinkle 4.5s ease-in-out infinite;
}

.star-node:nth-child(1) { animation-delay: 0.2s; }
.star-node:nth-child(2) { animation-delay: 0.7s; }
.star-node:nth-child(3) { animation-delay: 1.2s; }
.star-node:nth-child(4) { animation-delay: 1.7s; }
.star-node:nth-child(5) { animation-delay: 2.2s; }
.star-node:nth-child(6) { animation-delay: 2.7s; }
.star-node:nth-child(7) { animation-delay: 3.2s; }
.star-node:nth-child(8) { animation-delay: 3.7s; }

@keyframes starTwinkle {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

.domain-mark {
    position: absolute;
    top: 50%;
    right: 4vw;
    transform: translateY(-50%);
    z-index: 3;
    font-family: var(--display-font);
    font-weight: 400;
    color: var(--celestial-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1;
    text-align: right;
    pointer-events: none;
}

.domain-mark-line {
    display: block;
    font-size: clamp(64px, 16vw, 280px);
}

.domain-mark-line.one {
    color: var(--celestial-gold);
}

.domain-mark-line.two {
    color: var(--chalk-white);
    margin-top: -0.05em;
    text-indent: 0.6em;
    letter-spacing: 0.2em;
}

.observatory-sub {
    position: absolute;
    top: 32%;
    left: var(--offset-1);
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--secondary-font);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--dust-rose);
}

.meridian-tick {
    border-left: 1px solid var(--celestial-gold);
    padding-left: 12px;
}

.observatory-caption {
    position: absolute;
    bottom: 9vh;
    left: var(--offset-2);
    z-index: 3;
    max-width: 38ch;
    color: var(--chalk-white);
}

.observatory-caption .kicker {
    display: block;
    font-family: var(--secondary-font);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.32em;
    color: var(--celestial-gold);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.observatory-caption .caption-line {
    display: block;
    font-family: var(--body-font);
    font-style: italic;
    font-size: 15px;
    line-height: 1.7;
    color: var(--tarnished-silver);
}

/* ====================================================================
   ZONE 2 — THE ORRERY (100vh-250vh)
   ==================================================================== */
.zone-orrery {
    min-height: 150vh;
    background: var(--deep-indigo);
    padding: 14vh 0 16vh;
}

.orrery-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110vw;
    height: 110vh;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.95;
    pointer-events: none;
}

.orrery-block {
    position: relative;
    z-index: 3;
    max-width: 45ch;
    color: var(--chalk-white);
}

.block-frame {
    position: relative;
    padding: 28px 32px;
}

.deco-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.block-numeral {
    display: block;
    font-family: var(--display-font);
    font-size: 18px;
    letter-spacing: 0.2em;
    color: var(--celestial-gold);
    margin-bottom: 14px;
    text-transform: uppercase;
}

.block-heading {
    font-family: var(--display-font);
    font-weight: 400;
    font-size: clamp(28px, 3.4vw, 44px);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--chalk-white);
    margin-bottom: 18px;
}

.block-body {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.8;
    color: var(--chalk-white);
    opacity: 0.92;
}

.block-a {
    margin-left: var(--offset-1);
    margin-top: 4vh;
    transform: translateX(-1.5vw);
}

.block-b {
    margin-left: auto;
    margin-right: var(--offset-2);
    margin-top: 12vh;
    text-align: right;
}

.block-b .deco-border { display: none; }

.block-c {
    margin-left: var(--offset-3);
    margin-top: 14vh;
    transform: translateX(2vw);
}

.orrery-marker {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 2;
}

.marker-1 {
    top: 20vh;
    right: 12vw;
}

.marker-2 {
    bottom: 22vh;
    left: 38vw;
    width: 44px;
    height: 44px;
}

/* ====================================================================
   ZONE 3 — THE ANNOTATION FIELD (250vh-400vh)
   ==================================================================== */
.zone-annotation {
    position: relative;
    min-height: 150vh;
    background: var(--void-black);
    padding: 8vh 0;
}

.annotation-web {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.annotation {
    position: absolute;
    z-index: 3;
    max-width: 32ch;
    font-family: var(--body-font);
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: var(--tarnished-silver);
}

.annotation .annot-mark {
    display: block;
    font-family: var(--secondary-font);
    font-style: normal;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--celestial-gold);
    margin-bottom: 6px;
}

.annotation p {
    color: var(--chalk-white);
    opacity: 0.86;
}

.annotation .annot-citation {
    display: block;
    font-family: var(--body-font);
    font-style: italic;
    font-size: 12px;
    color: var(--dust-rose);
    margin-top: 8px;
}

/* Scattered positions, varied rotations */
.a-1 {
    top: 4%;
    left: 14%;
    transform: rotate(-3deg);
    max-width: 28ch;
}

.a-2 {
    top: 10%;
    right: 10%;
    transform: rotate(2deg);
    max-width: 30ch;
    text-align: right;
}

.a-3 {
    top: 30%;
    left: 38%;
    transform: rotate(-1deg);
    max-width: 26ch;
}

.a-4 {
    top: 46%;
    left: 8%;
    transform: rotate(4deg);
    max-width: 32ch;
}

.a-5 {
    top: 56%;
    right: 14%;
    transform: rotate(-2deg);
    max-width: 28ch;
    text-align: right;
}

.a-6 {
    top: 70%;
    left: 28%;
    transform: rotate(3deg);
    max-width: 30ch;
}

.a-7 {
    top: 84%;
    right: 18%;
    transform: rotate(-4deg);
    max-width: 24ch;
    text-align: right;
}

.tiny-star {
    position: absolute;
    width: 38px;
    height: 38px;
    z-index: 2;
}

.tstar-1 { top: 18%; left: 6%; }
.tstar-2 { top: 62%; left: 60%; width: 26px; height: 26px; }
.tstar-3 { top: 88%; left: 8%; width: 32px; height: 32px; }

/* ====================================================================
   ZONE 4 — THE CONVERGENCE (400vh-500vh)
   ==================================================================== */
.zone-convergence {
    min-height: 110vh;
    background: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 0 12vh;
}

.convergence-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(86vmin, 920px);
    height: min(86vmin, 920px);
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

.convergence-star {
    transform-origin: 500px 500px;
    will-change: filter;
    filter: drop-shadow(0 0 0 transparent);
}

.convergence-star.glow-active {
    filter: drop-shadow(0 0 8px var(--celestial-gold)) drop-shadow(0 0 24px rgba(232, 197, 90, 0.2));
}

.convergence-statement {
    position: relative;
    z-index: 4;
    text-align: center;
    color: var(--chalk-white);
    max-width: 56ch;
    padding: 0 8vw;
}

.kicker-final {
    font-family: var(--secondary-font);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--celestial-gold);
    text-transform: uppercase;
    margin-bottom: 28px;
}

.convergence-title {
    font-family: var(--display-font);
    font-weight: 400;
    font-size: clamp(40px, 7vw, 96px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.04;
    color: var(--celestial-gold);
    margin-bottom: 26px;
}

.convergence-title span {
    display: block;
}

.convergence-title span:nth-child(2) {
    color: var(--chalk-white);
    font-size: 0.6em;
    letter-spacing: 0.32em;
    margin: 8px 0;
}

.convergence-title span:nth-child(3) {
    color: var(--stellar-amber);
}

.convergence-coda {
    font-family: var(--body-font);
    font-style: italic;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: var(--chalk-white);
    opacity: 0.86;
    max-width: 44ch;
    margin: 0 auto 24px;
}

.convergence-stamp {
    font-family: var(--secondary-font);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.4em;
    color: var(--tarnished-silver);
    text-transform: uppercase;
}

.convergence-core {
    transform-origin: center;
    animation: corePulse 3.8s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { r: 5; opacity: 0.85; }
    50%      { r: 8; opacity: 1; }
}

/* ====================================================================
   Path-draw initial state — JS measures and animates stroke-dashoffset
   ==================================================================== */
.draw-path {
    will-change: stroke-dashoffset;
    vector-effect: non-scaling-stroke;
}

/* ====================================================================
   Responsive — keep anti-design feel on smaller viewports
   ==================================================================== */
@media (max-width: 880px) {
    :root {
        --offset-1: 6vw;
        --offset-2: 8vw;
        --offset-3: 10vw;
    }

    .zone-orrery { padding: 10vh 0; }

    .block-a, .block-b, .block-c {
        margin-left: var(--offset-1);
        margin-right: var(--offset-1);
        max-width: 100%;
        text-align: left;
        transform: none;
        margin-top: 8vh;
    }

    .block-b { margin-right: var(--offset-1); }

    .annotation {
        max-width: 70vw !important;
    }

    .a-1 { top: 2%; left: 6%; }
    .a-2 { top: 14%; right: 6%; }
    .a-3 { top: 28%; left: 10%; }
    .a-4 { top: 42%; left: 6%; }
    .a-5 { top: 56%; right: 6%; }
    .a-6 { top: 70%; left: 8%; }
    .a-7 { top: 86%; right: 6%; }

    .domain-mark { right: 2vw; }
    .observatory-caption { left: var(--offset-1); bottom: 4vh; }
}

@media (max-width: 540px) {
    .domain-mark-line { font-size: clamp(56px, 22vw, 140px); }
    .observatory-sub { top: 22%; }
    .convergence-title { font-size: clamp(34px, 11vw, 72px); }
}
