:root {
    --void: #050505;
    --chalk: #F4F0E8;
    --red: #E31B23;
    --blue: #1A4D8F;
    --green: #071C17;
    --brass: #C49A3A;
    --tile: #D8D1C3;
    --pole-x: 34%;
    --pole-y: 42%;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--chalk);
    background: var(--void);
    font-family: "Instrument Serif", serif;
    overflow-x: hidden;
}

.field-shell {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(circle at var(--pole-x) var(--pole-y), rgba(227, 27, 35, .2), transparent 7rem),
        radial-gradient(circle at 74% 18%, rgba(26, 77, 143, .16), transparent 18rem),
        linear-gradient(135deg, var(--void), var(--green) 58%, var(--void));
}

.tile-veil, .glass-sheen, .grain-field {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 2;
}

.tile-veil {
    opacity: .08;
    background-image: linear-gradient(rgba(244,240,232,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(244,240,232,.55) 1px, transparent 1px);
    background-size: 76px 76px;
    mix-blend-mode: screen;
}

.glass-sheen {
    background: linear-gradient(112deg, transparent 0 36%, rgba(244,240,232,.06) 44%, transparent 53% 100%);
}

.grain-field {
    opacity: .34;
    background-image: radial-gradient(circle, rgba(244,240,232,.5) 0 1px, transparent 1.5px);
    background-size: 31px 29px;
    mask-image: radial-gradient(circle at var(--pole-x) var(--pole-y), black, transparent 68%);
}

.chamber {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    padding: 7vh 7vw;
    border-bottom: 1px solid rgba(196, 154, 58, .22);
}

.chamber::before {
    content: "";
    position: absolute;
    left: calc(var(--pole-x) - 32vmin);
    top: calc(var(--pole-y) - 32vmin);
    width: 64vmin;
    height: 64vmin;
    border-radius: 50%;
    background: conic-gradient(from 30deg, transparent, rgba(196,154,58,.23), transparent, rgba(244,240,232,.09), transparent);
    opacity: .75;
    animation: precess 18s linear infinite;
    z-index: -1;
}

.pole-system { position: absolute; inset: 0; z-index: 3; }

.monopole {
    position: fixed;
    left: var(--pole-x);
    top: var(--pole-y);
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 8px rgba(227,27,35,.12), 0 0 34px rgba(227,27,35,.88), 0 0 90px rgba(227,27,35,.34);
    z-index: 12;
    transition: left .9s cubic-bezier(.2,.8,.2,1), top .9s cubic-bezier(.2,.8,.2,1);
    animation: pulse 1.9s ease-in-out infinite;
}

.brass-circle, .flux-ring {
    position: fixed;
    left: var(--pole-x);
    top: var(--pole-y);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: left .9s cubic-bezier(.2,.8,.2,1), top .9s cubic-bezier(.2,.8,.2,1);
}

.brass-circle {
    width: 46vmin;
    height: 46vmin;
    border: 1px solid rgba(196,154,58,.62);
    background: repeating-conic-gradient(from 0deg, rgba(196,154,58,.7) 0 1deg, transparent 1deg 9deg);
    mask: radial-gradient(circle, transparent 69%, black 70% 72%, transparent 73%);
    animation: tickTurn 26s steps(80) infinite;
}

.flux-ring { border: 1px solid rgba(244,240,232,.18); }
.ring-a { width: 72vmin; height: 72vmin; animation: breathe 7s ease-in-out infinite; }
.ring-b { width: 91vmin; height: 91vmin; animation: breathe 9s ease-in-out infinite reverse; }

.field-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: .78;
}

.field-lines path {
    fill: none;
    stroke: rgba(244,240,232,.52);
    stroke-width: 1.2;
    stroke-dasharray: 12 18;
    animation: drawField 7s linear infinite;
}

.field-lines.blue path { stroke: rgba(26, 77, 143, .82); }

.wordmark {
    position: absolute;
    left: 7vw;
    top: 10vh;
    width: min-content;
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(5rem, 15vw, 15rem);
    line-height: .78;
    letter-spacing: .075em;
    color: var(--chalk);
    text-transform: uppercase;
    clip-path: circle(73% at 49% 50%);
    text-shadow: 0 0 1px var(--chalk), 17px 0 0 rgba(227,27,35,.14);
    z-index: 4;
}

.chamber-copy, .map-labels, .dipole-copy, .choir-copy, .archive-copy {
    position: absolute;
    z-index: 5;
    max-width: 440px;
    transition: transform .2s ease-out;
}

.chamber-copy { right: 8vw; bottom: 12vh; transform-origin: -20vw -16vh; }
.map-labels { left: 9vw; top: 16vh; }
.dipole-copy { right: 9vw; top: 18vh; }
.choir-copy { left: 8vw; bottom: 12vh; }
.archive-copy { right: 8vw; bottom: 10vh; }

.kicker, .coordinate-readout, .radial-note, .fracture-ruler, .drawer, .equation-wheel, .nav-tick {
    font-family: "Chivo Mono", monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.kicker { color: var(--brass); font-size: .72rem; margin: 0 0 1.2rem; }
h2 {
    margin: 0 0 1rem;
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(3.1rem, 7vw, 8rem);
    line-height: .86;
    letter-spacing: .06em;
    font-weight: 400;
}
p { font-size: clamp(1.15rem, 1.8vw, 1.65rem); line-height: 1.22; margin: 0; }

.needle-cloud { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.needle {
    position: absolute;
    width: 42px;
    height: 4px;
    transform-origin: 50% 50%;
    transition: transform .16s cubic-bezier(.2,.9,.1,1);
}
.needle::before, .needle::after { content: ""; position: absolute; top: 0; height: 4px; }
.needle::before { left: 0; width: 23px; background: var(--red); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.needle::after { right: 0; width: 19px; background: var(--chalk); clip-path: polygon(0 0, 100% 50%, 0 100%); }

.radial-note { position: absolute; color: var(--brass); font-size: .72rem; z-index: 5; }
.note-a { left: 48vw; top: 19vh; transform: rotate(-24deg); }
.note-b { left: 15vw; bottom: 13vh; transform: rotate(31deg); color: var(--red); }

.polar-nav { position: fixed; right: 24px; top: 22px; z-index: 30; width: 160px; height: 160px; }
.nav-dial {
    position: relative;
    width: 108px;
    height: 108px;
    margin-left: auto;
    border: 1px solid rgba(196,154,58,.56);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5,5,5,.7), transparent 68%), repeating-conic-gradient(rgba(196,154,58,.55) 0 1deg, transparent 1deg 18deg);
    transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.nav-tick { position: absolute; left: 50%; top: 50%; color: var(--tile); font-size: .58rem; text-decoration: none; transform-origin: 0 0; }
.nav-tick span { display: block; transform: translate(38px, -50%); }
.nav-tick:nth-child(1) { transform: rotate(-90deg); }
.nav-tick:nth-child(2) { transform: rotate(-18deg); }
.nav-tick:nth-child(3) { transform: rotate(54deg); }
.nav-tick:nth-child(4) { transform: rotate(126deg); }
.nav-tick:nth-child(5) { transform: rotate(198deg); }
.nav-tick.active { color: var(--red); }
.coordinate-readout { margin: 12px 0 0; font-size: .62rem; color: var(--brass); text-align: right; }

.contour-map {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78vmin;
    height: 78vmin;
    transform: translate(-33%, -53%);
}
.contour-map span { position: absolute; inset: calc(var(--i, 0) * 7%); border: 1px solid rgba(216,209,195,.26); border-radius: 42% 58% 52% 48%; animation: wobble 9s ease-in-out infinite; }
.contour-map span:nth-child(1) { --i: 0; }
.contour-map span:nth-child(2) { --i: 1; border-color: rgba(196,154,58,.42); }
.contour-map span:nth-child(3) { --i: 2; }
.contour-map span:nth-child(4) { --i: 3; border-color: rgba(26,77,143,.65); }
.contour-map span:nth-child(5) { --i: 4; }

.equation-wheel { position: absolute; right: 12vw; bottom: 16vh; width: 310px; height: 310px; color: var(--chalk); animation: precess 22s linear infinite reverse; }
.equation-wheel span { position: absolute; left: 50%; top: 50%; font-size: .78rem; transform-origin: 0 0; }
.equation-wheel span:nth-child(1) { transform: rotate(0deg) translateX(120px); }
.equation-wheel span:nth-child(2) { transform: rotate(90deg) translateX(120px); }
.equation-wheel span:nth-child(3) { transform: rotate(180deg) translateX(120px); }
.equation-wheel span:nth-child(4) { transform: rotate(270deg) translateX(120px); }

.split-panels { position: absolute; inset: 11vh 8vw; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; transform: rotate(-7deg); }
.panel { background: linear-gradient(135deg, rgba(216,209,195,.2), rgba(216,209,195,.05)); border: 1px solid rgba(216,209,195,.24); }
.left-panel { clip-path: polygon(0 0, 100% 0, 84% 42%, 95% 100%, 0 100%); }
.right-panel { clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%, 16% 43%); }
.broken-magnet { position: absolute; left: 18vw; top: 50vh; width: 48vw; height: 120px; transform: rotate(-14deg); }
.magnet-fragment { position: absolute; height: 76px; border: 2px solid rgba(244,240,232,.7); display: grid; place-items: center; font-family: "Bebas Neue", sans-serif; font-size: 3rem; letter-spacing: .1em; }
.fragment-a { left: 0; width: 42%; background: var(--red); clip-path: polygon(0 0, 90% 0, 76% 100%, 0 100%); animation: separateA 8s ease-in-out infinite; }
.fragment-b { right: 0; width: 38%; background: rgba(5,5,5,.88); clip-path: polygon(24% 0, 100% 0, 100% 100%, 8% 100%); animation: separateB 8s ease-in-out infinite; }
.fracture-ruler { position: absolute; left: 11vw; top: 18vh; color: var(--brass); font-size: .72rem; transform: rotate(-7deg); }

.ferro-crown { position: absolute; left: 50%; top: 50%; width: 52vmin; height: 28vmin; transform: translate(-50%, -35%); border-radius: 50% 50% 8% 8%; background: radial-gradient(ellipse at center, var(--green), var(--void) 68%); filter: drop-shadow(0 0 30px rgba(7,28,23,.9)); }
.ferro-crown i { position: absolute; bottom: 43%; left: 50%; width: 8%; height: 48%; background: linear-gradient(var(--chalk), var(--green)); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform-origin: 50% 100%; animation: spike 3s ease-in-out infinite; }
.ferro-crown i:nth-child(1) { transform: translateX(-220%) rotate(-44deg); animation-delay: -.1s; }
.ferro-crown i:nth-child(2) { transform: translateX(-170%) rotate(-31deg); animation-delay: -.3s; }
.ferro-crown i:nth-child(3) { transform: translateX(-120%) rotate(-18deg); animation-delay: -.5s; }
.ferro-crown i:nth-child(4) { transform: translateX(-70%) rotate(-7deg); animation-delay: -.7s; }
.ferro-crown i:nth-child(5) { transform: translateX(-20%) rotate(2deg); animation-delay: -.9s; }
.ferro-crown i:nth-child(6) { transform: translateX(30%) rotate(11deg); animation-delay: -1.1s; }
.ferro-crown i:nth-child(7) { transform: translateX(80%) rotate(21deg); animation-delay: -1.3s; }
.ferro-crown i:nth-child(8) { transform: translateX(130%) rotate(34deg); animation-delay: -1.5s; }
.ferro-crown i:nth-child(9) { transform: translateX(180%) rotate(47deg); animation-delay: -1.7s; }
.filing-orbit { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.filing { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--tile); opacity: .7; animation: filingDrift 5s ease-in-out infinite; }

.archive-drawers { position: absolute; left: 8vw; top: 14vh; width: min(58vw, 760px); transform: rotate(-10deg); transform-origin: 15% 85%; }
.drawer { display: flex; justify-content: space-between; gap: 3rem; margin: 1.1rem 0; padding: 1rem 1.2rem; border: 1px solid rgba(196,154,58,.35); background: rgba(216,209,195,.08); color: var(--tile); font-size: .78rem; transform-origin: 0 50%; transition: transform .7s ease, background .7s ease; }
.drawer:nth-child(2) { margin-left: 3vw; }
.drawer:nth-child(3) { margin-left: 6vw; }
.drawer:nth-child(4) { margin-left: 9vw; }
.one-point-archive.active .drawer { transform: rotate(7deg) translateX(2vw); background: rgba(196,154,58,.12); }

@keyframes pulse { 0%,100% { transform: scale(.88); } 50% { transform: scale(1.18); } }
@keyframes precess { to { transform: rotate(360deg); } }
@keyframes tickTurn { to { rotate: 360deg; } }
@keyframes breathe { 50% { scale: 1.08; opacity: .48; } }
@keyframes drawField { to { stroke-dashoffset: -180; } }
@keyframes wobble { 50% { border-radius: 58% 42% 47% 53%; transform: rotate(12deg) scale(1.04); } }
@keyframes separateA { 50% { transform: translateX(-28px); } }
@keyframes separateB { 50% { transform: translateX(36px); opacity: .38; } }
@keyframes spike { 50% { height: 60%; filter: brightness(1.25); } }
@keyframes filingDrift { 50% { transform: translateY(-12px) translateX(8px); opacity: 1; } }

@media (max-width: 760px) {
    .chamber { padding: 8vh 6vw; }
    .wordmark { font-size: 6.5rem; }
    .chamber-copy, .map-labels, .dipole-copy, .choir-copy, .archive-copy { left: 6vw; right: 6vw; bottom: 8vh; top: auto; max-width: none; }
    .polar-nav { transform: scale(.82); transform-origin: top right; }
    .archive-drawers { width: 88vw; left: 4vw; top: 18vh; }
    .drawer { flex-direction: column; gap: .4rem; }
}
