/* Shared structure. Colours, fonts and the look live in variant-*.css (custom properties). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 1rem/1.65 var(--font-body); }
.wrapper { max-width: var(--measure); margin: 0 auto; padding: 0 1rem; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: .5rem; top: -3rem; padding: .5rem .75rem; background: var(--fg); color: var(--bg); z-index: 10; }
.skip-link:focus { top: .5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; }
h1 { font-size: 2rem; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
ul, ol { padding-left: 1.25rem; }

.site-header { padding: 1rem 0; }
.header-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; }
.site-title { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--fg); text-decoration: none; }
nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--fg); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--accent); }
nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }

main { padding-bottom: 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: .9rem; padding: 1.25rem 0 2rem; }
.lead { font-size: 1.15rem; }
.todo { background: var(--todo-bg); color: var(--fg); padding: 0 .25em; border-radius: 3px; }
ol.bibliography { padding-left: 1.25rem; }
ol.bibliography li { margin-bottom: 1rem; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: .4rem 0; border-bottom: 1px solid var(--rule); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header nav, .skip-link, .theme-toggle { display: none; } body { background: #fff; color: #000; } }

/* Publications */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pub-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.pub-filters[hidden], .pub[hidden], .pub-year[hidden] { display: none; }
.pub-filters button, .pub-copy { font: inherit; font-size: .9rem; color: var(--fg); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .9rem; cursor: pointer; }
.pub-filters button:hover, .pub-copy:hover { border-color: var(--accent); }
.pub-filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent, var(--bg)); }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.pub p { margin: 0 0 .2rem; }
.pub-title { font-weight: 600; }
.pub-authors, .pub-venue { color: var(--muted); font-size: .95rem; }
.pub-venue { font-style: italic; }
.pub-authors strong { color: var(--fg); }
.pub-badge { font-style: normal; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--rule); border-radius: 4px; padding: 0 .35rem; margin-right: .35rem; }
.pub-bibtex { margin-top: .35rem; font-size: .85rem; }
.pub-bibtex summary { cursor: pointer; color: var(--accent); }
.pub-bibtex pre { overflow-x: auto; background: var(--surface); border-radius: 6px; padding: .6rem .8rem; white-space: pre-wrap; word-break: break-word; }
.pub-copy { margin-top: .4rem; }
.pub-links:empty { display: none; }

/* Section headings: short accent underline */
main h2 { position: relative; padding-bottom: .4rem; }
main h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.5rem; height: 3px; background: var(--accent); border-radius: 2px; }

/* Publication links as small bordered buttons */
.pub-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; font-size: .8rem; }
.pub-links a { border: 1px solid var(--accent); border-radius: 6px; padding: .05rem .55rem; text-decoration: none; color: var(--accent); }
.pub-links a:hover { background: var(--accent); color: var(--on-accent, var(--bg)); }

/* Selected entries on Home: cards instead of divider lines */
.selected .pub { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: .9rem 1rem; margin-bottom: .75rem; }

/* Home hero: text + optional portrait (stacked on phones, two columns from 40rem) */
.hero { display: grid; gap: 1.5rem 2.5rem; align-items: center; margin: 1.5rem 0 2.5rem; }
.hero-text { min-width: 0; }
.hero h1 { margin-top: 0; }
.more { margin: .5rem 0 0; color: var(--muted); }
.portrait { margin: 0; width: var(--portrait-w, 14rem); max-width: 100%; aspect-ratio: var(--portrait-ratio, 4 / 5); overflow: hidden; isolation: isolate; background: var(--surface); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; mix-blend-mode: multiply; }
@media (min-width: 40rem) { .hero { grid-template-columns: minmax(0, 1fr) auto; } }

/* Topic chips (static) */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0; }
.chips li { font-size: .85rem; padding: .15rem .7rem; border-radius: 999px; background: var(--chip-bg, var(--surface)); color: var(--chip-fg, var(--fg)); border: 1px solid var(--chip-border, var(--rule)); }

/* Profile links as buttons (data: _data/links.yml) */
.link-row { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 1.1rem 0 .5rem; }
.link-row a, .link-row .email { display: inline-block; border: 1px solid var(--accent); border-radius: 8px; padding: .3rem .9rem; font-size: .95rem; text-decoration: none; color: var(--accent); }
.link-row .email a { border: 0; padding: 0; border-radius: 0; font: inherit; color: inherit; text-decoration: none; }
.link-row a:hover, .link-row .email:hover { background: var(--accent); color: var(--on-accent, var(--bg)); }
.link-row .email:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.link-row .email a:focus-visible { outline: 0; }

/* Light/dark toggle (revealed by js/theme.js) */
.header-tools { display: flex; align-items: center; gap: 1rem; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; background: transparent; color: var(--fg); border: 1px solid var(--rule); border-radius: 50%; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }

/* Venue acronym tag: --tag (0-7) picks the colour pair --tag-bg-N / --tag-fg-N defined by the variant */
.venue-tag { display: inline-block; font-style: normal; font-size: .75rem; font-weight: 600; line-height: 1.5; padding: 0 .45rem; margin-right: .35rem; border-radius: 4px; background: var(--tag-bg, var(--surface)); color: var(--tag-fg, var(--fg)); }
.venue-tag[style="--tag: 0"] { --tag-bg: var(--tag-bg-0); --tag-fg: var(--tag-fg-0); }
.venue-tag[style="--tag: 1"] { --tag-bg: var(--tag-bg-1); --tag-fg: var(--tag-fg-1); }
.venue-tag[style="--tag: 2"] { --tag-bg: var(--tag-bg-2); --tag-fg: var(--tag-fg-2); }
.venue-tag[style="--tag: 3"] { --tag-bg: var(--tag-bg-3); --tag-fg: var(--tag-fg-3); }
.venue-tag[style="--tag: 4"] { --tag-bg: var(--tag-bg-4); --tag-fg: var(--tag-fg-4); }
.venue-tag[style="--tag: 5"] { --tag-bg: var(--tag-bg-5); --tag-fg: var(--tag-fg-5); }
.venue-tag[style="--tag: 6"] { --tag-bg: var(--tag-bg-6); --tag-fg: var(--tag-fg-6); }
.venue-tag[style="--tag: 7"] { --tag-bg: var(--tag-bg-7); --tag-fg: var(--tag-fg-7); }
