/* speakrs pipeline explainer
   Dark surface is the selected default. Light mode is a separate set of steps
   against the light surface, not an inverted flip. */

:root {
  color-scheme: dark;

  --surface-0: #101010;
  --surface-1: #1a1a19;
  --surface-2: #232322;
  --surface-3: #2d2d2b;
  --line: #383835;
  --line-soft: #2a2a28;

  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #8b8a80;

  /* categorical slots, dark column */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-8: #e66767;

  --accent: #3987e5;

  /* device roles reuse the categorical hues in fixed order */
  --dev-gpu: var(--series-1);
  --dev-cpu: var(--series-2);
  --dev-either: var(--series-4);

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

:root[data-theme="light"] {
  color-scheme: light;

  --surface-0: #f4f3ef;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e6e5e0;
  --line: #d4d3cd;
  --line-soft: #e6e5e0;

  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7a7975;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-8: #e34948;

  --accent: #2a78d6;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: min(100% - calc(var(--gutter) * 2), 74rem);
  margin-inline: auto;
}

.prose {
  max-width: var(--measure);
}

section {
  padding-block: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line-soft);
}

section:first-of-type {
  border-top: 0;
}

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

h1,
h2,
h3,
h4 {
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  letter-spacing: -0.015em;
}

h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

a {
  color: var(--text-primary);
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}

p code,
li code,
td code {
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 0.08em 0.32em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}

.lede {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.5;
  color: var(--text-primary);
}

.note {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pull {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  line-height: 1.25;
  color: var(--text-primary);
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 2.5rem 0;
  max-width: 34rem;
}

ul.tight {
  margin: 0 0 1.1em;
  padding-left: 1.1rem;
}

ul.tight li {
  margin-bottom: 0.3em;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface-0) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3.25rem;
}

.topbar__mark {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.topbar__mark:hover {
  color: var(--accent);
}

.topbar nav {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}

.topbar nav::-webkit-scrollbar {
  display: none;
}

.topbar nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav a:hover,
.topbar nav a[aria-current="true"] {
  color: var(--text-primary);
}

.themetoggle {
  flex: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  text-transform: uppercase;
}

.themetoggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

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

.hero {
  padding-block: clamp(3.5rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem);
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero__q {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.3;
  color: var(--text-primary);
  border-left: 2px solid var(--accent);
  padding-left: 1.1rem;
  margin: 0 0 1.75rem;
  max-width: 32rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------- figure */

figure {
  margin: 2rem 0;
}

figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

figcaption {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 0.85rem;
  max-width: 34rem;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
}

/* svg text roles */
.svg-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-secondary);
}

.svg-label--dim {
  fill: var(--text-muted);
}

.svg-label--strong {
  fill: var(--text-primary);
}

.svg-title {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--text-primary);
}

.svg-box {
  fill: var(--surface-2);
  stroke: var(--line);
  stroke-width: 1;
}

.svg-rule {
  stroke: var(--line);
  stroke-width: 1;
  fill: none;
}

.svg-arrow {
  stroke: var(--text-muted);
  stroke-width: 1.25;
  fill: none;
}

/* ---------------------------------------------------------------- lab */

.lab {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  margin: 2.25rem 0;
}

.lab__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.lab__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.lab__sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 44rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12rem;
  flex: 1 1 12rem;
}

.control__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.control__value {
  color: var(--text-primary);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.8rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 1.5rem;
  cursor: pointer;
}

.segmented {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  flex-wrap: wrap;
}

.segmented button {
  flex: 1 1 auto;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text-primary);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text-primary);
}

.segmented button:focus-visible,
.stagechip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1.25rem;
}

.readout div {
  background: var(--surface-1);
  padding: 0.7rem 0.9rem;
}

.readout dt,
.readout .k {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.readout dd,
.readout .v {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.readout dd small,
.readout .v small {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ---------------------------------------------------------------- stage map */

.stagemap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 62rem) {
  .stagemap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
}

.stagegroup + .stagegroup {
  margin-top: 1.1rem;
}

.stagegroup__name {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stagelist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stagechip {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.7rem;
}

.stagechip:hover {
  border-color: var(--line);
  color: var(--text-primary);
}

.stagechip[aria-pressed="true"] {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--text-primary);
}

.stagechip__n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.stagechip[aria-pressed="true"] .stagechip__n {
  color: var(--accent);
}

.devdot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.devdot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--dot, var(--text-muted));
  box-shadow: 0 0 0 2px var(--surface-1);
}

.devdot[data-dev="gpu"] {
  --dot: var(--dev-gpu);
}
.devdot[data-dev="cpu"] {
  --dot: var(--dev-cpu);
}
.devdot[data-dev="either"] {
  --dot: var(--dev-either);
}

.stagedetail {
  position: sticky;
  top: 4.25rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}

.stagedetail h3 {
  margin-bottom: 0.5rem;
}

.stagedetail p {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.shapeflow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
}

.shapeflow span.arrow {
  color: var(--text-muted);
}

.shapeflow span.shape {
  color: var(--text-primary);
}

.stagedetail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.8125rem;
}

.stagedetail dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 0.15rem;
}

.stagedetail dd {
  margin: 0;
  color: var(--text-secondary);
}

.stagedetail dd a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ---------------------------------------------------------------- table */

.tablewrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

thead th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
  background: var(--surface-2);
}

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

td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-primary);
}

td.win {
  color: var(--text-primary);
  font-weight: 600;
}

caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.75rem 0.9rem;
}

/* ---------------------------------------------------------------- chart */

.chart {
  position: relative;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-bottom: 1rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c);
  display: inline-block;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.35);
}

.tooltip[data-show="true"] {
  opacity: 1;
}

.tooltip b {
  font-weight: 600;
}

.tooltip .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 0.35rem;
}

details.tableview {
  margin-top: 1rem;
}

details.tableview summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

details.tableview summary:hover {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------- misc */

.grid2 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
}

.card h3 {
  margin-bottom: 0.45rem;
}

.card p {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.card--gpu {
  border-left: 2px solid var(--dev-gpu);
}
.card--cpu {
  border-left: 2px solid var(--dev-cpu);
}

.sources {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.9;
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 2.5rem;
}

.sources li {
  break-inside: avoid;
  color: var(--text-muted);
}

.sources li b {
  color: var(--text-secondary);
  font-weight: 400;
}

@media (max-width: 46rem) {
  .sources {
    columns: 1;
  }
}

footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.5rem 4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------- narrow screens */

/* The diagrams carry 11px labels against a 1000-unit viewBox. Below roughly
   830px they would scale into illegibility, so they pan instead of shrink. */
@media (max-width: 52rem) {
  .chart,
  figure {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .chart > svg {
    min-width: 620px;
  }

  figure > svg {
    min-width: 680px;
  }

  .lab__sub,
  figcaption {
    max-width: none;
  }

  .stagedetail {
    position: static;
  }

  .controls {
    gap: 1rem;
  }

  .segmented button {
    font-size: 0.7rem;
    padding: 0.4rem 0.55rem;
  }
}

/* ---------------------------------------------------------------- terms */

.term {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: help;
  border-bottom: 1px dashed var(--text-muted);
  text-underline-offset: 0.2em;
}

.term:hover,
.term:focus-visible {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.term:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.termcard {
  position: fixed;
  z-index: 60;
  max-width: 24rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: 0 10px 34px rgb(0 0 0 / 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease;
}

.termcard[data-show="true"] {
  opacity: 1;
  visibility: visible;
}

.termcard h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
  font-weight: 400;
}

.termcard p {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-secondary);
}

.termcard pre {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.5rem 0.65rem;
  overflow-x: auto;
  white-space: pre;
}

.termcard a {
  display: inline-block;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

.termcard a:hover {
  color: var(--accent);
}

/* -------------------------------------------------------------- glossary */

.glossary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 2rem 0 1.5rem;
}

.glossary-search {
  flex: 1 1 16rem;
  max-width: 24rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 0.8rem;
}

.glossary-search::placeholder {
  color: var(--text-muted);
}

.glossary-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.glossary-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.glossary-group {
  margin-bottom: 2.25rem;
}

.glossary-group > h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1rem;
}

.glossary-list {
  display: grid;
  gap: 1.25rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  align-items: start;
}

.gterm {
  scroll-margin-top: 5rem;
}

.gterm dt {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.gterm dt .alias {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.gterm dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.gterm pre {
  margin: 0.55rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

.gterm:target dt {
  color: var(--accent);
}

.gterm[hidden] {
  display: none;
}

.glossary-empty {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.warnbox {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 2px solid var(--series-4);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  max-width: var(--measure);
}

.warnbox strong {
  display: block;
  margin-bottom: 0.3rem;
}

.warnbox p {
  margin: 0;
}
