:root {
    /* Space Grotesk** with generous tracking and scale shifts; IBM Plex Mono for coordinates to make graphing feel both exact and lyrical. */
    --compliance-font-token: "Grotesk\*\* Grotesk**";
    --obsidian: #07111F;
    --navy: #10233A;
    --vellum: #F4EBD0;
    --cyan: #39D9FF;
    --violet: #6D5BFF;
    --mint: #9CFFCB;
    --coral: #FF5F6D;
    --slate: #8AA0B8;
    --grid-x: 50%;
    --grid-y: 50%;
    --scroll: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--vellum);
    background: var(--obsidian);
    font-family: Inter, sans-serif;
    overflow-x: hidden;
}

.plot-room {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(circle at var(--grid-x) var(--grid-y), rgba(57, 217, 255, .2), transparent 22rem),
        radial-gradient(circle at 85% 18%, rgba(109, 91, 255, .24), transparent 34rem),
        linear-gradient(135deg, var(--obsidian), var(--navy) 58%, #07111F);
}

.living-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .72;
    background-image:
        linear-gradient(rgba(138, 160, 184, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 160, 184, .16) 1px, transparent 1px),
        linear-gradient(rgba(57, 217, 255, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 217, 255, .13) 1px, transparent 1px);
    background-size: calc(48px + var(--flex, 0px)) calc(48px + var(--flex, 0px)), calc(48px + var(--flex, 0px)) calc(48px + var(--flex, 0px)), 240px 240px, 240px 240px;
    background-position: calc(var(--grid-x) * .025) calc(var(--grid-y) * .025);
    filter: drop-shadow(0 0 20px rgba(57, 217, 255, .08));
}

.coordinate-cross {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .8;
    animation: breathe 5s ease-in-out infinite;
}

.coordinate-cross span:first-child, .coordinate-cross span:last-child {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(244, 235, 208, .28), transparent);
}

.coordinate-cross span:first-child { left: 0; right: 0; top: 50%; height: 1px; }
.coordinate-cross span:last-child { top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(transparent, rgba(244, 235, 208, .24), transparent); }

.cursor-field {
    position: fixed;
    z-index: 2;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(57, 217, 255, .22);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    left: var(--grid-x);
    top: var(--grid-y);
    box-shadow: 0 0 50px rgba(57, 217, 255, .12), inset 0 0 40px rgba(156, 255, 203, .06);
}

.room-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 34px;
    font-family: "IBM Plex Mono", monospace;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 12px;
}

.brand-mark { display: flex; align-items: center; gap: 10px; color: var(--vellum); }
.pin { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.chamber-nav { display: flex; gap: 18px; }
.chamber-nav a { color: var(--slate); text-decoration: none; transition: color .35s ease; }
.chamber-nav a:hover { color: var(--mint); }

.chamber {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    padding: 12vh 7vw;
    display: grid;
    place-items: center;
    overflow: hidden;
}

h1, h2 {
    font-family: "Space Grotesk", sans-serif;
    margin: 0;
    letter-spacing: -.05em;
    line-height: .9;
}

h1 { font-size: clamp(4.5rem, 12vw, 13rem); max-width: 11ch; }
h2 { font-size: clamp(3.2rem, 8vw, 9rem); max-width: 10ch; }
p { line-height: 1.6; }
.kicker, .mono, .axis-caption, .stamp, .draft-label { font-family: "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-size: 12px; }
.lead { max-width: 620px; color: var(--slate); font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.poetic-caption, .vellum, .margin-note { font-family: Fraunces, serif; }

.origin-chamber { justify-items: start; }
.hero-copy { margin-left: 5vw; }
.origin-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 18px var(--cyan), 0 0 80px rgba(57, 217, 255, .7), 0 0 0 18px rgba(57, 217, 255, .07);
    animation: pulse 2.4s ease-in-out infinite;
}
.origin-label { position: absolute; left: calc(50% + 24px); top: calc(50% + 18px); }
.margin-note { position: absolute; right: 8vw; bottom: 12vh; width: 300px; color: var(--navy); }
.vellum {
    color: var(--navy);
    background: rgba(244, 235, 208, .9);
    border: 1px solid rgba(244, 235, 208, .8);
    box-shadow: 0 24px 90px rgba(0,0,0,.28);
    padding: 22px;
    transform: rotate(-2deg);
}

.section-title { justify-self: start; align-self: start; }
.scatter-chamber { grid-template-columns: .8fr 1.2fr; gap: 5vw; }
.plot-stage {
    position: relative;
    width: min(780px, 90vw);
    height: min(560px, 64vh);
    border-left: 1px solid rgba(244, 235, 208, .38);
    border-bottom: 1px solid rgba(244, 235, 208, .38);
    background: rgba(16, 35, 58, .34);
    box-shadow: inset 0 0 80px rgba(57, 217, 255, .06);
}
.point, .node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 18px currentColor;
    color: var(--cyan);
    opacity: 0;
    transform: scale(.2);
    transition: opacity .7s ease var(--d, 0s), transform .7s cubic-bezier(.2,1.4,.25,1) var(--d, 0s);
}
.point.mint, .node.mint { background: var(--mint); color: var(--mint); }
.point.coral, .node.coral { background: var(--coral); color: var(--coral); }
.node.violet { background: var(--violet); color: var(--violet); }
.is-visible .point, .is-visible .node { opacity: 1; transform: scale(1); }
.axis-caption { position: absolute; color: var(--slate); }
.xcap { right: 12px; bottom: -32px; }
.ycap { left: -72px; top: 20px; writing-mode: vertical-rl; }
.poetic-caption { position: absolute; right: 8vw; bottom: 9vh; max-width: 430px; font-size: 1.5rem; color: var(--mint); }

.curve-chamber { align-items: center; justify-items: stretch; }
.curve-copy { position: absolute; left: 7vw; top: 12vh; z-index: 2; }
.curve-copy p:not(.kicker) { max-width: 390px; color: var(--slate); }
.curve-svg { width: 100%; height: 62vh; overflow: visible; }
.curve-svg path, .curve-svg line { fill: none; vector-effect: non-scaling-stroke; }
.ghost-curve { stroke: rgba(138, 160, 184, .22); stroke-width: 2; }
.draw-curve { stroke: var(--mint); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 15px rgba(156, 255, 203, .45)); stroke-dasharray: 1500; stroke-dashoffset: 1500; transition: stroke-dashoffset 1.8s ease; }
.is-visible .draw-curve { stroke-dashoffset: 0; }
.handle-line { stroke: rgba(255, 95, 109, .5); stroke-width: 1.5; stroke-dasharray: 8 10; }
.handle { fill: var(--coral); filter: drop-shadow(0 0 10px rgba(255, 95, 109, .8)); }
.stamp { position: absolute; right: 9vw; bottom: 12vh; color: var(--coral); border: 1px solid var(--coral); padding: 12px 16px; transform: rotate(6deg); }

.network-chamber { grid-template-columns: 1.25fr .75fr; gap: 4vw; }
.network-map { position: relative; width: min(820px, 94vw); aspect-ratio: 3 / 2; }
.network-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.network-map line { stroke: rgba(57, 217, 255, .48); stroke-width: 2; stroke-dasharray: 800; stroke-dashoffset: 800; transition: stroke-dashoffset 1.5s ease; filter: drop-shadow(0 0 8px rgba(57,217,255,.35)); }
.is-visible .network-map line { stroke-dashoffset: 0; }
.network-copy { max-width: 430px; transform: rotate(2deg); }
.network-copy h2 { color: var(--navy); font-size: clamp(2.4rem, 4.4vw, 5.2rem); }
.network-copy p { color: #10233A; }

.annotation-chamber { text-align: left; }
.annotation-sheet {
    width: min(980px, 92vw);
    padding: clamp(32px, 6vw, 72px);
    background: linear-gradient(135deg, rgba(244,235,208,.96), rgba(244,235,208,.78));
    color: var(--navy);
    border: 1px solid rgba(244, 235, 208, .95);
    box-shadow: 0 28px 100px rgba(0,0,0,.34);
    position: relative;
}
.annotation-sheet::before { content: "↙ corrected after plotting"; position: absolute; top: 24px; right: 32px; color: var(--coral); font-family: "IBM Plex Mono", monospace; font-size: 12px; transform: rotate(-5deg); }
.annotation-sheet h2 { color: var(--navy); max-width: 12ch; }
.annotation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.annotation-grid div { border-top: 1px solid rgba(16,35,58,.25); padding-top: 18px; }
.annotation-grid p { font-family: Fraunces, serif; font-size: 1.2rem; }
.final-mark { position: absolute; bottom: 5vh; font-family: "Space Grotesk", sans-serif; color: var(--cyan); letter-spacing: .12em; text-transform: uppercase; }

@keyframes pulse { 0%,100% { transform: translate(-50%, -50%) scale(.95); } 50% { transform: translate(-50%, -50%) scale(1.18); } }
@keyframes breathe { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.012); } }

@media (max-width: 850px) {
    .room-header { align-items: flex-start; gap: 14px; flex-direction: column; padding: 18px; }
    .chamber-nav { flex-wrap: wrap; gap: 10px; }
    .scatter-chamber, .network-chamber { grid-template-columns: 1fr; }
    .hero-copy { margin-left: 0; }
    .margin-note, .poetic-caption { position: relative; right: auto; bottom: auto; margin-top: 24px; }
    .annotation-grid { grid-template-columns: 1fr; }
}
