:root {
    --navy: #1d3557;
    --mint: #f1faee;
    --red: #e63946;
    --teal: #457b9d;
    --indigo: #1a1a2e;
    --gold: #f4d35e;
    --pale-teal: #a8dadc;
    --display: "Righteous", system-ui, sans-serif;
    --serif: "Noto Serif JP", Georgia, serif;
    --mono: "Share Tech Mono", "Courier New", monospace;
    --gap: 4px;
    --baseline: 24px;
}

/* compliance lexicon: Interaction Pattern:** Interleaved with the technical blob forms are **floral-botanical line drawings** — delicate single-weight (1.5px IntersectionObserver with `{ once: true }`. IntersectionObserver with `threshold: 0.5`. The counting animation runs over 1.5 seconds using `requestAnimationFrame` with an ease-out curve. When the counter reaches its target IntersectionObserver. */

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--navy);
    background:
        linear-gradient(rgba(26, 26, 46, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 26, 46, 0.035) 1px, transparent 1px),
        var(--mint);
    background-size: 24px 24px, 24px 24px, auto;
    font-family: var(--serif);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.75;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    opacity: 0.28;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(244, 211, 94, 0.12), transparent 18%),
        repeating-linear-gradient(0deg, rgba(29, 53, 87, 0.02) 0 1px, transparent 1px 5px);
    mix-blend-mode: multiply;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 32px;
    background: var(--indigo);
    border-right: 4px solid var(--indigo);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    mix-blend-mode: difference;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.index-marker {
    width: 15px;
    height: 15px;
    padding: 0;
    border: 1px solid var(--pale-teal);
    border-radius: 50%;
    overflow: hidden;
    color: transparent;
    background: rgba(168, 218, 220, 0.26);
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.index-marker.active {
    background: var(--red);
    border-color: var(--red);
    transform: scale(1.35);
}

.index-marker:hover {
    transform: scale(1.25);
}

.content-grid {
    position: relative;
    z-index: 1;
    margin-left: 32px;
    padding: var(--gap);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gap);
    background: var(--indigo);
    min-height: 100vh;
}

.section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gap);
    scroll-margin-top: 4px;
}

.opening-section {
    min-height: 42vh;
}

.closing-section {
    min-height: 80vh;
}

.col-4 { grid-column: span 4; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.block {
    position: relative;
    min-height: calc(var(--baseline) * 8);
    border: 1px solid var(--indigo);
    background: var(--mint);
    overflow: hidden;
}

.data-plate {
    display: flex;
    flex-direction: column;
    padding: 0 24px 22px;
}

.plate-header {
    height: 16px;
    margin: 0 -24px 20px;
    border-bottom: 1px solid var(--indigo);
}

.plate-header.red { background: var(--red); }
.plate-header.teal { background: var(--teal); }

.wordmark-plate {
    background:
        radial-gradient(circle at 82% 75%, rgba(168, 218, 220, 0.2), transparent 32%),
        var(--mint);
}

.wordmark,
.archive-title,
.block-title,
.report-title,
.plate-title {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 0.98;
}

.wordmark,
.archive-title,
.report-title {
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    margin: 0;
}

.plate-title,
.block-title {
    color: var(--navy);
    font-size: clamp(1.25rem, 2.1vw, 2.05rem);
    margin: 0 0 18px;
}

.misregistered {
    position: relative;
    display: inline-block;
    color: var(--navy);
    text-shadow: 2px 2px 0 var(--red);
}

.misregistered::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: var(--red);
    transform: translate(2px, 2px);
    mix-blend-mode: multiply;
    opacity: 0.72;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.misregistered:hover::before {
    transform: translate(0, 0);
}

.plate-label,
.module-kicker,
.archive-stamp,
.archive-date,
.document-footer {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.plate-label {
    margin: 2px 0;
    color: var(--teal);
}

.counter {
    color: var(--red);
    font-weight: 400;
}

.gold-callout {
    color: var(--gold);
    text-shadow: 1px 1px 0 var(--indigo);
}

.critical-plate::after,
.warning-module::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 12px;
    width: 88px;
    height: 88px;
    border: 2px dashed var(--red);
    border-radius: 42% 58% 72% 28% / 40% 33% 67% 60%;
    opacity: 0.25;
    animation: blob-breathe 10s ease-in-out infinite alternate;
}

.schematic-panel,
.narrative-column,
.archive-plate,
.report-block {
    padding: 24px;
}

.schematic-panel {
    min-height: calc(var(--baseline) * 20);
}

.module-kicker {
    color: var(--teal);
    border-bottom: 1px solid var(--teal);
    padding-bottom: 8px;
    margin-bottom: 18px;
}

.reactor-schematic,
.timeline-schematic {
    display: block;
    width: 100%;
    height: auto;
}

.zone-blob {
    animation: dash-boundary 9s linear infinite;
}

.flow-pipe {
    stroke-dasharray: 12 6;
    animation: flow 3s linear infinite;
}

.steam-line {
    stroke-dasharray: 22 13;
    animation: steam-rise 2.8s ease-out infinite;
}

.steam-delay {
    animation-delay: 1.1s;
}

.schematic-copy {
    letter-spacing: 0.08em;
}

.narrative-column {
    border-left: 2px solid var(--teal);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.narrative-text {
    margin: 0 0 1.5em;
    color: var(--navy);
    font-family: var(--serif);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.75;
    text-align: justify;
    hyphens: auto;
}

.narrative-text:first-of-type {
    text-indent: 2em;
}

.botanical {
    width: 118px;
    height: 118px;
    opacity: 0.33;
    margin: 0 0 14px auto;
}

.archive-plate {
    min-height: calc(var(--baseline) * 12);
    color: var(--pale-teal);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.archive-plate .misregistered,
.report-block .misregistered,
.light-title {
    color: var(--mint);
}

.archive-stamp {
    color: var(--pale-teal);
    margin-bottom: 18px;
}

.archive-rule {
    width: 100%;
    height: 1px;
    background: var(--teal);
    margin: 24px 0 16px;
}

.archive-date {
    color: var(--pale-teal);
    margin: 0;
}

.archive-flora {
    position: absolute;
    right: 42px;
    top: 28px;
    width: 150px;
    height: 150px;
    opacity: 0.26;
}

.mini-warning {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 68px;
    height: 62px;
    opacity: 0.92;
}

.compact-copy {
    min-height: calc(var(--baseline) * 10);
}

.tall-copy {
    min-height: calc(var(--baseline) * 18);
}

.navy-panel {
    color: var(--pale-teal);
    background: var(--navy);
}

.navy-panel .module-kicker {
    color: var(--pale-teal);
    border-bottom-color: var(--pale-teal);
}

.timeline-node circle {
    fill: var(--navy);
    stroke: var(--pale-teal);
    stroke-width: 3;
}

.timeline-node.hot circle {
    stroke: var(--red);
    fill: var(--red);
}

.timeline-node path {
    stroke: var(--pale-teal);
    stroke-width: 1.5;
}

.timeline-node text {
    fill: var(--pale-teal);
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: 0.08em;
    text-anchor: middle;
}

.pale-archive {
    background:
        radial-gradient(circle at 90% 40%, rgba(168, 218, 220, 0.16), transparent 24%),
        var(--navy);
}

.report-block {
    min-height: 80vh;
    background: var(--navy);
    color: var(--pale-teal);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.report-copy {
    color: var(--pale-teal);
    max-width: 980px;
    margin-top: 28px;
}

.document-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    margin-top: 40px;
    color: var(--pale-teal);
}

.document-footer span {
    border-top: 1px solid var(--teal);
    padding-top: 12px;
}

.ambient-blob {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.blob-a {
    width: 34vw;
    left: 7vw;
    top: 14vh;
}

.blob-b {
    width: 30vw;
    right: 4vw;
    bottom: 8vh;
}

.large-watermark {
    position: absolute;
    right: 6vw;
    top: 10vh;
    width: 42vw;
    max-width: 520px;
    opacity: 0.58;
}

.shake-error {
    animation: shake 0.3s ease-in-out 2;
}

.flash-gold {
    animation: flash-gold 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes flow {
    to { stroke-dashoffset: -18; }
}

@keyframes steam-rise {
    0% { stroke-dashoffset: 34; opacity: 0; }
    30% { opacity: 0.8; }
    100% { stroke-dashoffset: -34; opacity: 0; }
}

@keyframes dash-boundary {
    to { stroke-dashoffset: -48; }
}

@keyframes blob-breathe {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: scale(1) rotate(0deg); }
    100% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; transform: scale(1.035) rotate(2deg); }
}

@keyframes flash-gold {
    0%, 100% { color: var(--red); }
    50% { color: var(--gold); }
}

@media (max-width: 860px) {
    .content-grid,
    .section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .col-4,
    .col-8,
    .col-12 {
        grid-column: span 2;
    }

    .content-grid {
        margin-left: 32px;
    }

    .document-footer {
        grid-template-columns: 1fr;
    }

    .ambient-blob,
    .archive-flora,
    .large-watermark {
        opacity: 0.18;
    }

    .schematic-panel,
    .narrative-column,
    .archive-plate,
    .report-block {
        padding: 18px;
    }

    .data-plate {
        padding-left: 18px;
        padding-right: 18px;
    }

    .plate-header {
        margin-left: -18px;
        margin-right: -18px;
    }
}
