:root {
    /* Typography compliance: IBM Plex Mono for depth numbers; Space Grotesk** for concise interface labels. */
    --abyss: #071319;
    --pressure: #0E3D43;
    --glass: #D7F7F2;
    --silt: #E8DDC6;
    --mint: #79FFD0;
    --coral: #FF7A66;
    --pearl: #A9BBC0;
    --serif: "Fraunces", serif;
    --sans: "Space Grotesk", Inter, sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --jp: "Noto Serif JP", serif;
    --compliance-token: "Grotesk**";
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--abyss);
    color: var(--glass);
    font-family: var(--sans);
    overflow-x: hidden;
}

.waterfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 72% 18%, rgba(121, 255, 208, .16), transparent 26%),
        radial-gradient(circle at 22% 74%, rgba(14, 61, 67, .95), transparent 44%),
        linear-gradient(180deg, #071319 0%, #0A2026 42%, #0E3D43 100%);
}

.pearl-noise {
    position: absolute;
    inset: 0;
    opacity: .26;
    background-image:
        radial-gradient(circle, rgba(215, 247, 242, .28) 0 1px, transparent 1.6px),
        linear-gradient(117deg, transparent, rgba(232, 221, 198, .06), transparent),
        repeating-linear-gradient(33deg, rgba(169, 187, 192, .045) 0 1px, transparent 1px 11px);
    background-size: 48px 48px, 100% 100%, 170px 170px;
    mix-blend-mode: screen;
}

.contours {
    position: absolute;
    top: 8%;
    left: -5%;
    width: 110%;
    height: 82%;
    opacity: .34;
    transform: translateY(calc(var(--scroll, 0) * -70px));
    filter: blur(.15px);
}

.contours path {
    fill: none;
    stroke: #A9BBC0;
    stroke-width: 1.1;
    stroke-dasharray: 6 13;
}

.silt-layer {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(215, 247, 242, .45) 0 1px, transparent 1.5px);
    background-size: 92px 92px;
    transform: translate3d(0, calc(var(--scroll, 0) * -160px), 0);
    opacity: .21;
}

.depth-gauge {
    position: fixed;
    z-index: 12;
    left: 2.2rem;
    top: 6vh;
    height: 88vh;
    width: 13rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gauge-line {
    position: absolute;
    left: .45rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(#D7F7F2, #79FFD0, transparent);
    opacity: .38;
}

.depth-gauge a {
    color: #A9BBC0;
    text-decoration: none;
    padding-left: 1.45rem;
    position: relative;
    transition: color .45s ease, transform .45s ease;
}

.depth-gauge a::before {
    content: "";
    position: absolute;
    left: .23rem;
    top: .4rem;
    width: .46rem;
    height: 1px;
    background: currentColor;
}

.depth-gauge span { color: #79FFD0; margin-right: .45rem; }
.depth-gauge a.active { color: #D7F7F2; transform: translateX(.25rem); }

.migrating-lens {
    position: fixed;
    z-index: 5;
    left: calc(var(--lens-x, 58) * 1vw);
    top: calc(var(--lens-y, 47) * 1vh);
    width: min(44vw, 31rem);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(var(--lens-scale, 1));
    transition: left .9s cubic-bezier(.2,.8,.2,1), top .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1), filter .7s ease;
    border: 1.15rem solid rgba(14, 61, 67, .86);
    box-shadow: 0 0 0 1px rgba(215, 247, 242, .35), inset 0 0 5rem rgba(121, 255, 208, .12), 0 0 5rem rgba(121, 255, 208, .12);
    backdrop-filter: blur(5px) saturate(1.3);
    pointer-events: none;
}

.migrating-lens.is-fogged { filter: blur(2.8px) brightness(.82); }

.lens-inner {
    position: absolute;
    inset: .9rem;
    overflow: hidden;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 24%, rgba(215, 247, 242, .38), transparent 14%),
        radial-gradient(circle at 58% 58%, rgba(121, 255, 208, .18), transparent 36%),
        repeating-radial-gradient(circle at 50% 50%, transparent 0 31px, rgba(215, 247, 242, .13) 32px 33px),
        rgba(215, 247, 242, .045);
}

.lens-inner::before {
    content: "";
    position: absolute;
    inset: 13%;
    border: 1px dashed rgba(215, 247, 242, .45);
    border-radius: 50%;
    animation: rotateSlow 24s linear infinite;
}

.lens-chart {
    position: absolute;
    left: 18%;
    top: 30%;
    font-family: var(--serif);
    font-size: clamp(2.6rem, 6vw, 6.8rem);
    line-height: .75;
    color: rgba(215, 247, 242, .32);
    letter-spacing: -.06em;
    transform: rotate(-9deg);
}

.reticle { position: absolute; background: rgba(121, 255, 208, .42); }
.reticle.h { left: 11%; right: 11%; top: 50%; height: 1px; }
.reticle.v { top: 11%; bottom: 11%; left: 50%; width: 1px; }
.lens-speckle { position: absolute; width: .5rem; height: .5rem; border-radius: 50%; background: #79FFD0; opacity: .5; }
.s1 { left: 22%; top: 18%; } .s2 { left: 70%; top: 34%; } .s3 { left: 48%; top: 75%; }

main { position: relative; z-index: 2; }

.chapter {
    min-height: 100vh;
    position: relative;
    padding: 10vh 8vw 10vh 22vw;
    overflow: hidden;
    border-bottom: 1px solid rgba(169, 187, 192, .12);
}

.chapter-kicker, .side-caption, .log-id, .mono {
    font-family: var(--mono);
    color: #79FFD0;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .72rem;
}

h1, h2 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: .88;
    letter-spacing: -.045em;
    margin: .35em 0;
    color: #D7F7F2;
}

h1 { font-size: clamp(4.3rem, 12vw, 12.5rem); max-width: 67rem; }
h2 { font-size: clamp(3.4rem, 8vw, 8rem); }
p { color: #A9BBC0; font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.7; }

.dossier-label { max-width: 29rem; color: #E8DDC6; }
.airlock-plate {
    position: absolute;
    right: 8vw;
    bottom: 13vh;
    width: 18rem;
    padding: 1rem 1.2rem;
    background: rgba(14, 61, 67, .58);
    border: 1px solid rgba(215, 247, 242, .24);
    box-shadow: inset 0 0 2rem rgba(7, 19, 25, .45);
}

.airlock-plate span, .airlock-plate b { display: block; font-family: var(--mono); font-size: .75rem; color: #A9BBC0; text-transform: uppercase; letter-spacing: .12em; }
.airlock-plate b { color: #D7F7F2; margin-top: .65rem; }
.airlock-plate i { position: absolute; right: 1rem; top: .6rem; color: #FF7A66; font-family: var(--jp); font-style: normal; }
.wake-note, .silt-tag, .pulse-note {
    position: absolute;
    font-family: var(--mono);
    color: #A9BBC0;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.wake-note { left: 50vw; top: 19vh; max-width: 16rem; }

.side-caption { position: absolute; top: 10vh; right: 8vw; color: #A9BBC0; }
.text-island, .reef-copy, .final-copy { max-width: 31rem; position: relative; z-index: 4; }
.island-a { margin-top: 22vh; margin-left: 22vw; }

.specimen-strip {
    position: absolute;
    left: 25vw;
    bottom: 16vh;
    width: 48vw;
    display: flex;
    gap: 1rem;
    transform: rotate(-3deg);
}
.specimen-strip span {
    padding: .75rem 1rem;
    border: 1px solid rgba(215, 247, 242, .22);
    background: rgba(7, 19, 25, .38);
    color: #E8DDC6;
    font-family: var(--mono);
    font-size: .72rem;
}
.glass-fragment {
    position: absolute;
    font-family: var(--serif);
    font-size: 11rem;
    color: rgba(215, 247, 242, .13);
    text-shadow: 0 0 2rem rgba(121, 255, 208, .18);
}
.frag-one { left: 23vw; top: 18vh; transform: rotate(8deg); }
.frag-two { left: 50vw; top: 38vh; transform: rotate(-15deg); }
.frag-three { right: 10vw; top: 23vh; transform: rotate(18deg); }
.annotation-line { position: absolute; height: 1px; background: #79FFD0; opacity: .35; transform-origin: left; }
.line-one { left: 34vw; top: 47vh; width: 24vw; transform: rotate(-18deg); }

.vellum-stack { position: relative; width: min(58vw, 50rem); height: 70vh; margin-left: 14vw; margin-top: 8vh; }
.vellum {
    position: absolute;
    background: linear-gradient(135deg, rgba(232, 221, 198, .94), rgba(215, 247, 242, .72));
    color: #071319;
    border: 1px solid rgba(232, 221, 198, .7);
    box-shadow: 0 2rem 5rem rgba(0,0,0,.35), inset 0 0 4rem rgba(14, 61, 67, .12);
    padding: clamp(1.6rem, 4vw, 3rem);
}
.vellum h2 { color: #0E3D43; }
.vellum p { color: rgba(7, 19, 25, .78); max-width: 31rem; }
.sheet-one { width: 76%; min-height: 68%; transform: rotate(-4deg); left: 6%; top: 5%; }
.sheet-two { width: 43%; min-height: 34%; transform: rotate(7deg); right: 0; bottom: 4%; }
.stamp { color: #FF7A66; border: 2px solid #FF7A66; padding: .25rem .55rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .14em; transform: rotate(-8deg); display: inline-block; }
.redaction { height: .82rem; width: 74%; background: #071319; margin: 1.2rem 0; opacity: .82; }
.redaction.short { width: 54%; }
.vellum small { font-family: var(--mono); color: #0E3D43; }
.silt-tag { right: 9vw; bottom: 14vh; max-width: 15rem; }

.reef-copy { margin-top: 8vh; }
.signal-map { position: absolute; left: 31vw; top: 25vh; width: 55vw; height: 52vh; overflow: visible; }
.thread { fill: none; stroke: #79FFD0; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(121,255,208,.6)); stroke-dasharray: 900; stroke-dashoffset: calc(900 - (var(--chapter-progress, 0) * 900)); }
.thread-b { opacity: .62; stroke-width: 1.2; }
.specimen path { fill: rgba(215, 247, 242, .13); stroke: #A9BBC0; stroke-width: 1.3; }
.specimen circle { fill: #79FFD0; opacity: .72; animation: pulse 2.8s ease-in-out infinite; }
.sp-b circle { animation-delay: .7s; } .sp-c circle { animation-delay: 1.4s; }
.pulse-note { right: 10vw; bottom: 19vh; max-width: 16rem; color: #79FFD0; }

.final-copy { margin-top: 7vh; }
.emblem {
    position: absolute;
    right: 12vw;
    top: 21vh;
    width: min(42vw, 31rem);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: drop-shadow(0 0 2rem rgba(121, 255, 208, .22));
}
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(215, 247, 242, .44); inset: var(--inset); animation: rotateSlow var(--speed) linear infinite; }
.r1 { --inset: 0; --speed: 30s; border-color: #79FFD0; }
.r2 { --inset: 13%; --speed: 22s; border-style: dashed; }
.r3 { --inset: 29%; --speed: 15s; border-color: rgba(255, 122, 102, .55); }
.core { position: absolute; inset: 42%; border-radius: 50%; background: #D7F7F2; box-shadow: 0 0 2.2rem #79FFD0; }
.orbit { position: absolute; left: 50%; top: 50%; font-family: var(--mono); color: #E8DDC6; font-size: .72rem; transform-origin: 0 0; animation: orbitOnce 12s ease-in-out infinite; }
.o1 { animation-delay: 0s; } .o2 { animation-delay: -4s; } .o3 { animation-delay: -8s; font-family: var(--jp); color: #FF7A66; }

@keyframes rotateSlow { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.8); opacity: .95; } }
@keyframes orbitOnce { 0% { transform: rotate(0deg) translateX(43%) rotate(0deg); } 50%,100% { transform: rotate(360deg) translateX(43%) rotate(-360deg); } }

@media (max-width: 900px) {
    .depth-gauge { left: .8rem; width: 7rem; font-size: .58rem; }
    .depth-gauge a { color: transparent; }
    .depth-gauge span { color: #79FFD0; }
    .chapter { padding-left: 6rem; padding-right: 1.2rem; }
    .migrating-lens { width: 78vw; }
    .island-a, .vellum-stack { margin-left: 0; }
    .specimen-strip { left: 6rem; width: calc(100vw - 7rem); flex-direction: column; }
    .signal-map { left: 5rem; width: calc(100vw - 6rem); }
    .emblem { right: 5vw; top: 48vh; width: 75vw; }
}
