/* kamyarzeinalipour.github.io
   Palette: Siena. Warm near-black ink on stone paper, one burnt sienna accent
   (the pigment named after the city's earth), as on the SAILab site. Type: Spectral for display voice,
   Vazirmatn for interface text because one family covers Latin, Arabic and
   Persian, which the content needs. */

:root {
  color-scheme: light;
  --paper: #faf8f5;
  --paper-2: #f1ede7;
  --ink: #1c1917;
  --ink-2: #57534e;
  --rule: #e2ddd5;
  --rule-strong: #c4bdb2;
  --accent: #9a3412;
  --accent-soft: #f6e3d8;
  --cell: #ffffff;
  --block: #292524;
  --shadow: 0 18px 40px -28px rgba(28, 25, 23, 0.5);
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Vazirmatn", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 66ch;
  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --wrap: 72rem;
}
@media (min-width: 100rem) { :root { --wrap: 84rem; } }
@media (min-width: 135rem) { :root { --wrap: 94rem; } }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141110;
  --paper-2: #1c1816;
  --ink: #f2ede6;
  --ink-2: #aaa29b;
  --rule: #2e2825;
  --rule-strong: #4a423c;
  --accent: #e8845a;
  --accent-soft: #3a2620;
  --cell: #25201d;
  --block: #0a0908;
  --shadow: 0 18px 44px -30px rgba(0, 0, 0, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141110;
    --paper-2: #1c1816;
    --ink: #f2ede6;
    --ink-2: #aaa29b;
    --rule: #2e2825;
    --rule-strong: #4a423c;
    --accent: #e8845a;
    --accent-soft: #3a2620;
    --cell: #25201d;
    --block: #0a0908;
    --shadow: 0 18px 44px -30px rgba(0, 0, 0, 0.9);
  }
}

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

html { -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: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }

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

button, select { font: inherit; color: inherit; }
button:not(:disabled), select:not(:disabled), summary, a[href] { cursor: pointer; }
button:disabled { cursor: not-allowed; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; }
p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-inline: var(--gut); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip:focus { left: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.masthead-in {
  display: flex; align-items: center; gap: 0.9rem;
  min-height: 3.4rem;
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.01em; text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
/* The mark: a K drawn as a small graph, its lead node in the accent, as on the home graph. */
.wordmark .mark { width: 1.75rem; height: 1.75rem; flex: none; overflow: visible; }
.mark .mk-l { fill: none; stroke: var(--ink-2); stroke-width: 2.6; stroke-linecap: round; }
.mark .mk-n { fill: var(--ink); }
.mark .mk-a { fill: var(--accent); }
.mast-link {
  font-size: 0.85rem; color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid var(--rule-strong); padding-bottom: 1px;
}
.mast-link:hover, .mast-link:focus-visible { color: var(--ink); border-color: var(--accent); }
@media (max-width: 34rem) { .mast-link { display: none; } }

.nav { border-top: 1px solid var(--rule); }
.nav-in {
  display: flex; gap: clamp(0.9rem, 2.4vw, 1.9rem);
  overflow-x: auto; scrollbar-width: none;
  padding-block: 0.55rem;
}
.nav-in::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; font-size: 0.93rem; color: var(--ink-2);
  white-space: nowrap; padding-block: 0.15rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
@media (max-width: 40rem) {
  .nav-in { flex-wrap: wrap; gap: 0.1rem 1.05rem; overflow: visible; padding-block: 0.35rem 0.45rem; }
  .nav a { padding-block: 0.2rem; }
}
/* 15: on a phone the header gets out of the way while reading down, and comes back on the way up */
@media (max-width: 40rem) {
  .masthead.tucked { transform: translateY(-100%); }
}
@media (max-width: 40rem) and (prefers-reduced-motion: no-preference) {
  .masthead { transition: transform 240ms ease; }
}

.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 0.3rem 0.75rem; font-size: 0.8rem; color: var(--ink-2);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle:active { transform: translateY(1px); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 62rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

h1 {
  font-size: clamp(2.2rem, 1.3rem + 3.5vw, 3.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
h1 .line2 { display: block; font-style: italic; font-weight: 300; color: var(--ink-2); }
.lede { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem); color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 600; }

.id-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.7rem;
  margin-top: 1.6rem; padding: 0; list-style: none;
}
.id-row a {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 0.3rem 0.7rem; font-size: 0.85rem; color: var(--ink-2);
}
.id-row a:hover, .id-row a:focus-visible { border-color: var(--accent); color: var(--ink); }

.langs {
  margin-top: 2rem; padding-top: 1.1rem; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem;
  font-size: 0.93rem; color: var(--ink-2);
}
.langs b { font-weight: 500; color: var(--ink); }

/* ---------- crossword ---------- */
.puzzle-panel { position: relative; }
.puzzle-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem;
}
.puzzle-head h2 { font-size: 1rem; font-family: var(--sans); font-weight: 600; }
.puzzle-head p { margin: 0; font-size: 0.85rem; color: var(--ink-2); }

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 2px;
  width: min(100%, 25rem);
  padding: 2px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
}
.cell { position: relative; aspect-ratio: 1; background: var(--block); }
.cell.on { background: var(--cell); }
.cell.on::after {
  content: attr(data-ch);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(0.8rem, 2.6vw, 1.1rem);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
}
.cell.filled::after { opacity: 1; }
.cell .num {
  position: absolute; top: 1px; left: 2px;
  font-size: 0.52rem; line-height: 1; color: var(--ink-2);
  pointer-events: none; z-index: 1;
}
.cell.lit { background: var(--accent-soft); }
.cell.lit::after { color: var(--accent); }
.cell.seed::after { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .cell.on::after { transition: opacity 260ms ease; }
  .cell { transition: background-color 180ms ease; }
}

.clues { margin-top: 1.35rem; }
.clue-dir {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  color: var(--ink-2); margin: 0 0 0.4rem;
}
.clue-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.clue-list li { margin-bottom: 0.1rem; }
.clue-btn {
  display: flex; gap: 0.55rem; width: 100%; text-align: start;
  background: none; border: 0; border-radius: 3px;
  padding: 0.3rem 0.4rem; font-size: 0.9rem; line-height: 1.45;
  color: var(--ink-2);
}
.clue-btn b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.clue-btn:hover, .clue-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); }
.clue-answer {
  margin: 0.1rem 0 0.5rem 1.55rem; padding-left: 0.8rem;
  border-left: 2px solid var(--accent);
  font-size: 0.85rem; color: var(--ink-2);
}
.clue-answer a { color: var(--accent); }
.clue-answer[hidden] { display: none; }

/* ---------- generic section ---------- */
.band { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.band-alt { background: var(--paper-2); }
.band > .wrap > h2 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
  letter-spacing: -0.015em; margin-bottom: 0.6rem;
}
.band-intro { color: var(--ink-2); max-width: 54ch; }

/* ---------- research lines ---------- */
.lines { display: grid; gap: 1px; background: var(--rule); margin-top: 2.5rem; border-block: 1px solid var(--rule); }
@media (min-width: 55rem) { .lines { grid-template-columns: 1fr 1fr; } }
.line { background: var(--paper); padding: clamp(1.4rem, 3vw, 2rem); }
.line.wide { grid-column: 1 / -1; display: grid; gap: 1.4rem; }
@media (min-width: 55rem) { .line.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; } }
.band-alt .line { background: var(--paper-2); }
.line h3 { font-size: 1.25rem; margin-bottom: 0.55rem; }
.line.wide h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.line p { color: var(--ink-2); font-size: 0.93rem; margin-bottom: 0.7rem; }
.line p:last-child { margin-bottom: 0; }
.line .cite { font-size: 0.85rem; }
.line .cite a { color: var(--accent); }

/* ---------- figure ---------- */
.figure { margin: 2.5rem 0 0; }
.figure figcaption { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.7rem; max-width: 52ch; }
.chart { width: 100%; height: auto; display: block; max-width: 40rem; }
.chart .bar { fill: var(--accent); }
.chart .axis { stroke: var(--rule-strong); }
.chart .tick { fill: var(--ink-2); font-size: 12px; font-family: var(--sans); }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--sans); }
@media (prefers-reduced-motion: no-preference) {
  .chart .bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
  .chart.shown .bar { transform: scaleY(1); transition: transform 700ms cubic-bezier(0.2, 0.7, 0.3, 1); }
  .chart.shown .bar:nth-child(2) { transition-delay: 70ms; }
  .chart.shown .bar:nth-child(3) { transition-delay: 140ms; }
  .chart.shown .bar:nth-child(4) { transition-delay: 210ms; }
}

/* ---------- papers ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  margin: 2rem 0 1.6rem; padding: 0; border: 0;
}
.filters legend { padding: 0; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 0.5rem; }
.chip {
  background: none; border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 0.33rem 0.85rem; font-size: 0.85rem; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.papers { list-style: none; margin: 0; padding: 0; }
.year-head {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 300;
  color: var(--ink-2); padding-top: 1.6rem; margin-bottom: 0.2rem;
  border-top: 1px solid var(--rule);
}
.year-head h2 { font: inherit; }
.paper { display: grid; gap: 0.15rem 1.2rem; padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 48rem) {
  .paper { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .paper > h3, .paper > .authors, .paper > .meta { grid-column: 1; }
  .paper > .side { grid-column: 2; grid-row: 1 / -1; align-self: center; }
}
.paper h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.paper h3 a { text-decoration-color: var(--rule-strong); }
.paper .meta { font-size: 0.85rem; color: var(--ink-2); }
.paper .authors { font-size: 0.85rem; color: var(--ink-2); }
.paper .side { display: flex; align-items: center; gap: 0.8rem; font-size: 0.8rem; color: var(--ink-2); }
.paper .side a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.cites { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-note { padding: 2rem 0; color: var(--ink-2); }

/* ---------- releases ---------- */
.rel-table { width: 100%; border-collapse: collapse; margin-top: 2rem; font-size: 0.93rem; }
.rel-table caption { text-align: start; color: var(--ink-2); font-size: 0.85rem; padding-bottom: 0.8rem; }
.rel-table th, .rel-table td { text-align: start; padding: 0.7rem 0.9rem 0.7rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rel-table th { font-weight: 600; font-size: 0.8rem; color: var(--ink-2); text-transform: none; }
.rel-table td.what { color: var(--ink-2); }
.rel-table td.links { white-space: nowrap; }
.rel-table td.links a + a { margin-left: 1rem; }
.rel-table a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.rel-table tbody tr:hover { background: var(--accent-soft); }
@media (max-width: 44rem) {
  .rel-table, .rel-table tbody, .rel-table tr, .rel-table td { display: block; width: 100%; }
  .rel-table thead { position: absolute; left: -9999px; }
  .rel-table tr { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
  .rel-table td { border: 0; padding: 0.1rem 0; }
  .rel-table caption { display: block; width: 100%; }
}

/* ---------- path ---------- */
.path { list-style: none; margin: 2.2rem 0 0; padding: 0; }
.path li { display: grid; gap: 0.2rem 1.5rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 48rem) { .path li { grid-template-columns: 12rem minmax(0, 1fr); } }
.path .when { font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.path h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.path .where { color: var(--accent); font-weight: 500; }
.path p { font-size: 0.93rem; color: var(--ink-2); margin: 0.2rem 0 0; }

/* ---------- about ---------- */
.about-grid { display: grid; gap: clamp(1.8rem, 4vw, 3rem); margin-top: 1.5rem; }
@media (min-width: 55rem) { .about-grid { grid-template-columns: 19rem minmax(0, 1fr); align-items: start; } }
.portrait {
  width: 100%; max-width: 15rem; height: auto; display: block;
  border: 1px solid var(--rule-strong);
  filter: grayscale(1) contrast(1.05);
}
.about-text p { font-size: 1.05rem; }

/* ---------- contact + footer ---------- */
.contact-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; padding: 0; margin: 1.2rem 0 0; list-style: none; font-size: 0.93rem; }
.contact-links a { color: var(--accent); }
.site-foot { border-top: 1px solid var(--rule); padding-block: 2rem 2.5rem; font-size: 0.85rem; color: var(--ink-2); }
.site-foot p { max-width: none; margin: 0; }
.site-foot .foot-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }


/* ---------- page heads ---------- */
.page-head { padding-block: clamp(2.2rem, 6vw, 3.6rem) clamp(1rem, 2vw, 1.5rem); }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); margin-bottom: 0.7rem; }
.wrap.narrow { max-width: 46rem; margin-inline: auto; }
.wrap.narrow p { max-width: none; }

/* ---------- hero extras ---------- */
.counts { margin-top: 1.4rem; font-size: 0.9rem; color: var(--ink-2); }
.counts a { color: var(--accent); }
.hero-side { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.side-h { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 1.2rem; }

/* ---------- built ---------- */
.built { padding-bottom: 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--rule); }
.built:last-child { border-bottom: 0; margin-bottom: 0.4rem; }
.built .kind { font-size: 0.8rem; color: var(--ink-2); margin: 0 0 0.15rem; }
.built :is(h2, h3) { font-size: 1.3rem; margin-bottom: 0.45rem; }
.built p { font-size: 0.93rem; color: var(--ink-2); margin-bottom: 0.5rem; }
.built .cite a { color: var(--accent); }

/* ---------- updates ---------- */
.updates { list-style: none; margin: 1.6rem 0 1.2rem; padding: 0; counter-reset: none; }
.updates li { display: grid; gap: 0.25rem 1.5rem; padding: 1.15rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 48rem) { .updates li { grid-template-columns: 13rem minmax(0, 1fr); } }
.updates .when { font-size: 0.85rem; color: var(--ink-2); margin: 0; }
.updates p { margin: 0 0 0.35rem; }
.updates .cite { margin: 0; font-size: 0.85rem; }
.updates .cite a { color: var(--accent); }

/* ---------- crossword page ---------- */
.puzzle-layout { display: grid; gap: clamp(1.8rem, 4vw, 3rem); align-items: start; }
@media (min-width: 58rem) { .puzzle-layout { grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); } }
.puzzle-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.puzzle-status { margin-top: 0.9rem; font-size: 0.9rem; color: var(--ink-2); min-height: 2.6em; }
.puzzle-teaser { background: var(--accent-soft); padding: clamp(1.1rem, 2.5vw, 1.5rem); align-self: start; }
.puzzle-teaser h4 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; }
.puzzle-teaser p { font-size: 0.93rem; color: var(--ink-2); margin-bottom: 0.6rem; }
.puzzle-teaser .cite a { color: var(--accent); font-weight: 500; }

.letter {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 0; background: transparent; padding: 0;
  text-align: center; text-transform: uppercase;
  font-family: var(--sans); font-weight: 600;
  font-size: max(16px, clamp(0.85rem, 2.7vw, 1.15rem));
  color: var(--ink); caret-color: var(--accent);
}
.letter:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.letter.wrong { color: #c0392b; }
:root[data-theme="dark"] .letter.wrong { color: #ff9b8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .letter.wrong { color: #ff9b8a; } }

.clue-btn[aria-current="true"] { background: var(--accent-soft); color: var(--ink); }
.clue-list li.solved .clue-btn b { color: var(--accent); }
.clue-list li.solved .clue-btn span { text-decoration: line-through; text-decoration-color: var(--rule-strong); }

/* ---------- research lines with figures ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 1.4rem; font-size: 0.9rem; }
.toc a { color: var(--accent); }
.rline { padding-block: clamp(2.6rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); }
.rline:nth-of-type(even) { background: var(--paper-2); }
.rline-in { display: grid; gap: clamp(1.8rem, 4vw, 3.2rem); align-items: start; }
@media (min-width: 58rem) {
  .rline-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .rline.flip .rtext { order: 2; }
}
.rtext h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); letter-spacing: -0.01em; margin-bottom: 0.8rem; }
.rtext p { color: var(--ink-2); }
.rtext .cite a { color: var(--accent); }
.links a + a { margin-left: 1rem; }
.rfig { margin: 0; }
.rfig figcaption { margin-top: 0.8rem; font-size: 0.85rem; color: var(--ink-2); max-width: 50ch; }
.rfig figcaption a { color: var(--accent); }
.rfig.stack { display: grid; gap: 2.2rem; }
.rfig.stack figure { margin: 0; }
.fig-progress, .fig-note { font-size: 0.85rem; color: var(--ink-2); margin: 0 0 0.8rem; }
.fig-note { margin: 0.8rem 0; min-height: 1.4em; }
.rline .puzzle-teaser h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* one instruction, five languages */
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.seg button {
  background: none; border: 0; border-right: 1px solid var(--rule-strong);
  padding: 0.45rem 0.85rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); min-width: 44px; min-height: 40px;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); background: var(--accent-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg + div .fig-progress { margin: 1rem 0 0.3rem; }
.typed {
  margin: 0; min-height: 4em; max-width: 34ch;
  font-family: var(--serif); font-size: clamp(1.2rem, 1rem + 0.9vw, 1.55rem); line-height: 1.3;
}
.typed-a { margin: 0.6rem 0 0; max-width: 46ch; min-height: 4.8em; font-family: var(--serif); font-style: italic; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .typed-a { opacity: 0; transform: translateY(4px); transition: opacity 400ms ease, transform 400ms ease; }
  .typed-a.in { opacity: 1; transform: none; }
}
.typed::after { content: ""; display: inline-block; width: 2px; height: 0.95em; margin-left: 3px; vertical-align: -0.1em; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .typed::after { animation: caret 1s steps(2) 6; } }
@keyframes caret { 50% { opacity: 0; } }

/* ArabicSense */
.sense-pair { display: grid; gap: 0.7rem; }
.sense-opt {
  display: grid; gap: 0.35rem; text-align: start; width: 100%;
  background: var(--cell); border: 1px solid var(--rule-strong); border-radius: 4px;
  padding: 0.9rem 1rem; color: var(--ink);
}
.sense-opt:hover:not([aria-disabled="true"]) { border-color: var(--accent); }
.sense-opt[aria-disabled="true"] { cursor: default; }
.sense-opt .ar { font-size: 1.05rem; line-height: 1.7; text-align: right; }
.sense-opt .gloss { font-size: 0.85rem; color: var(--ink-2); }
.sense-opt.is-sense { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.sense-opt.is-nonsense { opacity: 0.62; }
.sense-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.sense-foot .fig-note { margin: 0.8rem 0; flex: 1 1 18rem; }

/* surprisal */
.surp { list-style: none; margin: 0 0 1rem; padding: 0; }
.surp li { display: grid; gap: 0.3rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 34rem) { .surp li { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: center; gap: 1rem; } }
.surp-label { display: grid; gap: 0.05rem; }
.clue-it { font-weight: 600; font-size: 0.93rem; }
.clue-gloss { font-size: 0.8rem; color: var(--ink-2); }
.surp-ans { font-size: 0.85rem; color: var(--accent); }
.surp-ans b { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.surp-track { display: flex; align-items: center; gap: 0.5rem; }
.surp-bar { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--accent); width: var(--w); }
.surp-val { font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 2.4em; }
@media (prefers-reduced-motion: no-preference) {
  .surp .surp-bar { width: 0; transition: width 900ms cubic-bezier(0.2, 0.7, 0.3, 1); }
  .surp.grown .surp-bar { width: var(--w); }
  .surp.grown li:nth-child(n) .surp-bar { transition-delay: calc(var(--i, 0) * 60ms); }
}

/* protein */
.aa-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; max-width: 26rem; }
.aa {
  aspect-ratio: 1; display: grid; place-items: center; padding: 0;
  background: var(--cell); border: 1px solid var(--rule-strong); border-radius: 2px;
  font-family: var(--sans); font-weight: 600; font-size: clamp(0.8rem, 2.4vw, 1rem); color: var(--ink);
}
.aa:hover, .aa:focus-visible { background: var(--accent-soft); border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .aa { opacity: 0; transform: translateY(4px); transition: opacity 220ms ease, transform 220ms ease; }
  .aa.in { opacity: 1; transform: none; }
}

/* knowledge graph */
.kg { width: 100%; height: auto; max-width: 40rem; display: block; margin-bottom: 0.9rem; }
.kg-node { fill: var(--cell); stroke: var(--ink); stroke-width: 1.2; }
.kg-label { fill: var(--ink); font: 600 12px var(--sans); }
.kg-rel { fill: var(--ink-2); font: 12px var(--sans); }
.kg-edge { stroke: var(--ink-2); stroke-width: 1.2; }
.kg-card { fill: var(--accent-soft); stroke: var(--rule-strong); }
.kg-sent { fill: var(--ink); font: 12px var(--serif); }
.kg-arrow { stroke: var(--accent); stroke-width: 2; fill: none; marker-end: none; }
.kg-score { fill: var(--accent); font: 600 12px var(--sans); }
.kg-right .kg-node { stroke: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .kg .kg-left, .kg .a1, .kg .kg-text, .kg .a2, .kg .kg-right, .kg .kg-score { opacity: 0; }
  .kg.run .kg-left { animation: kgin 500ms ease forwards; }
  .kg.run .a1 { animation: kgin 300ms ease 550ms forwards; }
  .kg.run .kg-text { animation: kgin 500ms ease 900ms forwards; }
  .kg.run .a2 { animation: kgin 300ms ease 1500ms forwards; }
  .kg.run .kg-right { animation: kgin 500ms ease 1850ms forwards; }
  .kg.run .kg-score { animation: kgin 400ms ease 2400ms forwards; }
  .kg.done * { opacity: 1; }
}
@keyframes kgin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* built and shipped, research page */
.built-grid { display: grid; gap: 0 clamp(1.5rem, 4vw, 3rem); margin-top: 1.6rem; }
@media (min-width: 52rem) { .built-grid { grid-template-columns: 1fr 1fr; } }
.built-grid .built { border-bottom: 1px solid var(--rule); margin-bottom: 0; padding: 1.2rem 0 1.4rem; }
.built-grid .built:last-child { border-bottom: 1px solid var(--rule); }

.crumb { margin: 0 0 0.6rem; font-size: 0.9rem; }
.crumb a { color: var(--accent); }

/* a page title followed directly by content needs less air between them */
.page-head + .band { padding-top: clamp(1rem, 3vw, 1.8rem); }
.page-head + .band .built-grid { margin-top: 0; }

/* about photo: the UNESCO talk, shown in colour */
.photo { margin: 0; max-width: 22rem; }
.photo img { display: block; width: 100%; height: auto; border-radius: 2px; }
.photo figcaption {
  margin-top: 0.7rem; padding-top: 0.6rem; border-top: 2px solid var(--accent);
  font-size: 0.9rem; color: var(--ink-2);
}
.photo figcaption b { color: var(--ink); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }

/* ---------- home: the work as a graph ---------- */
.hero-graph { margin: 0; }
.hero-graph figcaption { font-size: 0.8rem; color: var(--ink-2); margin-top: 0.3rem; }
.wg { width: 100%; height: auto; display: block; overflow: visible; }
.wg-edge { stroke: var(--rule-strong); stroke-width: 0.8; opacity: 0; transition: opacity 600ms ease, stroke 200ms ease; }
.wg-edge.lang { stroke-dasharray: 2 3; }
.wg.assembled .wg-edge { opacity: 0.75; }
.wg-node { transition: opacity 240ms ease; }
.wg-node circle { transform-box: fill-box; transform-origin: center;
  transition: opacity 200ms ease, fill 200ms ease, transform 260ms cubic-bezier(0.3, 1.5, 0.5, 1); }
.wg-node.topic circle { fill: var(--ink); }
.wg-node.lang circle { fill: var(--paper); stroke: var(--accent); stroke-width: 2; }
.wg-node.paper circle { fill: var(--ink-2); }
.wg-node.paper, .wg-node.topic, .wg-node.lang { cursor: pointer; }
.wg-node.paper:hover circle { fill: var(--accent); }
/* Open European LLMs (Villanova) is the lead line of work: amber node, amber label, model releases as diamonds */
.wg-node.topic.lead circle { fill: var(--accent); }
.wg-node.topic.lead .wg-label { fill: var(--accent); font-size: 17px; font-weight: 700; }
.wg-node.release rect { fill: var(--accent); stroke: var(--paper); stroke-width: 1.5; transition: opacity 200ms ease; }
.wg-node.release { cursor: pointer; }
.wg-node.release:hover rect { fill: var(--ink); }
.wg.focus .wg-node.on.release rect { fill: var(--accent); }
.wg-key.topic.lead { border-color: var(--accent); color: var(--accent); }
.wg-key.topic.lead[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.wg-label { font: 600 15px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.wg-node.lang .wg-label { font-weight: 500; fill: var(--ink-2); }
.wg.focus .wg-node:not(.on), .wg.focus .wg-edge:not(.on) { opacity: 0.12; }
.wg.focus .wg-edge.on { opacity: 1; stroke: var(--accent); stroke-width: 1.4; }
.wg.focus .wg-node.on.paper circle { fill: var(--accent); }
.wg-status { margin: 0.4rem 0 0.7rem; font-size: 0.85rem; color: var(--ink-2); min-height: 2.7em; }
.wg-keys { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.wg-key {
  background: none; border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 0.25rem 0.6rem; font-size: 0.8rem; color: var(--ink-2); min-height: 32px;
}
.wg-key.topic { color: var(--ink); font-weight: 600; }
.wg-key:hover { border-color: var(--accent); color: var(--ink); }
.wg-key[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (pointer: coarse) { .wg-key { min-height: 44px; } }
.built-grid.built-3 { margin-top: 1.4rem; }
@media (min-width: 62rem) { .built-grid.built-3 { grid-template-columns: repeat(3, 1fr); } }

/* the graph scales with the column; keep its labels legible on phones */
@media (max-width: 40rem) { .wg-label { font-size: 21px; } .wg-node.topic circle { r: 12px; } .wg-node.topic.lead circle { r: 15px; } .wg-node.topic.lead .wg-label { font-size: 23px; } }

/* ---------- home: the showcase, one scene per research area ---------- */
.hero-solo h1 { max-width: 22ch; }
.hero-solo .lede { max-width: 62ch; }
.showcase { background: var(--paper-2); border-block: 1px solid var(--rule); padding-block: clamp(2rem, 5vw, 3.5rem); }
.stage { display: grid; gap: 1.4rem 2.6rem; }
@media (min-width: 60rem) { .stage { grid-template-columns: 15.5rem minmax(0, 1fr); align-items: start; } }
.st-side { display: grid; gap: 0.8rem; align-content: start; }
.st-list { display: flex; flex-direction: column; gap: 3px; }
.st-tab {
  position: relative; display: block; width: 100%; text-align: start;
  background: none; border: 0; border-radius: 6px; padding: 0.6rem 0.8rem 0.8rem; color: var(--ink-2);
}
.st-tab:hover { background: color-mix(in srgb, var(--cell) 60%, transparent); }
.st-tab[aria-selected="true"] { background: var(--cell); box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08); }
.st-tab-title { display: block; font: 600 1.05rem/1.25 var(--serif); color: var(--ink); }
.st-tab-sub { display: block; font-size: 0.8rem; margin-top: 0.12rem; color: var(--ink-2); }
.st-prog { position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.35rem; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
@keyframes stprog { to { transform: scaleX(1); } }
@media (max-width: 59.99rem) {
  .st-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 0.25rem; }
  .st-tab { padding: 0.45rem 0.6rem 0.65rem; }
  .st-tab-title { font-size: 1rem; }
  .st-tab-sub { display: none; }
  .st-prog { left: 0.6rem; right: 0.6rem; }
}
.st-tour {
  justify-self: start; background: none; border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 0.3rem 0.9rem; font-size: 0.8rem; color: var(--ink-2); min-height: 36px;
}
.st-tour:hover { border-color: var(--accent); color: var(--ink); }
.st-main { min-width: 0; }
.st-cap { margin-bottom: 1rem; }
.st-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin-bottom: 0.4rem; }
.st-text { color: var(--ink-2); max-width: 62ch; margin-bottom: 0.4rem; }
.st-cap .links a { color: var(--accent); }
.st-view { max-width: 50rem; }
@media (prefers-reduced-motion: no-preference) {
  .st-view { opacity: 0; transform: translateY(8px); }
  .st-view.in { opacity: 1; transform: none; transition: opacity 420ms ease, transform 420ms ease; }
}
.st-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* languages */
.st-code { font: 600 12px var(--sans); fill: var(--ink-2); }
.st-rule { stroke: var(--rule); stroke-width: 1; }
.st-chip { fill: var(--cell); stroke: var(--rule-strong); stroke-width: 1; transition: fill 200ms ease, stroke 200ms ease; }
.st-word { font: 500 13.5px var(--sans); fill: var(--ink); }
.st-tok.now .st-chip { fill: var(--accent-soft); stroke: var(--accent); }
/* crossword */
.st-cell { fill: var(--cell); stroke: var(--rule-strong); stroke-width: 1; }
.st-block { fill: var(--block); }
.st-letter { font: 600 16px var(--sans); fill: var(--ink); }
.st-letter.live { fill: var(--accent); }
.st-clue-num { font: 600 12px var(--sans); fill: var(--ink-2); }
.st-clue-text { font: 400 16px var(--serif); fill: var(--ink); }
.st-clue-ans { font: 700 19px var(--sans); fill: var(--accent); letter-spacing: 0.08em; }
/* protein and molecule */
.st-bead circle { fill: var(--cell); stroke: var(--accent); stroke-width: 2; }
.st-bead text { font: 600 12px var(--sans); fill: var(--ink); }
.st-bead.small text { font-size: 12px; }
.st-bond { stroke: var(--ink-2); stroke-width: 1.6; }
.st-caption { font: 500 13.5px var(--sans); fill: var(--ink-2); }
.st-flow { stroke: var(--accent); stroke-width: 2; fill: none; }
.st-model { fill: var(--accent-soft); stroke: var(--rule-strong); }
.st-model-t { font: 600 15px var(--serif); fill: var(--ink); }
.st-mbond { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.st-atom { fill: var(--accent); }
/* knowledge graph */
.st-edge { stroke: var(--ink-2); stroke-width: 1.3; }
.st-rel { font: 12px var(--sans); fill: var(--ink-2); }
.st-node { fill: var(--cell); stroke: var(--ink); stroke-width: 1.2; }
.st-g.right .st-node { stroke: var(--accent); stroke-width: 1.6; }
.st-node-t { font: 600 13.5px var(--sans); fill: var(--ink); }
.st-card { fill: var(--accent-soft); stroke: var(--rule-strong); }
.st-sent-t { font: 15px var(--serif); fill: var(--ink); }
.st-score { font: 600 13.5px var(--sans); fill: var(--accent); }

/* scene extras: kicker, language threads */
.st-kicker { font: 600 13.5px var(--sans); fill: var(--ink-2); }
.st-thread { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.st-thread.sky { stroke: var(--ink-2); stroke-dasharray: 4 5; }
.st-thread.blue { stroke: var(--accent); }
.aligned .st-tok.blue .st-chip { fill: var(--accent); stroke: var(--accent); }
.aligned .st-tok.blue .st-word { fill: var(--paper); font-weight: 700; }
.aligned .st-tok.sky .st-chip { stroke: var(--ink); stroke-width: 1.6; }
/* benchmarks */
.st-sense-box { fill: var(--cell); stroke: var(--rule-strong); transition: stroke 300ms ease; }
.st-ar { font: 500 17px var(--sans); fill: var(--ink); }
.st-gloss { font: 12px var(--sans); fill: var(--ink-2); }
.st-strike { stroke: var(--ink-2); stroke-width: 1.6; transition: opacity 300ms ease; }
.st-tag { font: 600 12px var(--sans); fill: var(--ink-2); }
.st-sense { transition: opacity 400ms ease; }
.st-sense.is-sense .st-sense-box { stroke: var(--accent); stroke-width: 2.4; }
.st-sense.is-sense .st-tag { fill: var(--accent); }
.st-sense.is-nonsense { opacity: 0.45 !important; }
/* measuring */
.st-clue-it { font: 600 13.5px var(--sans); fill: var(--ink); }
.st-bar { fill: var(--accent); }
.st-val { font: 600 12px var(--sans); fill: var(--ink); dominant-baseline: middle; transform: translateY(-5px); }
.st-ans { font: 700 12px var(--sans); fill: var(--accent); letter-spacing: 0.06em; }
.st-bead circle { r: 15px; }
.st-bead text { font-size: 13.5px; }

/* real 3D structures */
.m3-seq { font: 600 12px/1.9 var(--sans); letter-spacing: 0.06em; word-break: break-all; margin: 0 0 0.6rem; max-width: 50rem; }
.m3-seq span { transition: opacity 200ms ease, background-color 150ms ease; border-radius: 2px; padding: 0 1px; }
@media (prefers-reduced-motion: no-preference) { .m3-seq span { opacity: 0; } .m3-seq span.in { opacity: 1; } }
.m3-seq span.hot { background: var(--ink); color: var(--paper) !important; }
.m3-box { position: relative; width: 100%; aspect-ratio: 640 / 460; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--cell); overflow: hidden; cursor: grab; }
.m3-box:active { cursor: grabbing; }
@media (prefers-reduced-motion: no-preference) { .m3-box canvas { opacity: 0; transition: opacity 700ms ease; } .m3-box.ready canvas { opacity: 1; } }
.m3-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 1rem; text-align: center; font-size: 0.9rem; color: var(--ink-2); max-width: none; }
.m3-status.err { color: var(--ink); }
.m3-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.85rem; color: var(--ink-2); margin: 0.6rem 0 0; }
.m3-legend .key::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; border-radius: 2px; margin-right: 0.4em; vertical-align: -0.1em; }
.m3-legend .prot::before { background: linear-gradient(90deg, #5b3a29, #a8988a, #d9693f); }
.m3-legend .drug::before { background: #d9693f; border-radius: 50%; }
.m3-legend .pocket::before { background: #7d8f91; height: 0.25em; vertical-align: 0.2em; }

/* ---------- home: story layout at the top ---------- */
.hero-top { padding-block: clamp(1.8rem, 4vw, 2.8rem) clamp(1rem, 2.5vw, 1.6rem); }
.hero-top h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); max-width: none; margin-bottom: 0.7rem; }
/* one short amber line under the headline: the work beyond languages */
.hero-also { font: italic 300 clamp(1.15rem, 1rem + 0.6vw, 1.5rem)/1.35 var(--serif); color: var(--accent); margin: 0 0 0.7rem; text-wrap: balance; }
.role-line { color: var(--ink-2); font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.05rem); max-width: 70ch; margin: 0; }
.showcase { padding-block: clamp(1.6rem, 4vw, 2.6rem); }
.st-story { padding: 0.2rem 0.8rem 0.9rem; }
.st-story-text { font-size: 0.93rem; line-height: 1.6; color: var(--ink); margin: 0 0 0.5rem; }
.st-story .links a { color: var(--accent); font-size: 0.9rem; }
@media (prefers-reduced-motion: no-preference) {
  .st-story { opacity: 0; transform: translateY(-4px); }
  .st-story.in { opacity: 1; transform: none; transition: opacity 360ms ease 120ms, transform 360ms ease 120ms; }
}
@media (min-width: 60rem) {
  .stage { grid-template-columns: 19rem minmax(0, 1fr); }
  .st-tab[aria-selected="true"] { border-radius: 6px 6px 0 0; }
  .st-tab[aria-selected="true"] + .st-story { background: var(--cell); border-radius: 0 0 6px 6px; box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08); }
}
@media (max-width: 59.99rem) { .st-story { padding: 0.9rem 0 0; } }
.intro .lede { max-width: 66ch; }
/* knowledge graph scene: the paper's Komodo dragon example */
.st-hub { fill: var(--ink); }
.st-hub-t { font: 600 13.5px var(--serif); fill: var(--paper); }
.st-track { fill: var(--rule); }
.st-sim.keep { fill: var(--accent); }
.st-sim.drop { fill: var(--ink-2); }
.st-simval { font: 600 12px var(--sans); fill: var(--ink-2); }
.st-verdict { font: 700 12px var(--sans); }
.st-verdict.keep { fill: var(--accent); }
.st-verdict.drop { fill: var(--ink-2); }
.st-kg-card .st-card { transition: stroke 300ms ease; }
.st-kg-card.keep.decided .st-card { stroke: var(--accent); stroke-width: 2; }
.st-kg-card.drop.decided { opacity: 0.62 !important; }
.st-sent-t { font-size: 13.5px; }

/* ---------- scene styles, round 3 ---------- */
.st-dot { fill: var(--rule-strong); transition: fill 200ms ease; }
.st-dot.on { fill: var(--accent); }
/* Multi-SFT cards */
.st-msft-card { fill: var(--cell); stroke: var(--rule); }
.st-msft-code { font: 700 12px var(--sans); fill: var(--accent); }
.st-msft-src { font: 500 12px var(--sans); fill: var(--ink-2); }
.st-qa { font: 700 12px var(--sans); fill: var(--ink-2); }
.st-qa.a { fill: var(--accent); }
.st-q { font: 500 13.5px var(--sans); fill: var(--ink); }
.st-a { font: 400 13.5px var(--serif); fill: var(--ink-2); font-style: italic; }
.st-caret { fill: var(--accent); }
/* Clue-Instruct */
.st-ci-src { fill: var(--cell); stroke: var(--rule); }
.st-ci-text { font: 400 13.5px var(--serif); fill: var(--ink); }
.st-ci .st-key { transition: fill 300ms ease; }
.st-ci.found .st-key { fill: var(--accent); font-weight: 700; }
.st-clue-n { font: 700 12px var(--sans); fill: var(--accent); }
.st-clue-line { font: 400 15px var(--serif); fill: var(--ink); }
.st-letter.big { font: 700 24px var(--sans); fill: var(--ink); }
/* ArabicSense */
.st-sense-box { fill: var(--cell); stroke: var(--rule-strong); transition: stroke 300ms ease, fill 300ms ease; }
.st-scan { fill: var(--accent); fill-opacity: 0.16; }
.st-absurd { transition: fill 300ms ease; }
.st-sense.hit .st-absurd { fill: var(--accent); font-weight: 700; }
.st-sense.is-sense .st-sense-box { stroke: var(--accent); stroke-width: 2.4; }
.st-sense.is-nonsense .st-sense-box { fill: var(--paper-2); }
.st-sense.is-nonsense .st-ar, .st-sense.is-nonsense .st-gloss { opacity: 0.75; }
.st-stamp { transform-box: fill-box; transform-origin: center; }
.st-stamp rect { fill: var(--paper); stroke: var(--accent); stroke-width: 2; }
.st-stamp text { font: 800 13.5px var(--sans); fill: var(--accent); letter-spacing: 0.04em; }
.st-sense.is-sense .st-stamp rect { fill: var(--accent); }
.st-sense.is-sense .st-stamp text { fill: var(--paper); }
/* measuring tiles */
.st-tile { transform-box: fill-box; transform-origin: center; }
.st-tile rect { fill: var(--cell); stroke: var(--accent); stroke-width: 1.2; }
.st-tile text { font: 700 12px var(--sans); fill: var(--ink); }
/* protein pipeline steps and honest notes */
.m3-steps { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 0.7rem; counter-reset: step; }
.m3-steps li { counter-increment: step; font-size: 0.85rem; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0.25rem 0.7rem; transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease; }
.m3-steps li::before { content: counter(step) "  "; font-weight: 700; }
.m3-steps li.on { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.m3-note { font-size: 0.8rem; color: var(--ink-2); margin: 0.5rem 0 0; max-width: 60ch; }

/* ---------- paper by paper slides ---------- */
.sl-paper { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 0.6rem; }
.sl-paper a { color: var(--ink); font-weight: 600; }
.sl-pills {
  display: flex; flex-wrap: wrap; gap: 0 1.1rem;
  border-bottom: 1px solid var(--rule); margin: 0 0 0.75rem;
}
.sl-pills::-webkit-scrollbar { display: none; }
.sl-pill {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 0.4rem 0 0.5rem; font-size: 0.85rem; color: var(--ink-2); white-space: nowrap; min-height: 38px;
}
.sl-pill:hover { color: var(--ink); }
.sl-pill[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.sl-card rect { fill: var(--cell); stroke: var(--rule); }
.sl-card.stmt rect { stroke: var(--rule-strong); }
.sl-card.out rect { fill: var(--accent-soft); stroke: var(--accent); }
.st-ar.sm { font-size: 15px; }
.sl-verdict rect { fill: var(--cell); stroke: var(--rule-strong); transition: fill 300ms ease, stroke 300ms ease; }
.sl-verdict text { font: 700 13.5px var(--sans); fill: var(--ink-2); }
.sl-verdict.right.lit rect { fill: var(--accent); stroke: var(--accent); }
.sl-verdict.right.lit text { fill: var(--paper); }
.sl-verdict:not(.right).lit { opacity: 0.4 !important; }
.sl-bubble rect { stroke: var(--rule); }
.sl-bubble.a rect { fill: var(--accent-soft); }
.sl-bubble.b rect { fill: var(--cell); }
.sl-who { font: 700 12px var(--sans); fill: var(--ink-2); }
.sl-opt rect { fill: var(--cell); stroke: var(--rule); transition: fill 300ms ease, stroke 300ms ease; }
.sl-opt-key { font: 700 15px var(--sans); fill: var(--ink-2); }
.sl-opt.ok.lit rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.sl-opt.ok.lit .sl-opt-key { fill: var(--accent); }
.sl-opt:not(.ok).lit { opacity: 0.55 !important; }
.sl-tag rect { fill: var(--ink); }
.sl-tag text { font: 700 12px var(--sans); fill: var(--paper); }
.sl-chip rect { fill: var(--paper-2); stroke: var(--rule-strong); }
.sl-chip.emotion rect { stroke: var(--accent); }
.sl-chip text { font: 600 12px var(--sans); fill: var(--ink); }

/* crossword slides */
.cw-tile rect { fill: var(--cell); stroke: var(--rule-strong); stroke-width: 1.2; }
.cw-tile text { font: 700 16px var(--sans); fill: var(--ink); }
.cw-row-bg { fill: var(--cell); stroke: var(--rule); }
.cw-hint { font: 700 13.5px var(--sans); fill: var(--accent); }
.cw-sent { font: 400 19px var(--serif); fill: var(--ink); }
.cw-sent.clue { fill: var(--accent); font-style: italic; }
.cw-sent .cw-ans { transition: fill 300ms ease; }
.cw-sent.lit .cw-ans { fill: var(--accent); font-weight: 700; }
.cw-count { font: 700 34px var(--serif); fill: var(--ink); font-variant-numeric: tabular-nums; }
.cw-box rect { fill: var(--cell); stroke: var(--ink); stroke-width: 1.2; }
.cw-box-t { font: 600 15px var(--serif); fill: var(--ink); }
.cw-out rect { stroke-width: 1.4; }
.cw-out.keep rect { fill: var(--accent-soft); stroke: var(--accent); }
.cw-out.drop rect { fill: var(--paper-2); stroke: var(--rule-strong); }
.cw-out text { font: 600 13.5px var(--sans); fill: var(--ink); }
.cw-dot { fill: var(--accent); }
.cw-dot.bad { fill: var(--ink-2); }

/* learning slides */
.fb-err { transition: fill 300ms ease; }
.fb-err.on { fill: #c0392b; text-decoration: underline; font-weight: 700; }
:root[data-theme="dark"] .fb-err.on { fill: #ff9b8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fb-err.on { fill: #ff9b8a; } }
.fb-card rect { fill: var(--cell); stroke: var(--rule); }
.fb-old { font: 400 13.5px var(--serif); fill: var(--ink-2); text-decoration: line-through; }
.fb-arrow { font: 600 12px var(--sans); fill: var(--ink-2); }
.fb-new { font: 600 13.5px var(--serif); fill: var(--accent); }
.fb-loop { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 4 4; }
.fb-loop-t { font: 600 12px var(--sans); fill: var(--accent); }
.cw-count.sm { font-size: 26px; }
.icl-expr { font: 600 26px var(--sans); fill: var(--ink); letter-spacing: 0.02em; }
.icl-step rect { fill: var(--cell); stroke: var(--rule); transition: fill 250ms ease, stroke 250ms ease; }
.icl-step-t { font: 600 16px var(--sans); fill: var(--ink); }
.icl-step.on rect { fill: var(--accent-soft); stroke: var(--accent); }
.sl-card .st-bar { fill: var(--accent); }

/* languages slides */
.cal-bar { fill: var(--ink-2); opacity: 0.5; }
.cal-row.mine .cal-bar { opacity: 1; }
.cal-row.mine .cal-bar { fill: var(--accent); }
.cal-val { font: 600 12px var(--sans); fill: var(--ink-2); dominant-baseline: middle; transform: translateY(-5px); }
.cal-row.mine .cal-val, .cal-row.mine .st-clue-it { fill: var(--ink); font-weight: 700; }
.pt-chip rect { fill: var(--cell); stroke: var(--rule); }
.pt-chip.pl rect { stroke: var(--accent); }
.pt-word { font: 600 16px var(--serif); fill: var(--ink); }
.pt-lab { font: 600 12px var(--sans); fill: var(--ink-2); }
.pt-link { stroke: var(--ink-2); stroke-width: 2; fill: none; }
.pt-link.l1 { stroke-dasharray: 5 4; }
.pt-link.l2 { stroke-dasharray: 2 6; }
.pt-axis { stroke: var(--rule); stroke-width: 6; stroke-linecap: round; fill: none; }
.pt-grow { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; fill: none; }
.pt-dot { fill: var(--accent); stroke: var(--cell); stroke-width: 2; }

/* the narrow board on phones: drawn at about the width it is shown, no label under 12px */
.st-svg.narrow :is(.st-code, .st-msft-code, .st-msft-src, .st-qa, .sl-who, .fb-arrow, .fb-loop-t, .pt-lab,
  .sl-chip text, .sl-tag text, .st-tile text, .cal-val, .st-val, .st-rel, .st-simval, .st-verdict, .st-clue-n) { font-size: 12px; }
.st-svg.narrow .cw-count.sm { font-size: 22px; }
.st-svg.narrow .icl-expr { font-size: 20px; }

/* Villanova: the lead chapter and its time line */
.st-tab.lead .st-tab-title { color: var(--accent); }
.vl-axis { stroke: var(--accent); stroke-width: 2; fill: none; }
.vl-dot { fill: var(--accent); stroke: var(--paper-2); stroke-width: 3; }
.vl-card.now rect { stroke: var(--accent); stroke-width: 1.6; }

/* ---------- home: split hero, headline on the left and the animated scene on the right ---------- */
.hero-split { border-bottom: 1px solid var(--rule); }
.stage.split { grid-template-areas: "text" "side" "main"; }
.stage.split .hero-text { grid-area: text; }
.stage.split .st-side { grid-area: side; }
.stage.split .st-main { grid-area: main; }
.stage.split .st-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 0.25rem; }
.stage.split .st-tab { padding: 0.45rem 0.6rem 0.65rem; }
.stage.split .st-tab-title { font-size: 1rem; }
.stage.split .st-tab-sub { display: none; }
.stage.split .st-prog { left: 0.6rem; right: 0.6rem; }
.stage.split .st-story { padding: 0.8rem 0 0; }
.stage.split .hero-text h1 { margin-bottom: 0.7rem; }
@media (min-width: 60rem) {
  .stage.split {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    grid-template-areas: "text main" "side main";
    grid-template-rows: auto 1fr;
    gap: 1.6rem 3rem;
    align-items: start;
  }
  .stage.split .hero-text h1 { font-size: clamp(2rem, 1rem + 2.1vw, 3rem); text-wrap: balance; }
  .stage.split .st-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage.split .st-tab[aria-selected="true"] { border-radius: 6px; }
  .stage.split .st-main { align-self: start; margin-top: -0.6rem; }
}

/* ---------- home, minimal: headline and links on the left, the graph of the work on the right ---------- */
.home-hero { padding-block: clamp(2.2rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--rule); }
.home-hero-in { display: grid; gap: 2rem 3.5rem; align-items: center; }
@media (min-width: 60rem) { .home-hero-in { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.home-text h1 { font-size: clamp(2rem, 1.1rem + 2.4vw, 3.2rem); margin-bottom: 0.8rem; text-wrap: balance; }
.home-text .role-line { margin-bottom: 1.6rem; }
.home-go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin: 0 0 1.4rem; }
.home-go a { color: var(--ink); font-weight: 600; }
.home-go .go-main { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 6px; background: var(--accent); color: var(--paper); text-decoration: none; }
.home-go .go-main:hover, .home-go .go-main:focus-visible { filter: brightness(1.08); }
.home-text .id-row { margin: 0; }
.home-graph { margin: 0; }
.home-graph .wg-keys, .home-graph .wg-status { display: none; }
.home-graph figcaption { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.4rem; max-width: 60ch; }
.two-col { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 60rem) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.home-two .papers .authors { display: none; }
.home-two .updates li { grid-template-columns: 1fr; gap: 0.2rem; }

/* home hero, full width like the SAILab site: text on the left half, the graph on a panel that runs to the right edge */
.home-hero { padding: 0; }
.home-hero-in { display: grid; gap: 0; }
.home-text { padding: clamp(2rem, 6vw, 3rem) var(--gut) 2rem; }
.home-graph { background: var(--paper-2); border-top: 1px solid var(--rule); padding: 1.5rem var(--gut) 1.75rem; }
@media (min-width: 60rem) {
  .home-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(86vh, 52rem); align-items: stretch; }
  .home-text { align-self: center; padding: 4rem 3.5rem 4rem max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); }
  .home-graph { border-top: 0; border-left: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.5rem, 4vw, 4.5rem); }
  .home-graph figcaption { align-self: center; text-align: center; }
}
.wg.play .wg-node { cursor: grab; touch-action: none; }
.wg.play .wg-node.grabbed { cursor: grabbing; }
.wg.play .wg-node.grabbed circle, .wg.play .wg-node.grabbed rect { fill: var(--accent); }
/* Hover and signals on the home graph. Settled links fade quickly instead of the slow
   assembly fade; a lit link carries a slow pulse toward its line of work. */
.wg.assembled .wg-edge { transition: opacity 260ms ease, stroke 260ms ease, stroke-width 260ms ease; }
.wg-node.hot circle { transform: scale(1.6); }
.wg-node.paper.hot circle { fill: var(--accent); }
.wg.play.focus .wg-edge.on { stroke-dasharray: 4 4; animation: wg-flow 1s linear infinite; }
@keyframes wg-flow { to { stroke-dashoffset: -8; } }
.wg:not(.focus) .wg-edge.lit { stroke: var(--accent); opacity: 0.6; }
.wg-spark { fill: var(--accent); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .wg.play.focus .wg-edge.on { animation: none; stroke-dasharray: none; } }

/* home graph: a fixed, comfortable size centred in its panel, so it never outgrows the text beside it */
.home-graph #home-graph { width: min(100%, 34rem); margin-inline: auto; }
@media (min-width: 60rem) { .home-graph #home-graph { width: min(100%, 46rem, calc(74vh * 1.12)); } }
.home-graph figcaption { margin-inline: auto; }
@media (min-width: 60rem) { .home-graph { align-items: center; } }
/* hover card */
.wg-tip {
  position: absolute; left: 0; top: 0; z-index: 2; max-width: 19rem; pointer-events: none;
  background: var(--cell); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 8px;
  padding: 0.6rem 0.75rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0; transition: opacity 160ms ease, transform 180ms ease;
}
.wg-tip.on { opacity: 1; }
.wg-tip b { display: block; font: 600 0.95rem/1.3 var(--serif); }
.wg-tip span { display: block; font-size: 0.82rem; color: var(--ink-2); margin-top: 0.2rem; line-height: 1.4; }
.wg-tip small { display: block; font-size: 0.72rem; color: var(--accent); margin-top: 0.35rem; }
@media (prefers-reduced-motion: reduce) { .wg-tip { transition: none; } }
/* Balance on every screen: the text starts at the page column's left edge (where the menu starts) and the
   graph ends at its right edge (where the header ends); only the panel colour runs to the screen edge.
   Percent padding on a grid item is a share of its own column, so 100% - 36rem lands on the 72rem column. */
@media (min-width: 60rem) {
  .home-text { padding-left: max(var(--gut), calc(100% - var(--wrap) / 2 + var(--gut))); padding-right: clamp(1.5rem, 3vw, 3rem); }
  .home-graph { padding-left: clamp(1.5rem, 3vw, 3rem); padding-right: max(var(--gut), calc(100% - var(--wrap) / 2 + var(--gut))); }
  .home-graph #home-graph { width: min(100%, 46rem, calc(70vh * 1.12)); }
  .home-hero-in { min-height: min(80vh, 48rem); }
}

@media (min-width: 100rem) {
  .home-text h1 { font-size: clamp(3.2rem, 1rem + 2.2vw, 4.2rem); }
  .home-text .role-line, .home-text .hero-also { max-width: 34ch; }
  .home-graph #home-graph { width: min(100%, 54rem, calc(74vh * 1.12)); }
}

/* ---------- a paper's own page ---------- */
.paper-head .crumbs { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 1rem; }
.paper-head .crumbs a { color: var(--ink-2); }
.paper-head h1 { font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.6rem); line-height: 1.15; max-width: 30ch; text-wrap: balance; margin-bottom: 0.9rem; }
.paper-authors { font-size: 1.02rem; margin: 0 0 0.5rem; max-width: 60ch; }
.paper-authors strong { color: var(--accent); font-weight: 600; }
.paper-venue { color: var(--ink-2); margin: 0 0 1.4rem; max-width: 60ch; }
.paper-venue span { font-size: 0.92rem; }
.paper-head-in { display: grid; gap: 2rem 3rem; align-items: center; }
@media (min-width: 60rem) { .has-scene .paper-head-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.paper-scene { margin: 0; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem 0.8rem; }
.paper-scene .sl-pills, .paper-scene .sl-paper { display: none; }
.paper-scene figcaption { font-size: 0.82rem; color: var(--ink-2); margin-top: 0.4rem; }
.paper-scene .play-again { margin-top: 0.5rem; }
.paper-body > * { max-width: 52rem; }
.paper-summary { font-size: 1.12rem; line-height: 1.65; max-width: 62ch; }
.paper-topics { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 2rem; }
.paper-topics .chip { text-decoration: none; }
pre.bib { background: var(--cell); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; max-width: 100%; }
.related { list-style: none; padding: 0; margin: 0.6rem 0 2rem; border-top: 1px solid var(--rule); }
.related li { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.related a { font-weight: 600; }
.related span { display: block; font-size: 0.85rem; color: var(--ink-2); margin-top: 0.15rem; }

/* Award photos on the About page: the stage wide, the certificate square. */
.award-photos { display: grid; gap: 1.2rem; margin-top: 1.8rem; }
@media (min-width: 48rem) { .award-photos { grid-template-columns: 1.75fr 1fr; align-items: start; } }
.award-photos figure { margin: 0; }
.award-photos img { display: block; width: 100%; height: auto; border-radius: 2px; }
.award-photos figcaption { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.45rem; }

/* ---------- CV: cv.html, resume.html, cv-full.html ----------
   On screen the CV is one sheet on the page; the sheet's edge and shadow say
   "this is the document you can download". In print the site's header, menu and
   footer go, and the sheet becomes plain A4: the PDFs are printed from this. */
.cv-pick { display: grid; gap: 2.2rem; }
@media (min-width: 48rem) { .cv-pick { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.cv-pick article { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.cv-pick h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 0.3rem; }
.cv-pick h2 a { text-decoration: none; }
.cv-pick h2 a:hover { color: var(--accent); }
.cv-for { color: var(--ink-2); font-weight: 500; }
.cv-pick .links a { color: var(--accent); font-weight: 500; }

.cv-page { padding-block: clamp(1.4rem, 4vw, 2.6rem) clamp(3rem, 7vw, 5rem); }
.cv-bar, .cv-doc { max-width: 54rem; margin-inline: auto; }
.cv-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1.5rem;
  font-size: 0.9rem; color: var(--ink-2); margin-bottom: 1rem; }
.cv-bar p { margin: 0; }
.cv-bar a { color: var(--accent); font-weight: 500; }
.cv-doc { background: var(--cell); border: 1px solid var(--rule); box-shadow: var(--shadow);
  padding: clamp(1.25rem, 5vw, 3.2rem); }
.cv-top h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); }
.cv-headline { color: var(--ink-2); margin: 0.35rem 0 0.7rem; }
.cv-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 1.2rem; font-size: 0.88rem; }
.cv-contact a { overflow-wrap: anywhere; }
.cv-summary { margin: 1.3rem 0 0; max-width: none; }
.cv-sec { margin-top: 1.8rem; }
.cv-sec > h2 { font-size: 1.2rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule-strong); margin-bottom: 0.5rem; }
.cv-sec > p { max-width: none; font-size: 0.95rem; }
.cv-row { display: grid; gap: 0.05rem 1.2rem; padding-block: 0.5rem; }
@media (min-width: 40rem) { .cv-row { grid-template-columns: 8.6rem minmax(0, 1fr); } }
.cv-when { margin: 0; font-size: 0.83rem; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.cv-row h3 { font-family: var(--sans); font-size: 0.98rem; line-height: 1.4; }
.cv-where { color: var(--accent); font-weight: 500; }
.cv-row p, .cv-row li { font-size: 0.91rem; color: var(--ink-2); max-width: none; }
.cv-row p { margin: 0.15rem 0 0; }
.cv-row ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.cv-plain { margin: 0; padding-left: 1.1rem; }
.cv-plain li { font-size: 0.92rem; margin-block: 0.25rem; }
.cv-plain a, .cv-pubs a { color: var(--ink); }
.cv-plain a { font-weight: 600; }
@media (min-width: 48rem) { .cv-cols { columns: 2; column-gap: 2.4rem; } .cv-cols li { break-inside: avoid; } }
.cv-skills { margin: 0; }
.cv-skills div { display: grid; gap: 0 1.2rem; padding-block: 0.2rem; }
@media (min-width: 40rem) { .cv-skills div { grid-template-columns: 8.6rem minmax(0, 1fr); } }
.cv-skills dt { font-weight: 600; font-size: 0.9rem; }
.cv-skills dd { margin: 0; font-size: 0.91rem; color: var(--ink-2); }
.cv-year { font-size: 1rem; margin: 1rem 0 0.2rem; }
.cv-pubs { margin: 0; padding-left: 2.1rem; }
.cv-pubs li { font-size: 0.9rem; color: var(--ink-2); margin-block: 0.35rem; }
.cv-pubs li::marker { font-variant-numeric: tabular-nums; }
.cv-pubs strong { color: var(--ink); font-weight: 600; }
.cv-foot { margin: 1.8rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--ink-2); max-width: none; }

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --paper: #fff; --cell: #fff; --ink: #1c1917; --ink-2: #3f3a36;
    --rule: #d6d0c7; --rule-strong: #a8a29e; --accent: #9a3412;
  }
  @page { size: A4; margin: 12mm 14mm; }
  html { font-size: 12.4px; }
  body { font-size: 1rem; line-height: 1.4; background: #fff; }
  .skip, .masthead, .site-foot, .cv-bar { display: none !important; }
  .cv-page { padding: 0; max-width: none; }
  .cv-doc { max-width: none; border: 0; box-shadow: none; padding: 0; background: none; }
  a { text-decoration: none; }
  .cv-row { grid-template-columns: 9.6rem minmax(0, 1fr); padding-block: 0.28rem; break-inside: avoid; }
  .cv-skills div { grid-template-columns: 9.6rem minmax(0, 1fr); }
  .cv-sec { margin-top: 1rem; }
  .cv-sec > h2 { break-after: avoid; }
  .cv-year { break-after: avoid; }
  .cv-pubs li, .cv-plain li { break-inside: avoid; }
  .cv-cols { columns: 2; column-gap: 2rem; }
  /* The resume has to fit one sheet. */
  html:has(.cv-short) { font-size: 12px; }
  .cv-short .cv-top h1 { font-size: 2rem; }
  .cv-short .cv-summary { margin-top: 0.7rem; }
  .cv-short .cv-sec { margin-top: 0.7rem; }
  .cv-short .cv-sec > h2 { font-size: 1.1rem; margin-bottom: 0.15rem; }
  .cv-short .cv-row { padding-block: 0.18rem; }
  .cv-short .cv-row ul { margin-top: 0.05rem; }
  .cv-short .cv-row li, .cv-short .cv-plain li { margin-block: 0.05rem; }
  .cv-short .cv-foot { margin-top: 0.7rem; padding-top: 0.4rem; }
}
