/* Programma: flat poster inks, one grotesk in three widths, a ruled shore.
   Locked palette: two grounds and four inks. No gradients, washes or shadows. */

@font-face {
  font-family: Archivo;
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Archivo;
  src: url('/assets/fonts/archivo-italic-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Grounds */
  --paper: #e9eef2;
  --ink: #14171f;
  --graphite: #474e5c;
  /* Fields: the same in both themes, they carry their own text colour */
  --vino: #7b1e34;
  --pino: #1f7a4d;
  --cielo: #2447b8;
  --sole: #f2c230;
  --on-field: #f1f5f8;
  --field-ink: #14171f;
  /* Figure inks and underline marks on the ground */
  --fig-vino: #7b1e34;
  --fig-pino: #1f7a4d;
  --fig-cielo: #2447b8;
  --fig-sole: #f2c230;
  --m-vino: #7b1e34;
  --m-pino: #1a6b43;
  --m-cielo: #2447b8;
  --m-sole: #a36f00;

  --page: var(--vino);
  --on-page: var(--on-field);
  --m-page: var(--m-vino);

  --gutter: clamp(1.25rem, 4.45vw, 4rem);
  --col: 9.5rem;
  --fig: clamp(20rem, 33vw, 32rem);
  --section: clamp(4.5rem, 9vw, 7.5rem);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --wide: 125%;
  --narrow: 80%;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #11141b;
    --ink: #e9eef2;
    --graphite: #a4aebb;
    --fig-vino: #dd6883;
    --fig-pino: #41b07c;
    --fig-cielo: #7591ff;
    --m-vino: #dd6883;
    --m-pino: #41b07c;
    --m-cielo: #7591ff;
    --m-sole: #f2c230;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #11141b;
  --ink: #e9eef2;
  --graphite: #a4aebb;
  --fig-vino: #dd6883;
  --fig-pino: #41b07c;
  --fig-cielo: #7591ff;
  --m-vino: #dd6883;
  --m-pino: #41b07c;
  --m-cielo: #7591ff;
  --m-sole: #f2c230;
}

[data-page='publications'] { --page: var(--pino); --m-page: var(--m-pino); }
[data-page='cv'] { --page: var(--cielo); --m-page: var(--m-cielo); }
[data-page='news'] { --page: var(--sole); --m-page: var(--m-sole); --on-page: var(--field-ink); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-stretch: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--paper);
  scroll-padding-top: 1.5rem;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  caret-color: var(--m-page);
}
main { flex: 1; outline: 0; }
::selection { background: var(--sole); color: var(--field-ink); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.sprite { position: absolute; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: 100rem; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }

.skip-link { position: absolute; left: var(--gutter); top: 0; z-index: 10; padding: 0.75rem 1rem; background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; transform: translateY(-110%); }
.skip-link:focus { transform: none; }

/* Type voices */
.display { font-stretch: var(--wide); font-weight: 600; font-size: clamp(2.5rem, 5.7vw, 5.5rem); line-height: 0.98; letter-spacing: -0.035em; text-wrap: balance; }
h2 { font-stretch: var(--wide); font-weight: 600; font-size: clamp(1.5rem, 2.5vw, 2.125rem); line-height: 1.08; letter-spacing: -0.025em; }
h3 { font-weight: 600; font-size: 1.3125rem; line-height: 1.25; letter-spacing: -0.012em; }
.label { font-stretch: var(--narrow); font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }

/* One entrance per page: the display line rises word by word. */
.display .w { display: inline-block; overflow: clip; vertical-align: top; padding-block: 0.06em 0.16em; margin-block: -0.06em -0.16em; }
.display .w > span { display: inline-block; animation: rise 720ms var(--ease-out) backwards; animation-delay: calc(var(--i) * 45ms + 40ms); }
@keyframes rise { from { transform: translateY(112%); } }
@keyframes draw { from { transform: scaleX(0); } }

/* Icons */
.icon { flex: none; width: 0.8em; height: 0.8em; transition: transform 200ms var(--ease-out); }

/* Links */
.prose a { text-decoration: underline; text-decoration-color: var(--m-page); text-decoration-thickness: 2px; text-underline-offset: 0.2em; transition: text-decoration-color 150ms ease; }
.link { position: relative; display: inline-flex; align-items: center; gap: 0.45em; padding-block: 0.3rem; font-weight: 600; text-decoration: none; }
.link::before { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: var(--m-page); }
.link::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 240ms var(--ease-out); }
.masthead .link::before, .band .link::before { display: none; }

.button { display: inline-flex; align-items: center; gap: 0.65em; padding: 0.85rem 1.3rem; background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; border: 0; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.button:focus-visible { outline-color: var(--ink); }
.masthead .button:focus-visible { outline-color: var(--on-page); }
.button:active { transform: scale(0.97); }
.masthead .button { background: var(--on-page); color: var(--field-ink); }
[data-page='news'] .masthead .button { background: var(--field-ink); color: var(--on-field); }

@media (hover: hover) and (pointer: fine) {
  .prose a:hover { text-decoration-color: currentColor; }
  .link:hover::after, .footer-email:hover::after, .nav a[data-ink]:hover::after { transform: scaleX(1); }
  a:hover > .icon-out { transform: translate(2px, -2px); }
  a:hover > .icon-right { transform: translateX(3px); }
  a:hover > .icon-left { transform: translateX(-3px); }
  a:hover > .icon-down { transform: translateY(2px); }
  a:hover > .icon-up { transform: translateY(-2px); }
  .button:hover { background: var(--page); color: var(--on-page); }
  .masthead .button:hover { background: var(--field-ink); color: var(--on-field); }
  [data-page='news'] .masthead .button:hover { background: var(--on-field); color: var(--field-ink); }
}

/* Navigation */
.nav { display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1.5rem); padding-block: 1.25rem; view-transition-name: nav; }
.wordmark { font-stretch: var(--wide); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; text-decoration: none; padding-block: 0.5rem; }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: clamp(1rem, 2.6vw, 2.25rem); }
.nav a[data-ink] { position: relative; display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.75rem; font-weight: 500; font-size: 0.9375rem; text-decoration: none; }
.nav a[data-ink]::after { content: ''; position: absolute; inset: auto 0 0.45rem; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 240ms var(--ease-out); }
.nav a[aria-current]::after { transform: scaleX(1); }
.sq { width: 0.625rem; height: 0.625rem; transition: transform 300ms var(--ease-out); }
[data-ink='home'] .sq { background: var(--fig-vino); }
[data-ink='publications'] .sq { background: var(--fig-pino); }
[data-ink='cv'] .sq { background: var(--fig-cielo); }
[data-ink='news'] .sq { background: var(--fig-sole); }
.theme-toggle { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-right: -0.75rem; padding: 0; background: none; border: 0; cursor: pointer; transition: transform 160ms var(--ease-out); }
.theme-toggle .icon { width: 1.125rem; height: 1.125rem; transition: transform 300ms var(--ease-out); }
.theme-toggle[aria-pressed='true'] .icon { transform: rotate(180deg); }
.theme-toggle:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .nav a[data-ink]:hover .sq { transform: rotate(90deg); }
}

/* Home: headline, agents and the shore */
.hero { position: relative; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--fig); align-items: end; padding-top: clamp(1.5rem, 5vh, 3.25rem); }
.hero .display { grid-area: 1 / 1 / 2 / -1; align-self: start; max-width: 9.75em; padding-bottom: clamp(3.5rem, 6.2vw, 6rem); }
.agents { grid-area: 1 / 2; width: var(--fig); aspect-ratio: 13 / 11; }
.agents-svg { width: 100%; height: 100%; overflow: visible; user-select: none; -webkit-user-select: none; }
.agents-svg .edges line { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ink-vino { fill: var(--fig-vino); }
.ink-pino { fill: var(--fig-pino); }
.ink-cielo { fill: var(--fig-cielo); }
.ink-sole { fill: var(--fig-sole); }
.ink-ink { fill: var(--ink); }
.agents-svg .eye { fill: var(--paper); }
.agents-svg .eye-dark { fill: var(--field-ink); }
.agents-svg .wire { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.agents-svg .outline { fill: var(--paper); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.agents-svg .hit, .agents-svg .grip { fill: transparent; stroke: none; pointer-events: all; }
.agents[data-live] .hit { cursor: copy; }
.agents[data-live] .node { cursor: grab; touch-action: none; }
.agents[data-live] .node:active { cursor: grabbing; }
.shore { position: relative; height: 2px; margin-top: -1px; background: var(--ink); transform-origin: 0 50%; animation: draw 1100ms var(--ease-out) 150ms backwards; }

.run-row { position: relative; }
.run { position: absolute; top: 0.125rem; right: var(--gutter); width: var(--fig); display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; font-stretch: var(--narrow); font-weight: 500; font-size: 0.875rem; line-height: 1.2; color: var(--graphite); }
.run-toggle { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; margin-left: -0.9rem; padding: 0; background: none; border: 0; color: var(--ink); cursor: pointer; transition: transform 160ms var(--ease-out); }
.run-toggle:active { transform: scale(0.92); }
.run-toggle .icon { width: 0.875rem; height: 0.875rem; }
.run-toggle[aria-pressed='false'] .icon-play, .run-toggle[aria-pressed='true'] .icon-pause { display: none; }
.run-trace { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-hint { flex-basis: 100%; }

.about { display: grid; grid-template-columns: 13.25rem minmax(0, 1fr) var(--fig); column-gap: clamp(1.75rem, 3.2vw, 2.75rem); align-items: start; padding-top: 2.25rem; }
.portrait { width: 100%; height: auto; aspect-ratio: 212 / 268; object-fit: cover; object-position: 50% 28%; }
.prose > p + p { margin-top: 1em; }
.bio { max-width: 35rem; font-size: 1.1875rem; line-height: 1.55; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.5rem; }
.identity { font-size: 0.9375rem; line-height: 1.5; }
main:has([data-run]:not([hidden])) .identity { padding-top: 4.5rem; }
.identity-name { font-stretch: var(--wide); font-weight: 600; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.02em; }
.identity-role { margin-top: 0.3rem; color: var(--graphite); }
.identity-list { margin-top: 1.1rem; }
.identity-list a { display: inline-flex; align-items: center; gap: 0.4em; min-height: 2rem; font-weight: 500; text-decoration: none; }
.identity-list a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--m-page); }

/* Sections */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem; margin-bottom: 1.75rem; }
.featured, .news { margin-top: var(--section); }

/* Selected publications: a paper sheet on a field of ink */
.band { overflow: clip; color: var(--on-field); }
.band-pino { background: var(--pino); }
.band-cielo { background: var(--cielo); }
.band-grid { display: grid; grid-template-columns: minmax(0, 1fr) min(34rem, 42%); column-gap: clamp(2rem, 5vw, 5rem); align-items: start; padding-top: clamp(2.5rem, 5vw, 4rem); }
.band-text { display: flex; flex-direction: column; align-self: stretch; padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.nb { white-space: nowrap; }
.band h3 { max-width: 20em; font-stretch: var(--wide); font-size: clamp(1.5rem, 2.7vw, 2.375rem); line-height: 1.08; letter-spacing: -0.028em; text-wrap: balance; }
.band h3 a { text-decoration: none; }
.band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; margin-top: auto; padding-top: 2rem; }
.band-actions .label { margin-right: 0.5rem; }
.sheet { display: block; margin-bottom: -5.5rem; background: #fff; transition: transform 300ms var(--ease-out); }
.sheet img { width: 100%; height: auto; }
@media (hover: hover) and (pointer: fine) {
  .band h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
  .sheet:hover, .band:has(h3 a:hover) .sheet { transform: translateY(-0.75rem); }
}

/* The register: every list keeps the same columns */
.rows { border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: var(--col) minmax(0, 1fr); column-gap: 2rem; padding-block: 1.4rem; border-bottom: 1px solid var(--ink); }
.row-key { font-stretch: var(--narrow); font-weight: 600; font-size: 0.9375rem; line-height: 1.7; font-variant-numeric: tabular-nums; text-decoration: none; }
a.row-key { align-self: start; }
.row-body { max-width: 44rem; text-wrap: pretty; }
@media (hover: hover) and (pointer: fine) {
  a.row-key:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--m-page); }
}

/* Inner pages: a masthead in the page ink */
.masthead { background: var(--page); color: var(--on-page); view-transition-name: masthead; }
.masthead-grid { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(1.75rem, 3vw, 2.5rem); }
.masthead .display { font-size: clamp(2.75rem, 7.4vw, 6rem); }
.masthead-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; padding-bottom: 0.4rem; }
.masthead-date { font-stretch: var(--narrow); font-weight: 600; padding-bottom: 0.6rem; font-variant-numeric: tabular-nums; }

.year-group { display: grid; grid-template-columns: var(--col) minmax(0, 1fr); column-gap: 2rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.year { position: sticky; top: 1.25rem; align-self: start; font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.year-count { display: block; margin-top: 0.6rem; font-stretch: var(--narrow); font-weight: 500; font-size: 0.875rem; line-height: 1.3; letter-spacing: 0; color: var(--graphite); }

/* Publications */
.tools { margin-top: clamp(2rem, 4vw, 3rem); }
.tools > label { display: block; margin-bottom: 0.5rem; font-stretch: var(--narrow); font-weight: 600; font-size: 0.9375rem; }
.tools-row { display: flex; gap: 0.75rem; }
.tools input, .tools select { min-height: 3.25rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 0; }
.tools input { flex: 1; min-width: 0; padding: 0 1rem; }
.tools input::placeholder { color: var(--graphite); opacity: 1; }
.tools input:focus-visible, .tools select:focus-visible { outline: 2px solid var(--m-page); outline-offset: 2px; }
.select { position: relative; display: inline-flex; }
.select select { appearance: none; -webkit-appearance: none; padding: 0 2.75rem 0 1rem; cursor: pointer; }
.select::after { content: ''; position: absolute; right: 1.1rem; top: 50%; width: 0.5rem; height: 0.5rem; border-right: 2px solid; border-bottom: 2px solid; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tools-count { margin-top: 0.6rem; font-stretch: var(--narrow); font-weight: 500; font-size: 0.875rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.empty-state { margin-top: 3rem; font-size: 1.1875rem; }

.paper { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); padding-block: 1.75rem; border-bottom: 1px solid var(--ink); scroll-margin-top: 1.5rem; }
.paper-number { justify-self: start; align-self: start; padding-inline: 0.2rem; font-stretch: var(--narrow); font-weight: 600; font-size: 0.9375rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.paper-number::before { content: '['; }
.paper-number::after { content: ']'; }
.paper:target .paper-number { background: var(--page); color: var(--on-page); }
.paper-body { max-width: 50rem; }
.paper h3 { text-wrap: pretty; }
.paper-venue { margin-top: 0.5rem; }
.paper h3 a { text-decoration: none; }
.paper-authors { margin-top: 0.35rem; color: var(--graphite); }
.paper-authors strong { color: var(--ink); font-weight: 600; }
.paper-journal { margin-top: 0.2rem; font-style: italic; color: var(--graphite); }
.paper-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.9rem; }
.paper-details { margin-top: 0.75rem; }
.paper-details + .paper-details { margin-top: 0; }
.paper-details summary { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; font-weight: 500; font-size: 0.9375rem; cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; }
.paper-details summary::-webkit-details-marker { display: none; }
.paper-details[open] > summary .icon { transform: rotate(45deg); }
.paper-details::details-content { block-size: 0; overflow: clip; transition: block-size 300ms var(--ease-out), content-visibility 300ms allow-discrete; }
.paper-details[open]::details-content { block-size: auto; }
.abstract { padding-block: 0.4rem 1rem; max-width: 44rem; text-wrap: pretty; }
.citation-box { position: relative; margin-block: 0.4rem 1rem; border: 1px solid var(--ink); }
.citation-box pre { overflow-x: auto; padding: 1rem; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.8125rem; line-height: 1.6; tab-size: 2; }
.copy-citation { display: block; width: 100%; padding: 0.6rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--ink); font-weight: 600; font-size: 0.875rem; text-align: left; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.copy-citation:active { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .paper h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; text-decoration-color: var(--m-page); }
  .copy-citation:hover { background: var(--ink); color: var(--paper); }
}

/* CV */
.cv-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-top: clamp(2rem, 4vw, 3rem); }
.cv-section { display: grid; grid-template-columns: 15rem minmax(0, 1fr); column-gap: 2rem; margin-top: clamp(2.5rem, 5vw, 4rem); scroll-margin-top: 1.5rem; }
.cv-section > h2 { font-size: clamp(1.375rem, 2vw, 1.75rem); padding-top: 1.25rem; }
.institution { margin-top: 0.2rem; color: var(--graphite); }
.details { margin-top: 0.5rem; }
.details p { display: inline; }

/* News item and 404 */
.item { padding-top: clamp(2.5rem, 5vw, 4rem); }
.item-body { max-width: 44rem; margin-bottom: 2.5rem; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.45; text-wrap: pretty; }

/* Footer: the page ink closes the page */
.footer { margin-top: var(--section); padding-block: clamp(3rem, 7vw, 5.5rem) 1.75rem; background: var(--page); color: var(--on-page); }
.footer-email { position: relative; display: inline-block; font-stretch: var(--wide); font-weight: 600; font-size: clamp(1.2rem, 4.6vw, 4.25rem); line-height: 1.1; letter-spacing: -0.035em; text-decoration: none; overflow-wrap: anywhere; }
.footer-email::after { content: ''; position: absolute; inset: auto 0 -0.04em; height: max(2px, 0.045em); background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 300ms var(--ease-out); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin-top: clamp(2rem, 4vw, 3rem); }
.footer-links a, .footer-meta a { display: inline-flex; align-items: center; gap: 0.4em; min-height: 2.75rem; font-weight: 500; text-decoration: none; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.75rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: 0.75rem; border-top: 2px solid currentColor; font-size: 0.9375rem; }
.footer-meta span { margin-right: auto; }
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover, .footer-meta a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
}

/* Cross-page transitions: the nav holds still, the masthead changes ink */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 240ms; animation-timing-function: var(--ease-out); }
::view-transition-group(masthead) { animation-duration: 420ms; animation-timing-function: var(--ease-in-out); }

/* Narrower screens */
@media (max-width: 72rem) {
  .about { grid-template-columns: 11rem minmax(0, 1fr) var(--fig); }
}
@media (max-width: 56rem) {
  :root { --col: 7.5rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero .display { grid-area: auto; padding-bottom: 2rem; }
  .agents { grid-area: auto; width: min(100%, 32rem); margin-inline: auto; }
  .run { position: static; width: auto; padding-top: 0.125rem; }
  .about { grid-template-columns: 9rem minmax(0, 1fr); row-gap: 2.5rem; padding-top: 2rem; }
  .run-hint { padding-bottom: 0.25rem; }
  .identity, main:has([data-run]:not([hidden])) .identity { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
  .band-grid { grid-template-columns: minmax(0, 1fr); }
  .band-text { padding-bottom: 2.5rem; }
  .sheet { margin-bottom: -40%; }
  .cv-section { grid-template-columns: minmax(0, 1fr); }
  .cv-section > h2 { padding-top: 0; margin-bottom: 1rem; }
}
@media (max-width: 40rem) {
  .nav { flex-wrap: wrap; row-gap: 0; padding-block: 0.75rem 0.25rem; }
  .theme-toggle { margin-left: auto; }
  .nav nav { order: 3; flex-basis: 100%; margin-left: 0; }
  .nav ul { justify-content: space-between; gap: 0.5rem; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { width: 9.5rem; }
  .identity-list a { min-height: 2.75rem; }
  .actions .button { flex: 1 1 100%; justify-content: space-between; }
  .row, .year-group { grid-template-columns: minmax(0, 1fr); }
  .row { row-gap: 0.25rem; padding-block: 1.15rem; }
  .year { position: static; margin-bottom: 1rem; }
  .year-count { display: inline; margin-left: 0.75rem; }
  .paper { grid-template-columns: minmax(0, 1fr); row-gap: 0.4rem; }
  .tools-row { flex-direction: column; }
  .select, .select select { width: 100%; }
  .footer-meta span { flex-basis: 100%; margin-bottom: 0.25rem; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  @view-transition { navigation: none; }
}

@media print {
  :root, :root[data-theme='dark'] { --paper: #fff; --ink: #000; --graphite: #333; --m-vino: #000; --m-pino: #000; --m-cielo: #000; --m-sole: #000; }
  .nav nav, .theme-toggle, .tools, .agents, .run, .footer-links { display: none; }
  .masthead, .footer, .band { background: none; color: #000; }
}
