/* =========================================================
   Shannon Whitlock — personal academic site
   Plain CSS. Mobile-first. Light/dark via prefers-color-scheme.
   ========================================================= */

:root {
  /* === Colour — light (default) === */
  --bg:               #f9f9f9;
  --bg-elev:          #ffffff;
  --bg-sunken:        #f2f0ea;
  --ink:              #16161a;
  --ink-muted:        #52525b;
  --ink-soft:         #71717a;
  --rule:             #e5e3dc;
  --rule-strong:      #c8c5bb;

  --accent:           #2f4858;     /* deep slate-teal */
  --accent-soft:      #e9eef0;
  --accent-ink:       #ffffff;

  --tag-bg:           #1d1f24;
  --tag-ink:          #f6f4ee;

  --shadow-sm:        0 1px 2px rgba(20, 20, 24, .04), 0 1px 1px rgba(20, 20, 24, .03);
  --shadow-md:        0 8px 24px -12px rgba(20, 20, 24, .15), 0 2px 6px rgba(20, 20, 24, .04);

  /* === Typography === */
  --font-serif:       "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono:        ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --fs-xs:            0.78rem;   /* 12.5px */
  --fs-sm:            0.875rem;  /* 14px */
  --fs-base:          1rem;      /* 16px */
  --fs-md:            1.0625rem; /* 17px */
  --fs-lg:            1.25rem;   /* 20px */
  --fs-xl:            1.5rem;    /* 24px */
  --fs-2xl:           2rem;      /* 32px */
  --fs-3xl:           2.75rem;   /* 44px */
  --fs-4xl:           clamp(2.75rem, 7vw, 5.25rem);

  --lh-tight:         1.1;
  --lh-snug:          1.3;
  --lh-normal:        1.55;
  --lh-relaxed:       1.7;

  /* === Spacing scale === */
  --sp-1:             0.25rem;
  --sp-2:             0.5rem;
  --sp-3:             0.75rem;
  --sp-4:             1rem;
  --sp-5:             1.5rem;
  --sp-6:             2rem;
  --sp-7:             3rem;
  --sp-8:             4rem;
  --sp-9:             6rem;
  --sp-10:            8rem;

  /* === Radii === */
  --r-xs:             4px;
  --r-sm:             6px;
  --r-md:             10px;
  --r-lg:             16px;
  --r-pill:           999px;

  /* === Layout === */
  --measure:          68ch;
  --container:        1180px;
  --container-narrow: 880px;
  --nav-h:            64px;

  /* === Motion === */
  --ease:             cubic-bezier(.2, .7, .2, 1);
  --t-fast:           120ms;
  --t-mid:            220ms;
  --t-slow:           420ms;
}

/* === Colour — dark === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #0e0f12;
    --bg-elev:        #15171c;
    --bg-sunken:      #0a0b0e;
    --ink:            #f1efe9;
    --ink-muted:      #b4b3ad;
    --ink-soft:       #8a8a85;
    --rule:           #25272d;
    --rule-strong:    #3a3d45;

    --accent:         #cfe3ea;
    --accent-soft:    #1c2127;
    --accent-ink:     #0e0f12;

    --tag-bg:         #f1efe9;
    --tag-ink:        #15171c;

    --shadow-sm:      0 1px 2px rgba(0,0,0,.5);
    --shadow-md:      0 12px 30px -16px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.35);
  }
}

/* =========================================================
   RESET + BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
ul { margin: 0 0 var(--sp-4); padding-left: 1.2em; }
li { margin-bottom: var(--sp-2); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* =========================================================
   LAYOUT PRIMITIVES
   ========================================================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-5);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.section > .section-banner:first-child {
  margin-top: calc(-1 * var(--sp-8));
  margin-bottom: var(--sp-8);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.section-index {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.section-head h2 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
}
.section-lede {
  max-width: var(--measure);
  font-size: var(--fs-md);
  color: var(--ink-muted);
  margin-bottom: var(--sp-7);
}

.section-banner {
  position: relative;
  margin: 0 auto var(--sp-7);
  max-width: var(--container);
  padding: 0 var(--sp-5);
}
.section-banner img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
.section-banner-credit {
  position: absolute;
  right: calc(var(--sp-5) + var(--sp-3));
  bottom: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px var(--sp-2);
  border-radius: var(--r-xs);
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* =========================================================
   NAV
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease), background var(--t-mid) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.nav {
  max-width: var(--container);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.nav-brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
}
.nav-brand-mark img {
  width: 32px;
  height: 32px;
  display: block;
}
.nav-brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  letter-spacing: -0.005em;
}

.nav-toggle {
  margin-left: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  cursor: pointer;
  gap: 4px;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  margin: 2px 0;
  transition: transform var(--t-mid) var(--ease), opacity var(--t-mid) var(--ease);
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule);
  flex-direction: column;
  gap: var(--sp-1);
}
.nav-menu.is-open { display: flex; }
.nav-menu li { margin: 0; }
.nav-menu a {
  display: block;
  padding: var(--sp-3) var(--sp-2);
  font-size: var(--fs-md);
  text-decoration: none;
  color: var(--ink-muted);
  border-radius: var(--r-sm);
}
.nav-menu a:hover,
.nav-menu a.is-active { color: var(--ink); background: var(--bg-sunken); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: calc(var(--sp-9) + var(--nav-h)) var(--sp-5) var(--sp-9);
  max-width: var(--container);
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  gap: var(--sp-7);
  align-items: center;
}
.hero-inner { max-width: 920px; }
.hero-tweezer { width: 100%; max-width: 420px; justify-self: start; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--sp-5);
}
.hero-title {
  font-size: var(--fs-4xl);
  letter-spacing: -0.035em;
  font-weight: 400;
  margin-bottom: var(--sp-6);
}
.hero-tagline {
  max-width: 60ch;
  font-size: var(--fs-lg);
  color: var(--ink-muted);
  line-height: var(--lh-normal);
  margin-bottom: var(--sp-6);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.hero-direct {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: var(--sp-4) 0 0;
}
.hero-direct a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 0.2em; }
.hero-direct a:hover { color: var(--accent); }
.hero-rule {
  position: absolute;
  left: var(--sp-5);
  right: var(--sp-5);
  bottom: 0;
  height: 1px;
  background: var(--rule);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.75rem 1.1rem;
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-link {
  padding: 0;
  background: transparent;
  border: 0;
  font-size: var(--fs-md);
  color: var(--ink);
  border-radius: 0;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px;
}
.btn-link:hover { color: var(--accent); }

/* =========================================================
   TWEEZER ARRAY (hero figure)
   ========================================================= */
.tweezer { margin: 0; }
.tweezer-frame {
  position: relative;
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 16px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 16px 100%,
    var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  aspect-ratio: 320 / 200;
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .tweezer-frame {
    background:
      linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 100% 16px,
      linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 16px 100%,
      var(--bg-elev);
  }
}
.tweezer-corners { position: absolute; inset: 0; pointer-events: none; }
.tweezer-corners span {
  position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--ink); opacity: 0.55;
}
.tweezer-corners span:nth-child(1) { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.tweezer-corners span:nth-child(2) { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.tweezer-corners span:nth-child(3) { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.tweezer-corners span:nth-child(4) { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.tweezer-svg { position: relative; width: 100%; height: 100%; display: block; }

.tweezer-site { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.tweezer-site-cross { stroke: var(--rule-strong); stroke-width: 1; }
.tweezer-site.is-filled { stroke: var(--ink-soft); }

.tweezer-atom {
  fill: var(--accent);
  stroke: var(--bg-elev);
  stroke-width: 1.2;
  cursor: grab;
  transition: cx 700ms var(--ease), cy 700ms var(--ease), opacity 400ms var(--ease), fill 200ms var(--ease), r 200ms var(--ease);
  touch-action: none;
  /* Per-atom wiggle phase, set inline by JS when each atom spawns. */
  --wiggle-duration: 0.4s;
  --wiggle-delay: 0s;
  transform-box: fill-box;
  transform-origin: center;
}
.tweezer-atom.is-wiggling {
  animation: tweezer-wiggle var(--wiggle-duration) var(--wiggle-delay) ease-in-out infinite;
}
.tweezer-atom:hover { r: 4.2; }
.tweezer-atom.is-dragging {
  cursor: grabbing; transition: none; animation: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
.tweezer-atom.is-rydberg { fill: var(--ink); }

@keyframes tweezer-wiggle {
  0%, 100% { translate: 0 0; }
  25%      { translate: 0.5px -0.4px; }
  50%      { translate: -0.4px 0.5px; }
  75%      { translate: 0.3px 0.4px; }
}

.tweezer-halo {
  fill: none; stroke: var(--accent); stroke-width: 1.5;
  opacity: 0; pointer-events: none;
}
.tweezer-halo.is-pulse { animation: tweezer-pulse 700ms var(--ease) forwards; }
@keyframes tweezer-pulse {
  0%   { r: 4;  opacity: 0.85; stroke-width: 2; }
  100% { r: 22; opacity: 0;    stroke-width: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .tweezer-atom { transition: none; }
  .tweezer-atom.is-wiggling { animation: none; }
  .tweezer-halo.is-pulse { animation: none; }
}

.tweezer-readout {
  position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
}
.tweezer-readout-stat { margin-left: auto; color: var(--ink-muted); }

.tweezer-cap {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2);
  margin-top: var(--sp-3); font-family: var(--font-mono);
  font-size: var(--fs-xs); color: var(--ink-soft); letter-spacing: 0.04em;
}
.tweezer-cap-label { color: var(--ink); font-weight: 500; }
.tweezer-reload {
  margin-left: auto; background: transparent;
  border: 1px solid var(--rule-strong); border-radius: var(--r-pill);
  padding: 0.25rem 0.65rem; font: inherit; font-size: 11px;
  color: var(--ink-muted); cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tweezer-reload:hover { color: var(--ink); border-color: var(--ink); }

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  gap: var(--sp-6);
  margin-bottom: var(--sp-7);
}
.about-text { max-width: 78ch; }
.lede {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  color: var(--ink);
  margin-bottom: var(--sp-5);
  letter-spacing: -0.005em;
}
.about-portrait {
  margin: 0;
  max-width: 308px;
}
.about-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
}
.about-portrait-cap {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: var(--sp-2);
  text-align: right;
}

.positions { margin-bottom: var(--sp-7); }
.positions h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-4);
}
.positions-list { list-style: none; padding: 0; margin: 0; }
.positions-list li {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-md);
}
.positions-list li:last-child { border-bottom: 0; }
.positions-list .years {
  display: inline-block;
  min-width: 8ch;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-right: var(--sp-3);
}
.positions-list .role-meta {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.funding-portfolio {
  margin-bottom: var(--sp-7);
}
.funding-heading {
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-4);
}
.funding-list {
  list-style: disc;
  padding-left: 1.2em;
  margin: 0;
}
.funding-list li {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: var(--lh-normal);
  padding: var(--sp-1) 0;
}
.funding-list li::marker { color: var(--ink-soft); }
.funding-list a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--rule-strong); }
.funding-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.past-roles {
  margin-top: var(--sp-5);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-4);
}
.past-roles summary {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  cursor: pointer;
  color: var(--ink-muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.past-roles summary::-webkit-details-marker { display: none; }
.past-roles summary::before {
  content: "+";
  font-family: var(--font-mono);
  color: var(--ink-soft);
  width: 1em;
}
.past-roles[open] summary::before { content: "−"; }
.past-roles[open] summary { margin-bottom: var(--sp-3); }

/* === Tag list === */
.expertise h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-4);
}
.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.tag-list li {
  margin: 0;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  background: var(--bg-elev);
}

/* =========================================================
   CARDS / ACCORDION (Research, Training)
   ========================================================= */
.cards {
  display: grid;
  gap: var(--sp-4);
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-sm); }
.card.is-open { border-color: var(--ink); box-shadow: var(--shadow-md); }

.card-head {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: var(--sp-5);
  cursor: pointer;
  position: relative;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: var(--sp-4);
  row-gap: var(--sp-2);
  align-items: start;
}
.card-tag {
  grid-column: 1 / 2;
  grid-row: 1;
  display: inline-block;
  width: max-content;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tag-ink);
  background: var(--tag-bg);
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-xs);
}
.card-title {
  grid-column: 1 / 2;
  grid-row: 2;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  margin: 0;
}
.card-summary {
  grid-column: 1 / 2;
  grid-row: 3;
  font-size: var(--fs-md);
  color: var(--ink-muted);
  margin: 0;
  line-height: var(--lh-snug);
}
.card-chev {
  grid-column: 2 / 3;
  grid-row: 1 / 4;
  align-self: center;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong);
  position: relative;
  transition: transform var(--t-mid) var(--ease), background var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.card-chev::before,
.card-chev::after {
  content: "";
  position: absolute;
  background: var(--ink);
  border-radius: 1px;
}
.card-chev::before { width: 10px; height: 1.5px; }
.card-chev::after  { width: 1.5px; height: 10px; transition: transform var(--t-mid) var(--ease); }
.card.is-open .card-chev { background: var(--ink); border-color: var(--ink); }
.card.is-open .card-chev::before,
.card.is-open .card-chev::after { background: var(--bg); }
.card.is-open .card-chev::after { transform: scaleY(0); }

.card-head:hover .card-chev { border-color: var(--ink); }

.card-body {
  padding: 0 var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--rule);
  margin-top: var(--sp-2);
  font-size: var(--fs-md);
  color: var(--ink-muted);
}
.card-body[hidden] { display: none; }
.card-body > :first-child { margin-top: var(--sp-5); }
.card-body h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: var(--sp-5) 0 var(--sp-2);
}
.card-body ul { padding-left: 1.1em; }
.card-body li { color: var(--ink-muted); }
.card-meta { font-size: var(--fs-sm); color: var(--ink-muted); }
.card-figures {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) 0;
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.card-figures span + span::before {
  content: "·";
  margin: 0 var(--sp-3);
  color: var(--ink-soft);
  opacity: 0.5;
}
.card-funding {
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule-strong);
  padding-left: var(--sp-3);
  margin-top: var(--sp-5);
}
.card-cta { margin-top: var(--sp-5); margin-bottom: 0; }

/* =========================================================
   PUBLICATIONS
   ========================================================= */
.section-pub { padding-bottom: var(--sp-9); }
.pub-callout {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
}
.pub-note {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  color: var(--ink);
  max-width: 50ch;
  margin: 0 auto var(--sp-3);
  line-height: var(--lh-snug);
}
.pub-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--sp-5);
}
.pub-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  margin: 0;
}

/* --- Highlighted publication --- */
.pub-highlight {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
  margin: 0 0 var(--sp-7);
}
.pub-highlight .pub-latest-title {
  margin-bottom: var(--sp-3);
}
.pub-highlight-citation {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  color: var(--ink);
  margin: 0 0 var(--sp-3);
}
.pub-highlight-authors {
  color: var(--ink-muted);
}
.pub-highlight-title {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
}
.pub-highlight-title:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.pub-highlight-venue {
  color: var(--ink-muted);
}
.pub-highlight-meta {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: var(--lh-normal);
  margin: 0 0 var(--sp-4);
}
.pub-highlight-stats {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: baseline;
}
.pub-highlight-stats a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.pub-highlight-stats a:hover { border-bottom-color: var(--accent); }
.pub-highlight-sep { color: var(--ink-soft); opacity: 0.5; }

/* --- Latest preprints (arXiv myarticles widget) --- */
.pub-latest {
  margin-bottom: var(--sp-7);
}
.pub-latest-title {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 500;
  margin: 0 0 var(--sp-2);
  color: var(--ink);
}
.pub-latest-note {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 var(--sp-5);
}
.pub-latest-note a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.2em; }
.pub-latest-note a:hover { color: var(--accent); }
.pub-latest-loading {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* Override the widget's inline-styled output to match the site. */
.arxivfeed #arxivcontainer {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-base) !important;
  margin: 0 !important;
  color: var(--ink);
}
.arxivfeed #arxivcontainer h3 { display: none !important; }
.arxivfeed dl {
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  gap: 0;
}
.arxivfeed dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--sp-2);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.arxivfeed dt:first-child { border-top: 0; padding-top: 0; }
.arxivfeed .list-identifier {
  font-weight: 500 !important;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.arxivfeed .list-identifier a {
  color: var(--ink) !important;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}
.arxivfeed .list-identifier a:hover { color: var(--accent) !important; border-bottom-color: var(--accent); }
.arxivfeed dd {
  margin: 0 !important;
  padding: 0 0 var(--sp-5) !important;
}
.arxivfeed .meta { line-height: var(--lh-normal) !important; }
.arxivfeed .list-title {
  font-family: var(--font-serif) !important;
  font-size: var(--fs-lg) !important;
  font-weight: 500 !important;
  line-height: var(--lh-snug) !important;
  margin: 0 0 var(--sp-2) !important;
  color: var(--ink);
}
.arxivfeed .list-authors {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 400 !important;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2) !important;
}
.arxivfeed .list-authors a { color: var(--ink-muted); text-decoration: none; }
.arxivfeed .list-authors a:hover { color: var(--accent); }
.arxivfeed .list-subjects,
.arxivfeed .list-journal-ref,
.arxivfeed .list-doi {
  font-family: var(--font-mono) !important;
  font-size: var(--fs-xs) !important;
  color: var(--ink-soft) !important;
  margin-top: var(--sp-1) !important;
}
.arxivfeed .descriptor {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.arxivfeed .primary-subject { font-weight: 500 !important; color: var(--ink-muted) !important; }
.arxivfeed .list-doi a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule); }
.arxivfeed .list-doi a:hover { border-bottom-color: var(--accent); }
.arxivfeed #authorid_hook { display: none !important; }
.arxivfeed dl > br { display: none !important; }
.arxivfeed dl > span {
  display: block;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono) !important;
  font-size: var(--fs-xs) !important;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.arxivfeed dl > span a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule); }
.arxivfeed dl > span a:hover { border-bottom-color: var(--accent); }

/* =========================================================
   SOFTWARE
   ========================================================= */
.software-feature {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  margin-bottom: var(--sp-7);
}
.software-feature-head { margin-bottom: var(--sp-5); }
.software-feature-title {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: var(--sp-3) 0 var(--sp-2);
  color: var(--ink);
}
.software-feature-summary {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  color: var(--ink-muted);
  margin: 0;
  max-width: 60ch;
}
.software-feature-body p,
.software-feature-body ul {
  color: var(--ink-muted);
  line-height: var(--lh-normal);
}
.software-feature-body ul {
  padding-left: var(--sp-5);
  margin: 0 0 var(--sp-5);
}
.software-feature-body li { margin-bottom: var(--sp-2); }
.software-feature-body li strong { color: var(--ink); font-weight: 500; }
.software-feature-body h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: var(--sp-5) 0 var(--sp-3);
}
.software-feature-note {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-4);
  margin-top: var(--sp-5);
}
.software-feature-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: var(--sp-5) 0 0;
}
.software-other-heading {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0 0 var(--sp-4);
}

/* =========================================================
   IMPACT
   ========================================================= */
.impact-grid {
  display: grid;
  gap: var(--sp-4);
}
.impact-block {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-5);
}
.impact-block h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.impact-list { list-style: none; padding: 0; margin: 0; }
.impact-list > li {
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
}
.impact-list > li:last-child { border-bottom: 0; }
.impact-list ul { margin: var(--sp-2) 0 0; padding-left: 1.2em; }
.impact-list ul li { padding: var(--sp-1) 0; border: 0; font-size: var(--fs-sm); }

.events-block {
  margin: 0 0 var(--sp-7);
  padding: var(--sp-5) var(--sp-6);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.events-heading {
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.events-list li {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: var(--lh-snug);
}
.events-list .years { min-width: 11ch; }

/* =========================================================
   CONTACT
   ========================================================= */
.section-contact { padding-bottom: var(--sp-9); }
.contact-grid {
  display: grid;
  gap: var(--sp-5);
}
.contact-block { font-style: normal; }
.contact-block h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--sp-3);
  font-weight: 500;
}
.contact-line {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  margin: 0;
}
.contact-line a { text-decoration-color: var(--ink-soft); }
.contact-emails {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.contact-emails li {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.contact-email-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-emails a {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-soft);
  text-underline-offset: 0.2em;
}
.contact-emails a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.contact-links li { margin: 0; }
.contact-links a { font-size: var(--fs-md); }
.contact-address p { font-size: var(--fs-md); line-height: var(--lh-snug); margin: 0; color: var(--ink-muted); }
.contact-address strong { color: var(--ink); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-sunken);
  margin-top: var(--sp-8);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-muted); }
.footer-sep { opacity: 0.5; margin: 0 var(--sp-1); }

/* =========================================================
   RESPONSIVE — ≥768px
   ========================================================= */
@media (min-width: 768px) {
  .section { padding: var(--sp-9) var(--sp-6); }
  .section > .section-banner:first-child {
    margin-top: calc(-1 * var(--sp-9));
    margin-bottom: var(--sp-9);
  }
  .section-head { gap: var(--sp-5); margin-bottom: var(--sp-7); }
  .section-head h2 { font-size: var(--fs-3xl); }
  .section-banner { padding: 0 var(--sp-6); }
  .section-banner-credit { right: calc(var(--sp-6) + var(--sp-3)); }

  .nav { padding: 0 var(--sp-6); }
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
    gap: var(--sp-1);
    margin-left: auto;
    align-items: center;
  }
  .nav-menu a { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }

  .hero { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .hero-rule { left: var(--sp-6); right: var(--sp-6); }
  .hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    gap: var(--sp-8);
  }
  .hero-tweezer { justify-self: end; max-width: 460px; }

  .about-grid {
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: var(--sp-7);
    align-items: start;
  }
  .about-portrait { justify-self: end; width: 100%; max-width: 308px; }

  .impact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
  }
  .impact-block-wide { grid-column: 1 / -1; }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-7);
  }

  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* =========================================================
   RESPONSIVE — ≥1080px
   ========================================================= */
@media (min-width: 1080px) {
  .section { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
  .section > .section-banner:first-child {
    margin-top: calc(-1 * var(--sp-10));
    margin-bottom: var(--sp-10);
  }
  .hero { padding-top: calc(var(--sp-10) + var(--nav-h)); padding-bottom: var(--sp-10); }

  .impact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .impact-block-wide { grid-column: 1 / -1; }

  .contact-grid {
    grid-template-columns: 1fr 1fr 1fr 1.2fr;
  }
}
