:root {
    --obsidian: #08090F;
    --signal-blue: #233CFF;
    --acid: #C7FF3D;
    --mist: #DCE7FF;
    --steel: #6E7485;
    --rose: #F4C6D8;
    --bodoni: "Bodoni Moda", serif;
    --space: "Space Grotesk", sans-serif;
    --mono: "IBM Plex Mono", monospace;
}

/* design lexicon: IBM Plex Mono only for tiny coordinate labels; IntersectionObserver: plates slide horizontally; Space Grotesk** Grotes* Grotesk* for body copy */

* { box-sizing: border-box; }

.design-token { position: fixed; left: -100vw; top: -100vh; width: 1px; height: 1px; overflow: hidden; }

html {
    scroll-behavior: smooth;
    background: var(--obsidian);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--mist);
    font-family: var(--space);
    overflow-x: hidden;
    background:
        radial-gradient(circle at 70% 18%, rgba(35, 60, 255, 0.28), transparent 32vw),
        radial-gradient(circle at 18% 82%, rgba(244, 198, 216, 0.16), transparent 34vw),
        linear-gradient(120deg, #08090F 0%, #0c1024 48%, #08090F 100%);
}

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

.global-field {
    position: fixed;
    inset: -15vh -12vw;
    pointer-events: none;
    z-index: 0;
    opacity: 0.74;
    transform: rotate(var(--field-rotation, -7deg));
    transition: transform 700ms cubic-bezier(.2, .8, .2, 1);
    background-image:
        linear-gradient(rgba(220, 231, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 231, 255, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(199, 255, 61, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(199, 255, 61, 0.08) 1px, transparent 1px);
    background-size: 92px 92px, 92px 92px, 23px 23px, 23px 23px;
    mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), black 0 28%, rgba(0,0,0,.58) 45%, transparent 78%);
}

.fault-line {
    position: absolute;
    left: -10%;
    top: 48%;
    width: 130%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rose), var(--mist), var(--signal-blue), transparent);
    box-shadow: 0 0 26px rgba(244, 198, 216, 0.65);
    transform: rotate(-18deg);
}

.axis { position: absolute; background: rgba(35, 60, 255, 0.35); }
.axis-x { left: 0; right: 0; top: 50%; height: 1px; }
.axis-y { top: 0; bottom: 0; left: 50%; width: 1px; }

.cursor-lens {
    position: fixed;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(199, 255, 61, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9;
    transform: translate(-50%, -50%);
    background:
        repeating-linear-gradient(0deg, rgba(199,255,61,.08) 0 1px, transparent 1px 12px),
        rgba(220, 231, 255, 0.035);
    mix-blend-mode: screen;
    box-shadow: 0 0 0 9999px rgba(8, 9, 15, 0.025), inset 0 0 36px rgba(35, 60, 255, 0.28);
    opacity: 0;
    transition: opacity 260ms ease;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 34px;
    color: var(--mist);
    mix-blend-mode: difference;
}

.brand-mark {
    position: relative;
    font-family: var(--bodoni);
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 700;
    letter-spacing: -0.05em;
}

.brand-mark::before,
.brand-mark::after,
.misregister::before,
.misregister::after {
    content: attr(data-ghost);
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.brand-mark::before, .misregister::before { color: var(--signal-blue); transform: translate(-5px, 3px); opacity: .88; }
.brand-mark::after, .misregister::after { color: var(--rose); transform: translate(5px, -3px); opacity: .74; }

.chapter-nav {
    display: grid;
    gap: 8px;
    text-align: right;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--steel);
}

.chapter-nav a { transition: color 240ms ease, transform 240ms ease; }
.chapter-nav a:hover { color: var(--acid); transform: translateX(-8px); }

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

.chapter {
    position: relative;
    min-height: 100vh;
    padding: clamp(88px, 12vw, 150px) clamp(24px, 7vw, 104px);
    display: grid;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.chapter::before {
    content: "";
    position: absolute;
    inset: 10vh 6vw;
    border: 1px solid rgba(220, 231, 255, 0.15);
    transform: rotate(var(--chapter-tilt, -7deg));
    background:
        linear-gradient(90deg, rgba(35, 60, 255, .14), transparent 34%, rgba(244, 198, 216, .09)),
        repeating-linear-gradient(90deg, transparent 0 63px, rgba(220,231,255,.1) 64px 65px);
    z-index: -1;
}

.hero-copy { max-width: 1050px; }
.eyebrow {
    margin: 0 0 18px;
    color: var(--acid);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1, h2 {
    margin: 0;
    font-family: var(--bodoni);
    font-weight: 700;
    letter-spacing: -0.07em;
    line-height: 0.88;
}

h1 { font-size: clamp(72px, 17vw, 230px); }
h2 { font-size: clamp(54px, 10vw, 142px); max-width: 1050px; }

.misregister { position: relative; display: inline-block; color: var(--mist); text-shadow: 0 18px 70px rgba(35,60,255,.28); }
.misregister.small { font-size: clamp(76px, 13vw, 178px); }

.thesis, .chapter-copy p:not(.eyebrow) {
    max-width: 560px;
    color: rgba(220, 231, 255, 0.78);
    font-size: clamp(18px, 2vw, 28px);
    line-height: 1.28;
}

.plate {
    position: absolute;
    border: 1px solid rgba(220, 231, 255, .22);
    background: rgba(220, 231, 255, .045);
    backdrop-filter: blur(2px);
}
.plate-a { width: 46vw; height: 28vw; right: 8vw; top: 20vh; transform: rotate(9deg); }
.plate-b { width: 34vw; height: 20vw; right: 23vw; bottom: 12vh; transform: rotate(-7deg); border-color: rgba(199, 255, 61, .28); }

.coordinate-label, .notation, .chapter-number, .final-seal {
    position: absolute;
    font-family: var(--mono);
    color: var(--steel);
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.top-left { top: 118px; left: 36px; }
.bottom-right { right: 40px; bottom: 36px; }
.notation { left: 8vw; bottom: 12vh; color: var(--acid); }
.chapter-number { right: 9vw; top: 18vh; font-size: clamp(80px, 16vw, 220px); color: rgba(220,231,255,.08); font-family: var(--bodoni); }

.margin-note {
    position: absolute;
    right: 8vw;
    bottom: 24vh;
    color: var(--rose);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    transform: rotate(8deg);
}

.registration-cross { position: absolute; width: 56px; height: 56px; border: 1px solid rgba(199,255,61,.6); border-radius: 50%; }
.registration-cross::before, .registration-cross::after { content:""; position:absolute; background:rgba(199,255,61,.7); }
.registration-cross::before { left: 50%; top: -18px; width: 1px; height: 90px; }
.registration-cross::after { top: 50%; left: -18px; height: 1px; width: 90px; }
.cross-one { left: 62vw; top: 18vh; }
.cross-two { left: 18vw; bottom: 20vh; }

.chapter-fault { grid-template-columns: 1fr 1fr; gap: 8vw; }
.split-grid { position: absolute; inset: 0; z-index: -2; }
.old-grid { clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%); background-image: linear-gradient(rgba(220,231,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(220,231,255,.1) 1px, transparent 1px); background-size: 70px 70px; }
.new-grid { clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%); background-image: linear-gradient(rgba(35,60,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(35,60,255,.18) 1px, transparent 1px); background-size: 70px 70px; transform: rotate(10deg) scale(1.2); }
.right-copy { align-self: end; padding-bottom: 10vh; }

.chapter-rotation { place-items: center; text-align: center; }
.rotor { position: absolute; width: min(72vw, 760px); aspect-ratio: 1; display: grid; place-items: center; transform: rotate(var(--rotor, 0deg)); transition: transform 500ms ease-out; }
.rotor-ring { position: absolute; border: 1px solid rgba(220,231,255,.25); border-radius: 50%; }
.ring-one { inset: 4%; border-color: rgba(35,60,255,.55); }
.ring-two { inset: 18%; border-color: rgba(244,198,216,.48); transform: translateX(7%); }
.ring-three { inset: 32%; border-color: rgba(199,255,61,.56); transform: translateY(-8%); }
.hinge-arc { position: absolute; width: 68%; height: 68%; border: 3px solid transparent; border-top-color: var(--acid); border-right-color: rgba(199,255,61,.55); border-radius: 50%; transform: rotate(36deg); }
.centered-copy { position: relative; z-index: 2; max-width: 900px; }
.centered-copy p:not(.eyebrow) { margin-inline: auto; }
.fragment { position: absolute; font-family: var(--bodoni); font-size: clamp(60px, 11vw, 160px); color: rgba(220,231,255,.08); letter-spacing: -.08em; }
.fragment-a { left: 4vw; top: 20vh; transform: rotate(-13deg); }
.fragment-b { right: 8vw; bottom: 14vh; transform: rotate(9deg); color: rgba(244,198,216,.12); }
.fragment-c { left: 28vw; bottom: 8vh; transform: rotate(-4deg); color: rgba(35,60,255,.18); }

.chapter-chamber { grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr); gap: 7vw; }
.lens-board { position: relative; height: 68vh; border: 1px solid rgba(220,231,255,.18); background: rgba(220,231,255,.035); transform: rotate(-5deg); }
.lens-window { position: absolute; inset: 8%; display: grid; align-content: space-around; overflow: hidden; background: radial-gradient(circle at var(--lx, 50%) var(--ly, 50%), rgba(199,255,61,.25) 0 90px, rgba(35,60,255,.14) 91px 178px, transparent 180px), repeating-linear-gradient(0deg, rgba(220,231,255,.09) 0 1px, transparent 1px 42px); }
.lens-window span { font-family: var(--bodoni); font-size: clamp(48px, 7vw, 106px); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 1px rgba(220,231,255,.42); transform: translateX(var(--shift, 0)); transition: transform 300ms ease; }
.lens-window span:nth-child(even) { --shift: 7%; color: rgba(244,198,216,.18); }
.proof-mark { position: absolute; width: 46px; height: 46px; border-color: var(--rose); border-style: solid; }
.mark-a { left: -1px; top: -1px; border-width: 2px 0 0 2px; }
.mark-b { right: -1px; top: -1px; border-width: 2px 2px 0 0; }
.mark-c { left: -1px; bottom: -1px; border-width: 0 0 2px 2px; }
.mark-d { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.chamber-copy { align-self: center; }
.chamber-notation { left: auto; right: 8vw; }

.chapter-grammar { align-items: end; }
.grammar-grid { position: absolute; inset: 15vh 7vw auto auto; width: min(640px, 78vw); display: grid; grid-template-columns: repeat(2, 1fr); transform: rotate(8deg); border: 1px solid rgba(220,231,255,.16); }
.grammar-card { min-height: 180px; padding: 22px; border: 1px solid rgba(220,231,255,.16); background: rgba(8,9,15,.48); display: grid; align-content: space-between; }
.grammar-card span, .grammar-card em { font-family: var(--mono); color: var(--steel); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-style: normal; }
.grammar-card strong { font-family: var(--bodoni); color: var(--mist); font-size: clamp(38px, 5vw, 76px); letter-spacing: -.07em; font-weight: 700; }
.grammar-card:nth-child(2), .grammar-card:nth-child(4) { background: rgba(35,60,255,.16); }
.final-copy { max-width: 980px; }
.final-seal { right: 8vw; bottom: 9vh; color: var(--acid); border: 1px solid var(--acid); padding: 16px 18px; text-align: center; transform: rotate(-8deg); }

.is-visible .misregister::before { animation: convergeBlue 1500ms ease forwards; }
.is-visible .misregister::after { animation: convergeRose 1500ms ease forwards; }
.is-visible .plate-a, .is-visible .plate-b { animation: plateFloat 6s ease-in-out infinite alternate, plateSlide 1500ms cubic-bezier(.2,.8,.2,1) both; }
.is-visible .old-grid { animation: oldPlateSlide 1300ms cubic-bezier(.2,.8,.2,1) both; }
.is-visible .new-grid { animation: newPlateSlide 1300ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes convergeBlue { 0% { transform: translate(-18px, 12px); } 100% { transform: translate(-5px, 3px); } }
@keyframes convergeRose { 0% { transform: translate(18px, -12px); } 100% { transform: translate(5px, -3px); } }
@keyframes plateFloat { from { translate: 0 -12px; } to { translate: 0 12px; } }
@keyframes plateSlide { from { margin-left: -28px; margin-right: 28px; } to { margin-left: 0; margin-right: 0; } }
@keyframes oldPlateSlide { from { transform: translateX(-8vw); } to { transform: translateX(0); } }
@keyframes newPlateSlide { from { transform: translateX(8vw) rotate(10deg) scale(1.2); } to { transform: translateX(0) rotate(10deg) scale(1.2); } }

@media (max-width: 820px) {
    .site-header { padding: 22px; }
    .chapter-nav { display: none; }
    .chapter, .chapter-fault, .chapter-chamber { grid-template-columns: 1fr; }
    .chapter { padding: 96px 24px 64px; }
    .plate-a, .plate-b, .grammar-grid { opacity: .45; }
    .lens-board { height: 48vh; }
    .grammar-grid { position: relative; inset: auto; width: 100%; margin-bottom: 42px; }
    .cursor-lens { display: none; }
}
