/* =========================================================
   HOLOCRON DATABANK — cyberpunk retrieval terminal theme
   ========================================================= */

@font-face { font-family: "Orbitron"; font-weight: 700; font-display: swap; src: url(../fonts/orbitron-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 900; font-display: swap; src: url(../fonts/orbitron-latin-900-normal.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 400; font-display: swap; src: url(../fonts/rajdhani-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url(../fonts/rajdhani-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url(../fonts/rajdhani-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Share Tech Mono"; font-weight: 400; font-display: swap; src: url(../fonts/share-tech-mono-latin-400-normal.woff2) format("woff2"); }

:root {
	--bg: #020407;
	--panel: rgba(6, 22, 30, 0.72);
	--panel-solid: #061219;
	--panel-hi: rgba(0, 240, 255, 0.07);
	--cyan: #00f0ff;
	--cyan-mid: rgba(0, 240, 255, 0.55);
	--cyan-dim: rgba(0, 240, 255, 0.22);
	--cyan-faint: rgba(0, 240, 255, 0.08);
	--yellow: #ffea00;
	--yellow-dim: rgba(255, 234, 0, 0.35);
	--magenta: #ff2bd6;
	--red: #ff3864;
	--text: #d6f7ff;
	--text-soft: #9cc6d2;
	--muted: #5d8794;

	--f-title: "Orbitron", "Eurostile", "Bank Gothic", sans-serif;
	--f-body: "Rajdhani", "Segoe UI", sans-serif;
	--f-mono: "Share Tech Mono", ui-monospace, monospace;

	--glow-cyan: 0 0 6px rgba(0, 240, 255, 0.7), 0 0 18px rgba(0, 240, 255, 0.35);
	--glow-yellow: 0 0 6px rgba(255, 234, 0, 0.6), 0 0 16px rgba(255, 234, 0, 0.25);
	--topbar-h: 64px;
	--status-h: 28px;
	--rail-w: 92px;
	--index-w: 290px;
	--cut: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--f-body);
	font-size: 18px;
	line-height: 1.55;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

::selection { background: var(--yellow); color: #000; }

/* ---------- Backdrop: starfield, grid, glow, scanlines ---------- */
.backdrop {
	position: fixed; inset: 0; z-index: 0; pointer-events: none;
	background:
		radial-gradient(ellipse 60% 50% at 75% 0%, rgba(0, 240, 255, 0.10), transparent 70%),
		radial-gradient(ellipse 50% 45% at 0% 100%, rgba(255, 43, 214, 0.08), transparent 70%),
		linear-gradient(rgba(0, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 40px 40px,
		linear-gradient(90deg, rgba(0, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 40px 40px,
		radial-gradient(1px 1px at 20px 30px, #fff8, transparent) 0 0 / 230px 190px,
		radial-gradient(1px 1px at 120px 80px, #8ff8, transparent) 0 0 / 310px 270px,
		radial-gradient(1.5px 1.5px at 60px 150px, #fff6, transparent) 0 0 / 420px 360px,
		var(--bg);
}
.backdrop::after {
	content: ""; position: absolute; inset: 0;
	background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
	mix-blend-mode: multiply;
}
body::after { /* vignette */
	content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
	box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.85);
}

/* ---------- Icons (SVG masks so they take currentColor) ---------- */
.ico {
	display: inline-block; flex: none;
	width: 20px; height: 20px;
	background: currentColor;
	-webkit-mask: no-repeat center / contain;
	mask: no-repeat center / contain;
}

/* ---------- Panels with HUD corner brackets ---------- */
.panel {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--cyan-dim);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 240, 255, 0.04);
}
.panel::before, .panel::after {
	content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 3;
	border: 2px solid var(--cyan);
	filter: drop-shadow(0 0 4px var(--cyan));
}
.panel::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

/* Yellow-contoured card */
.card {
	position: relative;
	background: rgba(20, 18, 0, 0.35);
	border: 1px solid var(--yellow-dim);
	clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.card::before, .card::after {
	content: ""; position: absolute; pointer-events: none;
	width: calc(var(--cut) * 1.42); height: 2px; background: var(--yellow);
	box-shadow: var(--glow-yellow);
}
.card::before { top: 0; left: 0; transform-origin: 0 0; transform: translate(0, var(--cut)) rotate(-45deg); }
.card::after { bottom: 0; right: 0; transform-origin: 100% 100%; transform: translate(0, calc(var(--cut) * -1)) rotate(-45deg); }

/* ---------- Top bar ---------- */
.topbar {
	position: relative; z-index: 10;
	height: var(--topbar-h);
	display: flex; align-items: center; gap: 18px;
	padding: 0 18px;
	background: linear-gradient(to bottom, rgba(0, 30, 40, 0.85), rgba(0, 12, 18, 0.85));
	border-bottom: 1px solid var(--cyan-mid);
	box-shadow: 0 1px 0 rgba(0, 240, 255, 0.15), 0 8px 30px rgba(0, 240, 255, 0.08);
}
.topbar::after { /* yellow accent strip */
	content: ""; position: absolute; left: 0; bottom: -3px; height: 3px; width: 220px;
	background: var(--yellow); box-shadow: var(--glow-yellow);
	clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 0 6px var(--cyan)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title {
	font-family: var(--f-title); font-weight: 900; font-size: 24px; letter-spacing: 0.22em;
	color: var(--cyan); text-shadow: var(--glow-cyan);
}
.brand-sub { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--yellow); opacity: 0.9; }

.navbtns { display: flex; gap: 6px; margin-left: 10px; }

.btn {
	display: inline-flex; align-items: center; gap: 7px;
	height: 36px; padding: 0 12px;
	font-family: var(--f-title); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--cyan); background: var(--cyan-faint);
	border: 1px solid var(--cyan-dim);
	clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
	cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.btn .ico { width: 17px; height: 17px; }
.btn:hover:not(:disabled), .btn:focus-visible {
	background: var(--cyan); color: #001014; outline: none;
	box-shadow: var(--glow-cyan);
}
.btn:disabled { opacity: 0.3; cursor: default; }
.btn.icon-only { padding: 0; width: 36px; justify-content: center; }
#btn-menu { display: none; }

.search {
	margin-left: auto;
	display: flex; align-items: center; gap: 8px;
	width: min(380px, 34vw); height: 38px; padding: 0 10px;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid var(--cyan-dim);
	border-left: 3px solid var(--yellow);
	color: var(--cyan);
	transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--cyan); box-shadow: var(--glow-cyan); border-left-color: var(--yellow); }
.search input {
	flex: 1; min-width: 0; background: none; border: 0; outline: none;
	color: var(--text); font-family: var(--f-mono); font-size: 15px; letter-spacing: 0.08em;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: hue-rotate(150deg) saturate(3); }
.search kbd {
	font-family: var(--f-mono); font-size: 11px; color: var(--muted);
	border: 1px solid var(--muted); padding: 0 5px;
}

/* ---------- Layout ---------- */
.layout {
	position: relative; z-index: 1;
	display: grid;
	grid-template-columns: var(--rail-w) var(--index-w) minmax(0, 1fr);
	gap: 14px;
	height: calc(100% - var(--topbar-h) - var(--status-h));
	padding: 14px;
}

/* ---------- Category rail ---------- */
.rail {
	display: flex; flex-direction: column; gap: 6px;
	overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.cat {
	position: relative;
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 10px 4px 8px;
	text-decoration: none;
	color: var(--text-soft);
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(0, 240, 255, 0.14);
	transition: color .15s, background .15s, border-color .15s;
}
.cat .ico { width: 24px; height: 24px; }
.cat-name { font-family: var(--f-title); font-weight: 700; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }
.cat-count { font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.cat.empty { color: var(--muted); border-color: rgba(0, 240, 255, 0.07); }
.cat:hover { color: var(--cyan); border-color: var(--cyan-mid); background: var(--cyan-faint); }
.cat.active {
	color: #001014; background: var(--cyan); border-color: var(--cyan);
	box-shadow: var(--glow-cyan);
}
.cat.active .cat-count { color: #00363d; }
.cat.active::after {
	content: ""; position: absolute; right: -9px; top: 50%; width: 6px; height: 60%;
	transform: translateY(-50%); background: var(--yellow); box-shadow: var(--glow-yellow);
}

/* ---------- Index panel ---------- */
.index { display: flex; flex-direction: column; min-height: 0; }
.panel-head {
	display: flex; justify-content: space-between; align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid var(--cyan-dim);
	background: linear-gradient(90deg, var(--cyan-faint), transparent);
}
.panel-label { font-family: var(--f-title); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; color: var(--cyan); text-shadow: var(--glow-cyan); }
.panel-count { font-family: var(--f-mono); font-size: 13px; color: var(--yellow); }

.index-list {
	list-style: none; margin: 0; padding: 4px 0 20px;
	overflow-y: auto; flex: 1; min-height: 0;
}
.index-letter {
	position: sticky; top: 0; z-index: 1;
	padding: 6px 14px 2px;
	font-family: var(--f-title); font-weight: 900; font-size: 13px; color: var(--yellow);
	background: linear-gradient(to bottom, var(--panel-solid) 70%, transparent);
	text-shadow: var(--glow-yellow);
}
.index-item a {
	display: flex; align-items: center; gap: 9px;
	padding: 5px 14px 5px 12px;
	border-left: 2px solid transparent;
	color: var(--text-soft); text-decoration: none;
	font-weight: 600; font-size: 16px; line-height: 1.2;
	transition: background .1s, color .1s;
}
.index-item a .ico { width: 15px; height: 15px; color: var(--muted); }
.index-item a:hover { background: var(--cyan-faint); color: var(--cyan); }
.index-item a:hover .ico { color: var(--cyan); }
.index-item a.active {
	color: var(--yellow); border-left-color: var(--yellow);
	background: linear-gradient(90deg, rgba(255, 234, 0, 0.14), transparent);
}
.index-item a.active .ico { color: var(--yellow); }
.index-item mark { background: none; color: var(--magenta); }
.index-empty { padding: 20px 14px; font-family: var(--f-mono); color: var(--muted); font-size: 14px; }

/* ---------- Viewer ---------- */
/* The panel itself stays put (so its corner brackets stay in the corners); the inner element scrolls. */
.viewer { display: flex; flex-direction: column; min-height: 0; }
.viewer-scroll { flex: 1; min-height: 0; overflow-y: auto; outline: none; scroll-behavior: smooth; }
.scanbar {
	position: sticky; top: 0; height: 0; z-index: 4; pointer-events: none;
}
.scanbar::before {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
	background: linear-gradient(90deg, transparent, var(--cyan), transparent);
	box-shadow: var(--glow-cyan); opacity: 0;
}
.viewer.loading .scanbar::before { animation: scan .6s ease-out; }
@keyframes scan { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(70vh); } }

.article { padding: 34px 44px 60px; max-width: 1100px; }
.article.enter { animation: materialize .45s ease-out; }
@keyframes materialize {
	0% { opacity: 0; filter: blur(3px) brightness(2); transform: translateY(6px); }
	60% { opacity: 1; filter: blur(0) brightness(1.3); }
	100% { opacity: 1; filter: none; transform: none; }
}

/* Article header */
.rec-meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
	font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.12em; color: var(--muted);
	margin-bottom: 10px;
}
.badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 10px 3px 8px;
	font-family: var(--f-title); font-weight: 700; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
	color: #000; background: var(--yellow);
	clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
	text-decoration: none;
}
.badge .ico { width: 13px; height: 13px; }
a.badge:hover { background: var(--cyan); }
.rec-title {
	margin: 0 0 6px;
	font-family: var(--f-title); font-weight: 900;
	font-size: clamp(28px, 4.4vw, 52px); line-height: 1.05;
	letter-spacing: 0.06em; text-transform: uppercase;
	color: #fff;
	text-shadow: 0 0 2px #fff, 0 0 12px var(--cyan), 0 0 30px rgba(0, 240, 255, 0.5);
}
.rec-summary {
	margin: 0 0 22px; padding: 2px 0 14px;
	color: var(--cyan); font-size: 20px; font-weight: 600;
	border-bottom: 1px solid var(--cyan-dim);
	position: relative;
}
.rec-summary::after {
	content: ""; position: absolute; left: 0; bottom: -2px; width: 90px; height: 3px;
	background: var(--yellow); box-shadow: var(--glow-yellow);
}

/* Article body */
.rec-body { overflow: hidden; } /* contain floats */
.rec-body h1, .rec-body h2, .rec-body h3, .rec-body h4 {
	font-family: var(--f-title); font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.12em; line-height: 1.2; clear: none;
}
.rec-body h1, .rec-body h2 {
	font-size: 19px; color: var(--cyan); margin: 34px 0 12px;
	display: flex; align-items: center; gap: 12px;
	text-shadow: var(--glow-cyan);
}
.rec-body h1::before, .rec-body h2::before {
	content: ""; width: 10px; height: 10px; flex: none;
	background: var(--yellow); box-shadow: var(--glow-yellow);
	transform: rotate(45deg);
}
.rec-body h1::after, .rec-body h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--cyan-dim), transparent); }
.rec-body h3 { font-size: 15px; color: var(--yellow); margin: 24px 0 8px; }
.rec-body h4 { font-size: 13px; color: var(--text-soft); margin: 18px 0 6px; }
.rec-body p { margin: 0 0 14px; }
.rec-body strong { color: #fff; font-weight: 700; }
.rec-body em { color: var(--text-soft); }
.rec-body code {
	font-family: var(--f-mono); font-size: 0.9em;
	color: var(--yellow); background: rgba(255, 234, 0, 0.08); padding: 1px 5px;
}
.rec-body ul, .rec-body ol { margin: 0 0 14px; padding-left: 26px; }
.rec-body ul { list-style: none; padding-left: 22px; }
.rec-body ul > li { position: relative; }
.rec-body ul > li::before {
	content: ""; position: absolute; left: -16px; top: 0.62em; width: 6px; height: 6px;
	border: 1px solid var(--cyan); transform: rotate(45deg);
}
.rec-body ol > li::marker { color: var(--yellow); font-family: var(--f-mono); }
.rec-body li { margin-bottom: 4px; }
.rec-body hr {
	border: 0; height: 1px; margin: 28px 0; clear: both;
	background: linear-gradient(90deg, transparent, var(--cyan-mid), transparent);
}
.rec-body blockquote {
	margin: 18px 0; padding: 12px 18px;
	border-left: 3px solid var(--magenta);
	background: linear-gradient(90deg, rgba(255, 43, 214, 0.08), transparent);
	font-size: 19px; font-style: italic; color: #f4e6ff;
}
.rec-body blockquote p:last-child { margin-bottom: 0; }
.rec-body blockquote cite {
	display: block; margin-top: 8px;
	font-family: var(--f-mono); font-size: 13px; font-style: normal; letter-spacing: 0.06em; color: var(--magenta);
}
.rec-body blockquote cite::before { content: "\2014\00a0"; }

/* Links */
.rec-body a, .home-grid a { color: var(--cyan); text-decoration: none; border-bottom: 1px dotted var(--cyan-mid); }
.rec-body a:hover { color: #001014; background: var(--cyan); border-bottom-color: var(--cyan); box-shadow: var(--glow-cyan); }
.rec-body a.ext::after { /* off-site marker: Lucide icon as a mask, so it takes the link color */
	content: ""; display: inline-block;
	width: 0.75em; height: 0.75em; margin-left: 0.3em; vertical-align: -0.02em;
	background: currentColor;
	-webkit-mask: url(../icons/external-link.svg) no-repeat center / contain;
	mask: url(../icons/external-link.svg) no-repeat center / contain;
}
.rec-body a.broken { color: inherit; border-bottom: 1px dashed rgba(255, 56, 100, 0.7); cursor: help; }
.rec-body a.broken:hover { background: none; color: var(--red); box-shadow: none; }

/* Tables */
.rec-body table {
	border-collapse: collapse; margin: 0 0 18px; width: auto; max-width: 100%;
	font-size: 16px; display: block; overflow-x: auto;
}
.rec-body th {
	font-family: var(--f-title); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--yellow); text-align: left;
	border-bottom: 1px solid var(--yellow-dim);
}
.rec-body th, .rec-body td { padding: 6px 14px 6px 0; vertical-align: top; }
.rec-body td { border-bottom: 1px solid rgba(0, 240, 255, 0.1); }

/* Figures / inline images */
.fig {
	margin: 4px 0 16px; padding: 8px;
	max-width: 100%;
}
.fig.right { float: right; width: 300px; margin-left: 24px; clear: right; }
.fig.left { float: left; width: 300px; margin-right: 24px; clear: left; }
.fig.center { width: min(560px, 100%); margin-left: auto; margin-right: auto; clear: both; }
.fig.full { width: 100%; clear: both; }
.fig.small { width: 200px; }
.fig .fig-img {
	position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000;
	cursor: zoom-in; overflow: hidden;
}
.fig img { display: block; width: 100%; height: auto; transition: transform .3s, filter .3s; }
.fig .fig-img:hover img { transform: scale(1.03); filter: brightness(1.15) saturate(1.2); }
.fig .fig-img .ico {
	position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; padding: 4px;
	color: var(--cyan); background: rgba(0, 0, 0, 0.7); opacity: 0; transition: opacity .2s;
	-webkit-mask-origin: content-box; mask-origin: content-box;
}
.fig .fig-img:hover .ico { opacity: 1; }
.fig figcaption {
	margin-top: 7px; font-family: var(--f-mono); font-size: 12.5px; letter-spacing: 0.04em; line-height: 1.4;
	color: var(--text-soft);
}
.fig figcaption::before { content: "IMG// "; color: var(--yellow); }

/* Data block (infobox) */
.databox { float: right; clear: right; width: 310px; margin: 4px 0 18px 26px; padding: 0 0 6px; }
.databox-head {
	padding: 9px 14px 8px calc(var(--cut) + 10px);
	font-family: var(--f-title); font-weight: 700; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
	color: #000; background: var(--yellow);
}
.databox .fig { margin: 0; padding: 8px 10px 0; }
.databox .fig.right, .databox .fig.left { float: none; width: auto; margin: 0; }
.databox dl { margin: 6px 0 0; padding: 0 14px; }
.databox dt {
	font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow);
	margin-top: 8px;
}
.databox dd { margin: 0 0 4px; font-size: 16.5px; font-weight: 600; line-height: 1.3; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 234, 0, 0.12); }
.databox dd:last-child { border-bottom: 0; }

/* Note callout */
.callout {
	margin: 16px 0; padding: 12px 16px 12px 18px; clear: both;
	border: 1px solid var(--cyan-dim); border-left: 4px solid var(--cyan);
	background: var(--cyan-faint);
}
.callout-title { font-family: var(--f-title); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--cyan); margin-bottom: 4px; text-transform: uppercase; }
.callout p:last-child { margin-bottom: 0; }
.callout.warning { border-color: rgba(255, 56, 100, 0.4); border-left-color: var(--red); background: rgba(255, 56, 100, 0.07); }
.callout.warning .callout-title { color: var(--red); }

/* Cross-references (backlinks) and card grids */
.xref { clear: both; margin-top: 44px; }
.xref-title {
	font-family: var(--f-title); font-weight: 700; font-size: 13px; letter-spacing: 0.2em; color: var(--yellow);
	margin: 0 0 14px; text-shadow: var(--glow-yellow);
}
.cards {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.rcard {
	display: flex; flex-direction: column; gap: 6px;
	padding: 14px 16px 16px 18px;
	color: var(--text); text-decoration: none;
	transition: background .15s, transform .15s;
}
.rcard:hover { background: rgba(255, 234, 0, 0.09); transform: translateY(-2px); }
.rcard-cat { display: flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; color: var(--yellow); text-transform: uppercase; }
.rcard-cat .ico { width: 13px; height: 13px; }
.rcard-title { font-family: var(--f-title); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; color: #fff; text-transform: uppercase; line-height: 1.2; }
.rcard:hover .rcard-title { color: var(--cyan); text-shadow: var(--glow-cyan); }
.rcard-sum { font-size: 15px; color: var(--text-soft); line-height: 1.35; }
.rcard-sum mark, .result-snip mark { background: rgba(255, 43, 214, 0.25); color: #fff; padding: 0 2px; }

/* Record footer: permalink, sources, licensing */
.rec-foot {
	clear: both; margin-top: 48px; padding-top: 16px;
	border-top: 1px solid var(--cyan-dim);
	font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; letter-spacing: 0.03em; color: var(--muted);
}
.rec-foot-row { display: flex; gap: 14px; margin-bottom: 8px; }
.rec-foot-key { flex: none; width: 100px; color: var(--yellow); letter-spacing: 0.14em; }
.rec-foot a { color: var(--text-soft); text-decoration: none; border-bottom: 1px dotted var(--muted); overflow-wrap: anywhere; }
.rec-foot a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.rec-legal { margin: 14px 0 0; max-width: 860px; }

/* Search results */
.result-snip { font-family: var(--f-mono); font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Home page category tiles */
.home-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 10px 0 26px; clear: both; }
.home-cat {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 14px 14px 18px; text-decoration: none; color: var(--text);
	transition: background .15s;
}
.home-cat:hover { background: rgba(255, 234, 0, 0.1); }
.home-cat .ico { width: 28px; height: 28px; color: var(--cyan); filter: drop-shadow(0 0 4px var(--cyan)); }
.home-cat b { display: block; font-family: var(--f-title); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.home-cat small { font-family: var(--f-mono); font-size: 12px; color: var(--yellow); }

/* Error / boot screens */
.sys-msg { font-family: var(--f-mono); color: var(--text-soft); }
.sys-msg h1 { font-family: var(--f-title); color: var(--red); text-shadow: 0 0 12px var(--red); letter-spacing: 0.1em; }
.sys-msg code { color: var(--yellow); }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Status bar ---------- */
.statusbar {
	position: relative; z-index: 10;
	height: var(--status-h);
	display: flex; align-items: center; gap: 14px;
	padding: 0 18px;
	font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted);
	background: rgba(0, 10, 14, 0.9);
	border-top: 1px solid var(--cyan-dim);
	white-space: nowrap; overflow: hidden;
}
.status-spacer { flex: 1; }
#status-main { color: var(--cyan); }
.status-legal { color: var(--muted); text-decoration: none; }
.status-legal:hover { color: var(--cyan); }
#status-record { color: var(--yellow); }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: var(--glow-cyan); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Lightbox ---------- */
.lightbox {
	position: fixed; inset: 0; z-index: 100;
	display: flex; align-items: center; justify-content: center;
	padding: 50px 30px;
	background: rgba(0, 4, 8, 0.92);
	backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
	animation: fadein .2s ease-out;
}
.lightbox[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.lightbox-frame {
	margin: 0; max-width: 100%; max-height: 100%;
	display: flex; flex-direction: column; align-items: center;
	padding: 10px; border: 1px solid var(--yellow-dim);
	background: rgba(0, 0, 0, 0.6);
	box-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
	animation: materialize .35s ease-out;
}
.lightbox-frame img { min-width: min(640px, calc(100vw - 80px)); max-width: calc(100vw - 80px); max-height: calc(100vh - 150px); object-fit: contain; display: block; }
.lightbox-frame figcaption { margin-top: 10px; font-family: var(--f-mono); font-size: 14px; color: var(--text-soft); text-align: center; max-width: 900px; }
.lightbox-close { position: absolute; top: 14px; right: 14px; }

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--cyan-dim) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
	.status-legal { display: none; }
}
@media (max-width: 1180px) {
	:root { --index-w: 240px; }
	.navbtns .btn span { display: none; }
	.navbtns .btn { padding: 0; width: 36px; justify-content: center; }
}
@media (max-width: 900px) {
	:root { --rail-w: 0px; --topbar-h: 104px; }
	body { font-size: 17px; }
	.topbar {
		display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 36px 38px;
		align-content: center; padding: 0 16px; gap: 10px 8px;
	}
	.brand { min-width: 0; overflow: hidden; }
	#btn-menu { display: inline-flex; }
	.brand { gap: 8px; }
	.brand-mark { width: 28px; height: 28px; }
	.brand-title { font-size: 16px; letter-spacing: 0.16em; }
	.brand-sub { display: none; }
	.navbtns { margin-left: auto; gap: 4px; }
	.navbtns .btn { width: 34px; }
	.search { grid-column: 1 / -1; width: 100%; margin-left: 0; }
	.layout { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
	.rail {
		position: fixed; z-index: 20; top: var(--topbar-h); left: 0; bottom: var(--status-h);
		width: 88px; padding: 10px 6px; background: rgba(0, 8, 12, 0.96);
		border-right: 1px solid var(--cyan-dim);
		transform: translateX(-110%); transition: transform .25s;
	}
	.index {
		position: fixed; z-index: 20; top: var(--topbar-h); left: 88px; bottom: var(--status-h);
		width: min(300px, calc(100vw - 88px)); background: rgba(3, 14, 20, 0.97);
		transform: translateX(calc(-100% - 100px)); transition: transform .25s;
	}
	body.menu-open .rail, body.menu-open .index { transform: none; }
	.cat.active::after { display: none; }
	.article { padding: 22px 16px 40px; }
	.rec-foot-row { flex-direction: column; gap: 0; }
	.fig.right, .fig.left, .databox { float: none; width: 100%; margin: 4px 0 18px; }
	#status-clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.viewer-scroll { scroll-behavior: auto; }
}
