:root {
    /* Interactions should feel physical: pointer movement slightly bends field lines. */
    --red: #FF3B2F;
    --black: #050507;
    --paper: #F3F0E7;
    --steel: #5E6773;
    --blue: #175CFF;
    --violet: #8B5CF6;
    --pole-x: 48vw;
    --accent: #8B5CF6;
    --glow: rgba(139, 92, 246, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--black);
    color: var(--paper);
    font-family: "Commissioner", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at var(--pole-x) 36%, rgba(139, 92, 246, 0.16), transparent 34vw),
        radial-gradient(circle at 82% 72%, rgba(23, 92, 255, 0.13), transparent 28vw),
        linear-gradient(180deg, #050507 0%, #09090f 46%, #050507 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    background-image: repeating-linear-gradient(0deg, rgba(243, 240, 231, 0.025) 0 1px, transparent 1px 4px);
    mix-blend-mode: screen;
}

.chamber {
    position: relative;
    isolation: isolate;
}

.fixed-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.polar-grid {
    position: absolute;
    width: 96vmax;
    height: 96vmax;
    left: calc(var(--pole-x) - 48vmax);
    top: -8vmax;
    border-radius: 50%;
    opacity: 0.42;
    background:
        repeating-radial-gradient(circle, transparent 0 7.4vmax, rgba(243, 240, 231, 0.08) 7.48vmax 7.55vmax),
        conic-gradient(from 9deg, transparent 0 11deg, rgba(243, 240, 231, 0.07) 11deg 12deg, transparent 12deg 30deg);
    transform: rotate(var(--grid-rotate, 0deg));
    transition: left 900ms cubic-bezier(.2,.8,.15,1), transform 900ms cubic-bezier(.2,.8,.15,1);
}

.field-svg {
    position: absolute;
    inset: -4vh -3vw;
    width: 106vw;
    height: 108vh;
    opacity: 0.86;
}

.field-line,
.fracture-line {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 9 19;
    vector-effect: non-scaling-stroke;
}

.field-line {
    stroke: var(--accent);
    filter: drop-shadow(0 0 8px var(--glow));
    stroke-dashoffset: var(--dash-offset, 0);
}

.fracture-line {
    stroke: var(--red);
    opacity: var(--fracture-opacity, 0);
    stroke-dasharray: 42 16;
    filter: drop-shadow(0 0 12px rgba(255, 59, 47, 0.42));
}

.dominant-pole {
    position: absolute;
    top: -7vh;
    left: var(--pole-x);
    width: 22px;
    height: 116vh;
    transform: translateX(-50%) rotate(var(--pole-tilt, 0deg));
    transition: left 900ms cubic-bezier(.2,.8,.15,1), transform 900ms cubic-bezier(.2,.8,.15,1);
}

.pole-core {
    position: absolute;
    inset: 0 9px;
    background: linear-gradient(180deg, transparent, var(--paper) 12%, var(--accent) 45%, var(--red) 72%, transparent);
    box-shadow: 0 0 26px var(--glow), 0 0 2px var(--paper);
}

.pole-halo {
    position: absolute;
    inset: 0 -19px;
    background: linear-gradient(90deg, transparent, var(--glow), transparent);
    opacity: 0.46;
    animation: polePulse 2200ms ease-in-out infinite alternate;
}

.pole-label {
    position: absolute;
    top: 12vh;
    left: 32px;
    writing-mode: vertical-rl;
    font: 500 11px/1 "Commissioner", sans-serif;
    letter-spacing: 0.28em;
    color: var(--paper);
    opacity: 0.72;
    text-transform: uppercase;
}

.compass {
    position: fixed;
    right: 5vw;
    top: 6vh;
    width: 108px;
    height: 108px;
    border: 1px solid rgba(243, 240, 231, 0.25);
    border-radius: 50%;
    transform: rotate(var(--needle-angle, 0deg));
}

.compass::before,
.compass::after {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(243, 240, 231, 0.16);
    border-radius: 50%;
}

.compass span {
    position: absolute;
    left: 50%;
    top: 14px;
    width: 7px;
    height: 80px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--red) 0 48%, var(--paper) 48% 52%, var(--blue) 52%);
    clip-path: polygon(50% 0, 100% 45%, 55% 50%, 50% 100%, 45% 50%, 0 45%);
}

.cursor-orbit {
    position: fixed;
    left: var(--cursor-x, 50vw);
    top: var(--cursor-y, 50vh);
    width: 220px;
    height: 220px;
    margin: -110px 0 0 -110px;
    border: 1px solid rgba(243, 240, 231, 0.10);
    border-radius: 50%;
    opacity: 0.7;
    transform: scale(var(--cursor-scale, 0.85));
    transition: transform 200ms ease;
}

.redaction {
    position: absolute;
    background: var(--red);
    opacity: 0.13;
    transform: rotate(-2deg);
}

.redaction-one {
    width: 23vw;
    height: 22px;
    left: 7vw;
    bottom: 19vh;
}

.redaction-two {
    width: 18vw;
    height: 16px;
    right: 15vw;
    top: 32vh;
}

.act {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 8vh 7vw;
    display: grid;
    align-items: center;
}

.hero {
    align-content: center;
}

.act-index,
.coordinate-block,
.diagram-label,
.legal-column,
.vector-readout,
.vector-button {
    font-family: "Commissioner", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.24em;
}

.act-index {
    color: var(--accent);
    font-size: clamp(0.68rem, 1vw, 0.92rem);
    margin-bottom: 2.5vh;
}

.hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.02em;
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(5.4rem, 18vw, 18rem);
    line-height: 0.78;
    letter-spacing: 0.015em;
    max-width: 93vw;
    transform: translateY(var(--title-shift, 0px));
}

.hero-title span {
    display: inline-block;
    text-shadow: 0 0 34px rgba(243, 240, 231, 0.10);
    animation: magneticAlign 1200ms cubic-bezier(.2,.9,.15,1) both;
}

.hero-title span:nth-child(1) { animation-delay: 120ms; }
.hero-title span:nth-child(2) { animation-delay: 260ms; }
.hero-title span:nth-child(3) { animation-delay: 390ms; }

.dot {
    color: var(--red);
}

h1 {
    margin: 0;
    max-width: 900px;
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    font-size: clamp(4.3rem, 12vw, 13.5rem);
    line-height: 0.86;
    letter-spacing: 0.02em;
}

.caption {
    max-width: 680px;
    margin: 3vh 0 0;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.45rem, 2.5vw, 2.7rem);
    line-height: 1.05;
    color: rgba(243, 240, 231, 0.86);
    font-style: italic;
}

.coordinate-block {
    position: absolute;
    right: 6vw;
    bottom: 6vh;
    display: grid;
    gap: 10px;
    font-size: 0.68rem;
    color: var(--steel);
}

.split {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 5vw;
}

.diagram {
    position: relative;
    min-height: 58vh;
}

.half-aura {
    position: absolute;
    border: 1px solid rgba(243, 240, 231, 0.20);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
    transform: rotate(-42deg);
}

.aura-one {
    inset: 5% 12% 8% 2%;
    box-shadow: 18px -18px 60px rgba(23, 92, 255, 0.18);
}

.aura-two {
    inset: 21% 25% 22% 16%;
    border-color: rgba(139, 92, 246, 0.42);
    border-left-color: transparent;
    border-bottom-color: transparent;
}

.needle-cluster i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 84px;
    background: var(--paper);
    transform-origin: center 132px;
    opacity: 0.76;
}

.needle-cluster i:nth-child(1) { transform: rotate(0deg) translateY(-132px); }
.needle-cluster i:nth-child(2) { transform: rotate(32deg) translateY(-132px); }
.needle-cluster i:nth-child(3) { transform: rotate(69deg) translateY(-132px); }
.needle-cluster i:nth-child(4) { transform: rotate(116deg) translateY(-132px); }
.needle-cluster i:nth-child(5) { transform: rotate(188deg) translateY(-132px); }
.needle-cluster i:nth-child(6) { transform: rotate(231deg) translateY(-132px); }
.needle-cluster i:nth-child(7) { transform: rotate(294deg) translateY(-132px); }
.needle-cluster i:nth-child(8) { transform: rotate(331deg) translateY(-132px); }

.diagram-label {
    position: absolute;
    right: 0;
    bottom: 0;
    color: var(--blue);
    font-size: 0.72rem;
}

.capture {
    justify-items: end;
    text-align: right;
}

.funnel {
    position: relative;
    width: min(700px, 76vw);
    height: 42vh;
    margin: 5vh 0 1vh;
    clip-path: polygon(5% 0, 95% 0, 58% 100%, 42% 100%);
    border-top: 1px solid rgba(243, 240, 231, 0.35);
    background: linear-gradient(180deg, rgba(255, 59, 47, 0.16), rgba(139, 92, 246, 0.04));
}

.funnel-ring {
    position: absolute;
    left: 50%;
    border: 1px solid rgba(255, 59, 47, 0.42);
    border-radius: 50%;
    transform: translateX(-50%);
}

.ring-one { width: 82%; height: 46px; top: 12%; }
.ring-two { width: 58%; height: 34px; top: 42%; }
.ring-three { width: 22%; height: 20px; top: 75%; }

.packet {
    position: absolute;
    padding: 8px 10px;
    border: 1px solid rgba(243, 240, 231, 0.24);
    background: rgba(5, 5, 7, 0.86);
    color: var(--paper);
    font-size: 0.72rem;
    animation: packetFall 4s ease-in-out infinite;
}

.packet-a { left: 20%; top: 7%; animation-delay: 0ms; }
.packet-b { left: 64%; top: 20%; animation-delay: 700ms; }
.packet-c { left: 36%; top: 37%; animation-delay: 1300ms; }
.packet-d { left: 50%; top: 62%; color: var(--red); animation-delay: 1900ms; }

.governance {
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    gap: 8vw;
}

.legal-column {
    display: grid;
    gap: 2vh;
    padding: 4vh 2vw;
    border-left: 10px solid var(--paper);
    background: linear-gradient(90deg, rgba(243, 240, 231, 0.09), transparent);
    color: var(--paper);
    font-size: clamp(0.68rem, 1.1vw, 0.9rem);
}

.legal-column span {
    display: block;
    padding: 1.2vh 1vw;
    background: linear-gradient(90deg, rgba(255, 59, 47, 0.70) 0 42%, rgba(5, 5, 7, 0.40) 42%);
}

.escape {
    text-align: center;
    justify-items: center;
    padding-bottom: 14vh;
}

.escape .caption {
    margin-left: auto;
    margin-right: auto;
}

.escape-controls {
    margin-top: 5vh;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: center;
}

.vector-button {
    border: 1px solid var(--paper);
    color: var(--paper);
    background: transparent;
    padding: 16px 22px;
    cursor: pointer;
    transition: color 240ms ease, background 240ms ease, box-shadow 240ms ease;
}

.vector-button.is-open,
.vector-button:hover {
    background: var(--paper);
    color: var(--black);
    box-shadow: 0 0 36px rgba(243, 240, 231, 0.20);
}

.vector-readout {
    color: var(--steel);
    font-size: 0.75rem;
}

body.vector-open {
    --fracture-opacity: 1;
    --cursor-scale: 1.28;
}

body.vector-open .field-line {
    stroke-dasharray: 2 32;
}

body.vector-open .pole-core {
    background: linear-gradient(180deg, transparent, var(--red), transparent 48%, var(--blue), transparent);
}

@keyframes magneticAlign {
    from {
        opacity: 0;
        transform: translateX(-0.18em) skewY(5deg) scaleY(1.14);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0) skewY(0deg) scaleY(1);
        filter: blur(0);
    }
}

@keyframes polePulse {
    from { opacity: 0.22; transform: scaleX(0.72); }
    to { opacity: 0.72; transform: scaleX(1.16); }
}

@keyframes packetFall {
    0%, 100% { transform: translate(0, 0) rotate(-2deg); opacity: 0.4; }
    50% { transform: translate(18px, 58px) rotate(3deg); opacity: 1; }
}

@media (max-width: 850px) {
    .act,
    .split,
    .governance {
        display: block;
    }

    .diagram,
    .funnel {
        margin-top: 6vh;
    }

    .coordinate-block {
        position: static;
        margin-top: 6vh;
    }

    .compass {
        width: 74px;
        height: 74px;
    }

    .compass span {
        height: 52px;
    }
}
