/* Option C: Magma.
   Taken from medical visualization itself: a near-black reading-room ground and the
   magma colour map (black to plum to coral to pale yellow) as the site's signature,
   drawn as a colour bar under the header and around the portrait. */
/* IBM Plex Sans, hosted with the site (SIL Open Font License, see assets/fonts/OFL.txt). */
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #100d14;
  --panel: #1a1520;
  --text: #f4f0f6;
  --muted: #b2a9ba;
  --accent: #fc8961;   /* magma coral */
  --accent-2: #e85a8a; /* magma pink */
  --rule: rgba(255, 255, 255, 0.12);
  --magma: linear-gradient(90deg, #000004 0%, #2c115f 18%, #721f81 36%, #b73779 54%, #f1605d 72%, #feb078 88%, #fcfdbf 100%);
  --max: 72rem;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; min-width: 0; }
html { font-size: 106.25%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.65; overflow-x: clip; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 max(1.5rem, 4vw); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--text); color: var(--bg); padding: 0.5rem 1rem; }

/* Header, closed by a full-width colour bar */
.site-header { position: relative; padding: 3rem 0 0; }
.site-header::after { content: ""; display: block; height: 10px; background: var(--magma); margin-top: 0; }
.site-title { font-size: clamp(2.2rem, 5vw, 3.1rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; color: var(--text); text-decoration: none; }
.site-tagline { margin: 0.4rem 0 1.75rem; color: var(--muted); font-size: 1.05rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
nav a { display: inline-block; padding: 0.6rem 0 0.75rem; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

/* Main + sidebar */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3.5rem; padding-top: 3rem; padding-bottom: 4rem; align-items: start; }
main { max-width: 44rem; }
main h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 1.5rem; }
main h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.5rem 0 0.75rem; }
main h3 { font-size: 1.05rem; font-weight: 600; color: var(--accent); margin: 2rem 0 0.5rem; }
main ul { padding-left: 1.2rem; overflow-wrap: anywhere; }
main li { margin-bottom: 0.35rem; }
main li::marker { color: var(--accent-2); }

/* Portrait framed by the colour map */
.portrait { float: right; width: 220px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; margin: 0.3rem 0 1.25rem 2rem; padding: 5px; border-radius: 14px; background: linear-gradient(160deg, #fcfdbf, #feb078 20%, #f1605d 40%, #b73779 60%, #721f81 80%, #2c115f); }

.sidebar { font-size: 0.9rem; color: var(--muted); border-top: 3px solid var(--accent-2); padding-top: 1.25rem; }
.sidebar h2 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 0 0 0.45rem; }
.sidebar section { margin-bottom: 1.75rem; }
.sidebar address { font-style: normal; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin-bottom: 0.25rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.gallery img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
figure.side { float: right; width: 40%; max-width: 20rem; margin: 0.3rem 0 1rem 2rem; }
figure img { width: 100%; height: auto; border-radius: 6px; }
figure figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
figure.wide { margin: 2rem 0; }

.note { background: var(--panel); border-left: 3px solid var(--accent); padding: 0.9rem 1.1rem; color: var(--muted); }
.post-date { color: var(--muted); margin-top: -1rem; }

.site-footer { padding: 0 0 1.75rem; color: var(--muted); font-size: 0.85rem; }
.site-footer::before { content: ""; display: block; height: 3px; background: var(--magma); opacity: 0.6; margin-bottom: 1.75rem; }

/* Publications */
.year-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0 0.5rem; }
.year-nav a { padding: 0.15rem 0.55rem; border: 1px solid var(--rule); border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.year-nav a:hover { border-color: var(--accent); color: var(--text); }
main h2[id^="y"] { display: flex; align-items: center; gap: 0.9rem; font-variant-numeric: tabular-nums; }
main h2[id^="y"]::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.pubs { list-style: none; padding: 0; margin: 0 0 1rem; }
.pubs li { margin-bottom: 1.15rem; padding-left: 0.9rem; border-left: 2px solid var(--rule); line-height: 1.5; }
.pubs li:hover { border-left-color: var(--accent-2); }
.pub-title { font-weight: 600; }
.pub-title a { color: var(--text); text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors, .pub-venue { font-size: 0.88rem; color: var(--muted); }
.pub-authors strong { color: var(--text); white-space: nowrap; }
.pubs li > a { font-size: 0.88rem; }
.pubs details { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.pubs summary { cursor: pointer; color: var(--accent); }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .portrait { width: 140px; margin-left: 1.25rem; padding: 4px; }
  figure.side { float: none; width: 100%; max-width: none; margin: 0 0 1rem; }
  nav ul { gap: 0 1.1rem; }
  nav a { padding: 0.45rem 0 0.55rem; }
}
