/* AI Security Corpus: BBS / teletext chrome on an indigo ground, one acid ANSI hero.
   Shared by the index, the 29 category pages and 404. */

:root {
  --bg: #0b0820;
  --panel: #140f33;
  --panel-2: #1a1442;
  --line: #2b2360;
  --line-2: #3a2f80;
  --text: #ece8ff;
  --dim: #a39cd4;
  --mute: #948dc4;
  --magenta: #ff2fb3;
  --cyan: #2ae8ff;
  --yellow: #e8ff3d;
  --lime: #9bff6a;
  --violet: #9d8cff;
  --c-foundations: #7c83ff;
  --c-attacks: #ff3b6b;
  --c-defense: #2ee38a;
  --c-agents: #00d4ff;
  --c-coding: #ffb020;
  --c-research: #c77dff;
  --c-practice: #ff7a45;
  --c-general: #9aa4b2;
  --gc: var(--cyan);
  --mono: "JetBrains Mono", "Noto Sans Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  --sans: "Barlow Semi Condensed", "Barlow fallback", "Roboto Condensed", system-ui, sans-serif;
  --topbar-h: 44px;
  --gutter: clamp(16px, 3vw, 40px);
  --pad: clamp(14px, 3vw, 48px);
  --spectrum: linear-gradient(90deg,
    var(--c-foundations), var(--c-attacks), var(--c-defense), var(--c-agents),
    var(--c-coding), var(--c-research), var(--c-practice), var(--c-general));
  --prism: linear-gradient(90deg, #ff3b6b, #ffb020, #2ee38a, #2ae8ff, #9d8cff, #ff2fb3);
  color-scheme: dark;
}

/* a system face squeezed to Barlow Semi Condensed's width, so link rows keep their line breaks when the webfont lands */
@font-face {
  font-family: "Barlow fallback";
  src: local("Arial"), local("Liberation Sans"), local("DejaVu Sans"), local("Helvetica");
  size-adjust: 86%;
  ascent-override: 98%;
  descent-override: 24%;
  line-gap-override: 0%;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.4;
  padding-inline: var(--gutter);
  padding-block: 0 48px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--yellow); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
::selection { background: var(--magenta); color: #fff; }
kbd { font-family: var(--mono); }

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--yellow);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px 12px;
}
.skip:focus { top: 8px; color: var(--bg); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.short { display: none; }

/* The whole page sits in one terminal frame: a double rule, like ╔══╗. */
.frame {
  max-width: 1180px;
  margin: 0 auto;
  border: 3px double var(--line-2);
  border-top: 0;
  background: var(--panel);
  position: relative;
}
.frame::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--spectrum);
}

/* ---------- Top bar (BBS status line) ---------- */
.topbar {
  font-family: var(--mono);
  font-size: 13px;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px 16px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  background: var(--panel);
}
.topbar .node { flex: none; }
.topbar .path { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* inline links in the chrome get a 24px tall hit box without moving the baseline */
.topbar .path a, .cat-hero .meta a, .foot a, .cat-hero .group a { display: inline-block; padding-block: 4px; }
.topbar .find { color: var(--cyan); white-space: nowrap; }
.topbar .find kbd { color: var(--dim); border: 1px solid var(--line-2); padding: 0 4px; font-size: 11px; }
.topbar .find:hover { color: var(--yellow); }
.topbar .search-slot { flex: 1 1 200px; min-width: 0; }
/* below 1100 the repo name and 'node' go so the breadcrumb, the prompt and the buttons share one row */
@media (max-width: 1100px) {
  .topbar .node { display: none; }
  .topbar.sticky .full { display: none; }
  .topbar.sticky .short { display: inline; }
}
.topbar.sticky { position: sticky; top: 0; z-index: 30; }
.topbar .node { color: var(--cyan); }
.topbar .path { color: var(--text); }
.topbar .path a:hover { color: var(--yellow); }
.topbar .sep { color: var(--mute); }
.topbar .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.topbar .star, .btn {
  color: var(--yellow);
  border: 1px solid var(--yellow);
  padding: 2px 8px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
}
.topbar .star:hover, .btn:hover { background: var(--yellow); color: var(--bg); }
.topbar .search { flex: 1 1 260px; max-width: 420px; }
.topbar .prompt { margin: 0; font-size: 13px; padding: 4px 10px; }
.topbar .prompt .caret { height: 14px; }
.topbar .results { right: auto; width: min(680px, calc(100vw - 2 * var(--gutter) - 32px)); }

/* sysop box: the status column at the right of the hero, wide screens only */
.sysop {
  display: none;
  position: absolute;
  right: clamp(14px, 3vw, 48px);
  bottom: clamp(24px, 4vw, 44px);
  z-index: 1;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  border: 1px solid var(--line-2);
  background: rgba(11,8,32,.72);
  padding: 10px 14px 12px;
  min-width: 250px;
}
.sysop .sysop-h { margin: 8px 0 4px; color: var(--cyan); }
.sysop .sysop-h:first-child { margin-top: 0; }
.sysop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 0; }
.sysop dt { font-weight: 400; }
.sysop dd { margin: 0; text-align: right; color: var(--text); }
.sysop kbd { color: var(--yellow); border: 1px solid var(--line-2); padding: 0 4px; }
@media (min-width: 980px) { .sysop { display: block; } }
/* between 980 and 1100 the box shares the hero with the tagline and prompt, so keep those clear of it */
@media (min-width: 980px) and (max-width: 1099px) {
  .tagline, .hero .search { max-width: calc(100% - 300px); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(28px, 5vw, 64px) var(--pad) clamp(24px, 4vw, 44px);
  border-bottom: 3px double var(--line-2);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* kaleidoscope: two static conic prisms, mirrored, that breathe on opacity only */
  content: "";
  position: absolute;
  inset: -24% -12%;
  z-index: -2;
  background:
    repeating-conic-gradient(from 12deg at 64% 42%,
      var(--magenta) 0 4deg, transparent 4deg 10deg,
      var(--cyan) 10deg 13deg, transparent 13deg 22deg,
      var(--yellow) 22deg 24deg, transparent 24deg 36deg),
    repeating-conic-gradient(from 200deg at 64% 42%,
      var(--lime) 0 2deg, transparent 2deg 15deg,
      var(--violet) 15deg 18deg, transparent 18deg 30deg);
  opacity: .16;
  mask-image: radial-gradient(ellipse at 64% 42%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(ellipse at 64% 42%, #000 0%, transparent 62%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .13; } 50% { opacity: .22; } }
.hero.paused::before, .hero.paused .logo-ghost { animation-play-state: paused; }
.hero::after {
  /* flower-of-life lattice under scanlines: sacred geometry as a hairline, not a filter */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='110.85'%3E%3Cg fill='none' stroke='%23c9c2ff' stroke-opacity='.11' stroke-width='.8'%3E%3Ccircle cx='0' cy='0' r='64'/%3E%3Ccircle cx='64' cy='0' r='64'/%3E%3Ccircle cx='32' cy='55.43' r='64'/%3E%3Ccircle cx='-32' cy='55.43' r='64'/%3E%3Ccircle cx='96' cy='55.43' r='64'/%3E%3Ccircle cx='0' cy='110.85' r='64'/%3E%3Ccircle cx='64' cy='110.85' r='64'/%3E%3Ccircle cx='32' cy='-55.43' r='64'/%3E%3Ccircle cx='-32' cy='-55.43' r='64'/%3E%3Ccircle cx='96' cy='-55.43' r='64'/%3E%3Ccircle cx='32' cy='166.28' r='64'/%3E%3C/g%3E%3C/svg%3E") 64% 42% / 64px 110.85px;
  mask-image: radial-gradient(ellipse at 64% 42%, #000 20%, rgba(0,0,0,.35) 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at 64% 42%, #000 20%, rgba(0,0,0,.35) 70%, transparent 100%);
  pointer-events: none;
}

.logo-wrap { position: relative; display: inline-block; max-width: 100%; margin: 0; font-size: 1rem; font-weight: 400; }
.logo, .logo-ghost {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(8.6px, 2.35vw, 27px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: pre;
}
.logo { color: var(--text); position: relative; z-index: 2; text-shadow: 0 0 18px rgba(42,232,255,.28); }
.logo .r0 { color: var(--yellow); }
.logo .r1 { color: var(--lime); }
.logo .r2 { color: var(--cyan); }
.logo .r3 { color: var(--violet); }
.logo .r4 { color: var(--magenta); }
.logo .sh { color: var(--line-2); }
/* misconverged guns: two ghost copies nudged apart, drifting on transform only */
.logo-ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .55;
  will-change: transform;
}
.logo-ghost.m { color: var(--magenta); transform: translate(-.12em, 0); animation: driftm 7s ease-in-out infinite; }
.logo-ghost.c { color: var(--cyan); transform: translate(.12em, 0); animation: driftc 9s ease-in-out infinite; }
@keyframes driftm { 0%, 100% { transform: translate(-.12em, 0); } 50% { transform: translate(-.04em, .04em); } }
@keyframes driftc { 0%, 100% { transform: translate(.12em, 0); } 50% { transform: translate(.06em, -.04em); } }

/* one page-load moment: rows dial in top to bottom like a 2400 baud download */
.logo .row { display: inline-block; animation: dialin .35s steps(3) both; }
.logo .row:nth-child(1) { animation-delay: .05s }
.logo .row:nth-child(2) { animation-delay: .12s }
.logo .row:nth-child(3) { animation-delay: .19s }
.logo .row:nth-child(4) { animation-delay: .26s }
.logo .row:nth-child(5) { animation-delay: .33s }
.logo .row:nth-child(6) { animation-delay: .40s }
.logo .row:nth-child(7) { animation-delay: .47s }
.logo .row:nth-child(8) { animation-delay: .54s }
.logo .row:nth-child(9) { animation-delay: .61s }
.logo .row:nth-child(10) { animation-delay: .68s }
.logo .row:nth-child(11) { animation-delay: .75s }
.logo .row:nth-child(12) { animation-delay: .82s }
.logo .row:nth-child(13) { animation-delay: .89s }
@keyframes dialin { from { opacity: 0; } to { opacity: 1; } }

.tagline {
  font-family: var(--mono);
  font-size: clamp(13px, 1.4vw, 16px);
  color: var(--dim);
  margin: 26px 0 0;
  max-width: 62ch;
  line-height: 1.6;
}
.tagline b { color: var(--text); font-weight: 400; }
.tagline .y { color: var(--yellow); }
.tagline .c { color: var(--cyan); }
.tagline .m { color: var(--magenta); }

/* ---------- Search prompt and results ---------- */
.search { position: relative; }
.hero .search { margin-top: 24px; max-width: 640px; }
.hero .results { position: static; margin-top: 8px; box-shadow: none; }
.prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  border: 1px solid var(--line-2);
  background: rgba(11,8,32,.7);
  padding: 8px 12px;
}
.prompt .ps1 { color: var(--magenta); flex: none; }
.prompt input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  padding: 4px 0;
}
.prompt input::placeholder { color: var(--mute); }
.prompt input::-webkit-search-cancel-button { -webkit-appearance: none; }
.prompt .key {
  flex: none;
  color: var(--dim);
  border: 1px solid var(--line-2);
  padding: 0 6px;
  font-size: 12px;
}
.prompt .caret { width: 9px; height: 17px; background: var(--cyan); flex: none; animation: blink 1.1s steps(2) infinite; }
.prompt:focus-within .caret, .prompt.live .caret { display: none; }
html.hid .caret { animation-play-state: paused; }
@keyframes blink { to { opacity: 0; } }
.nojs {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  margin: 8px 0 0;
}

.results {
  font-family: var(--sans);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 4px;
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  font-size: 15px;
}
/* the list scrolls inside the panel and fades at its bottom edge; the footer row stays put below it */
.results .rl { overflow: auto; min-height: 0; }
.results.over .rl {
  mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
}
.results .rf {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  padding: 6px 12px;
  border-top: 1px dotted var(--line);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.results .rf .n { color: var(--dim); }
.results .rf .sc { display: none; margin-left: auto; color: var(--cyan); }
.results.over .rf .sc { display: inline; }
.results .rs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  padding: 8px 12px;
  border-bottom: 1px dotted var(--line);
}
.results .rs .n { color: var(--yellow); }
.results .rh {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 8px 12px 2px;
  color: var(--gc);
}
.results .rh a { color: var(--gc); }
.results .rh .g { color: var(--mute); font-weight: 400; }
.results ul { list-style: none; margin: 0 0 4px; padding: 0; }
.results li a {
  display: block;
  padding: 4px 12px 4px 26px;
  position: relative;
  line-height: 1.3;
}
.results li a::before { content: "▸"; position: absolute; left: 12px; color: var(--gc); font-family: var(--mono); font-size: 11px; opacity: .8; }
.results li a:focus, .results li a.on { background: var(--panel-2); color: var(--yellow); outline: 0; }
.results li a i { font-style: normal; font-family: var(--mono); font-size: 12.5px; color: var(--mute); margin-left: 8px; white-space: nowrap; }
.results mark { background: transparent; color: var(--yellow); }
.results .more { font-family: var(--mono); font-size: 12px; color: var(--mute); padding: 6px 12px 10px; }

/* ---------- Stats readout ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 3px double var(--line-2);
  font-family: var(--mono);
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats li { padding: 14px 16px; border-right: 1px solid var(--line); }
.stats li:last-child { border-right: 0; }
.stats .n { display: block; font-size: clamp(20px, 2.4vw, 30px); font-weight: 700; line-height: 1.1; }
.stats .l { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; }
.stats .a .n { color: var(--yellow); }
.stats .b .n { color: var(--cyan); }
.stats .c .n { color: var(--magenta); }

/* ---------- Section headings drawn like ╔═ title ═══ ---------- */
.sec { padding: 28px var(--pad) 8px; }
.sec-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 21px);
  margin: 0 0 16px;
  color: var(--text);
}
.sec-h .t { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .sec-h .t { white-space: nowrap; } }
.sec-h .glyph { color: var(--line-2); font-weight: 400; margin-right: 12px; }
.sec-h .rule { flex: 1 1 24px; border-top: 3px double var(--line-2); align-self: center; min-width: 24px; }
.sec-h .count { font-weight: 400; color: var(--dim); font-size: 14px; white-space: nowrap; margin-left: 10px; }
/* narrow: a long title wraps and the double rule becomes a full-width underline instead of a stub */
@media (max-width: 639px) {
  .sec-h { flex-wrap: wrap; gap: 8px 12px; }
  .sec-h .rule { flex-basis: 100%; order: 9; margin-top: -2px; }
}

/* ---------- BBS main menu ---------- */
.menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.entry { min-width: 0; padding: 16px 0 18px; border-top: 1px dashed var(--line); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.entry-head { display: flex; align-items: baseline; gap: 12px; font-family: var(--mono); font-size: 18px; font-weight: 700; margin: 0; }
.entry-head .key { color: var(--bg); background: var(--gc); padding: 0 6px; font-weight: 700; }
.entry-head .name { color: var(--gc); }
.entry-head .links { margin-left: auto; font-weight: 400; color: var(--dim); font-size: 14px; }
.bar {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  margin: 8px 0 12px;
  white-space: pre;
  letter-spacing: 0;
  color: var(--gc);
}
/* the unfilled track is a tint of the group colour, so the 100% reference stays visible */
.bar .rest { color: var(--line-2); color: color-mix(in srgb, var(--gc) 28%, var(--panel)); }
.cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.cats li a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
}
.cats li a:hover { border-color: var(--gc); color: var(--gc); }
.cats .n { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- Recently added ---------- */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dotted var(--line);
  align-items: baseline;
}
.recent li:first-child { border-top: 0; }
.recent .date { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.recent a { font-weight: 500; }

/* ---------- Charts ---------- */
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.charts figure { margin: 0; min-width: 0; border: 1px solid var(--line); background: var(--bg); padding: 8px; }
.charts figure.wide { grid-column: 1 / -1; }
.charts svg { display: block; width: 100%; height: auto; }
.charts .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.charts figcaption { font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 6px 4px 2px; }
/* the category chart as HTML bars: shown in place of the 900px SVG on narrow screens */
.barlist { display: none; font-family: var(--mono); font-size: 12.5px; padding: 4px 2px 2px; }
.barlist .bl-g { padding: 8px 0 4px; }
.barlist .bl-h { margin: 0 0 4px; color: var(--gc); font-weight: 700; font-size: 13px; }
.barlist .bl-h span { color: var(--dim); font-weight: 400; margin-left: 8px; }
.barlist .bl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 10px;
  padding: 3px 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
}
.barlist .bl-row:hover .bl-n { color: var(--yellow); }
.barlist .bl-n { min-width: 0; overflow-wrap: anywhere; }
.barlist .bl-v { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.barlist .bl-b { grid-column: 1 / -1; height: 8px; background: color-mix(in srgb, var(--gc) 16%, var(--panel)); }
.barlist .bl-b span { display: block; height: 100%; background: var(--gc); min-width: 2px; }
@media (max-width: 640px) {
  .charts figure { position: relative; }
  .charts figure.wide .scroll { display: none; }
  .barlist { display: block; }
  /* the growth chart keeps a readable size and scrolls sideways: fade the edge and say so */
  .charts figure:first-child .scroll svg { min-width: 560px; }
  .charts figure:first-child .scroll {
    mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
    scroll-snap-type: x proximity;
  }
  .charts figure:first-child figcaption::after { content: " Scrolls sideways ▸"; color: var(--mute); }
}

/* ---------- About ---------- */
.about { max-width: 70ch; color: var(--dim); font-size: 17px; }
.about p { margin: 0 0 12px; }
.about a { color: var(--cyan); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.about a:hover { color: var(--yellow); text-decoration-color: currentColor; }
.about code { font-family: var(--mono); font-size: 14px; color: var(--text); }

/* ---------- Footer ---------- */
.foot {
  margin-top: 32px;
  padding: 18px var(--pad) 22px;
  border-top: 3px double var(--line-2);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
}
.foot a { color: var(--cyan); }
/* the closing ░▒▓ only fits on the one-row footer of the full-width frame */
@media (max-width: 1259px) { .foot .blocks:last-child { display: none; } }
.foot a:hover { color: var(--yellow); }
.foot .blocks { color: var(--line-2); letter-spacing: 0; }
.foot .end { margin-left: auto; }
.foot .hk {
  font: inherit;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line-2);
  padding: 1px 6px;
  cursor: pointer;
}
.foot .hk:hover { color: var(--yellow); border-color: var(--yellow); }
.foot .hk[aria-pressed="true"] { color: var(--cyan); }
.sysop kbd.off { color: var(--mute); text-decoration: line-through; }

/* ---------- Category page ---------- */
.cat-hero {
  padding: clamp(24px, 4vw, 48px) var(--pad) 20px;
  border-bottom: 3px double var(--line-2);
  border-left: 6px solid var(--gc);
  position: relative;
  overflow: hidden;
}
.cat-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.cat-hero .group { font-family: var(--mono); font-size: 13px; color: var(--gc); margin: 0 0 8px; }
.cat-hero .group a { color: var(--gc); }
.cat-hero .group a:hover { color: var(--yellow); }
.cat-hero h1 {
  font-family: var(--mono);
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
  margin: 0;
  font-weight: 700;
  text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan);
  overflow-wrap: anywhere;
}
.cat-hero .desc { font-size: 19px; margin: 10px 0 0; color: var(--dim); max-width: 60ch; }
.cat-hero .meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
  position: relative;
  z-index: 1;
}
.cat-hero .meta b { color: var(--text); font-weight: 400; }
.cat-hero .meta a { color: var(--cyan); }
.cat-hero .meta a:hover { color: var(--yellow); }
.cat-hero .desc, .cat-hero h1, .cat-hero .group { position: relative; z-index: 1; }
.cat-side {
  display: none;
  position: absolute;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  border: 1px solid var(--line-2);
  background: rgba(11,8,32,.72);
  padding: 10px 14px 12px;
  min-width: 250px;
  max-width: 320px;
}
.cat-side .sysop-h { margin: 8px 0 4px; color: var(--gc); }
.cat-side .sysop-h:first-child { margin-top: 0; }
.cat-side dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 0; }
.cat-side dt { font-weight: 400; white-space: nowrap; }
.cat-side dd { margin: 0; text-align: right; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-side dd a { color: var(--text); }
.cat-side dd a:hover { color: var(--yellow); }
@media (min-width: 1100px) {
  .cat-side { display: block; }
  .cat-hero .desc, .cat-hero h1, .cat-hero .meta { max-width: calc(100% - 360px); }
}

.cat-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.rail {
  border-right: 1px solid var(--line);
  padding: 20px 0 20px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  align-self: start;
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow: auto;
}
.rail .rail-h { color: var(--mute); margin: 0 0 8px; font-size: 12px; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--dim);
  padding: 4px 10px 4px 8px;
  border-left: 2px solid transparent;
  line-height: 1.3;
}
.rail a .t { flex: 1; min-width: 0; }
.rail a .n { color: var(--mute); }
.rail a:hover { color: var(--text); }
.rail a.on { color: var(--gc); border-left-color: var(--gc); background: var(--panel-2); }
.rail a.on .n { color: var(--dim); }

.cat-main { min-width: 0; }
.cat-main .sec { padding-top: 24px; }
/* off-screen sections skip layout: General reading alone has 1,800 rows */
.section { scroll-margin-top: 56px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.section .sec-h .count { color: var(--gc); }

.links { list-style: none; margin: 0; padding: 0; }
.links li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  border-top: 1px dotted var(--line);
  align-items: baseline;
}
.links li::before { content: "▸"; color: var(--gc); font-family: var(--mono); font-size: 11px; opacity: .8; }
.links a {
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  background: var(--prism) no-repeat 0 100% / 0 1px;
}
.links a:hover, .links a:focus-visible { color: var(--text); background-size: 100% 1px; }
.links a i { font-style: normal; font-family: var(--mono); font-size: 12.5px; color: var(--mute); margin-left: 8px; white-space: nowrap; }
.links a:hover i { color: var(--dim); }

.pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px var(--pad) 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 13px;
}
.pn a { display: block; color: var(--dim); }
.pn a b { display: block; font-family: var(--sans); font-size: 18px; font-weight: 500; color: var(--text); margin-top: 2px; }
.pn a:hover b { color: var(--yellow); }
.pn .next { text-align: right; }

/* ---------- 404 ---------- */
.lost { padding: clamp(40px, 8vw, 96px) var(--pad); font-family: var(--mono); }
.lost h1 { font-size: clamp(28px, 5vw, 56px); margin: 0 0 12px; text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan); }
.lost p { color: var(--dim); max-width: 60ch; }
.lost a { color: var(--cyan); }
.lost a:hover { color: var(--yellow); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cat-body { grid-template-columns: 1fr; }
  /* the rail becomes a chip row pinned under the status line; the list inside it scrolls sideways */
  .rail {
    position: sticky;
    top: var(--topbar-h);
    z-index: 20;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    padding: 8px var(--pad);
    display: flex;
    gap: 10px;
    align-items: baseline;
    overflow: hidden;
    white-space: nowrap;
  }
  .rail .rail-h { margin: 0; flex: none; }
  .rail ol {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    /* fades at the right edge so it reads as scrollable */
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  }
  .rail ol::-webkit-scrollbar { display: none; }
  .rail li { scroll-snap-align: start; }
  .rail ol::after { content: ""; flex: none; width: 28px; }
  .rail a { border: 1px solid var(--line); border-left-width: 1px; padding: 5px 10px; }
  .rail a.on { border-color: var(--gc); }
  .section { scroll-margin-top: calc(var(--topbar-h) + 54px); }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats li { border-bottom: 1px solid var(--line); }
  .stats li:nth-child(3n) { border-right: 0; }
  .stats li:nth-child(n+4) { border-bottom: 0; }
  .menu { grid-template-columns: 1fr; gap: 0; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero::before { inset: 0; }
  .hero::after { background: none; }
  .cat-hero::after { display: none; }
  /* the dropdown uses the screen below the status line, so its cut edge is the viewport edge */
  .topbar .results { max-height: calc(100dvh - var(--topbar-h) - 8px); }
  .topbar .find kbd { display: none; }
  /* one-row status line: ~ / cat | search | star; the group crumb goes, the page name stays */
  .topbar { gap: 10px; padding: 8px 12px; }
  .topbar.sticky .path { max-width: 46%; }
  .topbar.sticky .grp, .topbar.sticky .grp + .sep { display: none; }
  .topbar .search-slot { flex: 1 1 120px; min-width: 0; }
  .topbar .search { position: static; max-width: none; }
  .topbar .results { left: 0; right: 0; width: auto; }
  .topbar .right { margin-left: auto; flex: none; }
  .topbar .right .count { display: none; }
  .topbar .star { padding: 2px 6px; }
  #menu-h .count { display: none; }
  .links li { padding: 7px 0; }
  .foot { gap: 6px 18px; }
  .foot .blocks { display: none; }
  .foot .end { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding-inline: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(3n) { border-right: 1px solid var(--line); }
  .stats li:nth-child(2n) { border-right: 0; }
  .stats li:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .stats li:nth-child(n+5) { border-bottom: 0; }
  .prompt .key { display: none; }
  .cats li a { font-size: 15.5px; padding: 4px 8px; }
  .links a { font-size: 16px; }
  .links a i { display: block; margin-left: 0; margin-top: 1px; font-size: 13px; }
  .logo-ghost { mix-blend-mode: normal; opacity: .35; }
  .recent li { grid-template-columns: 1fr; gap: 2px; }
  .entry-head { flex-wrap: wrap; }
  .pn { grid-template-columns: 1fr; }
  .pn .next { text-align: left; }
  .results li a i { display: block; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-ghost, .logo .row, .prompt .caret, .hero::before { animation: none !important; }
  .logo .row { opacity: 1; }
}
