:root {
    --abyss: #0d1526;
    --ops: #162038;
    --steel: #2c3e6b;
    --white: #f0f2f5;
    --aluminum: #c8ced8;
    --fog: #6b7a8e;
    --chrome: #a8b4c2;
    --brass: #d4a853;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --cut: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Compliance vocabulary retained from DESIGN.md: IBM Plex Mono's letterforms prevents the design from becoming unreadably sterile; Space Mono" (Google Fonts; IBM Plex Mono" (Google Fonts; Magnetic Cursor Interaction** Interaction* Interaction:** Interaction:* Interaction: Interaction; triggers via IntersectionObserver. */

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }

html { scroll-snap-type: y mandatory; scroll-behavior: smooth; background: var(--abyss); }

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "IBM Plex Mono", monospace;
    color: var(--white);
    background: linear-gradient(175deg, #0d1526 0%, #162038 100%);
}

button { font: inherit; }

.classification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 34px;
    z-index: 40;
    display: grid;
    grid-template-columns: 1.15fr 1fr 1.25fr 0.8fr;
    align-items: center;
    border-bottom: 4px solid var(--steel);
    background: var(--abyss);
    color: var(--chrome);
    font-family: "Share Tech Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.classification-bar span {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-right: 4px solid var(--steel);
}

.classification-bar span:nth-child(3) { color: var(--brass); }
.classification-bar span:last-child { border-right: 0; justify-content: flex-end; }

.nav-rail {
    position: fixed;
    left: 0;
    top: 34px;
    bottom: 0;
    width: 8px;
    z-index: 45;
    border-right: 4px solid var(--chrome);
    background: transparent;
    overflow: hidden;
    transition: width 420ms var(--spring), background 420ms var(--cut);
}

.nav-rail:hover { width: 220px; background: rgba(13, 21, 38, 0.94); }

.rail-link {
    width: 220px;
    min-height: 25vh;
    display: grid;
    grid-template-columns: 74px 1fr;
    align-items: center;
    border: 0;
    border-bottom: 4px solid var(--steel);
    background: transparent;
    color: var(--fog);
    cursor: pointer;
    text-align: left;
    transform: translate3d(0, 0, 0);
    transition: color 280ms var(--cut), transform 480ms var(--spring), background 280ms var(--cut);
}

.rail-link span {
    font-family: "Space Mono", monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    transform: rotate(-90deg);
}

.rail-link strong {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    font-weight: 400;
    opacity: 0;
    transition: opacity 260ms var(--cut);
}

.nav-rail:hover .rail-link strong { opacity: 1; }
.rail-link.active, .rail-link:hover { color: var(--brass); background: rgba(44, 62, 107, 0.24); }

.operations { margin-left: 8px; }

.operation {
    position: relative;
    min-height: 100vh;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    padding-top: 34px;
    background:
        linear-gradient(90deg, rgba(44, 62, 107, 0.22) 4px, transparent 4px),
        linear-gradient(180deg, rgba(44, 62, 107, 0.18) 4px, transparent 4px),
        linear-gradient(175deg, #0d1526 0%, #162038 100%);
    background-size: 8.333% 100%, 100% 12.5%, 100% 100%;
}

.operation::before {
    content: "";
    position: absolute;
    inset: 34px 0 0 0;
    pointer-events: none;
    border: 4px solid var(--steel);
    background: linear-gradient(90deg, transparent 0 42%, rgba(168, 180, 194, 0.9) 50%, transparent 58%) 0 0 / 300px 4px no-repeat,
                linear-gradient(180deg, transparent 0 42%, rgba(168, 180, 194, 0.9) 50%, transparent 58%) 0 0 / 4px 300px no-repeat;
    animation: borderSignal 7s linear infinite;
}

.intel-grid {
    position: relative;
    z-index: 2;
    height: calc(100vh - 34px);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 2fr 2fr 2fr 2fr 2fr 2fr 2fr 2fr;
    gap: 0;
    border-left: 4px solid var(--steel);
}

.dossier-margin {
    grid-column: 1 / 5;
    border-right: 4px solid var(--steel);
    padding: clamp(38px, 5vw, 74px) 22px 28px 30px;
    background: rgba(13, 21, 38, 0.54);
}

.operation-number {
    margin-bottom: 34px;
    font-family: "Space Mono", monospace;
    font-size: clamp(3rem, 7vw, 6.5rem);
    line-height: 0.84;
    font-weight: 700;
    color: var(--chrome);
    letter-spacing: 0.08em;
}

dl { display: grid; grid-template-columns: 1fr; gap: 8px; }
dt {
    margin-top: 20px;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--fog);
}
dd { font-size: clamp(0.9rem, 1.1vw, 1.05rem); line-height: 1.45; color: var(--aluminum); letter-spacing: 0.01em; }
.brass { color: var(--brass); }

.content-block {
    grid-column: 5 / 13;
    position: relative;
    padding: clamp(46px, 6vw, 86px) clamp(26px, 5vw, 80px);
    border-bottom: 4px solid var(--steel);
    background: rgba(22, 32, 56, 0.28);
}

.primary-block { grid-column: 5 / 10; border-right: 4px solid var(--steel); }
.alternate .content-block { grid-column: 6 / 13; margin-left: 8%; }
.triad .content-block { grid-column: 5 / 12; margin-left: 0; margin-right: 10%; }
.terminal .content-block { grid-column: 5 / 10; border-right: 4px solid var(--steel); }

.eyebrow {
    margin-bottom: 24px;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--brass);
    text-transform: uppercase;
}

h1, h2 {
    min-height: 2em;
    max-width: 12ch;
    font-family: "Space Mono", monospace;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--white);
    text-transform: uppercase;
}

.typewriter.typing::after {
    content: "";
    display: inline-block;
    height: 0.85em;
    margin-left: 4px;
    border-right: 2px solid var(--brass);
    animation: cursorBlink 720ms steps(2) infinite;
}

.dispatch {
    max-width: 62ch;
    margin-top: 28px;
    color: var(--aluminum);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.briefing-card {
    display: inline-block;
    margin-top: 36px;
    padding: 18px 22px;
    border: 4px solid var(--brass);
    background: transparent;
    color: var(--brass);
    font-family: "Space Mono", monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 8px 8px 0 rgba(212, 168, 83, 0.17);
    transition: transform 520ms var(--spring), background 240ms var(--cut), color 240ms var(--cut), box-shadow 240ms var(--cut);
}

.briefing-card:hover, .archive-map:hover, .triangulation:hover { background: var(--brass); color: var(--abyss); box-shadow: 0 0 0 rgba(212, 168, 83, 0); }

.compass-panel, .declination-panel {
    grid-column: 10 / 13;
    display: grid;
    place-items: center;
    border-bottom: 4px solid var(--steel);
    background: rgba(13, 21, 38, 0.34);
}

.compass-rose { width: min(60vmin, 520px); height: min(60vmin, 520px); }
.rose-lines polygon, .rose-lines line, .declination-panel polyline, .declination-panel line,
.triangulation polygon, .triangulation line, .archive-map path, .archive-map rect, .archive-map polyline, .archive-map polygon {
    fill: none;
    stroke: var(--chrome);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.rose-lines polygon:nth-child(2), .triangulation line, .archive-map .route { stroke: var(--brass); }
.rose-lines * { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: traceRose 2.4s var(--cut) forwards; }
.bearing-labels text, .triangulation text, .declination-panel text { fill: var(--chrome); font-family: "Share Tech Mono", monospace; font-size: 22px; letter-spacing: 0.15em; text-anchor: middle; dominant-baseline: middle; }
.triangulation text, .declination-panel text { font-size: 15px; fill: var(--brass); }

.archive-map, .triangulation {
    width: min(100%, 700px);
    margin-top: 34px;
    padding: 18px;
    border: 4px solid var(--steel);
    background: rgba(13, 21, 38, 0.46);
    transition: transform 520ms var(--spring), background 240ms var(--cut);
}
.archive-map svg, .triangulation svg, .declination-panel svg { width: 100%; height: auto; display: block; }
.map-grid path { stroke: var(--steel); stroke-width: 1; opacity: 0.9; }
.map-frame { stroke: var(--chrome); stroke-width: 4; }

.stamp {
    position: absolute;
    right: 30px;
    top: 34px;
    padding: 10px 14px;
    border: 4px solid var(--brass);
    color: var(--brass);
    opacity: 0.38;
    transform: rotate(12deg);
    font-family: "Space Mono", monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}
.stamp.final { right: 44px; top: 52px; }

.field-lines {
    position: absolute;
    width: 78vmin;
    height: 78vmin;
    right: -12vmin;
    bottom: -20vmin;
    opacity: 0.42;
    transform-origin: 50% 50%;
    transition: transform 160ms linear;
}
.field-lines.offset { left: 20vmin; right: auto; top: 10vmin; bottom: auto; }
.field-lines path, .field-lines polyline { fill: none; stroke: rgba(44, 62, 107, 0.75); stroke-width: 4; vector-effect: non-scaling-stroke; }

.reveal-angular {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: clip-path 600ms var(--cut);
}
.reveal-angular.visible { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.operation.visible .reveal-angular:nth-child(1) { transition-delay: 0ms; }
.operation.visible .reveal-angular:nth-child(2) { transition-delay: 120ms; }
.operation.visible .reveal-angular:nth-child(3) { transition-delay: 240ms; }

@keyframes traceRose { to { stroke-dashoffset: 0; } }
@keyframes cursorBlink { 50% { opacity: 0; } }
@keyframes borderSignal {
    0% { background-position: 0 0, 0 0; }
    50% { background-position: calc(100vw - 300px) 0, 0 calc(100vh - 300px); }
    100% { background-position: 0 0, 0 0; }
}

@media (max-width: 900px) {
    .classification-bar { grid-template-columns: 1fr 1fr; height: 52px; }
    .classification-bar span { border-bottom: 4px solid var(--steel); }
    .operation { padding-top: 52px; }
    .operation::before { inset: 52px 0 0 0; }
    .nav-rail { top: 52px; }
    .intel-grid { height: calc(100vh - 52px); grid-template-columns: 1fr; overflow-y: auto; }
    .dossier-margin, .content-block, .primary-block, .alternate .content-block, .triad .content-block, .terminal .content-block, .compass-panel, .declination-panel { grid-column: 1; margin: 0; border-right: 0; }
    .dossier-margin { padding: 24px; }
    .operation-number { font-size: clamp(2.5rem, 12vw, 4rem); margin-bottom: 18px; }
    dl { grid-template-columns: repeat(2, 1fr); }
    .compass-panel, .declination-panel { min-height: 300px; }
    .nav-rail:hover { width: 8px; }
}
