/* PIXELPUNK — site styles.
   Flat colour only: no gradients anywhere. Texture comes from SVG noise and hard edges. */

@font-face {
    font-family: 'PatchFun';
    src: url('../fonts/patchfun.ttf') format('truetype');
    font-display: swap;
}

:root {
    --ink: #0a0a0b;
    --ink-2: #121214;
    --ink-3: #1b1b1e;
    --line: #2c2c31;
    --paper: #ebe6da;
    --paper-ink: #141414;
    --text: #e9e6df;
    --dim: #9a978f;
    --acid: #e8ff00;
    --hot: #ff2bd6;
    --cyan: #00f0ff;
    --blood: #ff3b1f;
    --mint: #2effb0;

    --f-logo: 'PatchFun', 'Anton', Impact, sans-serif;
    --f-head: 'Anton', Impact, 'Arial Narrow', sans-serif;
    --f-body: 'Space Grotesk', system-ui, sans-serif;
    --f-mono: 'Space Mono', ui-monospace, Consolas, monospace;

    --gutter: clamp(16px, 4vw, 56px);
    --maxw: 1320px;
    --nav-h: 58px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Film-grain over everything. An SVG turbulence tile, not a gradient. */
body::before {
    content: '';
    position: fixed;
    inset: -50%;
    z-index: 999;
    pointer-events: none;
    opacity: .09;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -4%); }
    60% { transform: translate(-4%, -1%); }
    80% { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--acid); color: var(--ink); }

:focus-visible {
    outline: 3px solid var(--acid);
    outline-offset: 3px;
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 2000;
    background: var(--acid);
    color: var(--ink);
    padding: 8px 14px;
    font-family: var(--f-mono);
}
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------ nav */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--ink);
    border-bottom: 2px solid var(--text);
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-logo {
    font-family: var(--f-logo);
    font-size: 26px;
    letter-spacing: 1px;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
    line-height: 1;
}
.nav-logo:hover { color: var(--acid); }

.nav-links {
    display: flex;
    gap: 2px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 6px 7px;
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    color: var(--dim);
    border: 1px solid transparent;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--text); border-color: var(--line); }
.nav-links a.on { color: var(--ink); background: var(--acid); }

.nav-cta {
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 7px 12px;
    background: var(--hot);
    color: var(--ink);
    border: 2px solid var(--hot);
    white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--hot); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 2px solid var(--text);
    color: var(--text);
    font-family: var(--f-mono);
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
}

/* Language switch: the two versions in one frame, the current one filled. */
.lang-switch {
    display: flex;
    flex: none;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
}
.lang-opt {
    display: block;
    padding: 4px 7px;
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .08em;
    text-decoration: none;
    color: var(--dim);
}
.lang-opt:hover { color: var(--text); background: var(--ink-3); }
.lang-opt[aria-current] { color: var(--ink); background: var(--acid); }

/* "Also in your language": a quiet note in a corner, once, until dismissed (js/i18n.js). */
.lang-hint {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 12px 12px 16px;
    background: var(--ink);
    color: var(--text);
    border: 2px solid var(--text);
    box-shadow: 5px 5px 0 var(--acid);
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s ease-out, transform .3s ease-out;
}
.lang-hint.in { opacity: 1; transform: none; }
.lang-hint p { margin: 0; }
.lang-hint-go {
    justify-self: start;
    color: var(--acid);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    white-space: nowrap;
}
.lang-hint-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.lang-hint-close {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid var(--line);
    color: var(--dim);
    font: inherit;
    cursor: pointer;
}
.lang-hint-close:hover { color: var(--text); border-color: var(--text); }

.progress {
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background: var(--acid);
}

/* Thirteen links, the language switch and the credit need about 1340px, a little more
   than the page column: the bar runs wider than the column, and below 1460px the menu
   folds. */
.nav-inner { max-width: calc(var(--maxw) + 160px); }
@media (max-width: 1460px) {
    .nav-toggle { display: block; white-space: nowrap; }
    .nav-cta { display: none; }
    .nav-links {
        position: absolute;
        top: calc(var(--nav-h) - 2px);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--ink);
        border-bottom: 2px solid var(--text);
        padding: 8px var(--gutter) 16px;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { font-size: 14px; padding: 10px 6px; border-bottom: 1px dashed var(--line); }
}
/* On a phone the bar keeps the wordmark, the menu and one way across: only the other
   language is shown. */
@media (max-width: 600px) {
    .nav-inner { gap: 12px; }
    .nav-logo { font-size: 22px; }
    .lang-switch { padding: 0; border: 0; }
    .lang-opt[aria-current] { display: none; }
    .lang-opt { padding: 6px 8px; border: 1px solid var(--line); }
}

/* ------------------------------------------------------------------ type */

.kicker {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--ink);
    background: var(--acid);
    padding: 3px 8px;
    margin-bottom: 18px;
}

h1, h2, h3, h4 {
    font-family: var(--f-head);
    font-weight: 400;
    text-transform: uppercase;
    line-height: .95;
    margin: 0;
    letter-spacing: .01em;
}

h2 { font-size: clamp(44px, 7.5vw, 112px); }
h3 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 12px; }
h4 { font-size: 22px; margin-bottom: 8px; }

p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 1.6vw, 21px); max-width: 62ch; color: var(--text); }
.dim { color: var(--dim); }
.mono { font-family: var(--f-mono); }

code, .code {
    font-family: var(--f-mono);
    font-size: .88em;
    background: var(--ink-3);
    border: 1px solid var(--line);
    padding: 1px 6px;
    color: var(--acid);
}

.hl-hot { color: var(--hot); }
.hl-cyan { color: var(--cyan); }
.hl-acid { color: var(--acid); }

/* ------------------------------------------------------------------ hero */

.hero {
    position: relative;
    border-bottom: 2px solid var(--text);
    overflow: hidden;
}

.hero-media {
    position: absolute;
    inset: 0;
}
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.15) contrast(1.05);
}
/* Flat scrim + scanlines as an SVG pattern so the type stays legible without a gradient. */
.hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(10, 10, 11, .55);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='2' fill='black' fill-opacity='.35'/></svg>");
}

.hero-inner {
    position: relative;
    min-height: min(92vh, 900px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding-top: 28px;
    padding-bottom: 28px;
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text);
}
/* The logo font rises above its line box, so the meta line needs room above it. */
.hero-meta { margin-bottom: clamp(14px, 3vw, 28px); }
@media (max-width: 600px) {
    .hero-meta { flex-direction: column; align-items: center; gap: 4px; text-align: center; }
}
.hero-meta .rec::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    background: var(--blood);
    margin-right: 8px;
    animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-title {
    align-self: center;
    text-align: center;
    container-type: inline-size;
}

.logo-big {
    font-family: var(--f-logo);
    font-weight: 400;
    font-size: clamp(30px, 9.2vw, 136px);
    max-width: 100%;
    line-height: .9;
    letter-spacing: .01em;
    color: var(--text);
    margin: 0 auto 18px;
    text-transform: none;
    position: relative;
    display: inline-block;
}

/* ------------------------------------------------------------------ hero reveal */

/* "PixelPunk" is about 8.7em wide in the logo font, so 1/9.2 of the container leaves a
   little room and never overflows. */
@supports (font-size: 1cqi) {
    .logo-big { font-size: calc(100cqi / 9.2); }
    .foot-big { font-size: calc(100cqi / 9.2); }
}
.logo-big, .nav-logo { white-space: nowrap; }

/* One-shot reveal: a thin acid line rises from the baseline and uncovers the wordmark
   behind it, then the words under it fade up, and everything holds still. js/fx.js
   plays it once (.play); things start hidden only while .hero-armed says it is coming. */
.hero-armed .hero:not(.play) .logo-big,
.hero-armed .hero:not(.play) .hero-tag,
.hero-armed .hero:not(.play) .hero-sub,
.hero-armed .hero:not(.play) .hero-title .btn-row { opacity: 0; }

.logo-big::after {
    content: '';
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: 0;
    height: 3px;
    background: var(--acid);
    opacity: 0;
    pointer-events: none;
}
.hero.play .logo-big { animation: logo-rise .8s cubic-bezier(.6, 0, .2, 1) both; }
.hero.play .logo-big::after { animation: logo-line .8s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes logo-rise {
    from { clip-path: inset(100% -5% -15% -5%); }
    to { clip-path: inset(-25% -5% -15% -5%); }
}
@keyframes logo-line {
    0% { bottom: 0; opacity: 1; }
    85% { bottom: 105%; opacity: 1; }
    100% { bottom: 105%; opacity: 0; }
}

.hero.play .hero-tag,
.hero.play .hero-sub,
.hero.play .hero-title .btn-row { animation: hero-up .6s cubic-bezier(.2, .7, .2, 1) both; }
.hero.play .hero-tag { animation-delay: .65s; }
.hero.play .hero-sub { animation-delay: .8s; }
.hero.play .hero-title .btn-row { animation-delay: .95s; }
@keyframes hero-up { from { opacity: 0; transform: translateY(14px); } }

/* Neo's wordmark (css/skin-neo.css); hidden in the classic look. */
.neo-mark { display: none; }

/* While the classic look puts its words back (js/skin.js). */
html.skin-pending body { visibility: hidden; }

/* ------------------------------------------------------------------ glitch */

/* Colour-shifted copies of an element's own markup, laid exactly over it. They take
   the element's box so the text lines up, and stay invisible until a glitch runs. */
.gl-host { position: relative; }
.gl-layer {
    position: absolute;
    inset: 0;
    display: inherit;
    align-items: inherit;
    justify-content: inherit;
    gap: inherit;
    padding: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: inherit;
    line-height: inherit;
    white-space: inherit;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}
.gl-layer.gl-a { color: var(--hot); }
.gl-layer.gl-b { color: var(--cyan); mix-blend-mode: screen; }
.sec-paper .gl-layer.gl-b { mix-blend-mode: multiply; }

/* Torn slices of a picture. */
.gl-img-host { position: relative; }
.gl-slices { position: absolute; z-index: 3; pointer-events: none; overflow: hidden; }
.gl-slices img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    border-radius: 0;
    opacity: 0;
}
.gl-slices img.tint { filter: hue-rotate(160deg) saturate(2.2) contrast(1.15); }

.hero-tag {
    font-family: var(--f-head);
    text-transform: uppercase;
    font-size: clamp(24px, 3.4vw, 46px);
    line-height: 1;
    max-width: 18ch;
    margin: 0 auto 24px;
}
.hero-tag mark {
    background: var(--acid);
    color: var(--ink);
    padding: 0 .12em;
}

.hero-sub {
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(16px, 1.4vw, 19px);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-title .btn-row { justify-content: center; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-mono);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-decoration: none;
    padding: 13px 18px;
    border: 2px solid var(--text);
    background: var(--ink);
    color: var(--text);
    box-shadow: 5px 5px 0 var(--text);
    transition: transform .08s, box-shadow .08s;
    cursor: pointer;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--text); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--text); }
.btn-acid { background: var(--acid); color: var(--ink); border-color: var(--ink); box-shadow: 5px 5px 0 var(--hot); }
.btn-acid:hover { box-shadow: 3px 3px 0 var(--hot); }

.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border: 2px solid var(--text);
    background: var(--ink);
    margin-top: 34px;
}
.stat {
    padding: 12px 14px;
    border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat b {
    display: block;
    font-family: var(--f-head);
    font-weight: 400;
    font-size: clamp(30px, 3.4vw, 48px);
    line-height: 1;
    color: var(--acid);
}
.stat span {
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--dim);
}
@media (max-width: 860px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stat:nth-child(3) { border-right: 0; }
    .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

/* ------------------------------------------------------------------ ticker */

.ticker {
    background: var(--hot);
    color: var(--ink);
    border-bottom: 2px solid var(--text);
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--f-head);
    font-size: 26px;
    text-transform: uppercase;
    line-height: 1;
    padding: 10px 0;
}
.ticker-track {
    display: inline-block;
    animation: slide 40s linear infinite;
}
.ticker-track span { padding: 0 18px; }
.ticker-track span::after { content: '✕'; margin-left: 36px; font-size: .7em; vertical-align: middle; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------ sections */

.sec {
    position: relative;
    padding: clamp(70px, 10vw, 140px) 0;
    border-bottom: 2px solid var(--text);
}

.sec-paper {
    background: var(--paper);
    color: var(--paper-ink);
}
.sec-paper .dim { color: #5e5a52; }
.sec-paper .lead { color: var(--paper-ink); }
.sec-paper code { background: #ddd7c8; border-color: #c4bdaa; color: var(--paper-ink); }
.sec-paper .kicker { background: var(--paper-ink); color: var(--acid); }

.sec-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 28px;
    align-items: end;
    margin-bottom: clamp(36px, 5vw, 64px);
}
.sec-num {
    font-family: var(--f-logo);
    font-size: clamp(70px, 12vw, 170px);
    line-height: .8;
    color: transparent;
    -webkit-text-stroke: 2px var(--text);
    grid-row: span 2;
}
.sec-paper .sec-num { -webkit-text-stroke-color: var(--paper-ink); }
.sec-head .lead { grid-column: 2; margin: 0; }
@media (max-width: 700px) {
    .sec-head { grid-template-columns: 1fr; }
    .sec-num { grid-row: auto; }
    .sec-head .lead { grid-column: 1; }
}

.sub {
    margin-top: clamp(60px, 8vw, 110px);
}
.sub-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 2px solid currentColor;
    padding-top: 14px;
    margin-bottom: 26px;
}
.sub-head h3 { margin: 0; }
.sub-head .tag {
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .7;
}

/* Two-column feature rows: text + capture. */
.split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(26px, 4vw, 60px);
    align-items: start;
}
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip > :first-child { order: 2; }
.split.even { grid-template-columns: 1fr 1fr; }
/* Grid items default to min-width:auto, which lets a code block widen the page on phones. */
.split > * { min-width: 0; }
@media (max-width: 900px) {
    .split, .split.flip, .split.even { grid-template-columns: 1fr; }
    .split.flip > :first-child { order: 0; }
}

.sticky-col { position: sticky; top: calc(var(--nav-h) + 24px); }
@media (max-width: 900px) { .sticky-col { position: static; } }

/* Spec lists: parameter name + what it does. */
.spec {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    border-top: 1px solid currentColor;
}
.spec li {
    display: grid;
    grid-template-columns: minmax(110px, 34%) 1fr;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(127, 127, 127, .45);
    font-size: 15px;
    line-height: 1.45;
}
.spec li > b {
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-top: 2px;
}
.sec:not(.sec-paper) .spec li > b { color: var(--acid); }

/* Inline chips for option lists. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; padding: 0; list-style: none; }
.chips li, .chip {
    font-family: var(--f-mono);
    font-size: 12px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    line-height: 1.4;
}

/* ------------------------------------------------------------------ figures */

.shot {
    position: relative;
    margin: 0;
}
.shot-frame {
    --shadow: var(--hot);
    position: relative;
    border: 2px solid var(--text);
    background: var(--ink-2);
    box-shadow: 8px 8px 0 var(--shadow);
    cursor: zoom-in;
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s cubic-bezier(.2, .7, .2, 1);
}
.sec-paper .shot-frame { --shadow: var(--paper-ink); border-color: var(--paper-ink); }
.shot-frame.c-cyan { --shadow: var(--cyan); }
.shot-frame.c-acid { --shadow: var(--acid); }
.shot-frame img { width: 100%; height: auto; }
/* Hover: the frame lifts off its shadow. The image itself is never distorted. */
.shot-frame:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--shadow); }

/* Corner crosshairs. */
.shot-frame::before, .shot-frame::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
    pointer-events: none;
}
.shot-frame::before { top: 6px; left: 6px; border-top: 2px solid var(--acid); border-left: 2px solid var(--acid); }
.shot-frame::after { bottom: 6px; right: 6px; border-bottom: 2px solid var(--acid); border-right: 2px solid var(--acid); }

.zoom-hint {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    font-family: var(--f-mono);
    font-size: 10px;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--acid);
    border: 1px solid var(--acid);
    padding: 2px 6px;
    opacity: 0;
    transition: opacity .15s;
}
.shot-frame:hover .zoom-hint { opacity: 1; }

.shot figcaption {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 70ch;
}
.shot figcaption .fig {
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    background: var(--text);
    color: var(--ink);
    padding: 1px 6px;
    margin-right: 8px;
}
.sec-paper .shot figcaption .fig { background: var(--paper-ink); color: var(--paper); }

/* Tape strip stuck across a corner. */
.tape {
    position: absolute;
    z-index: 4;
    top: -12px;
    left: 24px;
    transform: rotate(-4deg);
    background: var(--acid);
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 4px 12px;
    border: 1px solid var(--ink);
}
.tape.r { left: auto; right: 24px; transform: rotate(3deg); background: var(--cyan); }
.tape.h { background: var(--hot); }

/* Panel crops are narrow: let them sit in rows. */
.panels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 34px 26px;
    align-items: start;
}
.panels.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
/* Three across on a wide screen, so six theme shots make two even rows. */
.panels.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
@media (min-width: 1100px) { .panels.cols-3 { grid-template-columns: repeat(3, 1fr); } }
/* A featured shot across the whole row, above an even grid. */
.panels > .span-all { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ annotated console */

.annot {
    position: relative;
}
.pin {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
    background: var(--acid);
    color: var(--ink);
    border: 2px solid var(--ink);
    cursor: pointer;
    padding: 0;
}
.pin:hover, .pin.on { background: var(--hot); }
.legend {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0 28px;
    counter-reset: lg;
}
.legend li {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    padding: 10px 6px;
    border-bottom: 1px dashed var(--line);
    font-size: 15px;
    line-height: 1.45;
    transition: background .1s;
}
.legend li.on { background: var(--ink-3); }
.legend li::before {
    counter-increment: lg;
    content: counter(lg);
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    background: var(--acid);
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
}
.legend b { display: block; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------------------------ keycaps */

.keys {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 12px;
    margin-top: 22px;
}
.key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: var(--ink-2);
    font-size: 14px;
}
kbd {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
    background: var(--text);
    color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: 0 4px 0 var(--dim);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ galleries */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.filter {
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: transparent;
    color: inherit;
    border: 2px solid currentColor;
    padding: 6px 12px;
    cursor: pointer;
}
.filter:hover { background: var(--ink-3); color: var(--text); }
.filter.on { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.sec-paper .filter:hover { background: #d8d2c3; color: var(--paper-ink); }
.sec-paper .filter.on { background: var(--paper-ink); color: var(--acid); border-color: var(--paper-ink); }
.filter .n { opacity: .6; margin-left: 6px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 14px;
}
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }

.tile {
    position: relative;
    margin: 0;
    border: 2px solid currentColor;
    background: var(--ink);
    cursor: zoom-in;
    overflow: hidden;
    transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s cubic-bezier(.2, .7, .2, 1);
}
/* height:auto so the aspect-ratio wins over the height attribute. */
.tile img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
/* Hover: the tile lifts onto a hard shadow and its label lights up. */
.tile:hover, .tile:focus-visible { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--acid); }
.sec-paper .tile:hover, .sec-paper .tile:focus-visible { box-shadow: 6px 6px 0 var(--paper-ink); }
.tile figcaption { transition: background .2s, color .2s; }
.tile:hover figcaption { background: var(--acid); color: var(--ink); }
.tile:hover figcaption small { color: var(--ink); }
.tile figcaption {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 7px 9px;
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--text);
    border-top: 2px solid currentColor;
}
.sec-paper .tile figcaption { background: var(--paper-ink); color: var(--paper); }
.tile figcaption small { color: var(--dim); font-size: 10px; }
.tile .badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-family: var(--f-mono);
    font-size: 10px;
    text-transform: uppercase;
    background: var(--acid);
    color: var(--ink);
    padding: 1px 5px;
}
.tile[hidden] { display: none; }

/* Shader library: search, empty state, paging. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lib-bar { margin-bottom: 14px; }
.lib-search input {
    width: min(100%, 420px);
    font-family: var(--f-mono);
    font-size: 14px;
    color: var(--text);
    background: var(--ink-2);
    border: 2px solid var(--text);
    padding: 10px 12px;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
.lib-search input::placeholder { color: var(--dim); }
.lib-search input:focus { border-color: var(--acid); box-shadow: 4px 4px 0 var(--acid); }
.lib-empty { font-family: var(--f-mono); font-size: 13px; color: var(--dim); margin-top: 20px; }
.lib-more { display: flex; justify-content: center; margin-top: 30px; }
.lib-more .btn[hidden] { display: none; }

/* ------------------------------------------------------------------ before / after */

.compare {
    position: relative;
    border: 2px solid var(--text);
    box-shadow: 8px 8px 0 var(--acid);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ink-2);
    user-select: none;
    touch-action: pan-y;
}
.compare img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.compare .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.compare .bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--cut, 50%);
    width: 3px;
    background: var(--acid);
    transform: translateX(-50%);
    pointer-events: none;
}
.compare .bar::after {
    content: '◀ ▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--acid);
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 7px;
    white-space: nowrap;
}
.compare .lbl {
    position: absolute;
    top: 10px;
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    background: var(--ink);
    border: 1px solid var(--text);
    padding: 2px 7px;
    z-index: 2;
}
.compare .lbl.l { left: 10px; }
.compare .lbl.r { right: 10px; color: var(--acid); border-color: var(--acid); }
.compare input[type=range] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    margin: 0;
    z-index: 3;
}

.sec-paper .compare { border-color: var(--paper-ink); box-shadow: 8px 8px 0 var(--paper-ink); }
.compare .lbl { color: var(--text); }

/* Mapping: editor → output → room, side by side. */
.pipeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 26px;
    align-items: start;
}
@media (max-width: 1000px) { .pipeline { grid-template-columns: 1fr; } }

.fx-note {
    margin-top: 26px;
    border-left: 4px solid var(--acid);
    padding: 4px 0 4px 16px;
    min-height: 3.2em;
}
.fx-note b {
    font-family: var(--f-head);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 26px;
    display: block;
    line-height: 1.1;
}

/* ------------------------------------------------------------------ phones */

.phones {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(14px, 2.5vw, 30px);
    align-items: start;
}
.phone {
    margin: 0;
    border: 3px solid var(--text);
    border-radius: 26px;
    padding: 12px 8px 16px;
    background: var(--ink);
    box-shadow: 8px 8px 0 var(--cyan);
    cursor: zoom-in;
}
.phone:nth-child(even) { transform: translateY(36px); box-shadow: 8px 8px 0 var(--hot); }
.phone img { border-radius: 10px; width: 100%; }
.phone::before {
    content: '';
    display: block;
    width: 34%;
    height: 6px;
    margin: 0 auto 9px;
    background: var(--line);
}
.phone figcaption {
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    text-align: center;
    margin-top: 10px;
    color: var(--dim);
}
@media (max-width: 800px) {
    .phones { grid-template-columns: repeat(2, 1fr); }
    .phone:nth-child(even) { transform: translateY(20px); }
}

/* ------------------------------------------------------------------ network map */

.netmap {
    background: var(--ink);
    color: var(--text);
    border: 2px solid var(--paper-ink);
    box-shadow: 8px 8px 0 var(--paper-ink);
    margin-top: 10px;
}
.nm-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--line);
}
.nm-title {
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--acid);
}
.nm-title em { font-style: normal; color: var(--dim); font-weight: 400; }
.nm-scenes { display: flex; flex-wrap: wrap; gap: 6px; }
.netmap .nm-scenes .filter { font-size: 11px; padding: 5px 9px; border-width: 1px; color: var(--text); border-color: var(--line); }
.netmap .nm-scenes .filter:hover { background: var(--ink-3); color: var(--text); border-color: var(--text); }
.netmap .nm-scenes .filter.on { background: var(--acid); color: var(--ink); border-color: var(--acid); }

/* The side panel never sets the height: on a wide screen it takes the stage's height and
   scrolls inside, stacked it has fixed heights. Picking another card never moves the page. */
.nm-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: stretch;
}
.nm-stage { padding: 12px; min-width: 0; }
.nm-side {
    border-left: 2px solid var(--line);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    contain: size;
}
.nm-side .nm-inspect { flex: 0 0 55%; }
.nm-side .nm-log { flex: 1 1 0; }
/* Side by side only while the drawing keeps a readable size. */
@media (max-width: 1240px) {
    .nm-body { grid-template-columns: 1fr; }
    .nm-side { border-left: 0; border-top: 2px solid var(--line); contain: none; }
    .nm-side .nm-inspect { flex: none; height: 280px; }
    .nm-side .nm-log { flex: none; height: 230px; }
}
@media (max-width: 560px) {
    .nm-stage { padding: 8px 4px; }
}

.nm-svg { display: block; width: 100%; height: auto; overflow: visible; -webkit-tap-highlight-color: transparent; }
.nm-svg text { font-family: var(--f-mono); fill: var(--text); font-size: 14px; }
.nm-svg .nm-cap { font-size: 14px; font-weight: 700; letter-spacing: .06em; fill: var(--text); }
.nm-svg .nm-small { font-size: 13px; }
.nm-svg .nm-lbl { font-size: 13px; letter-spacing: .06em; fill: var(--dim); }
.nm-svg .dim { fill: var(--dim); }
.nm-svg .ok { fill: var(--mint); }
.nm-svg .nm-port { font-size: 14px; fill: var(--acid); font-weight: 700; }
.nm-svg.narrow text { font-size: 13px; }
.nm-svg.narrow .nm-small { font-size: 12px; }
.nm-svg.narrow .nm-lbl, .nm-svg.narrow .nm-cap, .nm-svg.narrow .nm-port { font-size: 13px; }

.nm-zone { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 6; }
.nm-dev { fill: var(--ink-3); stroke: var(--text); stroke-width: 2; transition: stroke .2s; }
.nm-screen { fill: #08080a; stroke: var(--line); stroke-width: 1; }
.nm-notch { fill: var(--line); }
.nm-transparent { fill: transparent; }
.nm-plug { fill: var(--line); stroke: var(--dim); stroke-width: 1; }
.nm-disk-mark { fill: var(--line); transition: fill .2s; }
.nm-box { fill: var(--ink-2); stroke: var(--line); stroke-width: 1.5; transition: stroke .2s, fill .2s; }

/* Selectable devices: hover points, selection marks, the rest steps back. */
.nm-click { cursor: pointer; transition: opacity .25s; }
.nm-click:focus { outline: none; }
.nm-ring { fill: none; stroke: var(--acid); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0; pointer-events: none; }
.nm-click:focus-visible > .nm-ring { opacity: 1; }
.nm-click.rel .nm-dev, .nm-click.rel .nm-box { stroke: var(--text); }
.nm-click.sel .nm-dev, .nm-click.sel .nm-box, .nm-click.hit .nm-dev, .nm-click.hit .nm-box { stroke: var(--acid); }
.nm-proc.sel .nm-box, .nm-proc.hit .nm-box { fill: #1c1f08; }
.nm-disk.sel .nm-disk-mark, .nm-disk.hit .nm-disk-mark, .nm-disk.rel .nm-disk-mark { fill: var(--acid); }
.nm-svg.has-sel .nm-click:not(.sel):not(.rel):not(.nm-wall) { opacity: .45; }
.nm-pv-bg { fill: #000; stroke: var(--line); }
.nm-lens { fill: #000; stroke: var(--text); stroke-width: 2; }
.nm-vent { stroke: var(--line); stroke-width: 2; }
.nm-led { fill: var(--line); }
.nm-led.on { fill: var(--blood); }
.nm-level { fill: var(--mint); }

.nm-wall-frame { fill: #000; stroke: var(--line); stroke-width: 2; }
.nm-wipe-edge { stroke: var(--acid); stroke-width: 2; transition: opacity .2s; }
.nm-beam { fill: var(--text); opacity: .07; }

.nm-track { stroke: var(--line); stroke-width: 4; }
.nm-tick { stroke: var(--line); stroke-width: 1; }
.nm-knob { fill: var(--text); stroke: var(--ink); stroke-width: 1.5; }
.nm-knob.live { fill: var(--acid); }
.nm-fader-hit { fill: transparent; cursor: ew-resize; touch-action: none; }
.nm-fader-hit:focus { outline: none; }
.nm-fader-hit:focus-visible { stroke: var(--acid); stroke-width: 1.5; stroke-dasharray: 4 4; }

.nm-path { fill: none; stroke: var(--dim); stroke-width: 2; transition: stroke .2s, opacity .25s; pointer-events: none; }
.nm-path.wifi { stroke-dasharray: 7 6; }
.nm-path.loop { stroke-dasharray: 2 5; stroke-linecap: round; }
.nm-path.cable { stroke-width: 5; stroke: #4a4944; stroke-linecap: round; stroke-linejoin: round; }
.nm-path.sel { stroke: var(--acid); }
.nm-path.cable.sel { stroke: #8a9a12; }
/* The signal inside a cable: a quiet dash that only moves while a picture flows. */
.nm-signal { fill: none; stroke: var(--acid); stroke-width: 1.5; stroke-dasharray: 2 9; opacity: 0; pointer-events: none; transition: opacity .3s; }
.nm-signal.live { opacity: .5; animation: nm-flow 1.1s linear infinite; }
.nm-signal.live.sel { opacity: .9; }
@keyframes nm-flow { to { stroke-dashoffset: -22; } }
.nm-svg.has-sel .nm-path:not(.sel) { opacity: .3; }
.nm-svg.has-sel .nm-signal.live:not(.sel) { opacity: .15; }
.nm-hit { fill: none; stroke: var(--acid); stroke-opacity: 0; stroke-width: 18; stroke-linecap: round; cursor: pointer; pointer-events: stroke; }
.nm-hit:focus { outline: none; }
.nm-hit:focus-visible { stroke-opacity: .14; }
.nm-hit.loop { stroke-linecap: butt; stroke-width: 14; }
@media (pointer: coarse) { .nm-hit { stroke-width: 26; } .nm-hit.loop { stroke-width: 16; } }

.nm-packets { pointer-events: none; }
.nm-pkt rect { stroke: var(--ink); stroke-width: 1; }
.nm-pkt text { font-size: 12px; font-weight: 700; fill: var(--ink); }
.nm-svg.narrow .nm-pkt text { font-size: 13px; }
.nm-pkt.k-state rect, .nm-pkt.k-state circle { fill: var(--acid); }
.nm-pkt.k-status rect, .nm-pkt.k-status circle { fill: var(--cyan); }
.nm-pkt.k-media rect, .nm-pkt.k-media circle { fill: var(--hot); }
.nm-pkt.k-file rect, .nm-pkt.k-file circle { fill: var(--mint); }
.nm-pkt.dot circle { stroke: var(--ink); stroke-width: 1; }

.nm-inspect { padding: 16px; border-bottom: 2px solid var(--line); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.nm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.nm-inspect h4 { font-size: 24px; margin: 0 0 4px; color: var(--text); }
.nm-inspect h4:focus { outline: none; }
.nm-close {
    flex: none;
    width: 28px;
    height: 28px;
    margin: -2px -4px 0 0;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--dim);
    font: 18px/1 var(--f-mono);
    cursor: pointer;
}
.nm-close:hover { color: var(--text); border-color: var(--text); }
.nm-close:focus-visible, .nm-chip:focus-visible, .nm-conn-head:focus-visible { outline: 1.5px dashed var(--acid); outline-offset: 2px; }
.nm-sub {
    margin: 16px 0 6px;
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--dim);
}
.nm-conn { border-top: 1px dashed var(--line); padding: 8px 0; }
.nm-conn-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 0 0 4px;
    background: none;
    border: 0;
    color: var(--text);
    text-align: left;
    font: 13px/1.4 var(--f-body);
    cursor: pointer;
}
.nm-conn-head b { font-weight: 700; }
.nm-conn-head span { font-family: var(--f-mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.nm-conn-head:hover b { color: var(--acid); }
.nm-inspect .nm-io { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 12px; line-height: 1.45; margin: 2px 0 0; }
.nm-io i { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--dim); }
.nm-io span { font-family: var(--f-mono); color: #c9c6be; word-break: break-word; }
.nm-ends { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.nm-ends i { font-style: normal; color: var(--dim); font-family: var(--f-mono); }
.nm-chip {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    font: 11px/1 var(--f-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 6px 8px;
    cursor: pointer;
}
.nm-chip:hover { border-color: var(--text); }
.nm-role {
    display: block;
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--acid);
    margin-bottom: 10px;
}
.nm-medium { display: block; font-size: 13px; line-height: 1.45; color: var(--acid); margin-bottom: 10px; }
.nm-inspect p { font-size: 14px; line-height: 1.5; margin: 0; color: var(--text); }
.nm-msgs { list-style: none; margin: 4px 0 0; padding: 0; }
.nm-msgs li {
    display: grid;
    grid-template-columns: 16px auto;
    gap: 2px 8px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
    line-height: 1.4;
}
.nm-msgs i { font-style: normal; color: var(--acid); font-family: var(--f-mono); grid-row: span 2; }
.nm-msgs b { font-family: var(--f-mono); font-size: 12px; color: var(--text); }
.nm-msgs span { color: var(--dim); }

.nm-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 16px 6px;
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--dim);
}
.nm-legend { display: flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; }
.nm-legend i { width: 9px; height: 9px; display: inline-block; margin-left: 6px; }
.nm-legend .k-state { background: var(--acid); }
.nm-legend .k-status { background: var(--cyan); }
.nm-legend .k-media { background: var(--hot); }
.nm-legend .k-file { background: var(--mint); }

.nm-log {
    list-style: none;
    margin: 0;
    padding: 0 16px 14px;
    font-family: var(--f-mono);
    font-size: 11px;
    line-height: 1.45;
    min-height: 0;
    overflow: hidden;
}
.nm-log li {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0 8px;
    padding: 5px 0 5px 8px;
    border-left: 3px solid var(--line);
    border-bottom: 1px dashed #222226;
    animation: nm-in .25s ease-out;
}
.nm-log li.k-state { border-left-color: var(--acid); }
.nm-log li.k-status { border-left-color: var(--cyan); }
.nm-log li.k-media { border-left-color: var(--hot); }
.nm-log li.k-file { border-left-color: var(--mint); }
.nm-log .t { color: var(--dim); grid-row: span 3; white-space: pre; }
.nm-log .r { color: var(--dim); }
.nm-log b { color: var(--text); }
.nm-log .p { color: #c9c6be; word-break: break-all; }
.nm-log .p:empty { display: none; }
@keyframes nm-in { from { opacity: 0; transform: translateY(-4px); } }

.nm-hint {
    margin: 0;
    padding: 10px 16px;
    border-top: 2px solid var(--line);
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--dim);
}
.nm-noscript { padding: 20px; color: var(--text); }

/* ------------------------------------------------------------------ code */

.term {
    border: 2px solid var(--text);
    background: var(--ink-2);
    box-shadow: 8px 8px 0 var(--acid);
}
.term-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    border-bottom: 2px solid var(--text);
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--text);
    color: var(--ink);
}
.term pre {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
    font-family: var(--f-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}
.term .c { color: var(--dim); }
.term .d { color: var(--hot); }
.term .t { color: var(--cyan); }
.term .s { color: var(--acid); }

.tree {
    font-family: var(--f-mono);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
}

/* ------------------------------------------------------------------ callout cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0;
    border: 2px solid currentColor;
}
.card {
    padding: 22px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    margin: -1px -1px 0 0;
}
.card .ix {
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    display: block;
    margin-bottom: 10px;
    opacity: .7;
}
.card h4 { font-size: 26px; }
.card p { font-size: 15px; margin: 0; line-height: 1.5; }

.stamp {
    display: inline-block;
    font-family: var(--f-head);
    text-transform: uppercase;
    font-size: 20px;
    border: 3px solid var(--blood);
    color: var(--blood);
    padding: 2px 10px;
    transform: rotate(-6deg);
    letter-spacing: .06em;
}

.note {
    font-family: var(--f-mono);
    font-size: 12px;
    border: 1px dashed currentColor;
    padding: 10px 14px;
    margin-top: 22px;
    opacity: .85;
}

/* ------------------------------------------------------------------ lightbox */

.lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 5, 6, .96);
    display: none;
    grid-template-rows: auto 1fr auto;
    padding: 14px;
}
.lb.open { display: grid; }
.lb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    color: var(--dim);
    gap: 12px;
}
.lb-stage {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 12px 0;
}
.lb-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 2px solid var(--text);
    box-shadow: 8px 8px 0 var(--hot);
}
.lb-cap {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 15px;
    color: var(--text);
}
.lb-btn {
    background: var(--ink);
    color: var(--text);
    border: 2px solid var(--text);
    font-family: var(--f-mono);
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
}
.lb-btn:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.lb-nav { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ footer */

.foot {
    background: var(--acid);
    color: var(--ink);
    padding: clamp(50px, 8vw, 100px) 0 28px;
}
.foot .wrap { container-type: inline-size; }
.foot-big {
    font-family: var(--f-logo);
    font-size: clamp(30px, 9.2vw, 136px);
    line-height: .85;
    margin: 0 0 30px;
    text-align: center;
}
.foot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    border-top: 2px solid var(--ink);
    padding-top: 24px;
    text-align: center;
}
.foot-grid p { margin-left: auto; margin-right: auto; }
.foot h4 { font-size: 20px; }
.foot ul { list-style: none; padding: 0; margin: 0; font-family: var(--f-mono); font-size: 13px; line-height: 2; }
.foot a { text-decoration: none; border-bottom: 2px solid var(--ink); }
.foot a:hover { background: var(--ink); color: var(--acid); }
.foot-credit {
    font-family: var(--f-head);
    text-transform: uppercase;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1;
    margin: 0 0 12px;
}
.foot-credit a { border-bottom-width: 4px; }
.foot-legal {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 36px;
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ reveal */

.rv { opacity: 0; transform: translateY(24px); transition: opacity .6s ease-out, transform .6s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .rv { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* Keep the staggered phones staggered after they reveal. */
.phone.rv.in:nth-child(even) { transform: translateY(36px); }
@media (max-width: 800px) { .phone.rv.in:nth-child(even) { transform: translateY(20px); } }

/* Phones: two-up galleries, and the console legend stands alone (pins would pile up). */
@media (max-width: 600px) {
    .grid, .grid.sm { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tile figcaption { font-size: 10px; padding: 5px 6px; }
    .tile figcaption small { display: none; }
    .pin { display: none; }
    figcaption kbd, p kbd { height: 22px; min-width: 22px; font-size: 11px; box-shadow: 0 2px 0 var(--dim); }
}
