/* ARCHIVE's console: the green system layer (docs/DESIGN.md, "ARCHIVE layer"). ARCHIVE speaks in green;
   the members never do. Shared by the homepage (Recovered Transmissions), member files and, later, the
   transmission pages. Self-contained: it sets its own fonts, colours, corners and box sizing because the
   transmission pages don't load site.css. Page stylesheets only add spacing and page-specific parts. */

.archive-panel {
    --archive: #85efb1;
    --archive-dim: #3f8f66;
    --archive-bright: #c9f5d9;
    --archive-text: #dff5e8;
    --archive-rule: #183123;
    --archive-alert: #ff514b;
    position: relative;
    box-sizing: border-box;
    padding: 24px 28px 22px;
    border: 1px solid #2f7052;
    background: linear-gradient(115deg, #07110c, #040806 65%);
    color: var(--archive);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
}
.archive-panel *, .archive-panel *::before, .archive-panel *::after { box-sizing: border-box; }
.archive-panel a { color: inherit; text-decoration: none; }
/* Corner brackets, as on the redesign's framed panels. */
.archive-panel::before, .archive-panel::after { content: ''; position: absolute; width: 29px; height: 12px; opacity: .5; pointer-events: none; }
.archive-panel::before { top: 5px; left: 5px; border-top: 1px solid currentColor; border-left: 1px solid currentColor; }
.archive-panel::after { bottom: 5px; right: 5px; border-bottom: 1px solid currentColor; border-right: 1px solid currentColor; }

.archive-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.archive-heading { margin: 0; text-align: left; }
.archive-heading h2 { margin: 0; color: var(--archive); font-family: 'Cinzel', Georgia, serif; font-size: 21px; font-weight: 400; letter-spacing: .26em; text-transform: uppercase; text-wrap: balance; }
.archive-heading p { margin: 4px 0 0; color: #9fc9b0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.live-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 6px 12px; border: 1px solid #2f7052; color: var(--archive-bright); font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--archive-alert); box-shadow: 0 0 10px var(--archive-alert); }

/* Record lists: ID, title, date, arrow. */
.archive-records h3 { margin: 0 0 8px; color: #b8d5c4; font-family: 'Orbitron', sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.archive-records ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--archive-rule); }
.archive-records li a { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto 18px; gap: 12px; align-items: center; min-height: 52px; padding: 6px 8px; border-bottom: 1px solid var(--archive-rule); transition: background-color .2s, color .2s; }
.archive-records li a:hover, .archive-records li a:focus-visible { background: #0f2419; color: #d9fbe6; }
.record-id { color: var(--archive-dim); font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: .06em; }
.record-title { color: var(--archive-text); font-size: 15px; line-height: 1.35; }
.record-date { color: var(--archive-dim); font-family: 'Courier New', monospace; font-size: 12px; }
.archive-records li a .arrow { width: 18px; height: 18px; }
.archive-all { display: inline-flex; align-items: center; gap: 14px; min-height: 49px; margin-top: 18px; padding: 12px 20px; border: 1px solid var(--archive); color: var(--archive); font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: background-color .2s, color .2s; }
.archive-all:hover { background: var(--archive); color: #04110b; }
.archive-count { padding: 1px 7px; border: 1px solid currentColor; font-family: 'Courier New', monospace; font-weight: 400; }

/* Asset files: ARCHIVE's record on a member (later also report blocks on transmission pages). */
.archive-file-meta { margin: 0; color: var(--archive-bright); font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.9; letter-spacing: .16em; text-transform: uppercase; }
.archive-fields { display: grid; grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); margin: 0; border-top: 1px solid var(--archive-rule); }
.archive-fields dt, .archive-fields dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--archive-rule); }
.archive-fields dt { color: var(--archive-dim); font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.archive-fields dd { padding-left: 16px; color: var(--archive-text); font-family: 'Courier New', monospace; font-size: 14px; line-height: 1.55; }
/* ARCHIVE's alarm: the one line that should stop the reader, with a terminal cursor. */
.archive-alert { margin: 18px 0 0; padding: 12px 14px; border-left: 2px solid var(--archive-alert); background: rgba(255, 81, 75, .08); color: #ff8a84; font-family: 'Courier New', monospace; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.archive-alert::after { content: '_'; margin-left: 4px; animation: archive-cursor 1.1s steps(1) infinite; }
@keyframes archive-cursor { 50% { opacity: 0; } }
.archive-notes { margin: 14px 0 0; padding: 0; list-style: none; color: var(--archive); font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.7; }
.archive-notes li + li { margin-top: 6px; }
.archive-notes b { color: var(--archive-bright); font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }


/* Surveillance feeds: green-tinted camera stills with a tally light in the subject's colour. */
.feed-cam { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid #1d4430; }
.feed-cam img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; filter: grayscale(1) sepia(1) hue-rotate(80deg) saturate(2.2) brightness(.82) contrast(1.15); }
.feed-cam::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .65)); pointer-events: none; }
.feed-cam figcaption { position: absolute; z-index: 1; left: 8px; top: 6px; display: flex; align-items: center; gap: 6px; color: #c9f5d9; font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: .1em; padding: 2px 6px; background: rgba(2, 8, 5, .78); }
.feed-cam figcaption::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cam); box-shadow: 0 0 6px var(--cam); }
.cam-ara { --cam: #ff6464; }
.cam-yuri { --cam: #d2dce8; }
.cam-minji { --cam: #59c9ff; }
.cam-hana { --cam: #d398f6; }
/* Signal strip: one tick per transmission, oldest to newest. */
.signal-strip { margin-top: 24px; padding-top: 16px; border-top: 1px solid #183123; }
.strip-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #c9f5d9; font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: .12em; }
.strip-label span { color: var(--archive-dim); }
.strip-ticks { display: flex; align-items: flex-end; gap: 4px; height: 52px; margin: 0; padding: 0; list-style: none; }
.strip-ticks li { flex: 1; min-width: 2px; border-radius: 1px; }
.tick-field { height: 32%; background: var(--archive-dim); }
.tick-audio { height: 70%; background: var(--archive); opacity: .8; }
.tick-album { height: 100%; background: #c9f5d9; box-shadow: 0 0 10px var(--archive); }
.strip-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; color: #c9f5d9; font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.key { display: inline-flex; align-items: center; gap: 8px; }
.key::before { content: ''; width: 6px; height: 14px; border-radius: 1px; }
.key-audio::before { height: 12px; background: var(--archive); }
.key-album::before { height: 16px; background: #c9f5d9; }
.key-field::before { height: 7px; background: var(--archive-dim); }

/* ARCHIVE device frame (user art: assets/archive/frame-*.webp, cut by scripts/export-member-art.mjs).
   A gunmetal bezel that marks this as ARCHIVE's hardware, not a BLAZE-LACE panel. Everything scales with the
   panel's width (cqw): a top band and a bottom band, split mid-way down the side light bars, with a slice
   of each bar stretched between them, so any panel height works. The frame art is transparent outside the bezel
   (exported with alphaFromBlack), so scenery shows around it; the green screen behind it is a chamfered layer inset to the bezel's inner line. */
.archive-device { container-type: inline-size; isolation: isolate; border: 0; background: none;
    padding: calc(6.2% + 18px) calc(4.4% + 20px) calc(5.8% + 16px); }
.archive-device::before { content: ''; position: absolute; z-index: 1; inset: 0; width: auto; height: auto; border: 0; opacity: 1; pointer-events: none;
    background:
        url('../assets/archive/frame-top.webp') center top / 100% auto no-repeat,
        url('../assets/archive/frame-bottom.webp') center bottom / 100% auto no-repeat,
        /* Side bars fill only the gap between the bands (the source is cut at 24.24% of its width, and both bands
           together are 50cqw tall); the slice is a plain stretch of light bar, so it stretches cleanly. */
        url('../assets/archive/frame-left.webp') left 0 top var(--frame-top) / 4.7914% max(0px, calc(100% - var(--frame-bands))) no-repeat,
        url('../assets/archive/frame-right.webp') right 0 top var(--frame-top) / 4.7914% max(0px, calc(100% - var(--frame-bands))) no-repeat; }
/* cqw measures the panel's content box, so convert to its full width W: W = (100cqw + 2 × side padding px) / 0.912
   (side padding is 4.4% of W plus --frame-px). The top band is 0.2425 W tall, both bands 0.5 W. */
.archive-device { --frame-px: 20px; --frame-w: calc((100cqw + 2 * var(--frame-px)) / 0.912); --frame-top: calc(var(--frame-w) * 0.2425); --frame-bands: calc(var(--frame-w) * 0.5); }
.archive-device::after { content: ''; position: absolute; z-index: -1; inset: 4.9cqw 3.4cqw 4.9cqw; width: auto; height: auto; border: 0; opacity: 1; pointer-events: none;
    background: linear-gradient(115deg, #07110c, #040806 65%);
    clip-path: polygon(2.2cqw 0, calc(100% - 2.2cqw) 0, 100% 2.2cqw, 100% calc(100% - 2.2cqw), calc(100% - 2.2cqw) 100%, 2.2cqw 100%, 0 calc(100% - 2.2cqw), 0 2.2cqw); }
/* The tab label sits on the long plate at the top of the bezel, like the mockup. */
.archive-tab { position: absolute; z-index: 2; top: 1.95cqw; left: 13.6cqw; margin: 0; color: #d9dde2; font-family: 'Courier New', monospace; font-size: max(12px, 1.05cqw); letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .8); white-space: nowrap; }
.archive-tab span { color: #85efb1; }
@media (max-width: 600px) {
    .archive-panel { padding: 20px 16px 18px; }
    .archive-device { --frame-px: 12px; padding: calc(6.2% + 12px) calc(4.4% + 12px) calc(5.8% + 12px); }
    .strip-label { flex-wrap: wrap; }
    .strip-ticks { gap: 2px; height: 44px; }
    .feed-cam figcaption { font-size: 10px; left: 6px; top: 4px; }
    .archive-records li a { grid-template-columns: 50px minmax(0, 1fr) 18px; min-height: 56px; padding: 6px 4px; }
    .record-date { display: none; }
    .record-title { font-size: 14px; }
    .archive-all { width: 100%; justify-content: space-between; }
    .archive-fields { grid-template-columns: 1fr; }
    .archive-fields dt { padding-bottom: 0; border-bottom: 0; }
    .archive-fields dd { padding-left: 0; padding-top: 2px; }
}
@media (max-width: 800px) {
    /* The plate is too small for the label on narrow screens; the heading inside says the same. */
    .archive-tab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .archive-alert::after { animation: none; }
    .archive-records li a, .archive-all { transition: none; }
}
