/* ── Self-hosted Riforma ───────────────────────────────── */

@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma';
  src: url('/fonts/riforma/RiformaLLWeb-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-LightItalic.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LL Riforma Mono';
  src: url('/fonts/riforma-mono-otf/RiformaMonoLL-BoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ── Design tokens ──────────────────────────────────────── */

:root {
  --sans: 'LL Riforma', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'LL Riforma Mono', 'SF Mono', Menlo, Consolas, monospace;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --rule: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #0a0a0a;
  --placeholder-bg: #f4f3ee;

  --sidebar-width: 156px;
  --wordmark-width: 8.45rem;  /* 5 cells × 1.3em × 1.3rem */
  --content-max: 900px;
  --frame-pad-x: 120px;
  --frame-pad-y: 32px;
  --frame-pad-bottom: 80px;
}


/* ── Reset ─────────────────────────────────────────────── */

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

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

ul, ol { list-style: none; }

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


/* ── Frame (page container) ────────────────────────────── */

.frame {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  padding: var(--frame-pad-y) var(--frame-pad-x) var(--frame-pad-bottom);
  gap: 0 60px;
}


/* ── Sidebar nav ───────────────────────────────────────── */

.sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
}

.nav-contact {
  position: fixed;
  bottom: var(--frame-pad-bottom);
  left: var(--frame-pad-x);
}

.wordmark {
  display: block;
  position: fixed;
  top: var(--frame-pad-y);
  left: var(--frame-pad-x);
  z-index: 10;
}

/* ── Wordmark grid (static, no hover effects) ── */

.wm-grid {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
}

/* Default: show normal, hide scrambled */
.wm-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wordmark .wm-grid:first-child {
  transition: opacity 0.15s ease;
}

/* Hover: swap grids, no colour change */
.wordmark:hover .wm-grid:first-child {
  opacity: 0;
}

.wordmark:hover .wm-hover {
  opacity: 1;
}

.wm-row {
  display: flex;
}

.wm-cell {
  display: inline-block;
  width: 1.3em;
  text-align: center;
  padding: 0.15em 0;
}

/* ── Nav list ── */

.nav-list {
  display: flex;
  flex-direction: column;
  margin-top: 5.5rem;
}

.nav-list li a {
  display: block;
  padding: 6px 0;
}

/* Current page: label stays in its scrambled (hover) form,
   highlighted with a full-wordmark-width black bar */
.nav-list li a.is-current {
  background: var(--fg);
  color: var(--bg);
  width: var(--wordmark-width);
}

.nav-list li a.is-current .wm-swap .wm-grid:first-child {
  opacity: 0;
}

.nav-list li a.is-current .wm-swap .wm-hover {
  opacity: 1;
}


/* Hover: swap to scrambled grid, same as wordmark */

.wm-swap {
  position: relative;
  display: block;
}

.wm-swap .wm-grid:first-child {
  transition: opacity 0.15s ease;
}

.nav-list li a:hover .wm-swap .wm-grid:first-child,
.nav-contact:hover .wm-swap .wm-grid:first-child {
  opacity: 0;
}

.nav-list li a:hover .wm-swap .wm-hover,
.nav-contact:hover .wm-swap .wm-hover {
  opacity: 1;
}


/* ── Handbook sidebar nav ─────────────────────────────── */

.handbook-back {
  position: fixed;
  top: calc(var(--frame-pad-y) + 4.5rem);
  left: var(--frame-pad-x);
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.handbook-back:hover {
  background: var(--fg);
  color: var(--bg);
}


/* ── Main content ──────────────────────────────────────── */

.content {
  grid-column: 2;
  grid-row: 1;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}


/* ── Page layout ───────────────────────────────────────── */

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.3;
}

.page-body h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.page-body h3 {
  font-family: var(--mono);
  font-size: 0.87rem;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.page-body p {
  margin-bottom: 1rem;
  max-width: 60ch;
}

.page-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-body a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}


/* ── Landing page ──────────────────────────────────────── */

.landing-section {
  margin-bottom: 2.5rem;
}

.landing-section + .landing-section {
  padding-top: 1rem;
}

.landing-section + .landing-section {
  border-top: 1px solid var(--rule);
}


.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 60ch;
}


/* ── Handbook entry ─────────────────────────────────────── */

.handbook-entry {
  display: grid;
  grid-template-columns: minmax(0, 65ch) var(--margin-width, 180px);
  gap: 0 2rem;
}

.handbook-entry > * {
  grid-column: 1;
}

.entry-margin {
  grid-column: 2;
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
}

.entry-title {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.entry-subtitle {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--muted);
}

.entry-author {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Table of contents */

.entry-toc {
  margin-bottom: 2.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.toc-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  font-size: 0.87rem;
  line-height: 1.6;
}

.toc-list li::before {
  content: counter(toc, decimal-leading-zero) ".";
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.5rem;
}

.toc-list a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toc-list a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

/* Entry body */

.entry-body h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.entry-body h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.entry-body h3 {
  font-family: var(--mono);
  font-size: 0.87rem;
  font-weight: 400;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.entry-body p {
  margin-bottom: 1rem;
  line-height: 1.55;
}

.entry-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* External links — styled like xref terms, arrow in margin */
.entry-body a[href^="http"] {
  font-style: italic;
  text-decoration: none;
}

.entry-body a[href^="http"]:hover,
.entry-body a[href^="http"].xref-active {
  background: var(--fg);
  color: var(--bg);
}

.entry-body a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.entry-body ul,
.entry-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.entry-body ul { list-style: disc; }
.entry-body ol { list-style: decimal; }

.entry-body li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

/* ── Code: shared base ── */

.entry-body pre,
pre[class*="language-"] {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

code[class*="language-"] {
  font-family: var(--mono);
}

.entry-body code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.entry-body p code {
  background: var(--placeholder-bg);
  padding: 0.15em 0.35em;
}

/* ── Historical code (figure): muted, archival, small ── */

.code-historical {
  background: none;
  padding: 0;
  margin: 1.5rem 0;
}

.code-historical pre,
.code-historical pre[class*="language-"] {
  background: #f0ead0;
  border: none !important;
  border-left: none !important;
  color: #5a5444;
  font-size: 0.65rem;
  line-height: 1.4;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 480px;
  text-align: left;
}

.code-historical .token.comment { color: #9a958e; font-style: italic; }
.code-historical .token.keyword { color: #7a756e; font-weight: 600; }
.code-historical .token.function { color: #7a756e; }
.code-historical .token.punctuation { color: #8a857e; }
.code-historical .token.number { color: #7a756e; }
.code-historical .token.operator { color: #8a857e; }
.code-historical .token.string { color: #7a756e; }
.code-historical .token.class-name { color: #6b6560; font-weight: 600; }

.code-historical figcaption {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #8a857e;
  line-height: 1.4;
}

/* ── Executable code: notebook-style cells ── */

.entry-body pre[class*="language-supercollider"] {
  background: #fafaf8;
  border: 1px solid #d8d8d4;
  border-left: 3px solid var(--fg);
  color: var(--fg);
  position: relative;
  padding: 1.75rem 1.25rem 1rem 3rem;
}

/* Language label */
.entry-body pre[class*="language-supercollider"]::before {
  content: "supercollider";
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: #aaa;
  background: #f0f0ee;
  padding: 2px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Line number gutter */
.entry-body pre[class*="language-supercollider"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2rem;
  background: #f0f0ee;
  border-right: 1px solid #e0e0dc;
}

/* Syntax tokens — coloured for executable code */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: #7a8a7a; font-style: italic; }

.token.punctuation { color: #666; }

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted { color: #8b3a3a; }

.token.boolean,
.token.number { color: #2a6496; font-weight: 500; }

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted { color: #4a7a4a; }

.token.operator { color: #555; }

.token.entity,
.token.url { color: var(--fg); }

.token.atrule,
.token.attr-value,
.token.keyword { color: #2a2a6a; font-weight: 700; }

.token.function { color: #6a3a1a; font-weight: 500; }

.token.class-name { color: #1a4a6a; font-weight: 700; }

.token.regex,
.token.important,
.token.variable { color: #5a3a6a; font-weight: 500; }

/* ── Interactive synth demo widget ── */

.synth-demo {
  border: 1px solid #d4d8dc;
  border-left: 3px solid #2a6496;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #f6f8fa;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.demo-scope-frame {
  margin-top: 0.75rem;
}

.demo-scope-frame .demo-scope {
  border: 1px solid var(--fg);
  background: var(--bg);
}

.demo-scope-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.demo-scope {
  width: 100%;
  height: 160px;
  display: block;
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.demo-header .demo-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-status {
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: auto;
}

.demo-boot,
.demo-trigger,
.demo-use-builder {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.demo-boot:hover,
.demo-trigger:hover,
.demo-use-builder:hover {
  background: var(--fg);
  color: var(--bg);
}

.demo-boot:disabled,
.demo-trigger:disabled,
.demo-use-builder:disabled {
  opacity: 0.3;
  cursor: default;
}

.demo-boot:disabled:hover,
.demo-trigger:disabled:hover,
.demo-use-builder:disabled:hover {
  background: var(--bg);
  color: var(--fg);
}

.demo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.demo-param {
  display: grid;
  grid-template-columns: 70px 1fr 45px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
}

.demo-param label {
  color: var(--muted);
}

.demo-slider {
  width: 100%;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: #ccc;
  outline: none;
}

.demo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background: var(--fg);
  cursor: pointer;
}

.demo-slider:disabled {
  opacity: 0.3;
}

.demo-value {
  text-align: right;
  color: var(--muted);
}

.demo-caption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.demo-caption em {
  font-style: normal;
  color: var(--fg);
}

/* ── Pulsaret builder widget ── */

.pulsaret-builder {
  border: 1px solid #d4d8dc;
  border-left: 3px solid #2a6496;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #f6f8fa;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.pulsaret-builder .demo-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.builder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.builder-panel label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.builder-panel label span {
  white-space: nowrap;
}

.builder-select {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  min-width: 14ch;
  border: 1px solid #d4d8dc;
  background: var(--bg);
  color: var(--fg);
}

.builder-canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  border: 1px solid #d4d8dc;
  background: var(--bg);
}

.builder-result {
  margin-top: 0.25rem;
}

.builder-result label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.builder-result .builder-canvas {
  cursor: default;
}

.builder-hint {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

@media (max-width: 600px) {
  .builder-row {
    grid-template-columns: 1fr;
  }
}

/* ── Cross-references (margin annotations) ─────────────── */

.entry-body {
  position: relative;
}

.entry-body .xref-link {
  text-decoration: none;
}

.entry-body .xref-link:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

/* Static note hidden — JS creates positioned arrows in the margin */
.xref-note {
  display: none;
}

/* JS-created margin container — placed in grid column 2 */
.xref-margin {
  grid-column: 2;
  grid-row: 1 / -1;
  position: relative;
  width: var(--margin-width, 180px);
}

/* Inline reference numbers */
.ref-num {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--muted);
  margin-left: 1px;
  cursor: default;
}

.ref-num-active {
  background: var(--fg);
  color: var(--bg);
}

.ref-num {
  cursor: default;
}

.margin-ref {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.15em;
}

.margin-ref-item {
  display: inline-flex;
  gap: 0.25em;
  align-items: baseline;
  cursor: default;
}

.margin-ref-item a,
.margin-ref-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
}

.margin-ref-label {
  font-size: 0.6rem;
}

.margin-ref-active {
  background: var(--fg);
  padding: 2px 4px;
  margin: -2px -4px;
}

.margin-ref-active a,
.margin-ref-active .margin-ref-label {
  color: var(--bg);
}

/* Bidirectional hover highlight on inline term */
.xref.xref-active .xref-link {
  background: var(--fg);
  color: var(--bg);
}

/* Static margin notes — positioned in the xref margin column */
.demo-with-margin {
  position: relative;
}

.margin-note {
  position: absolute;
  top: 0;
  left: calc(100% + 2rem);
  width: var(--margin-width, 180px);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--muted);
}

.margin-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.margin-note em {
  font-style: normal;
  background: var(--fg);
  color: var(--bg);
  padding: 1px 3px;
}

@media (max-width: 1100px) {
  .margin-note { display: none; }
}


/* Figures */

.entry-body figure {
  margin: 2rem 0;
}

.entry-body figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

.entry-body figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: left;
}

/* Tables */

.entry-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.entry-body th,
.entry-body td {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.entry-body th {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--fg);
}

.entry-body caption {
  caption-side: bottom;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  padding-top: 0.5rem;
  text-align: left;
}

.entry-body td {
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* References */

.entry-references {
  margin-top: 3rem;
}

.ref-list {
  list-style: none;
}

.ref-list li {
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding-left: 2rem;
  text-indent: -2rem;
}

/* Related entries */

.entry-related {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.entry-related ul {
  list-style: none;
}

.entry-related li {
  font-size: 0.87rem;
  line-height: 1.6;
}

.entry-related a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-related a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}


/* ── Handbook index list ──────────────────────────────── */

.handbook-index-list {
  list-style: none;
  margin-top: 1.5rem;
  max-width: 60ch;
}

.handbook-index-list li {
  padding: 0.35rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.handbook-index-list .index-entry {
  padding-left: 1.5rem;
}

.handbook-index-list .index-ref {
  padding-left: 0;
}

.handbook-index-list a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.handbook-index-list a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.handbook-index-list .entry-sep {
  color: var(--muted);
  font-size: 0.8rem;
}

.handbook-index-list .entry-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}


/* ── Glossary ─────────────────────────────────────────── */

.glossary-list {
  margin-bottom: 2rem;
}

.glossary-list dt {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.glossary-list dt:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.glossary-list dd {
  font-size: 0.87rem;
  line-height: 1.55;
  max-width: 60ch;
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.glossary-refs {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.glossary-refs a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.glossary-refs a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}


/* ── News / activity list ──────────────────────────────── */

.activity-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 16px;
  padding: 0.4rem 0;
  font-size: 0.87rem;
  line-height: 1.4;
}

.activity-list .date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}


/* ── Team ───────────────────────────────────────────────── */

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 0;
  margin-top: 1.5rem;
}

.team-member {
  display: grid;
  grid-template-columns: 180px 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.2rem 1.5rem;
  align-items: start;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.member-photo {
  grid-row: 1 / 4;
  grid-column: 1;
  width: 180px;
}

.member-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 0.4s ease;
  display: block;
}

.member-photo img:hover,
.team-member:hover .member-photo img {
  filter: grayscale(0);
}

.member-photo:empty {
  background: var(--placeholder-bg);
}

.photo-credit {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

h2.member-name {
  grid-row: 1;
  grid-column: 2;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  padding: 0;
  align-self: start;
  line-height: 1;
}

.team-grid .member-bio {
  grid-row: 2;
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: none;
  margin: 0;
}

.member-links {
  grid-row: 3;
  grid-column: 2;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.member-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.member-links a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}


/* ── Advisory board ────────────────────────────────────── */

.advisory-grid {
  margin-top: 1rem;
  column-count: 1;
}

.advisory-grid span {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 0.4rem;
  color: var(--fg);
}


/* ── Footer ────────────────────────────────────────────── */

.site-footer {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  font-size: 0.75rem;
  line-height: 1.45;
}

.footer-content h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.footer-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-content a:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.colophon {
  color: var(--muted);
}


/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 900px) {
  :root {
    --frame-pad-x: 24px;
    --frame-pad-y: 24px;
  }

  .frame {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar {
    position: static;
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 2rem;
  }

  .handbook-entry {
    grid-template-columns: 1fr;
  }

  .wordmark { position: static; margin-bottom: 1rem; }
  .wm-grid { font-size: 1.3rem; }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 0;
  }

  .nav-list li a {
    border-top: 1px solid var(--rule);
    border-bottom: none;
    padding: 6px 12px 6px 0;
  }

  .nav-list li:last-child a { border-bottom: none; }

  .handbook-back { margin-top: 1rem; margin-bottom: 0.75rem; }

  .content { grid-column: 1; grid-row: 2; padding-top: 0; }
  .site-footer { grid-column: 1; grid-row: 3; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
  :root { --frame-pad-x: 16px; }
  .footer-content { grid-template-columns: 1fr; }
  .activity-list li { grid-template-columns: 1fr; gap: 2px 0; }
}
