/* ==========================================================================
   Leen Alkalbani, MD — academic website (v2, multi-page)
   Design: journal editorial. Warm paper, ink navy, one signal-vermilion accent
   (the EEG spike). Newsreader serif + IBM Plex Sans / Mono for metadata.
   ========================================================================== */

:root {
  --paper: #f7f4ee;
  --paper-deep: #efe9dd;
  --card: #fbf9f5;
  --ink: #1b2b4b;
  --ink-2: #34425f;
  --muted: #5c6170;
  --rule: #dcd4c4;
  --rule-strong: #c9bfab;
  --signal: #d2492a;
  --signal-ink: #b03a1f;
  --signal-wash: #f6e3db;
  --on-ink-muted: #b9c1d2;
  --on-ink-accent: #f3b9a6;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1160px;
  --narrow: 920px;
  --gutter: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(27, 43, 75, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover { text-decoration-color: var(--signal); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.prose p + p { margin-top: 1em; }
.lede { font-size: clamp(20px, 2vw, 23px); line-height: 1.5; color: var(--ink); }

/* ------------------------------------------------------------------ buttons and links */
.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--signal-ink); border-color: var(--signal-ink); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn__meta { font-family: var(--mono); font-size: 11.5px; font-weight: 400; opacity: 0.78; letter-spacing: 0.04em; }
.btn--large { padding: 16px 24px; font-size: 16px; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.link-chip svg { width: 17px; height: 17px; flex: none; color: var(--signal-ink); }
.link-chip:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.link-chip:hover svg { color: var(--on-ink-accent); }

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.more svg { width: 18px; height: 18px; color: var(--signal-ink); transition: transform 0.2s var(--ease); }
.more:hover { color: var(--signal-ink); }
.more:hover svg { transform: translateX(4px); }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand__mark { width: 30px; height: 30px; color: var(--ink); flex: none; }
.brand__name { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.brand__deg { font-weight: 400; color: var(--muted); }

.topnav { position: relative; }
.topnav__list { display: flex; align-items: center; gap: 28px; }
.topnav__list a {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.topnav__list a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.topnav__list a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--signal); }

.topnav__toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.topnav__toggle-bars,
.topnav__toggle-bars::before,
.topnav__toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.topnav__toggle-bars { position: relative; }
.topnav__toggle-bars::before,
.topnav__toggle-bars::after { content: ""; position: absolute; left: 0; }
.topnav__toggle-bars::before { top: -5px; }
.topnav__toggle-bars::after { top: 5px; }
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bars { background: transparent; }
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.topnav__toggle[aria-expanded="true"] .topnav__toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

/* ------------------------------------------------------------------ kicker and labels */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-ink);
}
.kicker::before {
  content: "";
  width: 34px;
  height: 14px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 14'%3E%3Cpath d='M0 8h12l2.5-7 3.5 12 3-8h13' fill='none' stroke='%23d2492a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 48px 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal-ink);
}
.block--first .wrap > .label:first-child { margin-top: 0; }
.label__count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ------------------------------------------------------------------ home intro */
.intro { padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 6vw, 72px); }
.intro__name {
  font-size: clamp(44px, 6.6vw, 86px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.intro__deg { font-style: italic; font-weight: 400; color: var(--ink-2); }
.intro__title {
  margin-top: 16px;
  font-size: clamp(21px, 2.4vw, 27px);
  font-style: italic;
  line-height: 1.3;
  color: var(--ink-2);
}
.intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "bio photo"
    "bio aside";
  grid-template-rows: auto 1fr;
  column-gap: clamp(36px, 6vw, 88px);
  row-gap: 28px;
  align-items: start;
  margin-top: clamp(32px, 4vw, 48px);
}
.intro__bio { grid-area: bio; max-width: 64ch; }
.intro__bio p:not(.lede) { font-size: 18px; color: var(--ink-2); }

.intro__photo {
  grid-area: photo;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--rule);
}
.intro__photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.intro__aside { grid-area: aside; padding-top: 16px; border-top: 3px solid var(--ink); }
.aside-block + .aside-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); }
.intro__aside .label { margin: 0 0 8px; color: var(--muted); }
.aside-block__main { font-size: 19px; font-weight: 500; line-height: 1.35; }
.aside-block__sub { margin-top: 4px; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); }
.interests li {
  position: relative;
  padding: 5px 0 5px 20px;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.interests li::before {
  content: "";
  position: absolute;
  left: 0; top: 13px;
  width: 9px; height: 1.5px;
  background: var(--signal);
}

/* ------------------------------------------------------------------ question band */
.band {
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.band .label { margin: 0 0 22px; }
.trace { display: block; width: 100%; height: 56px; overflow: visible; }
.trace path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trace__base { stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.trace__spike { stroke: var(--signal); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.question__text {
  margin-top: 22px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.question .more { margin-top: 24px; }

/* ------------------------------------------------------------------ generic blocks */
.block { padding: clamp(52px, 7vw, 80px) 0; }
.block + .block { border-top: 1px solid var(--rule); }
.block--first { padding-top: clamp(28px, 4vw, 44px); }
.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.block__head h2,
.block__h { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -0.015em; }
.block__h { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.block__note { margin: -8px 0 18px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------ news */
.news li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.news time {
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--signal-ink);
  white-space: nowrap;
}
.news p { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.news strong { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ selected publications */
.pubs li { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.pubs__title { font-size: 19.5px; font-weight: 500; line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.pubs__authors { margin-top: 6px; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.pubs__authors strong { font-weight: 600; color: var(--ink); }
.pubs__venue { margin-top: 4px; font-size: 16px; color: var(--ink-2); }

/* ------------------------------------------------------------------ people */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 36px; }
.people--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.people--stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
.person { padding-top: 16px; border-top: 2px solid var(--ink); }
.people--stack .person { padding: 14px 0 16px; border-top: 0; border-bottom: 1px solid var(--rule); }
.people--stack .person:first-child { padding-top: 0; }
.person__rel { font-family: var(--mono); font-size: 12px; color: var(--signal-ink); }
.person__name { margin: 6px 0; font-size: 21px; }
.person__title { font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ------------------------------------------------------------------ inner page head */
.page-head { padding: clamp(48px, 7vw, 88px) 0 clamp(36px, 5vw, 56px); }
.page-head__title {
  margin-top: 18px;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.page-head__lede {
  max-width: 62ch;
  margin-top: 20px;
  font-size: clamp(18.5px, 1.8vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
}
.page-head__actions { margin-top: 28px; }
.page-head--404 { min-height: 52vh; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chips a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chips a span { font-family: var(--mono); font-size: 11px; color: var(--signal-ink); }
.chips a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips a:hover span { color: var(--on-ink-accent); }

/* ------------------------------------------------------------------ research banner */
.banner { margin: 0 0 clamp(8px, 2vw, 16px); }
.banner__art {
  max-width: var(--wrap);
  margin: 0 auto;
  height: clamp(190px, 28vw, 380px);
  overflow: hidden;
  background: var(--paper-deep);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.banner__art img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.banner figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.fig-no { margin-right: 8px; font-weight: 500; color: var(--signal-ink); }

/* ------------------------------------------------------------------ research themes */
.theme { padding: clamp(56px, 7vw, 88px) 0 clamp(16px, 2vw, 24px); }
.theme__head { margin-bottom: 30px; }
.theme__no {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-ink);
}
.theme__head h2 {
  margin-top: 10px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  font-size: clamp(30px, 3.8vw, 42px);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.theme__lede { max-width: 64ch; margin-top: 16px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  transition: border-top-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { border-top-color: var(--signal); box-shadow: 0 16px 36px -28px rgba(27, 43, 75, 0.45); }
.card__meta { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; letter-spacing: 0.02em; color: var(--signal-ink); }
.card__title { margin: 10px 0; font-size: 22px; line-height: 1.22; letter-spacing: -0.008em; }
.card > p:not(.card__meta):not(.card__role) { font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.card__role {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--signal);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.card__role span {
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.tags li {
  padding: 3px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ training + mentors split */
.block--split { margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--rule); }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 64px); align-items: start; }
.goals li {
  position: relative;
  padding-left: 26px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}
.goals li + li { margin-top: 14px; }
.goals li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 16px; height: 10px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M0 6h5l1.5-5 2 8 1.5-4h6' fill='none' stroke='%23d2492a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.goals strong { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ full reference lists */
.refs { counter-reset: ref; }
.refs li {
  position: relative;
  padding: 14px 0 14px 46px;
  border-top: 1px solid var(--rule);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-2);
  counter-increment: ref;
}
.refs li:last-child { border-bottom: 1px solid var(--rule); }
.refs li::before {
  content: counter(ref, decimal-leading-zero);
  position: absolute;
  left: 0; top: 17px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--signal-ink);
}
.refs strong { font-weight: 600; color: var(--ink); }
.doi {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ presentations */
.year {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.block__head + .year { border-top: 0; padding-top: 4px; }
.year__no { font-size: 32px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.talks li + li { margin-top: 18px; }
.talks__title { font-size: 17.5px; line-height: 1.45; }
.talks__meta { margin-top: 4px; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); }
.talks__meta b { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ CV entries and skills */
.entries .entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 13px 0;
  border-top: 1px solid var(--rule);
}
.entries .entry:last-child { border-bottom: 1px solid var(--rule); }
.entries dt { padding-top: 4px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.entries dd { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.entries strong { font-weight: 600; color: var(--ink); }

.skills > div { padding: 14px 0; border-top: 1px solid var(--rule); }
.skills > div:last-child { border-bottom: 1px solid var(--rule); }
.skills dt { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); }
.skills dd { margin-top: 4px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }

/* ------------------------------------------------------------------ footer */
.footer { margin-top: clamp(48px, 6vw, 80px); background: var(--ink); color: var(--paper); }
.footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 44px var(--gutter) 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px 40px;
  align-items: start;
  font-family: var(--sans);
  font-size: 14px;
}
.footer__id { display: flex; align-items: flex-start; gap: 14px; }
.footer__mark { width: 38px; height: 38px; flex: none; color: var(--paper); }
.footer__name { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.25; }
.footer__aff { margin-top: 4px; color: var(--on-ink-muted); }
.footer__links { display: grid; gap: 8px; }
.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  text-decoration-color: rgba(247, 244, 238, 0.35);
  overflow-wrap: anywhere;
}
.footer__links a:hover { text-decoration-color: var(--on-ink-accent); }
.footer__links svg { width: 17px; height: 17px; flex: none; color: var(--on-ink-accent); }
.footer__note {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid rgba(247, 244, 238, 0.16);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--on-ink-muted);
}

/* ------------------------------------------------------------------ motion */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .trace path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .trace__base { transition: stroke-dashoffset 1.4s var(--ease); }
.js .trace__spike { transition: stroke-dashoffset 0.5s var(--ease) 0.55s; }
.js .is-visible .trace path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .trace path { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .btn, .btn:hover, .more:hover svg { transform: none; }
}

@media print {
  .topbar, .skip-link, .chips, .banner { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .footer { background: none; color: var(--ink); }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .intro__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "photo" "bio" "aside";
    grid-template-rows: auto;
    row-gap: clamp(28px, 5vw, 40px);
  }
  .intro__photo { width: min(240px, 60%); }
  .intro__aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
  .aside-block + .aside-block { margin-top: 0; padding-top: 0; border-top: 0; }
  .people--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topnav__toggle { display: inline-flex; }
  .topnav__list {
    position: absolute;
    right: 0;
    top: calc(100% + 13px);
    width: min(280px, calc(100vw - 2 * var(--gutter)));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 18px 10px;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    box-shadow: 0 18px 40px -20px rgba(27, 43, 75, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
  }
  .topnav[data-open="true"] .topnav__list {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s;
  }
  .topnav__list li { border-bottom: 1px solid var(--rule); }
  .topnav__list li:last-child { border-bottom: 0; }
  .topnav__list a { display: block; padding: 12px 0; font-size: 15px; border-bottom: 0; }
  .topnav__list a[aria-current="page"] { color: var(--signal-ink); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .intro__aside { grid-template-columns: minmax(0, 1fr); }
  .aside-block + .aside-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
  .news li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .people,
  .people--compact { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .year { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .year__no { font-size: 26px; }
  .entries .entry { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .refs li { padding-left: 36px; }
  .card { padding: 20px 18px; }
  .block__head { flex-wrap: wrap; }
  .footer__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .brand__name { font-size: 14px; }
  .link-chip { flex: 1 1 calc(50% - 10px); justify-content: center; }
}

/* ------------------------------------------------------------------ feature card (flagship project per theme) */
@media (min-width: 821px) {
  .card--feature {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: 36px;
    align-content: start;
  }
  .card--feature > * { grid-column: 1; }
  .card--feature .card__role { grid-column: 2; grid-row: 1 / span 4; align-self: start; margin-top: 0; }
  .card--feature .card__title { font-size: 25px; }
}
