/*  BBS HQ — the placeholder site (hq-001).
    Source: bbshq-vault/sites/bbshq.org/public/ — published to /var/www/bbshq/public by
    tools/deploy.sh. An edit made in /var/www is overwritten by the next deploy, and
    tools/check.sh reports it before that happens.

    THE PALETTE IS THE VGA SIXTEEN, NAMED BY INDEX, and the brightness rule is the one The
    Vortex's art runs on: 15 is the thing itself (a key, a value), 7 is text and every
    symbol that separates, 8 is brackets, frames and murmur. Hue is spent on the logo and
    on one meaning — 14 yellow is "not open yet". Nothing else is coloured for variety.   */

/*  Web437 IBM VGA 9x16 — int10h.org Oldschool PC Font Pack v2.2 by VileR, CC BY-SA 4.0
    (fonts/WEB437-LICENSE.TXT). Advance 0.5625em: 9px at 16px, so 1ch is one CP437 cell and
    the half-block logo tiles with no seams. Full box-drawing and block coverage.         */
@font-face {
    font-family: 'Web437 IBM VGA 9x16';
    src: url('/fonts/Web437_IBM_VGA_9x16.woff') format('woff');
    font-display: swap;
}

:root {
    --c0: #000000; --c1: #0000aa; --c3: #00aaaa; --c7: #aaaaaa; --c8: #555555;
    --c9: #5555ff; --c11: #55ffff; --c14: #ffff55; --c15: #ffffff;
    --font: 'Web437 IBM VGA 9x16', Consolas, 'Courier New', monospace;
    color-scheme: dark;
}

/*  colours by VGA index. The generated logo paints each of its paths in currentColor. */
.f1  { color: var(--c1); }
.f3  { color: var(--c3); }
.f7  { color: var(--c7); }
.f8  { color: var(--c8); }
.f9  { color: var(--c9); }
.f11 { color: var(--c11); }
.f14 { color: var(--c14); }
.f15 { color: var(--c15); }

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--c0); }

body {
    margin: 0;
    padding-inline: 20px;
    background: var(--c0);
    color: var(--c7);
    font: 16px/1.5 var(--font);
    -webkit-text-size-adjust: 100%;
}

a { color: var(--c15); text-decoration: none; }
a:hover, a:focus-visible { color: var(--c0); background: var(--c3); outline: none; }

.sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

.screen {
    max-width: 80ch;
    margin: 0 auto;
    padding-block: 40px 28px;
}

/*  ── the dial ──────────────────────────────────────────────────────────────────────── */
.modem { margin: 0 0 28px; line-height: 1.25; }
.modem span.line { display: block; white-space: nowrap; overflow: hidden; }
.modem .l1 { width: 10ch; animation: type 0.9s steps(10, end) 0.2s both; }
.modem .l2 { animation: appear 0s linear 1.6s both; }
@keyframes type   { from { width: 0; } to { width: 10ch; } }
@keyframes appear { from { visibility: hidden; } to { visibility: visible; } }

/*  ── the logo ──────────────────────────────────────────────────────────────────────────
    An SVG of the pixel grid, not text. Drawn in the font's own half-blocks it tiled only
    at multiples of 16px: at 19px every bar showed pale seams and at phone width the rows
    split. Paths with crispEdges do not. Generated by PROJECTS/hq-001-placeholder-site/logo.js;
    its width attribute is the most it grows, and a narrow screen shrinks it.            */
.logo { display: block; max-width: 100%; height: auto; }
.logo path { fill: currentColor; }

.tagline {
    margin: 18px 0 36px;
    color: var(--c7);
    letter-spacing: 0.2ch;
}
.tagline b { color: var(--c15); font-weight: normal; }

/*  ── panels ────────────────────────────────────────────────────────────────────────────
    A frame is furniture: it fades from the logo's cyan at the corners to its blue along
    the run, so the longest lines on the page are never one flat colour.                 */
.panel {
    position: relative;
    margin: 0 0 30px;
    padding: 20px 2ch 14px;
    border: 2px solid;
    border-image: linear-gradient(90deg, var(--c3), var(--c1) 22%, var(--c1) 78%, var(--c3)) 1;
}
.panel > h2 {
    position: absolute;
    top: -0.8em;
    left: 1.5ch;
    margin: 0;
    padding: 0 1ch;
    background: var(--c0);
    font-size: 1em;
    font-weight: normal;
    line-height: 1.5;
    color: var(--c15);
    letter-spacing: 0.1ch;
}
.panel > h2::before { content: '['; color: var(--c8); margin-right: 1ch; }
.panel > h2::after  { content: ']'; color: var(--c8); margin-left: 1ch; }
.panel p { margin: 0 0 10px; }

/*  status: label / value rows */
.readout { display: grid; grid-template-columns: 10ch 1fr; gap: 2px 1ch; margin: 0 0 10px; }
.readout dt { color: var(--c8); }
.readout dd { margin: 0; color: var(--c15); }
.readout dd.soon { color: var(--c14); }

.cursor { display: inline-block; width: 1ch; background: var(--c7); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; } }

/*  departments: a main menu whose lights are not on yet */
.menu { list-style: none; margin: 4px 0 12px; padding: 0; }
.menu li {
    display: grid;
    grid-template-columns: 3ch 12ch 1fr;
    gap: 0 1ch;
    padding: 1px 0;
}
.menu .key   { color: var(--c8); }
.menu .key b { color: var(--c15); font-weight: normal; }
.menu .name  { color: var(--c15); }
.menu .what  { color: var(--c7); }
.note { color: var(--c8); }

/*  ── footer ────────────────────────────────────────────────────────────────────────── */
.foot {
    margin-top: 10px;
    padding-top: 12px;
    color: var(--c8);
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 3ch;
}
.foot .sep { color: var(--c7); }
.foot a { color: var(--c7); }

/*  ── the 404: no carrier ───────────────────────────────────────────────────────────── */
.nocarrier { margin: 0 0 14px; font-size: 2em; line-height: 1.2; color: var(--c15); letter-spacing: 0.1ch; }

/*  ── narrow ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    body { padding-inline: 16px; }
    .menu li { grid-template-columns: 3ch 1fr; padding-bottom: 6px; }
    .menu .what { grid-column: 2; }
    .readout { grid-template-columns: 8ch 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .modem .l1, .modem .l2, .cursor { animation: none; }
}
