/* =================================================================
   AV-Phys Bench project site
   Visual language forked from renovamen.github.io into vanilla CSS.
   Reserved blue accent (--primary) is used ONLY on text links inside
   prose contexts. Everything else is monochrome.
   ================================================================= */

@font-face {
  font-family: "Computer Modern Sans";
  font-style: normal;
  font-weight: normal;
  src: url("./fonts/cmu-sans/regular.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "Computer Modern Sans";
  font-style: normal;
  font-weight: bold;
  src: url("./fonts/cmu-sans/bold.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "Computer Modern Sans";
  font-style: italic;
  font-weight: normal;
  src: url("./fonts/cmu-sans/italic.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "Computer Modern Sans";
  font-style: italic;
  font-weight: bold;
  src: url("./fonts/cmu-sans/bolditalic.woff") format("woff");
  font-display: swap;
}

:root {
  --fg: 0 0% 20%;
  --fg-light: 0 0% 35%;
  --fg-dark: 0 0% 0%;
  --bg: 0 0% 100%;
  --bg-dark: 0 0% 92%;
  --bg-elevated: 0 0% 97%;
  --border: 0 0% 85%;
  --border-strong: 0 0% 70%;
  --primary: 210 80% 45%;
  --danger: 0 70% 50%;
  --success: 142 50% 38%;

  --font-sans: "Computer Modern Sans", system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    monospace;

  --content-narrow: 90ch;
  --content-wide: 1180px;
}

html.dark {
  --fg: 0 0% 85%;
  --fg-light: 0 0% 70%;
  --fg-dark: 0 0% 100%;
  --bg: 0 0% 17%;
  --bg-dark: 0 0% 25%;
  --bg-elevated: 0 0% 22%;
  --border: 0 0% 32%;
  --border-strong: 0 0% 48%;
  --primary: 210 70% 63%;
  --danger: 0 70% 60%;
  --success: 142 50% 50%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s ease, color 0.2s ease;
}

::selection {
  background: hsl(var(--primary) / 0.25);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ===================== NAVBAR (terminal-prompt logo) ===================== */
header.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 1.25rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: hsl(var(--bg));
  font-family: var(--font-ui);
}

header.nav.is-fixed {
  position: fixed;
  top: -56px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid hsl(var(--border));
}

header.nav.is-visible {
  transform: translateY(56px);
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.08);
}

html.dark header.nav.is-visible {
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4);
}

header.nav .logo {
  font-weight: 700;
  color: hsl(var(--fg-light));
  display: inline-flex;
  align-items: center;
  font-size: 1.125rem;
  transition: color 0.2s ease;
}

header.nav .logo:hover {
  color: hsl(var(--fg-dark));
}

header.nav .logo .prompt {
  font-size: 0.78em;
  vertical-align: -0.05em;
  display: inline-flex;
  width: 0.78em;
  height: 0.78em;
  margin: 0 1px;
}

header.nav .logo .blink {
  animation: blinker 1s infinite;
}

@keyframes blinker {
  50% { opacity: 0; }
}

header.nav nav.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-item {
  color: hsl(var(--fg-light));
  text-underline-offset: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s ease;
  font-size: 0.95rem;
}

.nav-item:hover {
  color: hsl(var(--fg-dark));
}

.nav-item.nav-active {
  color: hsl(var(--fg-dark));
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--fg-light));
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

.theme-toggle:hover {
  color: hsl(var(--fg-dark));
}

.theme-toggle .icon {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: transform 0.5s ease, opacity 0.3s ease;
  transform: scale(0) rotate(-90deg);
  opacity: 0;
}

html.theme-auto .theme-toggle .icon-auto,
html.theme-light .theme-toggle .icon-light,
html.theme-dark .theme-toggle .icon-dark {
  transform: scale(1) rotate(0);
  opacity: 1;
}

/* ===================== MAIN LAYOUT ===================== */
main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 6rem 1.25rem 1.5rem;
}

.content {
  width: 100%;
  margin-inline: auto;
  flex: 1;
}

.content.narrow {
  max-width: var(--content-narrow);
}

.content.wide {
  max-width: var(--content-wide);
}

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3, h4, h5 {
  color: hsl(var(--fg-dark));
  margin-bottom: 0.5em;
}

h1 { font-weight: 800; font-size: 2.25em; margin: 0 0 0.7em; line-height: 1.15; }
h2 { font-weight: 700; font-size: 1.5em; margin: 2em 0 0.85em; line-height: 1.333; }
h3 { font-weight: 600; font-size: 1.18em; margin: 1.5em 0 0.5em; }
h4 { font-weight: 600; font-size: 1.04em; margin: 1.2em 0 0.4em; }

.h2-aux {
  font-size: 0.6em;
  color: hsl(var(--fg-light));
  font-weight: 400;
  margin-left: 0.4em;
}

p { margin: 1em 0; line-height: 1.55; }

.content a {
  color: hsl(var(--primary));
  text-decoration: none;
  text-underline-offset: 4px;
  font-weight: normal;
}

.content a:hover { text-decoration: underline; }

.muted { color: hsl(var(--fg-light)); }

strong { color: hsl(var(--fg-dark)); font-weight: 700; }
em { font-style: italic; }

/* ===================== HERO ===================== */
.hero { margin-top: 0; }

.hero .paper-title {
  font-size: 2em;
  font-weight: 800;
  color: hsl(var(--fg-dark));
  line-height: 1.18;
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}

@media (min-width: 768px) {
  .hero .paper-title { font-size: 2.4em; }
}

.hero .authors {
  margin: 0 0 0.45em;
  color: hsl(var(--fg));
  font-size: 0.97em;
  line-height: 1.55;
}

.hero .authors sup {
  font-size: 0.72em;
  color: hsl(var(--fg-light));
}

.hero .affil {
  margin: 0 0 0.25em;
  color: hsl(var(--fg-light));
  font-size: 0.92em;
}

.hero .affil-note {
  margin: 0 0 1.25em;
  color: hsl(var(--fg-light));
  font-size: 0.88em;
}

.hero .affil sup,
.hero .affil-note sup,
.hero .authors sup {
  font-size: 0.72em;
  color: hsl(var(--fg-light));
}

.hero .authors a {
  color: hsl(var(--fg));
  text-decoration: underline;
  text-decoration-color: hsl(var(--border-strong));
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: normal;
}

.hero .authors a:hover {
  color: hsl(var(--fg-dark));
  text-decoration-color: hsl(var(--fg-dark));
}

.hero .lede {
  margin: 0.5em 0 1.25em;
  color: hsl(var(--fg));
  font-size: 1em;
  line-height: 1.6;
}

/* ===================== Teaser (qualitative comparison) ===================== */
.teaser {
  margin: 2rem 0 2.5rem;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .teaser-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
  .teaser-grid { grid-template-columns: 1fr; }
}

.teaser-card {
  margin: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--bg));
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.teaser-card:hover {
  border-color: hsl(var(--border-strong));
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.06);
}

html.dark .teaser-card:hover {
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.35);
}

.teaser-media {
  aspect-ratio: 16 / 9;
  background: #000;
}

.teaser-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.teaser-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--fg-dark));
  border-top: 1px solid hsl(var(--border));
}

.teaser-mark {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.teaser-mark.pass {
  color: hsl(var(--success));
  background: hsl(var(--success) / 0.12);
  border: 1px solid hsl(var(--success) / 0.35);
}

.teaser-mark.fail {
  color: hsl(var(--danger));
  background: hsl(var(--danger) / 0.12);
  border: 1px solid hsl(var(--danger) / 0.35);
}

.teaser-prompt {
  margin: 1rem 0 0;
  color: hsl(var(--fg-light));
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
}

.teaser-prompt .quot {
  font-style: normal;
  color: hsl(var(--fg-light));
  margin: 0 0.05em;
}

.teaser-link {
  display: inline-block;
  margin-left: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-style: normal;
  color: hsl(var(--fg-light)) !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.teaser-link:hover {
  color: hsl(var(--fg-dark)) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.hero .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.25rem;
}

.btn,
.content a.btn,
.content .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 4px;
  background: hsl(var(--bg-dark));
  color: hsl(var(--fg));
  font-size: 0.88rem;
  font-family: var(--font-ui);
  transition: background 0.15s ease, color 0.15s ease;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.btn .icon { width: 15px; height: 15px; color: hsl(var(--fg)); }

.btn:hover,
.content a.btn:hover {
  background: hsl(0 0% 45%);
  color: #fff;
  text-decoration: none;
}

.btn:hover .icon { color: #fff; }


/* ===================== LEADERBOARD ===================== */
.lb-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin: 0.5em 0 1.25em;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.lb-controls .group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lb-controls .group-label {
  color: hsl(var(--fg-light));
  font-size: 0.85em;
}

.seg {
  display: inline-flex;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  overflow: hidden;
  background: hsl(var(--bg));
}

.seg button {
  padding: 0.32rem 0.7rem;
  font-size: 0.85em;
  background: none;
  border: 0;
  cursor: pointer;
  color: hsl(var(--fg-light));
  transition: background 0.15s ease, color 0.15s ease;
  font-family: var(--font-ui);
}

.seg button + button {
  border-left: 1px solid hsl(var(--border));
}

.seg button:hover {
  color: hsl(var(--fg-dark));
}

.seg button.on {
  background: hsl(var(--bg-dark));
  color: hsl(var(--fg-dark));
  font-weight: 600;
}

.lb-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--bg));
  margin: 0.5em 0;
}

table.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}

table.leaderboard thead {
  background: hsl(var(--bg-elevated));
}

table.leaderboard th {
  text-align: left;
  font-weight: 600;
  color: hsl(var(--fg-dark));
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
  font-size: 0.85em;
  letter-spacing: 0.01em;
}

table.leaderboard th.num,
table.leaderboard td.num {
  text-align: right;
}

table.leaderboard td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}

table.leaderboard tbody tr:last-child td {
  border-bottom: 0;
}

table.leaderboard tbody tr:hover {
  background: hsl(var(--bg-elevated));
}

table.leaderboard tbody tr.best {
  background: hsl(var(--bg-dark) / 0.55);
}

table.leaderboard tbody tr.best:hover {
  background: hsl(var(--bg-dark));
}

table.leaderboard td.rank {
  color: hsl(var(--fg-light));
  font-variant-numeric: tabular-nums;
  width: 2.5rem;
}

table.leaderboard td.model {
  font-weight: 600;
  color: hsl(var(--fg-dark));
}

table.leaderboard td.model .meta {
  color: hsl(var(--fg-light));
  font-weight: 400;
  font-size: 0.85em;
  display: block;
  margin-top: 0.15em;
}

table.leaderboard td.headline {
  font-weight: 700;
  color: hsl(var(--fg-dark));
}

/* Score bar — a subtle grey track under each "Both" score. No color tint. */
.score-cell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 4.5rem;
}

.score-bar {
  height: 3px;
  width: 100%;
  background: hsl(var(--border));
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.score-bar > i {
  display: block;
  height: 100%;
  background: hsl(var(--fg-dark));
  border-radius: 2px;
}

.lb-note {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: hsl(var(--fg-light));
  margin: 0.4em 0 0;
}

/* ===================== TERMINAL CODE BLOCK ===================== */
.code-block {
  position: relative;
  background: hsl(var(--bg-elevated));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 2.25rem 1.1rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  color: hsl(var(--fg));
}

.code-block code {
  display: block;
  white-space: pre;
  font-family: inherit;
  color: inherit;
}

.code-block code .cm {
  color: hsl(var(--fg-light));
  font-style: italic;
}

.code-block::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fd5f57;
  box-shadow: 16px 0 0 0 #febb2f, 32px 0 0 0 #2ec841;
}

.code-block .lang {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.75rem;
  color: hsl(var(--fg-light));
  font-family: var(--font-ui);
}

.code-block .copy-btn {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.72rem;
  font-family: var(--font-ui);
  color: hsl(var(--fg-light));
  background: hsl(var(--bg));
  border: 1px solid hsl(var(--border));
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}

.code-block .copy-btn:hover {
  color: hsl(var(--fg-dark));
}

/* ===================== VIDEO GALLERY (videos/index.html) ===================== */
.gallery {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.category-picker {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0.5rem 0;
}

@media (max-width: 768px) {
  .category-picker {
    position: static;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
}

.cat-btn {
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 400;
  color: hsl(var(--fg-light));
  line-height: 1.18;
  letter-spacing: -0.005em;
  transition: color 0.25s ease, transform 0.25s ease, font-weight 0.25s ease;
  position: relative;
}

@media (max-width: 768px) {
  .cat-btn {
    font-size: 1.1rem;
    white-space: nowrap;
    padding: 0.4rem 0.7rem;
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
  }
}

.cat-btn:hover {
  color: hsl(var(--fg));
}

.cat-btn.on {
  color: hsl(var(--fg-dark));
  font-weight: 600;
}

.cat-btn .count {
  display: block;
  font-size: 0.7rem;
  color: hsl(var(--fg-light));
  font-weight: 400;
  margin-top: 0.18em;
  font-family: var(--font-ui);
}

@media (max-width: 768px) {
  .cat-btn .count { display: none; }
}

.cat-btn.on .count {
  color: hsl(var(--fg-light));
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.video-card {
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--bg));
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  position: relative;
}

.video-card:hover {
  border-color: hsl(var(--border-strong));
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.06);
  transform: translateY(-1px);
}

html.dark .video-card:hover {
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.35);
}

.video-card .media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: hsl(var(--bg-elevated));
  display: block;
  overflow: hidden;
}

.video-card .media video,
.video-card .media img.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card .meta {
  padding: 0.55rem 0.75rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: hsl(var(--fg-light));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.video-card .meta .idx {
  font-family: var(--font-mono);
  color: hsl(var(--fg-dark));
  font-weight: 600;
}

.video-card .meta .sub {
  font-style: italic;
}

.video-card.anti::after {
  content: "anti";
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: hsl(var(--danger));
  padding: 2px 7px;
  border-radius: 3px;
  opacity: 0.92;
}

/* ===================== PER-PROMPT PAGE ===================== */
.prompt-detail .prompt-text {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  line-height: 1.55;
  color: hsl(var(--fg-dark));
  margin: 1rem 0 0.5rem;
}

.prompt-detail .prompt-meta {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: hsl(var(--fg-light));
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
}

.prompt-detail .prompt-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  font-size: 0.82em;
  background: hsl(var(--bg-elevated));
}

.prompt-detail .prompt-meta .chip.anti {
  background: hsl(var(--danger) / 0.1);
  border-color: hsl(var(--danger) / 0.4);
  color: hsl(var(--danger));
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5em 0;
}

.model-cell {
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--bg));
  overflow: hidden;
}

.model-cell .media {
  aspect-ratio: 16 / 9;
  background: hsl(var(--bg-elevated));
}

.model-cell .media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.model-cell .label {
  padding: 0.45rem 0.75rem 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: hsl(var(--fg-dark));
  border-top: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-cell .label .org {
  font-weight: 400;
  font-size: 0.78em;
  color: hsl(var(--fg-light));
}

/* Rubric block (collapsible details) */
details.rubric {
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--bg));
  padding: 0;
  margin: 1.25em 0;
}

details.rubric > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--fg-dark));
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

details.rubric > summary::-webkit-details-marker { display: none; }

details.rubric > summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  color: hsl(var(--fg-light));
  transition: transform 0.2s ease;
}

details.rubric[open] > summary::after { content: "−"; }

details.rubric > .rubric-body {
  padding: 0 1rem 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: hsl(var(--fg));
  border-top: 1px solid hsl(var(--border));
}

.rubric-body h4 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
  color: hsl(var(--fg-light));
  font-weight: 600;
}

.rubric-body ul {
  margin: 0.3rem 0 0.6rem;
  padding-left: 1.3em;
}

.rubric-body ul li { margin: 0.18em 0; }

.rubric-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: hsl(var(--bg-elevated));
  padding: 0.05em 0.3em;
  border-radius: 3px;
  border: 1px solid hsl(var(--border));
}

.rubric-body .basic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

@media (max-width: 640px) {
  .rubric-body .basic-grid { grid-template-columns: 1fr; }
}

/* ===================== FOOTER ===================== */
footer.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: hsl(var(--fg-light));
  max-width: var(--content-wide);
  margin: 4rem auto 1rem;
  width: 100%;
  padding: 0 1.25rem;
}

footer.footer .right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

footer.footer .right a {
  color: hsl(var(--fg-light));
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s ease;
}

footer.footer .right a:hover { color: hsl(var(--fg-dark)); }

footer.footer .right .icon { width: 15px; height: 15px; }

/* ===================== UTILITIES ===================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: hsl(var(--fg-light));
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin: 0 0 0.5rem;
}

.back-link:hover { color: hsl(var(--fg-dark)); }

.sub-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.sub-chip {
  padding: 0.22rem 0.6rem;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  color: hsl(var(--fg-light));
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  background: hsl(var(--bg));
}

.sub-chip:hover {
  color: hsl(var(--fg-dark));
  border-color: hsl(var(--border-strong));
}

.sub-chip.on {
  background: hsl(var(--bg-dark));
  color: hsl(var(--fg-dark));
  font-weight: 600;
  border-color: hsl(var(--border-strong));
}

.sub-chip.anti {
  border-color: hsl(var(--danger) / 0.45);
  color: hsl(var(--danger));
}

.sub-chip.anti.on {
  background: hsl(var(--danger) / 0.13);
}

.dim {
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: hsl(var(--fg-light));
}

/* ===================== Taxonomy cards (homepage) ===================== */
.tax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1em 0;
}

.tax-card {
  display: block;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: hsl(var(--bg));
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  color: inherit;
  text-decoration: none !important;
}

.tax-card:hover {
  border-color: hsl(var(--border-strong));
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.06);
  transform: translateY(-1px);
  text-decoration: none !important;
}

html.dark .tax-card:hover {
  box-shadow: 0 4px 14px hsl(0 0% 0% / 0.35);
}

.tax-card .tax-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.tax-card .tax-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: hsl(var(--fg-light));
  padding: 0.1rem 0.4rem;
  border: 1px solid hsl(var(--border));
  border-radius: 3px;
}

.tax-card .tax-name {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: hsl(var(--fg-dark));
}

.tax-card .tax-count {
  margin: 0.15rem 0 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: hsl(var(--fg-light));
}

.tax-card .tax-subs {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: hsl(var(--fg));
  line-height: 1.55;
}

.tax-card .tax-subs code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: hsl(var(--fg-light));
  padding: 0.02em 0.3em;
  background: hsl(var(--bg-elevated));
  border-radius: 3px;
}

.anti-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: hsl(var(--danger));
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: 1px;
  opacity: 0.92;
}
