/* =========================================================
   Sorif Hossain — site styles
   Colours and fonts are set once here, at the top.
   ========================================================= */
:root {
  --paper: #F4F6F5;
  --surface: #FFFFFF;
  --ink: #16242B;
  --muted: #5A6A71;
  --rule: #D3DBDA;
  --accent: #173F4A;       /* petrol: links, buttons */
  --accent-soft: #E1EBEA;
  --infect: #C2463F;       /* I curve */
  --sus: #2F6DB0;          /* S curve */
  --rem: #7A57A8;          /* R curve */
  --amber: #A8660F;        /* first-author mark */
  --focus: #2D7FF9;
  /* motto card */
  --calm-bg: #E8F3EF;
  --calm-ink: #1F4E4A;
  --calm-mark: #8CC2AE;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 4.5vw, 2.8rem);

  --wrap: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F181C; --surface: #16232A; --ink: #E3EAEA; --muted: #9AABB0;
    --rule: #2A3A41; --accent: #8CC5CF; --accent-soft: #1D3238;
    --infect: #F07A6E; --sus: #7FB0E8; --rem: #B79DE0; --amber: #E3A64E;
    --calm-bg: #15302E; --calm-ink: #CDE8DF; --calm-mark: #4F8C79; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F181C; --surface: #16232A; --ink: #E3EAEA; --muted: #9AABB0;
  --rule: #2A3A41; --accent: #8CC5CF; --accent-soft: #1D3238;
  --infect: #F07A6E; --sus: #7FB0E8; --rem: #B79DE0; --amber: #E3A64E;
  --calm-bg: #15302E; --calm-ink: #CDE8DF; --calm-mark: #4F8C79; color-scheme: dark;
}

[hidden] { display: none !important; }

/* The yellow "setup check" bar only shows if this file fails to load */
.setup-warning { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-behavior: smooth; scroll-padding-top: calc(5rem + env(safe-area-inset-top, 0px)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: var(--step-0); line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-weight: 500; line-height: 1.18; margin: 0; }
h3 { font-family: var(--sans); font-size: var(--step--1); font-weight: 600; color: var(--muted); margin: 0 0 0.7rem; letter-spacing: 0.01em; }
p { margin: 0 0 1rem; max-width: 70ch; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.fine { color: var(--muted); font-size: 0.8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0.75rem var(--gutter); display: flex; align-items: center; gap: 1rem; position: relative; }
.brand { font-size: var(--step-1); font-weight: 600; color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.nav ul { display: flex; gap: 1.25rem; }
.nav a { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.nav-toggle { display: none; }
.cv-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--paper); background: var(--accent); text-decoration: none; padding: 0.35rem 0.8rem; border-radius: 999px; flex: none; }
.cv-pill svg { width: 1em; height: 1em; }
.cv-pill:hover { filter: brightness(1.12); }
.theme { background: none; border: 1px solid var(--rule); color: var(--ink); width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.theme:hover { border-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--sans); font-size: var(--step--1); font-weight: 500; text-decoration: none; padding: 0.45rem 0.95rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); background: var(--surface); cursor: pointer; line-height: 1.3; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.small { font-size: 0.78rem; padding: 0.25rem 0.7rem; }
.btn svg { width: 1em; height: 1em; flex: none; }

/* ---------- About: profile + biography ---------- */
.about { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding: clamp(2.5rem, 6vw, 4.5rem) 0 3rem; align-items: start; }
.profile { position: sticky; top: 5.5rem; text-align: center; }
.avatar { position: relative; width: 190px; height: 190px; margin: 0 auto 1.25rem; border-radius: 50%; overflow: hidden; background: var(--accent); box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--rule); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.monogram { display: none; }
.avatar.no-photo .monogram { display: grid; place-items: center; position: absolute; inset: 0; font-size: 4rem; font-style: italic; color: var(--paper); }
.profile-name { font-size: 2.1rem; letter-spacing: -0.01em; margin-bottom: 0; }
.profile-role { font-family: var(--sans); font-size: 0.9375rem; color: var(--muted); margin: 0.5rem auto 0; line-height: 1.5; }
.profile-role a { color: inherit; }
.profile-links { margin-top: 1.3rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.cv-btn { margin-top: 1rem; }

/* The motto: soft, calm, unhurried */
.motto { margin: 1.8rem 0 0; padding: 1.6rem 1.4rem 1.1rem; background: var(--calm-bg); border-radius: 22px; position: relative; text-align: center; }
.motto::before { content: "\201C"; position: absolute; top: -0.35rem; left: 0.9rem; font-family: var(--serif); font-size: 4.2rem; line-height: 1; color: var(--calm-mark); }
.motto blockquote { margin: 0; }
.motto blockquote p { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.32rem; line-height: 1.4; color: var(--calm-ink); margin: 0 auto; max-width: 16ch; }
.motto-smile { display: block; width: 96px; height: 20px; margin: 0.55rem auto 0.3rem; }
.motto-smile path { fill: none; stroke: var(--calm-mark); stroke-width: 3; stroke-linecap: round; }
.motto figcaption { font-family: var(--sans); font-size: 0.75rem; color: var(--calm-ink); opacity: 0.75; }

.bio h1 { font-size: var(--step-3); letter-spacing: -0.015em; margin-bottom: 1.1rem; }
.lede { font-size: 1.17rem; line-height: 1.58; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--rule); padding-top: 1.6rem; margin-top: 1.6rem; }
.interests li { position: relative; padding: 0.22rem 0 0.22rem 1.1rem; }
.interests li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 6px; height: 6px; border-radius: 50%; background: var(--infect); }
.edu li { padding: 0.35rem 0 0.75rem; }
.edu-deg { display: block; font-weight: 500; line-height: 1.35; }
.edu-where { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 3rem 0; border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { font-size: var(--step-2); }
.section-head a { font-family: var(--sans); font-size: var(--step--1); }

/* ---------- Inner page header ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem; }
.page-head h1 { font-size: var(--step-3); letter-spacing: -0.015em; margin-bottom: 0.8rem; }
.page-head p { font-size: var(--step-1); color: var(--muted); margin: 0; }
.sub-h { font-size: var(--step-2); margin-bottom: 1.4rem; }

/* ---------- Publications ---------- */
.pub-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding-bottom: 3rem; }
.filters { position: sticky; top: 5.5rem; display: grid; gap: 1.4rem; font-family: var(--sans); font-size: var(--step--1); }
.filters h3 { margin-bottom: 0.5rem; }
.filter-selects { display: grid; gap: 0.9rem; }
.flabel { display: block; font-weight: 600; color: var(--muted); margin-bottom: 0.35rem; }
.search input, .filters select, .ctl select { width: 100%; font: inherit; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); }
.search input:focus, .filters select:focus, .ctl select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.topic-list { display: grid; gap: 0.15rem; }
.topic { display: flex; justify-content: space-between; gap: 0.5rem; width: 100%; text-align: left; font: inherit; padding: 0.4rem 0.6rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; }
.topic:hover { background: var(--accent-soft); }
.topic[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.topic .n { opacity: 0.65; font-variant-numeric: tabular-nums; }
.checks { display: grid; gap: 0.45rem; }
.checks input, .chk input { accent-color: var(--accent); margin-right: 0.4rem; }
.pub-count { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin: 0 0 0.6rem; }
.pub-year { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.1rem; margin-bottom: 0.4rem; }
.pub-year > h2 { font-size: var(--step-1); font-weight: 400; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.pub { padding: 0 0 1.4rem; }
.pub-title { font-size: 1.08rem; font-weight: 500; line-height: 1.4; margin: 0 0 0.25rem; }
.pub-authors { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin: 0 0 0.15rem; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: var(--step--1); margin: 0; }
.pub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin-top: 0.55rem; }
.tag { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); padding: 0 0.2rem; }
.tag.first { color: var(--amber); font-weight: 600; }
.empty { font-family: var(--sans); color: var(--muted); padding: 1.5rem 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
mark { background: color-mix(in srgb, var(--amber) 28%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }
.home-pubs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.home-pubs .pub { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.2rem; }
.home-pubs .pub-actions { margin-top: auto; padding-top: 0.7rem; }
.pub-year-inline { font-family: var(--sans); color: var(--muted); }

/* Cite dialog */
dialog.cite { width: min(640px, calc(100vw - 2rem)); border: 1px solid var(--rule); border-radius: 10px; padding: 0; background: var(--surface); color: var(--ink); }
dialog.cite::backdrop { background: rgba(10, 20, 25, 0.45); }
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.cite-head h2 { font-size: var(--step-1); }
.cite-body { padding: 1rem 1.25rem 1.25rem; font-family: var(--sans); font-size: var(--step--1); }
.cite-body h3 { margin: 0.4rem 0; }
.cite-body pre { white-space: pre-wrap; word-break: break-word; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 0.8rem; font-size: 0.78rem; margin: 0 0 0.6rem; max-height: 14rem; overflow: auto; }
.cite-body .row { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.close { background: none; border: 1px solid var(--rule); border-radius: 50%; width: 2rem; height: 2rem; color: var(--ink); cursor: pointer; font-size: 1.1rem; line-height: 1; }

/* ---------- Awards ---------- */
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.award { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.7rem; padding: 0.65rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step-0); line-height: 1.4; }
.award .y { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.award .by { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }

/* ---------- Presentations ---------- */
.talk-list { max-width: 900px; padding-bottom: 3rem; }
.talk-year { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; margin-bottom: 0.6rem; }
.talk-year > h2 { font-size: var(--step-1); font-weight: 400; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.talks li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 0 0 1.2rem; }
.talks .when { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); padding-top: 0.15rem; }
.talks .kind { display: inline-block; font-family: var(--sans); font-size: 0.72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0.05rem 0.45rem; margin-bottom: 0.3rem; }
.talks .t { display: block; font-weight: 500; line-height: 1.4; }
.talks .w { display: block; font-size: var(--step--1); color: var(--muted); }

/* ---------- Timeline (Experience, Voluntary) ---------- */
.timeline { position: relative; max-width: 900px; padding-bottom: 2rem; }
.timeline::before { content: ""; position: absolute; left: 7.6rem; top: 0.6rem; bottom: 2.6rem; width: 1px; background: var(--rule); }
.tl { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 2rem; padding-bottom: 1.6rem; position: relative; }
.tl::after { content: ""; position: absolute; left: calc(7.6rem - 4.5px); top: 0.5rem; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.tl.now::after { background: var(--accent); }
.tl-when { text-align: right; padding-top: 0.1rem; font-family: var(--sans); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-role { font-weight: 500; margin: 0; }
.tl-org { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin: 0 0 0.3rem; }
.tl-text { font-size: var(--step--1); margin: 0; }
.vol-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; padding-bottom: 2rem; }
.review-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.5rem; position: sticky; top: 5.5rem; }
.review-card .when, .teach-card .when { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin-bottom: 0.8rem; }
.review-card p:last-child { margin-bottom: 0; font-size: var(--step--1); }

/* ---------- Teaching ---------- */
.teach { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.teach-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.5rem; }
.teach-card h2 { font-size: var(--step-1); margin-bottom: 0.25rem; }
.courses li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); font-size: var(--step--1); }
.courses li b { font-family: var(--sans); font-weight: 600; }
.courses.names li { grid-template-columns: 1fr; }

/* ---------- Projects ---------- */
.project-main { padding-bottom: 2rem; }
.project-intro { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); margin-bottom: 2rem; }
.status { display: inline-block; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--paper); background: var(--infect); border-radius: 4px; padding: 0.1rem 0.55rem; margin-bottom: 0.8rem; }
.project-intro h2 { font-size: var(--step-2); margin-bottom: 0.6rem; line-height: 1.25; }
.project-intro .when { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }

.bc-fig { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.bc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--rule); }
.bc-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; font-family: var(--sans); font-size: var(--step--1); }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.seg-small button { font-size: 0.75rem; padding: 0.2rem 0.65rem; }
.bc-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.bc-plots { padding: 1rem 1.2rem 0.6rem; display: grid; gap: 1rem; min-width: 0; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel { min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.panel-head h3 { margin: 0; color: var(--ink); font-weight: 600; }
.panel svg { width: 100%; height: auto; display: block; font-family: var(--sans); overflow: visible; }
.bc-controls { border-left: 1px solid var(--rule); padding: 1rem 1.2rem; display: grid; gap: 1rem; align-content: start; font-family: var(--sans); font-size: var(--step--1); }
.ctl-group { border: 0; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.ctl-group legend { font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 0.5rem; }
.ctl { display: block; }
.ctl-top { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 500; }
.ctl-top output { font-variant-numeric: tabular-nums; color: var(--infect); white-space: nowrap; }
.ctl input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0.35rem 0 0.1rem; }
.ctl-hint { display: block; font-size: 0.74rem; color: var(--muted); line-height: 1.35; margin-top: 0.15rem; }
.ctl select { margin-top: 0.35rem; padding: 0.4rem 0.6rem; }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 0.8rem; margin: 0.2rem 0 0; }
.readout div { border-top: 2px solid var(--infect); padding-top: 0.35rem; }
.readout div:last-child { border-top-color: var(--muted); }
.readout dt { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.readout dd { margin: 0; font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.bc-caption { padding: 0.9rem 1.2rem 1.1rem; border-top: 1px solid var(--rule); font-size: var(--step--1); line-height: 1.55; }
.fig-num { font-weight: 600; }
.noscript-note { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); padding: 1rem; }

/* chart marks */
.axis line, .axis path { stroke: var(--rule); }
.axis text { fill: var(--muted); font-size: 11px; }
.grid line { stroke: var(--rule); stroke-dasharray: 2 4; }
.c-base { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 5; opacity: 0.9; }
.c-s { fill: none; stroke: var(--sus); stroke-width: 2.4; }
.c-i { fill: none; stroke: var(--infect); stroke-width: 2.6; stroke-linejoin: round; }
.c-r { fill: none; stroke: var(--rem); stroke-width: 2.4; }
.c-i-area { fill: var(--infect); opacity: 0.1; }
.c-rt { fill: none; stroke: var(--accent); stroke-width: 2.4; }
.c-one { stroke: var(--infect); stroke-width: 1; stroke-dasharray: 3 3; }
.c-alarm { fill: none; stroke: var(--accent); stroke-width: 2.6; }
.c-visited { fill: var(--accent); opacity: 0.08; }
.c-stoch { fill: none; stroke: var(--infect); stroke-width: 1; opacity: 0.28; }
.c-cursor { stroke: var(--ink); stroke-width: 1; opacity: 0.5; }
.c-dot { fill: var(--infect); stroke: var(--surface); stroke-width: 2; }
.lab { font-size: 12px; font-weight: 600; }
.lab-s { fill: var(--sus); } .lab-i { fill: var(--infect); } .lab-r { fill: var(--rem); }
.lab-base { fill: var(--muted); font-weight: 500; font-size: 11px; }
.lab-note { fill: var(--muted); font-size: 10.5px; }

.model-box { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.3rem 1.4rem; }
.model-box h3 { color: var(--ink); }
.eqs { display: grid; gap: 0.5rem; margin-bottom: 1rem; overflow-x: auto; }
.eq { font-family: var(--serif); font-style: italic; margin: 0; max-width: none; }
.alarm-table { border-collapse: collapse; font-family: var(--serif); }
.alarm-table th { font-family: var(--sans); font-size: var(--step--1); font-weight: 600; text-align: left; padding: 0.35rem 1.2rem 0.35rem 0.6rem; color: var(--muted); }
.alarm-table td { font-style: italic; padding: 0.35rem 0.6rem; }
.alarm-table tr { border-radius: 6px; }
.alarm-table tr.on { background: var(--accent-soft); }
.alarm-table tr.on th { color: var(--ink); }

/* ---------- Footer ---------- */
.foot { margin-top: 3rem; border-top: 1px solid var(--rule); background: var(--surface); }
.foot-inner { max-width: var(--wrap); margin: 0 auto; padding: 2.5rem var(--gutter) 2.5rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; font-family: var(--sans); font-size: var(--step--1); }
.foot-name { font-family: var(--serif); font-size: var(--step-1); margin-bottom: 0.5rem; }
.foot address { font-style: normal; color: var(--muted); line-height: 1.7; }
.foot li { padding: 0.15rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .nav-toggle { display: inline-block; font-family: var(--sans); font-size: var(--step--1); background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 999px; padding: 0.35rem 0.95rem; cursor: pointer; }
  .nav ul { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0.5rem var(--gutter) 1rem; }
  .nav ul.open { display: flex; }
  .nav ul a { display: block; padding: 0.7rem 0; font-size: var(--step-0); border-bottom: 0; }
  .nav a[aria-current="page"] { color: var(--accent); }
}
@media (max-width: 980px) {
  .bc-body { grid-template-columns: 1fr; }
  .bc-controls { border-left: 0; border-top: 1px solid var(--rule); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .readout { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .pub-layout { grid-template-columns: 1fr; }
  .filters { position: static; grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .project-intro { grid-template-columns: 1fr; gap: 0.5rem; }
  .vol-layout { grid-template-columns: 1fr; }
  .review-card { position: static; }
}
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .profile { position: static; max-width: 420px; margin: 0 auto; }
  .facts, .teach, .awards, .home-pubs { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
  .panel-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
  .pub-year, .talk-year { grid-template-columns: 1fr; gap: 0.3rem; }
  .talks li { grid-template-columns: 1fr; gap: 0.15rem; }
  .timeline::before { left: 0.3rem; }
  .tl { grid-template-columns: 1fr; gap: 0.1rem; padding-left: 1.5rem; }
  .tl::after { left: calc(0.3rem - 4.5px); }
  .tl-when { text-align: left; }
  .readout { grid-template-columns: 1fr 1fr; }
  .bc-top { padding: 0.8rem; }
  .seg button { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
  .bc-plots { padding: 0.8rem 0.6rem 0.4rem; }
  .axis text { font-size: 15px; }
  .lab { font-size: 15px; }
  .cv-pill { padding: 0.35rem 0.6rem; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .theme, .filters, .pub-actions, .foot, .bc-fig, .motto, .cv-btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  a { color: #000; text-decoration: none; }
  .pub-layout, .about { grid-template-columns: 1fr; }
}

/* ---------- Visitor map (About page) ---------- */
/* Map shades: one teal ramp from the site accent, checked for colour-blind and contrast safety */
:root { --vm-land: #E1E8EA; --vm-1: #81BECE; --vm-2: #57A0B2; --vm-3: #348294; --vm-4: #1C6373; --vm-5: #0B4653; --vm-bar: #348294; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --vm-land: #2B3639; --vm-1: #2E6370; --vm-2: #418494; --vm-3: #5BA5B7; --vm-4: #84C5D6; --vm-5: #B6E4F0; --vm-bar: #84C5D6; }
}
:root[data-theme="dark"] { --vm-land: #2B3639; --vm-1: #2E6370; --vm-2: #418494; --vm-3: #5BA5B7; --vm-4: #84C5D6; --vm-5: #B6E4F0; --vm-bar: #84C5D6; }

.vm { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; font-family: var(--sans); }
.vm-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.8rem 1.5rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule); }
.vm-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 2.2rem; margin: 0; }
.vm-stats dt { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.vm-stats dd { margin: 0.1rem 0 0; font-size: 1.55rem; font-weight: 600; line-height: 1.15; color: var(--ink); }
.vm-status { margin: 0; font-size: var(--step--1); color: var(--muted); max-width: none; }
.vm-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; }
.vm-map { position: relative; padding: 1rem 1.2rem 0.9rem; min-width: 0; }
.vm-svg { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 448; }
.vm-c { fill: var(--vm-land); stroke: var(--surface); stroke-width: 0.7px; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill 0.35s ease; }
.vm-c.vm-b1, .vm-dot.vm-b1 { fill: var(--vm-1); }
.vm-c.vm-b2, .vm-dot.vm-b2 { fill: var(--vm-2); }
.vm-c.vm-b3, .vm-dot.vm-b3 { fill: var(--vm-3); }
.vm-c.vm-b4, .vm-dot.vm-b4 { fill: var(--vm-4); }
.vm-c.vm-b5, .vm-dot.vm-b5 { fill: var(--vm-5); }
.vm-c.is-hot { stroke: var(--ink); stroke-width: 1.4px; }
.vm-dot { stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.vm-dot.is-hot { stroke: var(--ink); stroke-width: 1.5px; }
.vm-dot-hit { fill: transparent; }
.vm-tip { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 0.4rem 0.65rem; box-shadow: 0 4px 16px rgba(10, 20, 25, 0.14); font-size: 0.78rem; line-height: 1.35; white-space: nowrap; }
.vm-tip strong { display: block; font-size: 0.92rem; font-weight: 600; }
.vm-tip span { color: var(--muted); }
.vm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.85rem; margin-top: 0.8rem; font-size: 0.75rem; color: var(--muted); }
.vm-legend-title { font-weight: 600; }
.vm-key { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.vm-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.vm-k0 { background: var(--vm-land); box-shadow: inset 0 0 0 1px var(--rule); }
.vm-k1 { background: var(--vm-1); } .vm-k2 { background: var(--vm-2); } .vm-k3 { background: var(--vm-3); }
.vm-k4 { background: var(--vm-4); } .vm-k5 { background: var(--vm-5); }
.vm-side { border-left: 1px solid var(--rule); padding: 1rem 1.2rem; min-width: 0; }
.vm-side h3 { color: var(--ink); margin-bottom: 0.5rem; }
.vm-list { display: grid; gap: 0.1rem; }
.vm-row { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr) auto; column-gap: 0.5rem; align-items: baseline; padding: 0.32rem 0.4rem; margin: 0 -0.4rem; border-radius: 6px; font-size: var(--step--1); line-height: 1.35; outline-offset: 0; }
.vm-row:hover, .vm-row.is-hot { background: var(--accent-soft); }
.vm-rank { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.vm-name { overflow-wrap: anywhere; }
.vm-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.vm-bar { grid-column: 2 / 4; height: 6px; margin-top: 0.3rem; }
.vm-bar span { display: block; height: 100%; min-width: 3px; background: var(--vm-bar); border-radius: 0 3px 3px 0; }
.vm-empty { font-size: var(--step--1); color: var(--muted); padding: 0.3rem 0; }
.vm-more { margin-top: 0.8rem; }
.vm-all { padding: 1rem 1.2rem 1.1rem; border-top: 1px solid var(--rule); }
.vm-all h3 { color: var(--ink); margin-bottom: 0.5rem; }
.vm-list-all { display: block; columns: 4 210px; column-gap: 2.2rem; }
.vm-list-all .vm-row { break-inside: avoid; margin: 0 -0.4rem 0.1rem; }
.vm-note { margin: 0; padding: 0.8rem 1.2rem 0.95rem; border-top: 1px solid var(--rule); font-size: 0.78rem; line-height: 1.5; color: var(--muted); max-width: none; }
@media (max-width: 980px) {
  .vm-body { grid-template-columns: 1fr; }
  .vm-side { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .vm-top, .vm-map, .vm-side, .vm-all, .vm-note { padding-left: 0.9rem; padding-right: 0.9rem; }
  .vm-stats { gap: 0.6rem 1.4rem; }
  .vm-stats dd { font-size: 1.3rem; }
}
@media print { .vm-tip, .vm-more { display: none !important; } }
