/* =========================================================
   Adrian M. V. Brânzanic — personal academic site
   Dark theme: black + deep blue, azure-blue accent
   ========================================================= */

:root {
  --bg:          #080b12;   /* near-black navy */
  --bg-soft:     #0c1120;   /* dark blue panel */
  --bg-tint:     #141d33;   /* lighter dark-blue: chips / hovers */
  --surface:     #0f1626;   /* card surface */
  --surface-2:   #121b2e;

  --blue:        #0a2647;   /* deep blue (panels, footer accents) */
  --blue-accent: #1f4e88;   /* brighter blue for buttons */
  --link:        #8fb3e0;   /* light blue links */

  --gold:        #4d9dff;   /* azure-blue accent (kept var name for now) */
  --gold-soft:   #86bbff;

  --heading:     #eef2f8;   /* near-white headings */
  --ink:         #cdd6e4;   /* body text */
  --muted:       #8a97ae;   /* secondary text */
  --line:        #1b2540;   /* borders */

  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 2px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.35);
  --shadow-lg:   0 18px 50px rgba(0,0,0,.55);
  --maxw:        1080px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #08111f; padding: 10px 16px;
  font-weight: 600; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,11,18,.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 600; color: var(--heading);
  font-size: 1.05rem; letter-spacing: .2px;
}
.brand:hover { color: var(--heading); }

/* brand mark removed — name-only wordmark in the nav */
.monogram { display: none; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 8px;
  color: var(--ink); font-weight: 500; font-size: .96rem; position: relative;
}
.nav-links a:hover { background: var(--bg-tint); color: var(--heading); }
.nav-links a.active { color: var(--heading); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: var(--gold); border-radius: 2px;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; width: 42px; height: 42px; cursor: pointer; color: var(--heading);
}
.nav-toggle svg { margin: auto; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1000px 440px at 86% -12%, rgba(31,78,136,.30), transparent 62%),
    radial-gradient(700px 380px at 6% 4%, rgba(77,157,255,.06), transparent 60%),
    linear-gradient(180deg, #05070d, #0a0f1c);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 64px;
}
.hero-inner { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  font-weight: 600; color: var(--gold); margin-bottom: 14px;
}
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: 1.15rem; color: #b7c2d4; max-width: 56ch; }
.hero .affil { color: var(--link); font-weight: 500; margin-bottom: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-motif { width: 300px; max-width: 32vw; opacity: .9; }

/* ---------- minimal home landing ---------- */
.home-main { min-height: calc(100vh - 68px); display: flex; flex-direction: column; }
.home-hero {
  flex: 1; display: flex; align-items: center;
  padding: 64px 0;
  background: radial-gradient(1100px 520px at 12% 0%, rgba(31,78,136,.16), transparent 60%), linear-gradient(180deg, #05070d, var(--bg));
}
.home-hero-inner { max-width: 720px; }
.home-grid { display: grid; grid-template-columns: 1fr minmax(0, 430px); gap: 56px; align-items: center; }
.home-copy { max-width: 620px; }
.home-figure { margin: 0; }
.home-figure img { display: block; width: 100%; max-width: 400px; height: auto; margin: 0 auto; filter: drop-shadow(0 12px 34px rgba(0,0,0,.55)); }
.home-figure figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: .8rem; color: var(--muted); text-align: center; }
.home-figure figcaption a { color: var(--muted); border-bottom: 1px solid var(--line); }
.home-figure figcaption a:hover { color: var(--gold); border-color: var(--gold); }
.home-name {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.06; letter-spacing: -0.015em;
  color: var(--heading); margin: 0 0 1rem;
}
.home-role {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  color: var(--link); margin: 0 0 1.4rem;
}
.home-affil { color: var(--muted); font-size: 1.05rem; line-height: 1.65; margin: 0; max-width: 46ch; }
.home-saying { margin-top: 3.6rem; padding-top: 1.8rem; border-top: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.55; color: var(--heading); }
@media (min-width: 1000px) { .home-saying { white-space: nowrap; } }

/* ---------- CV contact block + extras ---------- */
.cv-contact { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 44px; margin: 20px 0 6px; max-width: 660px; }
.cv-contact > div { font-size: .96rem; color: var(--ink); }
.cv-contact .k { display: inline-block; min-width: 66px; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; margin-right: 10px; }
.cv-contact a { color: var(--link); }
.cv-contact a:hover { color: var(--gold); }
@media (max-width: 560px) { .cv-contact { grid-template-columns: 1fr; } }
.role-pi { color: var(--gold); font-weight: 600; }
.timeline .tag { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(77,157,255,.4); border-radius: 999px; padding: 1px 9px; vertical-align: middle; }
.timeline .when .d { display: block; margin-top: 1px; font-weight: 400; letter-spacing: .01em; text-transform: none; color: var(--muted); font-size: .95em; }
.numlist { margin: 0; padding-left: 2.4em; }
.numlist li { padding: 0 0 12px 0.35em; color: var(--ink); line-height: 1.62; }
.numlist li::marker { color: var(--gold); font-family: var(--serif); font-weight: 700; }
.numlist em { color: var(--heading); }
.numlist .role { color: var(--muted); }
.cv-note { color: var(--muted); font-size: .9rem; font-style: italic; margin: 2px 0 16px; }
.book-entry { color: var(--ink); line-height: 1.66; max-width: 74ch; }
.book-entry em { color: var(--heading); }
.pub-book { margin: 44px 0 8px; padding-top: 30px; border-top: 1px solid var(--line); }
.pub-book h2 { font-size: 1.5rem; margin: 0 0 12px; color: var(--heading); }
.soft-list { margin: 6px 0 0; }
.soft-list p { margin: 0 0 8px; color: var(--ink); font-size: .96rem; line-height: 1.6; }
.soft-list .lbl { color: var(--heading); font-weight: 600; }
.home-links {
  display: flex; flex-wrap: wrap; gap: 30px;
  margin-top: 2.6rem; padding-top: 1.7rem; border-top: 1px solid var(--line);
}
.home-links a {
  color: var(--ink); font-size: .98rem; letter-spacing: .01em;
  position: relative; padding-bottom: 3px;
}
.home-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--gold); transition: right .28s ease;
}
.home-links a:hover { color: var(--heading); }
.home-links a:hover::after { right: 0; }
.home-foot {
  padding: 20px 0; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; gap: 34px; justify-items: start; }
  .home-figure { order: 2; }
  .home-figure img { max-width: 340px; margin: 0; }
}
@media (max-width: 520px) { .home-links { gap: 20px 26px; } .home-figure img { max-width: 300px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid transparent; cursor: pointer; transition: .15s ease; font-family: var(--sans);
}
.btn-primary { background: var(--blue-accent); color: #fff; }
.btn-primary:hover { background: #2a63a8; color: #fff; transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #08111f; }
.btn-gold:hover { background: var(--gold-soft); color: #08111f; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--heading); border-color: #33405e; }
.btn-ghost:hover { border-color: var(--gold); color: var(--heading); background: rgba(255,255,255,.03); }

/* ---------- sections ---------- */
section { padding: 64px 0; }
section.tint { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head .kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .76rem;
  font-weight: 700; color: var(--gold); margin-bottom: 10px;
}
.section-head p { color: var(--muted); margin: 0; }
.lead { font-size: 1.12rem; color: #aeb9cc; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); transition: .18s ease;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #2b3960; }
.card .icon {
  width: 46px; height: 46px; border-radius: 11px; margin-bottom: 16px;
  background: var(--bg-tint); color: var(--gold); display: grid; place-items: center;
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .97rem; margin: 0; }
.card .tag { color: var(--gold); font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- publications ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 64px 1fr; gap: 20px; }
.pub:first-child { padding-top: 0; }
.pub-year { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 1.1rem; }
.pub-num { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 1.05rem; }
.pub-yearhead { list-style: none; font-family: var(--serif); font-weight: 700; color: var(--heading); font-size: 1.5rem; margin: 42px 0 2px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.pub-yearhead:first-child { margin-top: 0; }
.pub-title { font-family: var(--serif); font-weight: 600; color: var(--heading); font-size: 1.08rem; margin: 0 0 4px; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--gold); }
.pub-authors { color: var(--ink); font-size: .95rem; margin: 0 0 4px; }
.pub-authors .me { color: var(--gold); font-weight: 700; }
.pub-venue { color: var(--muted); font-size: .92rem; font-style: italic; margin: 0; }
.pub-links { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--link); background: var(--surface);
}
.pill:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- CV timeline ---------- */
.cv-block { margin-bottom: 40px; }
.cv-block h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.cv-block h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 28px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold);
}
.timeline .when { font-size: .82rem; font-weight: 700; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.timeline .what { font-family: var(--serif); font-weight: 600; color: var(--heading); font-size: 1.08rem; margin: 2px 0; }
.timeline .where { color: var(--muted); font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { background: var(--bg-tint); color: var(--link); border-radius: 999px; padding: 5px 13px; font-size: .85rem; font-weight: 500; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.info-row .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-tint); color: var(--gold); display: grid; place-items: center; flex: none; }
.info-row .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-weight: 700; }
.info-row a, .info-row span { color: var(--ink); }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--sans); font-size: 1rem; color: var(--ink); background: var(--surface);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: #6b7893; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--gold); outline: none; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- about band + photo ---------- */
.about-band { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.photo-frame { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); border: 6px solid var(--surface-2); outline: 1px solid var(--line); }
.photo-frame img { width: 100%; height: auto; display: block; }
.photo-caption { font-size: .82rem; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------- utility ---------- */
.prose p { color: var(--ink); }
.prose p + h3 { margin-top: 1.6em; }
.notice {
  background: rgba(77,157,255,.08); border: 1px solid rgba(77,157,255,.32); border-left: 4px solid var(--gold);
  padding: 14px 18px; border-radius: 8px; font-size: .92rem; color: #bcd8ff;
}
.notice code { background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; }
.center { text-align: center; }
.mt-32 { margin-top: 32px; }

/* ---------- metrics + publication extras ---------- */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 26px; box-shadow: var(--shadow); text-align: center; min-width: 116px; }
.stat .num { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 1.9rem; line-height: 1; }
.stat .lbl { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 7px; }
.cite-badge { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--link); background: var(--bg-tint); border-radius: 999px; padding: 2px 9px; margin-left: 8px; white-space: nowrap; }
.featured-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-soft); background: rgba(77,157,255,.1); border: 1px solid rgba(77,157,255,.35); border-radius: 999px; padding: 2px 9px; margin-bottom: 7px; }
.pub.feat { background: linear-gradient(90deg, rgba(77,157,255,.09), transparent 55%); border-radius: 10px; padding-left: 12px; margin-left: -12px; }
.source-note { font-size: .85rem; color: var(--muted); margin-top: 14px; }

/* ---------- footer ---------- */
.site-footer { background: #05070d; color: #8ea0ba; padding: 48px 0 28px; margin-top: 20px; border-top: 1px solid var(--line); }
.site-footer a { color: #cdd8e6; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--heading); font-weight: 600; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: .95rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px; font-size: .85rem; color: #6f7d94; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--bg-tint); }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-motif { display: none; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-band { grid-template-columns: 1fr; gap: 22px; }
  .about-band .photo-wrap { max-width: 300px; margin: 0 auto; }
  section { padding: 48px 0; }
}
@media (max-width: 520px) {
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .pub-year { font-size: .95rem; }
}

/* ---------- thesis page ---------- */
.thesis-meta { color: var(--muted); font-size: 1rem; margin: 0; max-width: 62ch; }
.motto { border-left: 3px solid var(--gold); margin: 4px 0 30px; padding: 4px 0 4px 22px; max-width: 70ch; }
.motto p { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: 1.1rem; line-height: 1.72; margin: 0 0 10px; }
.motto cite { display: block; font-style: normal; color: var(--muted); font-size: .9rem; letter-spacing: .02em; }
.download-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.download-note { color: var(--muted); font-size: .88rem; }
.thesis-outline { list-style: none; margin: 18px 0 0; padding: 0; max-width: 68ch; }
.thesis-outline li { display: flex; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.thesis-outline li:last-child { border-bottom: 0; }
.thesis-outline .n { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 1rem; min-width: 20px; }
.thesis-outline .t { color: var(--ink); }
.thesis-outline strong { color: var(--heading); font-weight: 600; }

/* home emblem */
.home-emblem img { max-width: 430px; filter: drop-shadow(0 0 34px rgba(77,157,255,.16)); }
@media (max-width: 860px) { .home-emblem img { max-width: 330px; margin: 0 auto; } }

/* ---------- thesis two-column + chapter pages ---------- */
.thesis-layout { display: grid; grid-template-columns: 1fr 300px; gap: 50px; align-items: start; }
.thesis-side { position: sticky; top: 90px; }
.thesis-cover { display: block; width: 100%; max-width: 220px; height: auto; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lg); margin: 0 auto; }
.motto-side { margin: 24px 0 0; }
.motto-side p { font-size: .95rem; line-height: 1.6; }
.thesis-outline a { display: flex; gap: 16px; align-items: baseline; color: inherit; }
.thesis-outline a:hover .t, .thesis-outline a:hover strong { color: var(--gold); }
.thesis-outline li.no-link { display: flex; gap: 16px; opacity: .55; }
.eyebrow a, .hero .eyebrow a { color: inherit; border-bottom: 1px solid transparent; }
.eyebrow a:hover, .hero .eyebrow a:hover { border-color: currentColor; }
.chapter-layout { display: grid; grid-template-columns: 1fr 380px; gap: 50px; align-items: start; }
.chapter-figure { margin: 0; }
.chapter-figure img { width: 100%; height: auto; }
.chapter-figure figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: .85rem; color: var(--muted); line-height: 1.55; }
.chapter-nav { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.chapter-nav a { font-weight: 500; }
@media (max-width: 860px) {
  .thesis-layout, .chapter-layout { grid-template-columns: 1fr; gap: 34px; }
  .thesis-side { position: static; }
  .chapter-figure { order: -1; }
  .thesis-cover { max-width: 200px; }
}

/* stacked chapter figures + light plate */
.chapter-figs { display: flex; flex-direction: column; gap: 26px; }
.chapter-figs .chapter-figure { margin: 0; }
.plate { background: #ffffff; border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.plate img { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .chapter-figs { order: -1; } }

/* ---------- epilogue: image-led narrative ---------- */
.epilogue { max-width: 780px; margin: 0 auto; }
.epi-figure { margin: 0; }
.epi-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); }
.epi-figure figcaption { margin-top: 15px; text-align: center; font-family: var(--serif); font-style: italic; font-size: .92rem; color: var(--muted); line-height: 1.62; }
.epi-figure figcaption b { color: var(--heading); font-weight: 600; font-style: normal; }
.epi-figure .credit { display: block; margin-top: 8px; font-style: normal; font-size: .73rem; letter-spacing: .015em; color: #64728a; }
.epi-figure .credit a { color: inherit; border-bottom: 1px solid transparent; }
.epi-figure .credit a:hover { border-color: currentColor; }
.epi-figure.closing { margin-top: 46px; }

/* verbatim excerpt lifted from the thesis */
.thesis-excerpt { margin: 42px 0; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.thesis-excerpt .excerpt-label { display: block; text-align: center; font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; }
.thesis-excerpt p { font-family: var(--serif); color: var(--ink); font-size: 1.07rem; line-height: 1.82; margin: 0 0 1.1em; }
.thesis-excerpt p:last-child { margin-bottom: 0; }
.thesis-excerpt p:last-child { color: var(--heading); }

/* ---------- research themes with figure clusters ---------- */
.research-row { display: grid; grid-template-columns: 1.02fr .98fr; gap: 48px; align-items: center; padding: 46px 0; border-bottom: 1px solid var(--line); }
.research-row:first-of-type { padding-top: 6px; }
.research-row:last-of-type { border-bottom: 0; padding-bottom: 6px; }
.research-row .r-text { min-width: 0; }
.research-row .r-text .cv-block { margin-bottom: 0; }
.research-figs { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.research-figs.solo { justify-content: center; }
.research-figs .rfig { margin: 0; }
.research-figs .plate { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.research-figs .plate img { display: block; margin: 0 auto; width: auto; height: auto; max-width: 100%; max-height: 188px; }
.research-figs .plate.plate-dark { background: var(--bg); border: 1px solid var(--line); }
.research-figs figcaption { margin-top: 9px; font-family: var(--serif); font-style: italic; font-size: .8rem; color: var(--muted); line-height: 1.5; text-align: center; }
.research-row.flip .r-text { order: 2; }
.research-row.flip .research-figs { order: 1; }
@media (max-width: 900px) {
  .research-row, .research-row.flip { grid-template-columns: 1fr; gap: 26px; padding: 32px 0; }
  .research-row.flip .r-text, .research-row.flip .research-figs { order: 0; }
  .research-figs .plate img { max-height: 300px; }
}

/* cross-reference markers: research figure → publication index */
.pubref { font-family: var(--sans); font-style: normal; font-weight: 600; font-size: .72em; vertical-align: super; color: var(--gold); margin-left: 4px; text-decoration: none; white-space: nowrap; }
.pubref:hover { text-decoration: underline; }
.pubref::before { content: ""; }
/* deep-link target highlight on the publications list */
.pub { scroll-margin-top: 96px; border-radius: 10px; transition: background .35s ease, outline-color .35s ease; outline: 1px solid transparent; }
.pub:target { background: rgba(77,157,255,.10); outline: 1px solid rgba(77,157,255,.40); outline-offset: 5px; }

/* inline citations woven into the research prose */
.cite { font-family: var(--sans); font-weight: 600; font-size: .72em; color: var(--muted); white-space: nowrap; }
.cite a { color: var(--gold); text-decoration: none; }
.cite a:hover { text-decoration: underline; }
