/* xbom.wiki — Decommissioned Cold War Monitoring Station Archive */

/* ============================================================
   COLOR TOKENS — Decommissioned Terminal palette
   #050805 Absolute Black
   #0A0E0A Deep Black
   #3A5A3A Terminal Green
   #7ABA7A Terminal Phosphor
   #D4A017 Amber Warning
   #C44536 Hazard Red
   #2A3A2A Grid Line
   #C8CFC8 Declassified White
   ============================================================ */

:root {
    --absolute-black: #050805;
    --deep-black: #0A0E0A;
    --terminal-green: #3A5A3A;
    --terminal-phosphor: #7ABA7A;
    --amber-warning: #D4A017;
    --hazard-red: #C44536;
    --grid-line: #2A3A2A;
    --declassified-white: #C8CFC8;
}

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

html, body {
    background-color: #050805;
    color: #7ABA7A;
    font-family: "Space Mono", monospace;
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    /* Coordinate grid SVG, 60px spacing, #2A3A2A at 12% opacity */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'><path d='M60 0H0v60' fill='none' stroke='%232A3A2A' stroke-opacity='0.12' stroke-width='1'/></svg>");
    background-attachment: fixed;
    background-repeat: repeat;
    background-position: 0 0;
    line-height: 1.65;
    font-size: 16px;
}

/* Force fixed grid via overlay too, in case background-attachment glitches on mobile */
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'><path d='M60 0H0v60' fill='none' stroke='%232A3A2A' stroke-opacity='0.18' stroke-width='1'/></svg>");
    background-repeat: repeat;
    mix-blend-mode: screen;
    opacity: 0.6;
}

/* ============================================================
   SCAN LINE — single 1px Terminal Phosphor sweep, 6s linear
   ============================================================ */
.scan-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(122, 186, 122, 0.15);
    pointer-events: none;
    z-index: 50;
    top: 0;
    animation: scan-sweep 6s linear infinite;
    box-shadow: 0 0 6px rgba(122, 186, 122, 0.10);
}

@keyframes scan-sweep {
    0%   { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* ============================================================
   STATUS BAR — persistent 48px header readout
   ============================================================ */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background-color: rgba(5, 8, 5, 0.96);
    border-bottom: 1px solid #3A5A3A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    color: #3A5A3A;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-mark {
    font-family: "Black Ops One", "Oswald", sans-serif;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: #D4A017;
    text-transform: uppercase;
}

.cursor-blink {
    color: #D4A017;
    font-family: "Space Mono", monospace;
    animation: blink 1s steps(2, end) infinite;
    font-weight: 700;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.status-mode {
    color: #7ABA7A;
    opacity: 0.7;
    margin-left: 8px;
    letter-spacing: 0.06em;
}

.status-center {
    flex: 0 1 240px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waveform {
    width: 100%;
    height: 24px;
    opacity: 0.6;
}

#waveformPath {
    animation: wave-shift 20s linear infinite;
}

@keyframes wave-shift {
    0%   { transform: translateX(0); opacity: 0.5; }
    50%  { opacity: 0.85; }
    100% { transform: translateX(-40px); opacity: 0.5; }
}

.status-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7ABA7A;
    letter-spacing: 0.08em;
    font-size: 11px;
    text-transform: uppercase;
}

.coord-marker {
    cursor: pointer;
    padding: 4px 6px;
    border: 1px solid transparent;
    transition: border-color 120ms linear, color 120ms linear, background-color 120ms linear;
}

.coord-marker:hover {
    color: #D4A017;
    border-color: #3A5A3A;
    background-color: rgba(212, 160, 23, 0.06);
}

.coord-marker.active {
    color: #D4A017;
    border-color: #D4A017;
}

.coord-divider {
    color: #2A3A2A;
}

/* ============================================================
   ARCHIVE MAIN — broken-grid dossier descent
   ============================================================ */
.archive-main {
    position: relative;
    z-index: 5;
    padding: 0 60px;
    /* User arrives mid-document — first panel cropped by viewport.
       48px status bar + small offset so the title line is partially below the bar. */
    padding-top: 18px;
    padding-bottom: 120px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-anchor {
    position: relative;
    padding: 80px 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.section-anchor:first-of-type {
    /* Cropped first panel — sits just below status bar, top edge cropped */
    padding-top: 24px;
    margin-top: -40px;
}

/* ============================================================
   DOSSIER PANELS
   - sharp corners, 1px Terminal Green border
   - 4px left-edge accent stripe Amber Warning
   - semi-transparent Deep Black 92% so grid bleeds through
   - asymmetric placement on 12-col grid
   ============================================================ */

.dossier-panel {
    position: relative;
    background-color: rgba(10, 14, 10, 0.92);
    border: 1px solid #3A5A3A;
    padding: 32px 32px 28px 36px;
    color: #7ABA7A;
    font-family: "Space Mono", monospace;

    /* Border draw-in animation */
    clip-path: inset(0 100% 0 0);
    transition: clip-path 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dossier-panel.revealed {
    clip-path: inset(0);
}

/* 4px left-edge accent stripe — Amber Warning */
.dossier-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #D4A017;
}

/* Top-right corner tick mark, technical drawing style */
.dossier-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    border-top: 1px solid #D4A017;
    border-right: 1px solid #D4A017;
    pointer-events: none;
}

/* Layout placement — broken grid */
.panel-wide {
    grid-column: 1 / span 10;
}

.panel-medium {
    grid-column: 2 / span 9;
}

.panel-narrow {
    grid-column: 8 / span 5;
}

.panel-offset {
    margin-top: -30px;
    margin-left: 28px;
    grid-column: 7 / span 5;
}

.panel-offset-right {
    margin-top: -24px;
    grid-column: 1 / span 5;
    margin-left: 0;
}

.panel-footer {
    grid-column: 1 / span 12;
    margin-top: 40px;
}

/* ============================================================
   PANEL META — Share Tech Mono, 11-13px, terminal green @60%
   ============================================================ */
.panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    color: rgba(58, 90, 58, 1);
    opacity: 0.85;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(58, 90, 58, 0.5);
}

.meta-tag {
    color: #3A5A3A;
}

/* ============================================================
   PANEL HEADER
   ============================================================ */
.panel-header {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.panel-header.small {
    margin-bottom: 12px;
}

.panel-section-id {
    font-family: "Share Tech Mono", monospace;
    font-size: 13px;
    color: #3A5A3A;
    letter-spacing: 0.12em;
    border: 1px solid #3A5A3A;
    padding: 2px 8px;
    text-transform: uppercase;
}

.panel-title {
    font-family: "Black Ops One", "Oswald", sans-serif;
    font-weight: 400;
    font-size: 48px;
    line-height: 1.05;
    letter-spacing: 0.08em;
    color: #D4A017;
    text-transform: uppercase;
}

.panel-subtitle {
    font-family: "Black Ops One", "Oswald", sans-serif;
    font-weight: 400;
    font-size: 28px;
    letter-spacing: 0.08em;
    color: #D4A017;
    text-transform: uppercase;
    line-height: 1.1;
}

/* ============================================================
   PANEL BODY
   ============================================================ */
.panel-body {
    position: relative;
    z-index: 2;
}

.panel-paragraph {
    font-family: "Space Mono", monospace;
    font-size: 16px;
    line-height: 1.65;
    color: #7ABA7A;
    margin-bottom: 14px;
}

.panel-paragraph.mono-quote {
    color: #C8CFC8;
    border-left: 2px solid #3A5A3A;
    padding-left: 14px;
    font-style: normal;
}

.panel-paragraph.attribution {
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    color: #3A5A3A;
    letter-spacing: 0.06em;
    margin-top: -4px;
}

.two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
    margin-bottom: 12px;
}

@media (max-width: 880px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

.col {
    min-width: 0;
}

.panel-list {
    list-style: none;
    font-family: "Share Tech Mono", monospace;
    font-size: 13px;
    color: #7ABA7A;
    letter-spacing: 0.06em;
}

.panel-list li {
    padding: 6px 0;
    border-bottom: 1px dotted rgba(58, 90, 58, 0.6);
}

.panel-list li::before {
    content: ">> ";
    color: #D4A017;
}

/* Protocol list — ordered, with step IDs */
.protocol-list {
    list-style: none;
    counter-reset: protocol;
    margin-top: 12px;
    margin-bottom: 18px;
}

.protocol-list li {
    position: relative;
    padding: 8px 0 8px 0;
    border-bottom: 1px dotted rgba(58, 90, 58, 0.5);
    font-family: "Space Mono", monospace;
    font-size: 15px;
    color: #C8CFC8;
}

.step-id {
    display: inline-block;
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #D4A017;
    border: 1px solid #3A5A3A;
    padding: 1px 6px;
    margin-right: 12px;
    min-width: 44px;
    text-align: center;
}

/* ============================================================
   CALLOUTS — Oswald 600, alert style
   ============================================================ */
.callout {
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 14px;
    margin: 16px 0;
    border-left: 4px solid currentColor;
    line-height: 1.3;
}

.callout-amber {
    color: #D4A017;
    background-color: rgba(212, 160, 23, 0.06);
    border-left-color: #D4A017;
}

.callout-red {
    color: #C44536;
    background-color: rgba(196, 69, 54, 0.06);
    border-left-color: #C44536;
}

/* ============================================================
   PANEL SCHEMATIC OVERLAY — rotated SVG diagrams
   ============================================================ */
.panel-schema {
    position: absolute;
    right: 24px;
    bottom: 18px;
    width: 220px;
    height: 160px;
    pointer-events: none;
    transform: rotate(-3deg);
    z-index: 1;
    opacity: 0.85;
}

.panel-schema svg {
    width: 100%;
    height: 100%;
}

.panel-schema.schema-large {
    width: 360px;
    height: 200px;
    bottom: 24px;
    right: 32px;
    transform: rotate(2deg);
    position: relative;
    margin-top: 16px;
    margin-left: auto;
    display: block;
}

.panel-schema.schema-side {
    right: 24px;
    top: 24px;
    bottom: auto;
    width: 200px;
    height: 240px;
    transform: rotate(4deg);
}

/* ============================================================
   TABLE — dossier inventory
   ============================================================ */
.dossier-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    font-family: "Share Tech Mono", monospace;
    font-size: 13px;
    color: #C8CFC8;
}

.dossier-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #3A5A3A;
    color: #D4A017;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
    background-color: rgba(212, 160, 23, 0.04);
}

.dossier-table td {
    padding: 8px 10px;
    border-bottom: 1px dotted rgba(58, 90, 58, 0.6);
    letter-spacing: 0.04em;
}

.dossier-table tr:hover td {
    background-color: rgba(58, 90, 58, 0.10);
    color: #7ABA7A;
}

/* ============================================================
   FORM — archive request
   ============================================================ */
.dossier-form {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-text {
    font-family: "Share Tech Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.10em;
    color: #3A5A3A;
    text-transform: uppercase;
}

.form-input {
    background-color: rgba(5, 8, 5, 0.9);
    border: 1px solid #3A5A3A;
    color: #7ABA7A;
    font-family: "Space Mono", monospace;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 0;
    outline: none;
    transition: border-color 120ms linear, color 120ms linear;
}

.form-input::placeholder {
    color: rgba(58, 90, 58, 0.7);
    letter-spacing: 0.04em;
}

.form-input:hover {
    border-color: #D4A017;
}

.form-input:focus {
    border-color: #D4A017;
    color: #C8CFC8;
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: "Space Mono", monospace;
}

.form-submit {
    align-self: flex-start;
    background-color: transparent;
    color: #D4A017;
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border: 1px solid #D4A017;
    padding: 8px 18px;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 120ms linear, color 120ms linear;
}

.form-submit:hover {
    background-color: #D4A017;
    color: #050805;
}

.form-status {
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    color: #7ABA7A;
    letter-spacing: 0.06em;
    min-height: 18px;
}

.form-status.ok {
    color: #7ABA7A;
}

.form-status.warn {
    color: #C44536;
}

/* ============================================================
   FOOTER PANEL
   ============================================================ */
.footer-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 18px;
}

@media (max-width: 880px) {
    .footer-body {
        grid-template-columns: 1fr;
    }
}

.footer-col {
    min-width: 0;
}

.footer-heading {
    font-family: "Black Ops One", "Oswald", sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #D4A017;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.footer-line {
    font-family: "Space Mono", monospace;
    font-size: 14px;
    color: #7ABA7A;
    margin-bottom: 4px;
}

.footer-bottom {
    border-top: 1px dashed #3A5A3A;
    padding-top: 12px;
    font-family: "Share Tech Mono", monospace;
    font-size: 12px;
    color: #3A5A3A;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   TOPOGRAPHIC INTERLUDES — full-width contour SVG strips
   ============================================================ */
.topo-interlude {
    width: 100%;
    height: 180px;
    margin: 40px 0 -40px 0;
    overflow: hidden;
    pointer-events: none;
}

.topo-interlude svg {
    width: 100%;
    height: 100%;
    display: block;
}

.topo-1 { margin-top: 80px; }
.topo-2 { margin-top: 60px; }
.topo-3 { margin-top: 60px; }
.topo-4 { margin-top: 60px; }

/* ============================================================
   TYPEWRITER REVEAL — character-by-character.
   Elements with [data-typewriter] start hidden until JS reveals them.
   ============================================================ */
[data-typewriter] {
    visibility: hidden;
}

[data-typewriter].typing,
[data-typewriter].typed {
    visibility: visible;
}

/* Caret while typing */
[data-typewriter].typing::after {
    content: "_";
    color: #D4A017;
    margin-left: 2px;
    animation: blink 0.7s steps(2, end) infinite;
}

/* ============================================================
   RESPONSIVE — keep grid feel on narrower viewports
   ============================================================ */
@media (max-width: 1100px) {
    .panel-title { font-size: 38px; }
    .panel-subtitle { font-size: 24px; }
    .archive-main { padding: 18px 28px 100px; }
    .panel-wide, .panel-medium, .panel-narrow,
    .panel-offset, .panel-offset-right, .panel-footer {
        grid-column: 1 / span 12;
        margin-left: 0;
    }
    .panel-schema {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        height: 160px;
        margin-top: 16px;
        transform: rotate(0);
    }
    .panel-schema.schema-side {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        height: 200px;
    }
    .status-right { display: none; }
    .status-center { flex: 1; }
}

@media (max-width: 640px) {
    .panel-title { font-size: 30px; }
    .panel-subtitle { font-size: 20px; }
    .callout { font-size: 16px; }
    .archive-main { padding: 18px 16px 80px; }
    .dossier-panel { padding: 22px 18px 22px 22px; }
    .status-bar { padding: 0 12px; }
    .domain-mark { font-size: 14px; }
}
