/* ericbruno.com site styles
   Same system as the NoHeapDB and EventPost pages: a cool "paper" ground, ink text,
   one blue accent, Bricolage Grotesque for display, IBM Plex Sans for body and
   JetBrains Mono for code and labels. Light and dark themes share every token. */

:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --ink: #0e1a2b;
  --muted: #586579;
  --rule: #dbe2ea;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebfd;

  --c1: #2563eb;   /* blue   */
  --c2: #4f46e5;   /* indigo */
  --c3: #059669;   /* green  */
  --c4: #d97706;   /* amber  */

  --code-bg: #0f1b2d;
  --code-fg: #d6dfec;
  --code-dim: #7d8ba1;
  --code-kw: #8db8ff;
  --code-str: #f0c47e;
  --code-type: #86dcbc;
  --code-num: #f3a27c;
  --code-line: #22324a;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4.1rem);

  --wrap: 72rem;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a111d; --surface: #101a2a; --ink: #e5ebf3; --muted: #95a2b6; --rule: #1f2b3e;
    --accent: #7ea6ff; --accent-ink: #0a111d; --accent-soft: #17264a;
    --c1: #5f93f2; --c2: #8c86f4; --c3: #34c495; --c4: #e9a23b;
    --code-bg: #060c16; --code-line: #19263a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a111d; --surface: #101a2a; --ink: #e5ebf3; --muted: #95a2b6; --rule: #1f2b3e;
  --accent: #7ea6ff; --accent-ink: #0a111d; --accent-soft: #17264a;
  --c1: #5f93f2; --c2: #8c86f4; --c3: #34c495; --c4: #e9a23b;
  --code-bg: #060c16; --code-line: #19263a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, pre, .mono { font-family: var(--f-mono); }
:not(pre) > code {
  font-size: 0.88em; background: var(--accent-soft); color: var(--ink);
  padding: 0.08em 0.35em; border-radius: 4px; overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--surface); padding: 0.5rem 0.8rem; border-radius: 6px; }

.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: var(--wrap); margin: 0 auto; }
section.band { padding-block: clamp(3rem, 6vw, 5rem); }
.eyebrow {
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 0.5rem; border-radius: 2px; background: var(--c1); flex: none; }
.section-head { display: grid; gap: 0.7rem; margin-bottom: 1.75rem; }
.section-head h2 { font-size: var(--step-3); font-weight: 700; }
.section-head p { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; cursor: pointer;
  font: 600 0.95rem/1 var(--f-body); padding: 0.75rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-row { display: flex; align-items: center; gap: 0.5rem 1.5rem; padding-block: 0.7rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--paper); font-size: 0.85rem; letter-spacing: 0.02em; position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; left: 5px; right: 5px; bottom: 5px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c1) 0 25%, var(--c2) 25% 50%, var(--c3) 50% 75%, var(--c4) 75%);
}
.nav-links { display: flex; gap: 0.25rem; margin-left: auto; font-size: 0.95rem; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 0.4rem 0.65rem; border-radius: 6px; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav .btn { padding: 0.55rem 0.85rem; font-size: 0.9rem; }
.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); color: var(--ink);
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
@media (max-width: 860px) {
  .nav-actions { margin-left: auto; }
  .nav-links {
    order: 3; width: 100%; margin: 0 -0.65rem; overflow-x: auto; scrollbar-width: none;
    width: calc(100% + 1.3rem);
  }
  .nav-links::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) { .nav-links { gap: 0; font-size: 0.9rem; } .nav-links a { padding: 0.4rem 0.5rem; } }
@media (max-width: 380px) { .nav .btn-email span { display: none; } }

/* ---------- Hero (home page) ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-copy { display: grid; gap: 1.4rem; min-width: 0; }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.profile {
  margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  padding: 1.25rem; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; min-width: 0;
  box-shadow: 0 20px 50px -30px color-mix(in srgb, var(--ink) 40%, transparent);
}
.profile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--paper); }
.profile figcaption { display: grid; gap: 0.75rem; min-width: 0; }
.profile-title { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.focus { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.93rem; line-height: 1.4; }
.focus li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0.6rem; align-items: baseline; }
.focus li::before { content: ""; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--c1); background: var(--accent-soft); transform: translateY(1px); }
.focus li:nth-child(4n+2)::before { border-color: var(--c2); }
.focus li:nth-child(4n+3)::before { border-color: var(--c3); }
.focus li:nth-child(4n+4)::before { border-color: var(--c4); }
@media (max-width: 460px) { .profile { grid-template-columns: minmax(0, 1fr); } .profile img { width: 7.5rem; } }

/* Proof strip */
.proof { border-block: 1px solid var(--rule); background: var(--surface); }
.proof .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.proof-item { padding: 1rem 1.25rem; display: grid; gap: 0.15rem; align-content: start; min-width: 0; }
.proof-item + .proof-item { border-left: 1px solid var(--rule); }
.proof-item b { font-family: var(--f-display); font-size: clamp(1.3rem, 1rem + 1.3vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.proof-item span { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
@media (max-width: 820px) {
  .proof .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-item:nth-child(3) { border-left: 0; }
  .proof-item:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- Listing + sidebar ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.listing-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.page-count { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.3rem; display: grid; gap: 0.55rem; min-width: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:has(a:hover), .card:focus-within { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: var(--step-1); font-weight: 700; line-height: 1.25; letter-spacing: -0.005em; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:focus-visible { outline: none; }
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.55; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.card-source { display: inline-flex; align-items: center; gap: 0.4rem; text-transform: lowercase; }
.card-source::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c2); }
.card.local .card-source { text-transform: none; color: var(--ink); font-weight: 600; }
.card.local .card-source::before { background: var(--c3); }
.card.local { border-left: 3px solid var(--c3); }
.card-source svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.card.nolink h3 a::after { display: none; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.pager-pages { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; justify-content: center; }
.pager-pages a, .pager-pages span {
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.5rem; display: grid; place-items: center; border-radius: 7px;
  font: 500 0.88rem var(--f-mono); text-decoration: none; color: var(--muted); border: 1px solid transparent;
}
.pager-pages a:hover { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.pager-pages [aria-current="page"] { background: var(--ink); color: var(--paper); }
.pager-pages .gap { min-width: 1.2rem; padding: 0; }
.pager-step.disabled { visibility: hidden; }
@media (max-width: 560px) { .pager-pages { order: 3; width: 100%; } .pager-pages li.far { display: none; } }

/* Sidebar */
.sidebar { display: grid; gap: 1.25rem; min-width: 0; }
@media (min-width: 961px) { .sidebar { position: sticky; top: 84px; } }
.side-block { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: 0.85rem; }
.side-title { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.book { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.85rem; align-items: center; text-decoration: none; color: var(--ink); }
.book img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); display: block; }
.book b { display: block; font-weight: 600; font-size: 0.93rem; line-height: 1.3; }
.book small { color: var(--muted); font-size: 0.8rem; }
.book:hover b { color: var(--accent); }
.side-link { display: grid; gap: 0.1rem; text-decoration: none; color: var(--ink); padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.side-block .side-title + .side-link { border-top: 0; padding-top: 0; }
.side-link b { font-weight: 600; font-size: 0.95rem; }
.side-link span { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.side-link:hover b { color: var(--accent); }
.side-more { font-size: 0.88rem; font-weight: 500; text-decoration: none; }
.side-more:hover { text-decoration: underline; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: 0.92rem; }
.contact-list a { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); }
.contact-list svg { width: 16px; height: 16px; flex: none; fill: currentColor; color: var(--muted); }

/* ---------- Page head (inner pages and articles) ---------- */
.page-head { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head .wrap { display: grid; gap: 1rem; }
.page-head h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em; }
.page-lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; max-width: 44rem; }
.page-body { padding-top: 0 !important; }

/* ---------- Article (Markdown) ---------- */
.article-head { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.75rem, 3vw, 2.5rem); border-bottom: 1px solid var(--rule); }
.article-head .wrap { display: grid; gap: 1.1rem; max-width: 50rem; margin-inline: auto; }
.article-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
.back { font-size: 0.9rem; text-decoration: none; color: var(--muted); width: fit-content; }
.back:hover { color: var(--accent); }
.byline { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.byline img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: top; border: 1px solid var(--rule); }
.byline b { display: block; font-weight: 600; }
.byline span { color: var(--muted); }

.article-band { padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.article-grid { display: grid; grid-template-columns: minmax(0, 46rem); justify-content: center; gap: 3rem; }
@media (min-width: 1180px) {
  .article-grid.has-toc { grid-template-columns: minmax(0, 46rem) 15rem; }
}
.toc { display: none; }
@media (min-width: 1180px) {
  .toc { display: block; position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 0.86rem; }
  .toc .side-title { display: block; margin-bottom: 0.75rem; }
  .toc ol { list-style: none; margin: 0; padding: 0 0 0 0.9rem; border-left: 1px solid var(--rule); display: grid; gap: 0.5rem; }
  .toc a { color: var(--muted); text-decoration: none; line-height: 1.35; display: block; }
  .toc a:hover, .toc a.active { color: var(--ink); }
  .toc a.active { box-shadow: -0.9rem 0 0 -0.78rem var(--accent); }
}

.prose { font-size: 1.06rem; line-height: 1.75; min-width: 0; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: var(--step-2); font-weight: 700; margin-top: 2.2em; padding-top: 0.2em; line-height: 1.2; }
.prose h3 { font-size: 1.3rem; font-weight: 700; margin-top: 1.8em; line-height: 1.25; }
.prose h4, .prose h5, .prose h6 { font-family: var(--f-body); font-size: 1.05rem; font-weight: 600; margin: 1.6em 0 0; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.prose h2 code, .prose h3 code { font-size: 0.85em; }
.prose a { overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: 0.35em; }
.prose li > ul, .prose li > ol { margin-top: 0.35em; }
.prose li > p + p { margin-top: 0.8em; }
.prose blockquote { margin-inline: 0; padding: 0.9rem 1.2rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--ink); }
.prose blockquote > * + * { margin-top: 0.8em; }
.prose .note { font-size: 0.92rem; color: var(--muted); font-style: italic; border-left: 3px solid var(--rule); padding-left: 1rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.prose img { display: block; margin-inline: auto; border-radius: 8px; }
.prose figure { margin-inline: 0; }
.prose figure img { border: 1px solid var(--rule); background: #fff; }
.prose figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }
.prose .table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 0.65rem 0.9rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
.prose tr:last-child td { border-bottom: 0; }
.prose thead th { font-weight: 600; font-size: 0.85rem; color: var(--muted); background: var(--paper); }
.prose td code, .prose th code { white-space: nowrap; }

pre.code {
  margin-inline: 0; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-line);
  border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.65; tab-size: 4;
  position: relative;
}
pre.code[data-lang] { padding-top: 1.8rem; }
pre.code code { font-family: var(--f-mono); background: none; padding: 0; color: inherit; white-space: pre; }
pre.code[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 0.45rem; right: 0.7rem;
  font: 500 0.68rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--code-dim);
}
.hljs-keyword, .hljs-literal, .hljs-built_in, .hljs-selector-tag { color: var(--code-kw); }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--code-str); }
.hljs-comment, .hljs-quote { color: var(--code-dim); font-style: italic; }
.hljs-type, .hljs-title.class_, .hljs-title, .hljs-section { color: var(--code-type); }
.hljs-number, .hljs-symbol, .hljs-deletion { color: var(--code-num); }
.hljs-meta, .hljs-tag, .hljs-name, .hljs-attr, .hljs-attribute { color: var(--code-kw); }
.hljs-title.function_, .hljs-variable, .hljs-params { color: var(--code-fg); }

/* "Keep reading" block under an article */
.more { border-top: 1px solid var(--rule); background: var(--surface); }
.more .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.more .card { background: var(--paper); }
@media (max-width: 900px) { .more .cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Inner page building blocks ---------- */
.stack { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.text { display: grid; gap: 1rem; max-width: 46rem; }
.text h2 { font-size: var(--step-2); font-weight: 700; margin-top: 0.75rem; }
.text h2:first-child { margin-top: 0; }
.text p { color: var(--muted); }
.text p strong { color: var(--ink); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: 1rem; min-width: 0; }
.panel h2, .panel h3 { font-size: var(--step-1); font-weight: 700; }
.panel p { color: var(--muted); font-size: 0.95rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li { font-size: 0.85rem; padding: 0.25rem 0.65rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; font-size: 0.95rem; }
.facts li { display: grid; gap: 0.1rem; }
.facts span { color: var(--muted); font-size: 0.82rem; font-family: var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; }

/* Books page */
.books { display: grid; gap: 1.5rem; }
.book-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.25rem); background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); align-items: start; }
.book-row img { width: 100%; border-radius: 6px; border: 1px solid var(--rule); box-shadow: 0 18px 30px -22px color-mix(in srgb, var(--ink) 60%, transparent); display: block; }
.book-row .text { gap: 0.85rem; }
.book-row h2 { font-size: var(--step-2); font-weight: 700; margin: 0; }
.book-row ul { margin: 0; padding-left: 1.2rem; color: var(--muted); display: grid; gap: 0.3rem; }
.book-row .downloads { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.book-row .downloads a { display: inline-block; font: 500 0.8rem var(--f-mono); padding: 0.3rem 0.6rem; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; }
.book-row .downloads a:hover { border-color: var(--accent); }
@media (max-width: 640px) { .book-row { grid-template-columns: minmax(0, 1fr); } .book-row img { width: 9rem; } }

/* Papers page */
.paper-group { display: grid; gap: 1rem; }
.paper-group + .paper-group { margin-top: 2.5rem; }
.paper-group h2 { font-size: var(--step-1); font-weight: 700; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.paper-group h2 small { font: 400 0.85rem var(--f-body); color: var(--muted); }
.papers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.paper a {
  display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.6rem; transition: border-color 0.15s ease, transform 0.15s ease;
}
.paper a:hover { border-color: var(--accent); transform: translateY(-2px); }
.paper img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; object-position: top; background: #fff; border-radius: 4px; display: block; }
.paper span { display: block; font: 500 0.72rem var(--f-mono); color: var(--muted); margin-top: 0.5rem; letter-spacing: 0.04em; }

/* Presentations page */
.talks { display: grid; gap: 2rem; }
.talk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); }
.talk h2 { font-size: var(--step-2); font-weight: 700; }
.talk .text { gap: 0.8rem; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) { .talk { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { padding-block: 2.5rem 3rem; border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; font-size: 0.88rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .btn, .card, .paper a { transition: none; }
  .btn:hover, .card:has(a:hover), .card:focus-within, .paper a:hover { transform: none; }
}
