/* ==========================================================================
   foutsemomo.com — design tokens
   ========================================================================== */
:root {
  --bg: #fbfaf7;
  --bg-alt: #f2f1ec;
  --bg-tint: #eef3f7;
  --surface: #ffffff;
  --text: #1b2330;
  --muted: #5a6472;
  --navy: #1f2d44;
  --accent: #1d5c8c;
  --accent-soft: #e2ecf4;
  --copper: #9c5426;
  --copper-soft: #f6ebe2;
  --border: #e0ddd5;
  --chart: #1d5c8c;
  --band-bg: #1f2d44;
  --band-text: #e9eef5;
  --on-accent: #ffffff;
  --max: 1120px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 8px 24px rgba(20, 30, 50, .06);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --bg-alt: #161b22;
    --bg-tint: #162130;
    --surface: #1b212a;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --navy: #dbe4f0;
    --accent: #7db6e3;
    --accent-soft: #1d3247;
    --copper: #e2a37a;
    --copper-soft: #33261d;
    --border: #2a323d;
    --chart: #3b93dd;
    --band-bg: #1a2638;
    --band-text: #e6edf6;
    --on-accent: #0f1520;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.65 var(--sans); }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font: 600 clamp(2rem, 4.6vw, 3.1rem)/1.12 var(--serif); letter-spacing: -.015em; }
h2 { font: 600 clamp(1.4rem, 2.6vw, 1.75rem)/1.2 var(--serif); margin-bottom: 1.1rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .9rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.section { padding: 4rem 0; }
.section.alt { background: var(--bg-alt); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.muted, .note { color: var(--muted); }
.note { font-size: .9rem; }
.mt { margin-top: 2.5rem; }
.sub { margin: 2.75rem 0 1rem; font-size: 1.2rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 30; background: var(--surface); padding: .5rem .75rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.when { display: inline-block; min-width: 3.6rem; font-weight: 600; font-size: .85rem; color: var(--copper); font-variant-numeric: tabular-nums; }
.prose p { font-size: 1.07rem; }
.prose strong { color: var(--navy); }
.narrow > h2:not(:first-child) { margin-top: 2.75rem; }

/* Buttons */
.button {
  display: inline-block; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--navy);
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { filter: brightness(1.1); color: var(--on-accent); }
.button.light { background: #fff; color: #1f2d44; border-color: #fff; }
.links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }

/* ==========================================================================
   Header and footer
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  /* Solid background: a blurred see-through header makes scrolling stutter on long pages. */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--navy); text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px;
  background: var(--navy); color: var(--bg); font: 600 .85rem var(--serif); letter-spacing: .02em;
}
.header-actions { display: flex; align-items: center; gap: .9rem; }
.nav { display: flex; gap: 1.3rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--navy); }
.nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--copper); }
.lang-toggle, .nav-toggle {
  font: 600 .8rem var(--sans); letter-spacing: .04em; text-decoration: none; display: inline-block;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: .4rem .8rem; cursor: pointer;
}
.lang-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; }

.site-footer { background: var(--band-bg); color: var(--band-text); padding: 3rem 0 1.5rem; margin-top: 0; }
.site-footer a { color: var(--band-text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-name { font: 600 1.25rem var(--serif); margin-bottom: .2rem; }
.footer-h { font: 600 .8rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: inherit; opacity: .7; margin-bottom: .6rem; }
.site-footer li { padding: .2rem 0; }
.site-footer address { font-style: normal; opacity: .8; margin-top: .6rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 2rem; padding-top: 1.2rem; font-size: .85rem; opacity: .75; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { padding: 4.5rem 0 3rem; }
.trace { height: 56px; margin: 2.5rem 0 -1.5rem; }
.trace svg { width: 100%; height: 100%; overflow: visible; display: block; }
.trace path { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trace-line { stroke: var(--accent); opacity: .35; }
.trace-pulse { stroke: var(--copper); stroke-width: 2.5; stroke-dasharray: 0 1000; opacity: 0; }
.hero-inner { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3.5rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--copper); margin-bottom: 1rem; }
.hero h1 { max-width: 19ch; }
.hero .lead { margin-top: 1.1rem; }
.hero-photo { margin: 0; justify-self: end; max-width: 380px; width: 100%; }
.hero-photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 24px;
  box-shadow: var(--shadow); border: 6px solid var(--surface);
}
.hero-photo figcaption { margin-top: .8rem; font-size: .9rem; color: var(--muted); }
.hero-photo strong { color: var(--navy); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 1.5rem 0 .5rem;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stats > div { background: var(--surface); padding: 1.1rem 1.25rem; }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: .2rem 0 0; font: 600 2rem/1.1 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.stats-note { color: var(--muted); font-size: .85rem; }
.stats-inline { grid-template-columns: repeat(2, 1fr); margin-top: 1.5rem; max-width: 26rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.section-head a { font-weight: 600; text-decoration: none; }
.section-intro { color: var(--muted); max-width: 46rem; margin-bottom: 1.6rem; }

.news li { display: flex; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.news li:last-child { border-bottom: 0; }
.news .when { flex: 0 0 5.2rem; }

.band { background: var(--band-bg); color: var(--band-text); padding: 3rem 0; }
.band h2 { color: inherit; margin-bottom: .5rem; }
.band p { margin: 0; opacity: .9; max-width: 46rem; }
.band-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }

/* ==========================================================================
   Cards, projects, themes
   ========================================================================== */
.grid { display: grid; gap: 1.25rem; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.35rem; box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }
.project { display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease; }
.project:hover { transform: translateY(-2px); border-color: var(--accent); }
.project h3 a { color: var(--navy); text-decoration: none; }
.project h3 a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.project .more { margin-top: auto; padding-top: .5rem; font-weight: 600; font-size: .9rem; color: var(--accent); }
.project-art {
  display: grid; place-items: center; height: 120px; margin: -1.3rem -1.35rem 1.1rem;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-tint); color: var(--accent);
}
.strand-second .project-art { background: var(--copper-soft); color: var(--copper); }
.project-img { width: calc(100% + 2.7rem); margin: -1.3rem -1.35rem 1.1rem; height: 160px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.icon { width: 64px; height: 64px; }
.icon .accent { stroke: var(--copper); }
.strand-second .icon .accent { stroke: var(--accent); }
.tag { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--copper); margin-bottom: .35rem; }

.themes { grid-template-columns: repeat(2, 1fr); gap: 1rem 2.5rem; }
.theme { padding: .25rem 0 .25rem 1.1rem; border-left: 3px solid var(--accent); }
.theme.strand-second { border-left-color: var(--copper); }
.theme p { color: var(--muted); margin: 0; }

/* Inner page heads */
.page-head { background: var(--bg-tint); border-bottom: 1px solid var(--border); padding: 3.25rem 0 2.75rem; }
.page-head h1 { margin-bottom: .6rem; }
.page-head .lead { margin-bottom: 0; }
.crumb { margin-bottom: 1rem; font-size: .9rem; }
.crumb a, .back a { text-decoration: none; font-weight: 600; }
.project-head.strand-second { background: var(--copper-soft); }
.project-head-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.project-head-art { color: var(--accent); }
.project-head.strand-second .project-head-art { color: var(--copper); }
.project-head-art .icon { width: 150px; height: 150px; stroke-width: 1.5; }
.project-head-art img { width: 320px; border-radius: var(--radius); box-shadow: var(--shadow); }
.theses-list li { display: flex; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.theses-list li:last-child { border-bottom: 0; }
.back { margin-top: 2.5rem; }

/* ==========================================================================
   Publications
   ========================================================================== */
.pubs-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.pub-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  font: 500 .88rem var(--sans); cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.scholar-link { font-weight: 600; text-decoration: none; }
.pubs .year {
  font: 700 1rem var(--sans); color: var(--copper); margin: 2rem 0 .25rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border);
}
.pub { padding: 1rem 0; border-bottom: 1px dashed var(--border); }
.pub:last-child { border-bottom: 0; }
.pub p { margin: 0; }
.pub .title { font-weight: 600; color: var(--navy); font-size: 1.03rem; line-height: 1.4; }
.pub .authors { font-size: .92rem; color: var(--muted); margin-top: .2rem; }
.pub .authors b { color: var(--text); }
.pub .venue { font-size: .92rem; }
.pub .meta { margin-top: .55rem; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.btn {
  font: 700 .72rem var(--sans); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 6px; padding: .2rem .55rem;
}
.btn:hover, .btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.btn-oa { color: var(--copper); border-color: var(--copper); }
.btn-oa:hover { background: var(--copper); color: var(--surface); }
.cites { font-size: .82rem; color: var(--muted); margin-left: .25rem; }
.kind { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--copper); border: 1px solid currentColor; border-radius: 4px; padding: 0 .4rem; margin-right: .2rem; font-style: normal; vertical-align: 1px; }
.panel { margin-top: .7rem; padding: .9rem 1rem; background: var(--bg-alt); border-radius: 8px; font-size: .93rem; }
.panel-bib { position: relative; }
.panel pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.panel .copy { position: absolute; top: .6rem; right: .6rem; background: var(--surface); }
.talks li { display: flex; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.talks li:last-child { border-bottom: 0; }
.talks .when { flex: none; }

/* Citations chart: single series, column per year */
.chart { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem 1rem; box-shadow: var(--shadow); }
.chart-title { font-weight: 600; color: var(--navy); margin-bottom: .8rem; }
.bars { position: relative; height: 170px; margin: 1.4rem 0 1.6rem 1.6rem; }
.gridlines span {
  position: absolute; left: 0; right: 0; bottom: calc(var(--v) / var(--top) * 100%);
  border-top: 1px solid var(--border); font-size: .7rem; color: var(--muted); line-height: 0;
}
.gridlines span { text-indent: -1.6rem; }
.plot { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--muted); }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar {
  display: block; width: 72%; max-width: 22px; min-height: 2px; height: calc(var(--n) / var(--top) * 100%);
  background: var(--chart); border-radius: 4px 4px 0 0; position: relative; cursor: default; transition: opacity .12s;
}
.bar.partial { opacity: .55; }
.bar.dim { opacity: .35; }
.bar .val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: .72rem; font-weight: 600; color: var(--text); }
.yr { position: absolute; top: 100%; margin-top: 4px; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.tip {
  position: absolute; top: -1.9rem; transform: translateX(-50%); background: var(--navy); color: var(--bg);
  font-size: .78rem; font-weight: 600; padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; pointer-events: none;
}
.chart-note { font-size: .8rem; color: var(--muted); margin: 0; }
.trend { margin-top: 1.5rem; max-width: 26rem; }
.trend .bars { height: 110px; margin: .6rem 0 1.5rem; }

/* Word cloud of paper themes */
.cloud { list-style: none; margin: 0 0 1rem; padding: .25rem 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .15rem .7rem; }
.word {
  font: 600 calc(.78rem + var(--w) * .2rem)/1.15 var(--serif); letter-spacing: -.005em;
  background: none; border: 0; border-radius: 6px; padding: .15rem .3rem; cursor: pointer;
  transition: color .15s, background-color .15s, opacity .15s;
}
.word.bio { color: var(--accent); }
.word.nl { color: var(--copper); }
.word:hover, .word:focus-visible { background: var(--bg-tint); }
.word[aria-pressed="true"] { background: var(--navy); color: var(--bg); }
.cloud.picked .word[aria-pressed="false"] { opacity: .45; }
.cloud.hovering .word:not(.rel):not(:hover):not(:focus-visible) { opacity: .28; }
.word.rel { opacity: 1; }
/* Motion: words pop in one after another, then drift gently; drift pauses under the pointer. */
.cloud.anim li { opacity: 0; transform: scale(.4); }
.cloud.anim.in li { animation: word-in .6s cubic-bezier(.2, .9, .3, 1.25) calc(var(--i) * 45ms) both; }
.cloud.anim.in .word { animation: word-drift calc(4.5s + var(--f) * .9s) ease-in-out calc(var(--i) * -.37s) infinite alternate; }
.cloud.anim:hover .word, .cloud.anim:focus-within .word { animation-play-state: paused; }
@keyframes word-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes word-drift { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
.key { display: inline-flex; align-items: center; gap: .35rem; margin-right: .9rem; }
.key::before { content: ""; width: .7rem; height: .7rem; border-radius: 3px; background: var(--accent); }
.key.nl::before { background: var(--copper); }
.focus-status { margin: -.5rem 0 1.5rem; color: var(--muted); font-size: .95rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chart-table summary { font-size: .8rem; color: var(--accent); cursor: pointer; margin-top: .3rem; }
.chart-table table { margin-top: .5rem; font-size: .85rem; }

/* ==========================================================================
   Teaching, theses, CV
   ========================================================================== */
.teaching { grid-template-columns: repeat(2, 1fr); }
.teaching li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.teaching li:last-child { border-bottom: 0; }
.level { flex: none; font-size: .78rem; font-weight: 700; color: var(--copper); background: var(--copper-soft); border-radius: 4px; padding: 0 .4rem; align-self: center; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: .65rem .85rem; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; color: var(--muted); background: var(--bg-alt); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--copper); font-weight: 600; white-space: nowrap; }
td:nth-child(2) { white-space: nowrap; }
.inst { color: var(--muted); font-style: italic; }

.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 3.5rem; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline > li { position: relative; padding: 0 0 1.5rem 1.4rem; }
.timeline > li::before {
  content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { display: block; }
.timeline h3 { margin: .1rem 0 0; }
.org { color: var(--muted); font-size: .93rem; margin: 0 0 .3rem; }
.timeline ul { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .93rem; }
.timeline ul li { margin-bottom: .25rem; }
.thesis { font-size: .9rem; font-style: italic; margin-top: .3rem; }

/* 404 */
.notfound { padding: 6rem 0; text-align: center; }
.notfound .big { font: 600 5rem/1 var(--serif); color: var(--copper); margin-bottom: 1rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: .85rem 16px; border-top: 1px solid var(--border); border-bottom: 0; font-size: 1rem; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--copper); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .two-col, .pubs-head { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 720px) {
  .section { padding: 2.75rem 0; }
  .hero { padding: 2.25rem 0 2rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-photo { order: -1; justify-self: start; max-width: 150px; }
  .hero-photo figcaption { display: none; }
  .hero-photo img { border-radius: 18px; border-width: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 2rem; }
  .stats-inline { grid-template-columns: repeat(2, 1fr); }
  .stats dd { font-size: 1.6rem; }
  .cards-3, .themes, .teaching { grid-template-columns: 1fr; }
  .news li, .talks li, .theses-list li { flex-direction: column; gap: .1rem; }
  .news .when { flex: none; }
  .band-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .page-head { padding: 2.25rem 0 2rem; }
  .project-head-inner { grid-template-columns: 1fr; }
  .project-head-art { order: -1; }
  .project-head-art .icon { width: 90px; height: 90px; }
  .project-head-art img { width: 100%; }
  td:nth-child(2) { white-space: normal; min-width: 8rem; }
  .yr { font-size: .6rem; }
}

@media print {
  .site-header, .lang-toggle, .filters, .band, .site-footer, .meta button { display: none; }
  body { background: #fff; }
}

/* ==========================================================================
   Motion (all of it is disabled for prefers-reduced-motion)
   ========================================================================== */
@view-transition { navigation: auto; }

.site-header { transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(20, 30, 50, .08); }
.button { transition: transform .15s ease, border-color .15s ease, color .15s ease, filter .15s ease; }
.button:hover { transform: translateY(-1px); }

/* Hero entrance */
/* Transform only: the text stays readable even where animations do not run. */
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
.hero-text > *, .hero-photo { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.hero-text > :nth-child(5) { animation-delay: .32s; }
.hero-photo { animation-delay: .15s; }

/* ECG trace: draw once, then a pulse runs along it */
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
@keyframes pulse-run { 0% { stroke-dashoffset: 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { stroke-dashoffset: -1000; opacity: 0; } }
.trace-line { stroke-dasharray: 1000; animation: draw 1.8s .4s ease-out both; }
.trace-pulse { stroke-dasharray: 70 930; animation: pulse-run 3.2s 2.2s linear infinite; }

/* Device spotlight */
.spotlight { margin-top: 1.75rem; max-width: 30rem; }
.spot-list { position: relative; height: 4.75rem; }
.spot { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease, visibility .45s; }
.spot.on { opacity: 1; visibility: visible; transform: none; }
.spot a {
  display: flex; align-items: center; gap: .9rem; height: 100%; padding: .55rem .9rem .55rem .55rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); color: var(--text);
}
.spot a:hover { border-color: var(--accent); }
.spot-art { flex: none; display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 10px; background: var(--bg-tint); color: var(--accent); }
.spot-art.strand-second { background: var(--copper-soft); color: var(--copper); }
.spot-art .icon { width: 40px; height: 40px; }
.spot-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.spot-text .tag { margin: 0 0 .2rem; font-size: .68rem; }
.spot-text strong { color: var(--navy); font-size: 1rem; }
.spot-go { margin-left: auto; color: var(--accent); font-weight: 700; }
.spot-dots { display: flex; gap: 6px; margin-top: .7rem; padding-left: .3rem; }
.spot-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background .3s, width .3s; }
.spot-dots span.on { background: var(--copper); width: 18px; border-radius: 3px; }

/* Reveal on scroll (only when JS runs) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* Chart bars grow */
.js .bars .bar { transform: scaleY(0); transform-origin: bottom; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .12s; transition-delay: calc(var(--i, 0) * 50ms); }
.js .bars.in .bar { transform: scaleY(1); }

/* Living drawings */
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(.98); } 45% { transform: scale(1.06); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.icon { transform-box: fill-box; transform-origin: center; }
.icon .accent { transform-box: fill-box; transform-origin: center; }
.project:hover .icon-heart, .live .icon-heart, .spot.on .icon-heart { animation: beat 1.3s ease-in-out infinite; }
.project:hover .icon-egg, .live .icon-egg, .spot.on .icon-egg { animation: wobble 1.6s ease-in-out infinite; transform-origin: 50% 85%; }
.project:hover .icon-radiation, .live .icon-radiation, .spot.on .icon-radiation { animation: spin 9s linear infinite; }
.project:hover .icon-incubator .accent, .live .icon-incubator .accent, .spot.on .icon-incubator .accent { animation: blink 1.4s ease-in-out infinite; }
.project:hover .icon-laser .accent, .live .icon-laser .accent, .spot.on .icon-laser .accent,
.project:hover .icon-wave .accent, .live .icon-wave .accent, .spot.on .icon-wave .accent { stroke-dasharray: 6 6; animation: flow .8s linear infinite; }
.project:hover .icon-tooth, .live .icon-tooth, .spot.on .icon-tooth,
.project:hover .icon-microscope, .live .icon-microscope, .spot.on .icon-microscope,
.project:hover .icon-hospital, .live .icon-hospital, .spot.on .icon-hospital { animation: float 2.4s ease-in-out infinite; }
.project:hover .project-art { background: var(--accent-soft); }
.strand-second.project:hover .project-art { background: var(--copper-soft); }
.project-art { transition: background .2s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .bars .bar { transform: none; }
  .cloud.anim li { opacity: 1; transform: none; }
  .trace-line { stroke-dasharray: none; }
  .trace-pulse { display: none; }
}
@media (max-width: 720px) {
  .spotlight { max-width: none; }
}
/* After a card has been revealed, restore its quick hover behaviour. */
.js .card.reveal.in { transition: transform .15s ease, border-color .15s ease; transition-delay: 0s; }
.js .project.reveal.in:hover { transform: translateY(-2px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.memberships li { padding: .45rem 0; }
.memberships .muted { font-size: .88rem; }
.memberships .muted a { color: inherit; }

/* ==========================================================================
   Hero v3: CV-style identity block + spotlight card
   ========================================================================== */
.identity { display: flex; align-items: center; gap: 1.75rem; padding-bottom: 2rem; border-bottom: 2px solid var(--navy); }
.id-photo {
  flex: none; width: 168px; height: 168px; border-radius: 50%; object-fit: cover;
  border: 5px solid var(--surface); box-shadow: var(--shadow);
}
.id-name { font: 600 clamp(2.1rem, 4.6vw, 3.2rem)/1.08 var(--serif); margin: 0 0 .45rem; }
.id-name .phd { font-size: .55em; color: var(--muted); font-weight: 600; }
.id-title { margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; font-weight: 700; color: var(--copper); }
.id-affil { margin: 0; color: var(--muted); font-size: 1.02rem; }
.hero { padding-top: 3.25rem; }
.hero .hero-inner { grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; margin-top: 2.25rem; }
.tagline { font: 600 clamp(1.55rem, 3vw, 2.15rem)/1.2 var(--serif); color: var(--navy); margin: 0 0 1rem; max-width: 22ch; }
.hero .lead { margin-top: 0; }

/* Spotlight as a card in the right column */
.spotlight { margin: 0; max-width: none; }
.spot-list { height: 15.5rem; }
.spot a { flex-direction: row; align-items: stretch; padding: 0; overflow: hidden; border-radius: var(--radius); }
.spot-art { width: 38%; height: auto; border-radius: 0; }
.spot-art .icon { width: 84px; height: 84px; }
.spot-text { padding: 1.2rem 1.25rem; justify-content: center; }
.spot-text strong { font-size: 1.15rem; margin-bottom: .4rem; }
.spot-desc { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.spot-go { margin: .8rem 0 0; font-size: .9rem; }
.identity > *, .hero-text > *, .spotlight { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.identity > :nth-child(2) { animation-delay: .06s; }
.spotlight { animation-delay: .3s; }

@media (max-width: 980px) {
  .hero .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .spot-list { height: 13rem; }
}
@media (max-width: 720px) {
  .hero { padding-top: 2rem; }
  .identity { gap: 1rem; padding-bottom: 1.5rem; }
  .id-photo { width: 96px; height: 96px; border-width: 3px; }
  .id-name { font-size: 1.7rem; }
  .id-title { font-size: .72rem; }
  .id-affil { font-size: .9rem; }
  .hero .hero-inner { margin-top: 1.5rem; }
  .spot-list { height: 15rem; }
  .spot-art { width: 32%; }
  .spot-art .icon { width: 60px; height: 60px; }
  .spot-text { padding: 1rem; }
}
