/* gregor-posadas.github.io
   Same signage rules as the Microbe Busters hub: near-black on warm paper (white on black in dark mode),
   one typeface (Atkinson Hyperlegible Next), two weights, few sizes, thick rules. Colour never carries meaning alone. */

@font-face { font-family: "Atkinson"; src: url(../fonts/AtkinsonHyperlegibleNext-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(../fonts/AtkinsonHyperlegibleNext-RegularItalic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(../fonts/AtkinsonHyperlegibleNext-Bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f2e9;
  --surface: #fcfaf5;
  --sunk: #ece6d8;
  --ink: #1b1a17;
  --ink-2: #4d4a43;
  --rule: #d4ccbb;
  --rule-strong: #1b1a17;
  --band: #1b1a17;
  --band-ink: #ffffff;
  --focus: #0072b2;
  color-scheme: light;

  --f1: 0.875rem;  /* meta */
  --f2: 1rem;      /* body, 18px */
  --f3: 1.25rem;
  --f4: 1.75rem;
  --f5: 2.5rem;
  --gap: 24px;
  --wrap: 1480px;
  --read: 44rem;
  --tap: 48px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000; --surface: #121212; --sunk: #1c1c1c;
    --ink: #ffffff; --ink-2: #c9c9c9; --rule: #3d3d3d; --rule-strong: #ffffff;
    --band: #000000; --band-ink: #ffffff; --focus: #56b4e9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000; --surface: #121212; --sunk: #1c1c1c;
  --ink: #ffffff; --ink-2: #c9c9c9; --rule: #3d3d3d; --rule-strong: #ffffff;
  --band: #000000; --band-ink: #ffffff; --focus: #56b4e9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Atkinson", system-ui, sans-serif; font-weight: 400;
  font-size: var(--f2); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--paper); color: var(--ink); padding: 12px 16px; z-index: 50; border: 2px solid var(--ink); }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
@media (min-width: 1100px) { .wrap { padding: 0 56px; } }

/* Signage band */
.band { background: var(--band); color: var(--band-ink); border-bottom: 6px solid var(--band); }
.band__inner { max-width: var(--wrap); margin: 0 auto; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 16px; align-items: center; }
/* Same layout in every language: brand and tools share the first row, the menu gets its own row, so switching language never moves the controls. */
@media (min-width: 720px) { .band__inner { grid-template-columns: minmax(0, 1fr) auto; } .band__tools { justify-content: flex-end; } .nav { grid-column: 1 / -1; } }
@media (min-width: 720px) { .band__inner { padding: 18px 32px; } }
@media (min-width: 1100px) { .band__inner { padding: 18px 56px; } }
.brand { text-decoration: none; display: flex; flex-direction: column; min-height: var(--tap); justify-content: center; }
.brand__name { font-size: var(--f3); font-weight: 700; letter-spacing: 0.01em; }
.brand__sub { font-size: var(--f1); color: #cfcfcf; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: -14px; }
.nav a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 14px; text-decoration: none; border-bottom: 4px solid transparent; }
.nav a:hover { border-bottom-color: #7a7a7a; }
.nav a[aria-current="page"] { border-bottom-color: #ffffff; font-weight: 700; }
.band :focus-visible { outline-color: #56b4e9; }
.theme-toggle { min-height: var(--tap); padding: 0 14px; background: transparent; color: var(--band-ink); border: 2px solid #6b6b6b; font-weight: 700; cursor: pointer; }
.theme-toggle:hover { border-color: #ffffff; }

/* Page heads */
.head { padding: 40px 0 24px; }
.head h1 { font-size: var(--f5); letter-spacing: -0.01em; }
.head p { margin-top: 8px; color: var(--ink-2); max-width: var(--read); }
.head .creds { font-size: var(--f1); font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; margin-top: 10px; }
.section { padding: 8px 0 40px; }
.section > h2 { font-size: var(--f3); padding-bottom: 10px; border-bottom: 4px solid var(--rule-strong); margin-bottom: 4px; }
.section__note { color: var(--ink-2); font-size: var(--f1); margin: 8px 0 0; }
.rt-p { margin: 14px 0 0; max-width: var(--read); }
.rt-h { font-size: var(--f2); margin: 24px 0 0; }
.list { margin: 8px 0 0; padding-left: 1.4em; display: grid; gap: 6px; max-width: var(--read); }

/* Intro: text beside an optional photo */
.intro { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; padding: 8px 0 40px; }
@media (min-width: 800px) { .intro.has-photo { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (min-width: 1100px) { .intro.has-photo { grid-template-columns: minmax(0, 44rem) minmax(260px, 420px); gap: 56px; } }
.intro__text p { max-width: var(--read); }
.intro__text p + p { margin-top: 14px; }
.photo { border: 2px solid var(--rule-strong); background: var(--sunk); display: block; width: 100%; height: auto; }
.photo-cap { font-size: var(--f1); color: var(--ink-2); margin-top: 8px; }

/* Line bullets (station markers) */
.bullet { --c: var(--ink); --t: var(--paper); flex: none; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--c); color: var(--t); display: inline-grid; place-items: center; font-weight: 700; line-height: 1; font-size: 1rem; }

/* Route line: a life as stations */
.route { margin: 8px 0 32px; }
.route h2 { font-size: var(--f1); font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.route ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.route li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 0 0 18px; }
.route li::before { content: ""; position: absolute; left: 12px; top: 14px; bottom: -4px; width: 4px; background: var(--ink); }
.route li:last-child::before { display: none; }
.route .stop { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 4px solid var(--ink); position: relative; z-index: 1; }
.route li.is-past .stop { background: var(--ink); }
.route li.is-now .stop { border-width: 8px; }
.route .when { font-weight: 700; display: block; }
.route .what { color: var(--ink-2); }
.route .what b { color: var(--ink); font-weight: 700; }
@media (min-width: 800px) {
  .route ol { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .route li { grid-template-columns: 1fr; grid-template-rows: 28px auto; padding: 0 16px 0 0; }
  .route li::before { left: 14px; right: -14px; top: 12px; bottom: auto; width: auto; height: 4px; }
  .route li:last-child::before { display: none; }
}

/* "Now" board: two-cell framed block (the hub's meeting block) */
.now { margin: 8px 0 32px; border: 2px solid var(--rule-strong); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.now__main { padding: 20px 24px; border-right: 2px solid var(--rule-strong); }
.now__big { font-size: var(--f4); font-weight: 700; line-height: 1.15; }
.now__sub { font-size: var(--f3); font-weight: 700; margin-top: 2px; }
.now__rel { margin-top: 6px; color: var(--ink-2); }
.now__side { padding: 20px 24px; display: grid; gap: 10px; align-content: center; }
.now__side li { display: flex; gap: 10px; align-items: baseline; }
.now__side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.now__side .k { font-size: var(--f1); color: var(--ink-2); min-width: 7.5rem; flex: none; }
@media (max-width: 719px) { .now { grid-template-columns: 1fr; } .now__main { border-right: 0; border-bottom: 2px solid var(--rule-strong); } .now__side .k { min-width: 6rem; } }

/* Signs: framed cards (links, projects) */
.signs { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 720px) { .signs { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .signs--3 { grid-template-columns: 1fr 1fr 1fr; } }
.sign { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; text-decoration: none; background: var(--surface); border: 2px solid var(--rule-strong); padding: 20px; min-height: 120px; }
.sign:hover { background: var(--sunk); }
.sign:hover .sign__name { text-decoration: underline; }
.sign > span:last-child { min-width: 0; display: block; }
.sign__name { display: block; font-size: var(--f3); font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.sign__role { display: block; color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }
.sign__meta { display: block; margin-top: 10px; font-size: var(--f1); color: var(--ink-2); overflow-wrap: anywhere; }
.sign--static { cursor: default; }
.sign--static:hover { background: var(--surface); }

/* Departure-board rows (publications, talks, CV entries) */
.rows { list-style: none; margin: 0; padding: 0; }
.row { border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 16px 4px; min-height: 72px; align-items: start; }
.row__main { display: grid; gap: 4px; min-width: 0; }
.row__title { font-size: var(--f3); font-weight: 700; line-height: 1.25; }
.row__title a { text-decoration-thickness: 2px; }
.row__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; color: var(--ink-2); font-size: var(--f1); }
.row__meta b { color: var(--ink); }
.row__side { text-align: right; display: grid; gap: 2px; justify-items: end; }
.row__day { font-weight: 700; }
.row__rel { font-size: var(--f1); color: var(--ink-2); }
.row__body { margin-top: 6px; max-width: var(--read); }
.row__body ul { margin: 6px 0 0; padding-left: 1.3em; display: grid; gap: 4px; }
.row.is-quiet .row__title { font-weight: 400; }
@media (max-width: 559px) {
  .row { grid-template-columns: 1fr; }
  .row__side { text-align: left; justify-items: start; grid-auto-flow: column; gap: 12px; justify-content: start; }
}
.me { font-weight: 700; }
.tag { display: inline-flex; align-items: center; min-height: 1.6em; padding: 0 8px; border: 2px solid var(--ink); font-weight: 700; font-size: var(--f1); line-height: 1.2; white-space: nowrap; }
.tag--solid { background: var(--ink); color: var(--paper); }

/* Buttons: a physical sign that sits 4px proud of the page and sinks flush when pressed */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer;
  --lift: 4px; box-shadow: var(--lift) var(--lift) 0 0 var(--ink); transform: translate(0, 0); transition: transform 90ms ease-out, box-shadow 90ms ease-out, background 90ms; margin: 0 var(--lift) var(--lift) 0; }
.btn:hover { background: var(--sunk); }
.btn:active, .btn.is-pressed { transform: translate(var(--lift), var(--lift)); box-shadow: 0 0 0 0 var(--ink); }
.btn--solid { background: var(--ink); color: var(--paper); box-shadow: var(--lift) var(--lift) 0 0 var(--ink-2); }
.btn--solid:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--solid:active, .btn--solid.is-pressed { box-shadow: 0 0 0 0 var(--ink-2); }
.sign { --lift: 4px; box-shadow: var(--lift) var(--lift) 0 0 var(--ink); transform: translate(0, 0); transition: transform 90ms ease-out, box-shadow 90ms ease-out; margin-right: var(--lift); }
.sign:active, .sign.is-pressed { transform: translate(var(--lift), var(--lift)); box-shadow: 0 0 0 0 var(--ink); }
.sign--static { box-shadow: none; }
.sign--static:active { transform: none; }
.theme-toggle:active, .theme-toggle.is-pressed, .tool:active, .tool.is-pressed { transform: translateY(2px); }
.nav a:active { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) { .btn, .sign, .theme-toggle, .tool { transition: none; } .btn:active, .btn.is-pressed, .sign:active, .sign.is-pressed, .theme-toggle:active, .tool:active, .nav a:active { transform: none; } }

/* Header tools: language, sound, theme */
.band__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool { min-height: var(--tap); padding: 0 14px; background: transparent; color: var(--band-ink); border: 2px solid #6b6b6b; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.tool:hover { border-color: #ffffff; }
.tool[aria-pressed="true"] .tool__state::before { content: "● "; }
.tool[aria-pressed="false"] .tool__state::before { content: "○ "; }

/* Photo galleries */
.gallery { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .gallery--3 { grid-template-columns: repeat(3, 1fr); } .gallery--4 { grid-template-columns: repeat(4, 1fr); } }
.gallery figure { margin: 0; border: 2px solid var(--rule-strong); background: var(--surface); }
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption { padding: 10px 14px; font-size: var(--f1); color: var(--ink-2); border-top: 2px solid var(--rule-strong); }
.gallery a { display: block; text-decoration: none; }
.gallery a:hover img { opacity: 0.9; }
.gallery a:focus-visible { outline-offset: 4px; }

/* Tribute page */
.tribute { max-width: var(--read); }
.tribute p + p { margin-top: 14px; }
.tribute blockquote { margin: 24px 0; padding: 16px 20px; border-left: 6px solid var(--ink); background: var(--sunk); }
.tribute blockquote p { font-size: var(--f3); line-height: 1.4; }
.tribute blockquote footer { margin-top: 8px; font-size: var(--f1); color: var(--ink-2); }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); border: 2px solid var(--rule-strong); margin: 16px 0 8px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat b { display: block; font-size: var(--f4); line-height: 1.1; }
.stat span { color: var(--ink-2); font-size: var(--f1); }

/* Legend list (two columns) */
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; max-width: var(--read); }
.legend li { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; align-items: baseline; }
.legend li b { font-size: var(--f1); color: var(--ink-2); font-weight: 700; }
@media (max-width: 480px) { .legend li { grid-template-columns: 1fr; gap: 2px; } }

details.more { margin-top: 8px; }
details.more summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 700; }

.foot { border-top: 1px solid var(--rule); margin-top: 32px; }
.foot .wrap { padding-top: 16px; padding-bottom: 16px; color: var(--ink-2); font-size: var(--f1); display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }

@media print {
  .band, .theme-toggle, .skip, .actions, .foot { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .row, .sign, .now { break-inside: avoid; }
  a { text-decoration: none; }
}

/* Accessibility page: palette swatches (always labelled with words and hex values) */
.palette { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; max-width: var(--read); }
.palette li { display: grid; grid-template-columns: 40px 40px 1fr; gap: 12px; align-items: center; }
.swatch { width: 40px; height: 40px; background: var(--sw); border: 2px solid var(--rule-strong); display: block; }
.swatch__meta { font-size: var(--f1); color: var(--ink-2); }
.foot a { color: inherit; }
.solo { margin: 16px 0 0; max-width: 40rem; border: 2px solid var(--rule-strong); background: var(--surface); }
.solo img { display: block; width: 100%; height: auto; }
.solo figcaption { padding: 10px 14px; font-size: var(--f1); color: var(--ink-2); border-top: 2px solid var(--rule-strong); }

/* Dad page: vertical route line for a long life */
@media (min-width: 800px) {
  .route--v ol { grid-auto-flow: row; grid-auto-columns: auto; max-width: var(--read); }
  .route--v li { grid-template-columns: 28px 1fr; grid-template-rows: none; padding: 0 0 18px; }
  .route--v li::before { left: 12px; right: auto; top: 14px; bottom: -4px; width: 4px; height: auto; }
}
/* Wide screens: the long timeline flows into two columns so it uses the width. */
@media (min-width: 1200px) {
  .route--v ol { display: block; columns: 2; column-gap: 56px; max-width: none; }
  .route--v li { display: grid; break-inside: avoid; }
}
.route--v h2 { font-size: var(--f3); color: var(--ink); padding-bottom: 10px; border-bottom: 4px solid var(--rule-strong); margin-bottom: 16px; }
.gallery { align-items: start; }
.intro figure { margin: 0; }
.intro figure a { display: block; }

/* ---------- Wide screens: use the width with columns, not longer lines ---------- */
.signs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.legend { max-width: none; column-gap: 56px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr)); }
.legend li { align-content: start; }
@media (min-width: 1200px) { .gallery--3 { grid-template-columns: repeat(4, 1fr); } .gallery--4 { grid-template-columns: repeat(5, 1fr); } }
.split { display: grid; gap: 24px 56px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); }
  /* Photos beside the text pack into as many ~210px columns as fit, masonry-style, so a long set of documents does not leave the text column empty. */
  .split > .gallery { display: block; margin-top: 14px; columns: 190px; column-gap: 16px; }
  .split > .gallery > li { break-inside: avoid; margin-bottom: 16px; }
}
.split > .tribute { max-width: var(--read); }
.split > .gallery--clips { columns: auto; max-width: 36rem; }

/* ---------- Video timelapses ---------- */
.gallery video { display: block; width: 100%; height: auto; background: #000; }
.gallery--video { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.gallery--video .is-wide { grid-column: span 2; }
@media (max-width: 559px) { .gallery--video .is-wide { grid-column: auto; } }

/* ---------- Lightbox ---------- */
.lb { border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(0,0,0,0.94); color: #fff; }
.lb::backdrop { background: rgba(0,0,0,0.94); }
.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.lb__count { font-size: var(--f1); color: #d0d0d0; }
.lb__close { min-height: var(--tap); padding: 0 18px; background: #fff; color: #000; border: 2px solid #fff; font-weight: 700; font-size: var(--f2); cursor: pointer; display: inline-flex; align-items: center; gap: 10px; }
.lb__close:hover { background: #e6e6e6; }
.lb__close span[aria-hidden] { font-size: 1.4em; line-height: 1; }
.lb__stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 8px; min-height: 0; }
.lb__fig { margin: 0; align-self: stretch; position: relative; min-height: 0; }
/* The photo fills the space between the bar and the caption and is scaled to fit, so the caption never covers it. */
.lb__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.lb__nav { min-width: var(--tap); min-height: 72px; background: transparent; color: #fff; border: 2px solid #8a8a8a; font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.lb__nav:hover { border-color: #fff; }
.lb__nav:disabled { visibility: hidden; }
.lb__cap { padding: 12px 16px 16px; max-width: 60rem; margin: 0 auto; text-align: center; color: #f0f0f0; }
.lb :focus-visible { outline: 3px solid #56b4e9; outline-offset: 2px; }
@media (max-width: 559px) { .lb__stage { grid-template-columns: 1fr; } .lb__nav { display: none; } }
@media print { .lb { display: none !important; } }

/* ---------- Lineage diagram ---------- */
.lineage { margin: 16px 0 0; border: 2px solid var(--rule-strong); background: var(--surface); padding: 20px; }
.lineage svg { display: block; width: 100%; height: auto; }
.lineage .ln { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.lineage .ln--dash { stroke-dasharray: 1 14; }
.lineage .st { fill: var(--paper); stroke: var(--ink); stroke-width: 6; }
.lineage .st--dad { fill: var(--ink); }
.lineage .nm { fill: var(--ink); font: 700 22px "Atkinson", system-ui, sans-serif; }
.lineage .rl { fill: var(--ink-2); font: 400 16px "Atkinson", system-ui, sans-serif; }
.lineage__list { display: none; }
@media (max-width: 899px) { .lineage svg { display: none; } .lineage__list { display: block; } }
.lineage__note { margin-top: 14px; color: var(--ink-2); font-size: var(--f1); max-width: var(--read); }

/* Glossary terms on the Dad page: a dotted underline marks a term with an explanation.
   Hover shows it; a click, tap, Enter or Space pins it; Escape or a click elsewhere closes it. */
.term { position: relative; }
.term__btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; cursor: help;
  text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 3px; -webkit-tap-highlight-color: transparent; }
.term__btn:hover, .term__btn[aria-expanded="true"] { background: var(--sunk); text-decoration-style: solid; }
.term__tip { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; display: block; width: max-content; max-width: min(24rem, calc(100vw - 32px));
  padding: 12px 14px; background: var(--surface); color: var(--ink); border: 2px solid var(--rule-strong); box-shadow: 4px 4px 0 0 var(--rule-strong);
  font-size: var(--f1); font-weight: 400; line-height: 1.5; white-space: normal; text-align: left; }
.term__tip[hidden] { display: none; }
.term__def { display: block; }
.term__more { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--ink); }
@media print { .term__tip { display: none !important; } .term__btn { text-decoration: none; } }

/* Signage-style table (Research → Interests): black header band, ruled rows, row labels in bold. Stacks on phones. */
.ttable { width: 100%; margin-top: 18px; border-collapse: collapse; border: 2px solid var(--rule-strong); background: var(--surface); }
.ttable thead th { background: var(--ink); color: var(--paper); text-align: left; font-size: var(--f1); font-weight: 700; padding: 10px 16px; letter-spacing: 0.02em; }
.ttable tbody th, .ttable td { padding: 14px 16px; border-top: 2px solid var(--rule-strong); vertical-align: top; text-align: left; }
.ttable tbody th { width: 30%; font-weight: 700; color: var(--ink); }
.ttable td { color: var(--ink-2); border-left: 2px solid var(--rule); }
.ttable tbody tr:hover { background: var(--sunk); }
@media (max-width: 599px) {
  .ttable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ttable, .ttable tbody, .ttable tr, .ttable th, .ttable td { display: block; width: auto; }
  .ttable tbody th { width: auto; background: var(--sunk); padding-bottom: 8px; }
  .ttable td { border-top: 0; border-left: 0; padding-top: 6px; }
}
.ttable--years tbody th { width: 7rem; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .ttable--years tbody th { width: auto; } }
.ttable caption { caption-side: top; text-align: left; font-weight: 700; font-size: var(--f1); color: var(--ink); padding: 0 0 10px; }
.ttable caption.sr { padding: 0; }
.ttable--acro tbody th { width: 4.5rem; font-size: var(--f3); line-height: 1.1; text-align: center; }
.split > .ttable { margin-top: 14px; }
@media (max-width: 599px) { .ttable--acro tbody th { width: auto; text-align: left; } }
/* Tools page: featured tools get wide cards, two across on large screens. */
.signs--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }

/* Share dialog and toast */
.sh { border: 2px solid var(--rule-strong); background: var(--surface); color: var(--ink); padding: 24px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 8px 8px 0 0 var(--rule-strong); }
.sh::backdrop { background: rgba(0, 0, 0, 0.6); }
.sh h2 { font-size: var(--f3); margin-bottom: 14px; }
.sh__body { display: grid; grid-template-columns: 216px 1fr; gap: 20px; align-items: start; }
.sh__img { display: block; width: 216px; height: auto; border: 2px solid var(--rule-strong); }
.sh__status { margin-top: 10px; font-size: var(--f1); color: var(--ink-2); min-height: 1.5em; overflow-wrap: anywhere; }
@media (max-width: 599px) { .sh__body { grid-template-columns: 1fr; } .sh__img { width: 160px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: calc(100vw - 32px); background: var(--ink); color: var(--paper); padding: 12px 18px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media print { .sh, .toast, #share-btn { display: none !important; } }
/* Large screens: tighten the header a little so brand, menu and tools stay on one line. */
@media (min-width: 1200px) {
  .band__inner { padding-left: 40px; padding-right: 40px; gap: 12px; }
  .nav a { padding: 0 10px; }
  .nav { margin-left: -10px; }
  .band__tools { gap: 6px; }
  .tool, .theme-toggle { padding-left: 12px; padding-right: 12px; }
}
.toast { width: max-content; }
.sh__label { display: block; font-size: var(--f1); font-weight: 700; margin-bottom: 6px; }
.sh__url { width: 100%; min-height: var(--tap); padding: 0 12px; border: 2px solid var(--rule-strong); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--f1); }
.sh__actions { margin-top: 14px; }
.sh__actions [hidden] { display: none; }
.sh__note { margin-top: 6px; font-size: var(--f1); color: var(--ink-2); }
@media (max-width: 599px) { .sh__body { grid-template-columns: 1fr; } .sh__img { width: 120px; } .sh__actions .btn { flex: 1 1 100%; justify-content: center; } }
/* Dad page: "On this page" bar. It sticks to the top while reading; on narrow screens the links scroll sideways inside the bar. */
.toc { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 0 -16px 28px; padding: 0 16px; background: var(--paper); border-bottom: 2px solid var(--rule-strong); }
@media (min-width: 720px) { .toc { margin-left: -32px; margin-right: -32px; padding: 0 32px; } }
@media (min-width: 1100px) { .toc { margin-left: -56px; margin-right: -56px; padding: 0 56px; } }
.toc__label { flex: none; margin: 0; font-size: var(--f1); font-weight: 700; color: var(--ink-2); }
@media (max-width: 599px) { .toc__label { display: none; } }
.toc__list { position: relative; display: flex; gap: 2px; flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.toc__list li { flex: none; margin: 0; }
.toc__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; white-space: nowrap; text-decoration: none; color: var(--ink); font-size: var(--f1); border-bottom: 4px solid transparent; }
.toc__list a:hover { border-bottom-color: var(--rule-strong); }
.toc__list a[aria-current="true"] { border-bottom-color: var(--ink); font-weight: 700; }
.toc__list a:focus-visible { outline-offset: -4px; }
html:has(.toc) { scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html:has(.toc) { scroll-behavior: smooth; } }
@media print { .toc { display: none; } }
/* Breadcrumb on sub-pages */
.crumbs { margin: 0 0 8px; font-size: var(--f1); color: var(--ink-2); }
.crumbs a { color: var(--ink); }
@media (min-width: 900px) {
  .toc__list { flex-wrap: wrap; overflow: visible; }
  .toc__list a { min-height: 38px; }
  html:has(.toc) { scroll-padding-top: 110px; }
}
/* Explanatory animations (Dad page and dissertation page): one ink colour, thin lines, a pause button. */
.anims { display: grid; gap: 20px; align-content: start; margin-top: 14px; }
.anim { margin: 0; border: 2px solid var(--rule-strong); background: var(--surface); }
.anim svg { display: block; width: 100%; height: auto; }
.anim .an-dot { fill: var(--ink); }
.anim .an-ring, .anim .an-cone { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.anim .an-trail { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 5; }
.anim .an-grid line { stroke: var(--ink-2); stroke-width: 0.75; opacity: 0.5; }
.anim .an-axis { stroke: var(--ink-2); stroke-width: 1.5; }
.anim .an-label { fill: var(--ink-2); font-size: 14px; font-family: inherit; }
.anim figcaption { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; border-top: 2px solid var(--rule-strong); font-size: var(--f1); color: var(--ink-2); }
.anim__btn { flex: none; min-height: 36px; padding: 0 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.anim__btn:hover { background: var(--surface); }
@media print { .anim__btn { display: none; } }
.anims > .gallery { margin: 0; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .anims:has(> .gallery) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .anims:has(> .gallery) > .gallery { grid-row: span 2; }
}
/* Portraits in explainers */
.term__photo { float: left; width: 64px; height: 80px; object-fit: cover; margin: 2px 12px 4px 0; border: 1px solid var(--rule-strong); }
.term__credit { display: block; clear: both; margin-top: 8px; font-size: 0.8em; color: var(--ink-2); }
.term__credit a { color: inherit; }
/* Portrait strips on the Dad page */
.faces { list-style: none; margin: 20px 0 8px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); }
.faces figure { margin: 0; }
.faces img { display: block; width: 100%; height: auto; border: 2px solid var(--rule-strong); }
.faces figcaption { display: grid; gap: 2px; padding-top: 8px; font-size: var(--f1); color: var(--ink-2); }
.faces figcaption b { color: var(--ink); }
.faces small { font-size: 0.85em; }
.faces small a { color: inherit; }
