/* ── Fonts ── */
@font-face {
  font-family: 'Michelangelus';
  src: url('fonts/Michelangelus-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Michelangelus';
  src: url('fonts/Michelangelus-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Michelangelus';
  src: url('fonts/Michelangelus-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Michelangelus';
  src: url('fonts/Michelangelus-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  --bg:           #ffffff;
  --bg-subtle:    #F7F7F5;
  --border:       #E5E4DF;
  --text:         #111111;
  --muted:        #5A6472;
  --accent:       #94475E;
  --accent-hover: #7a3a4d;
  --accent-subtle:#fdf0f3;
  --nav-h:        60px;
}

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Michelangelus', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.22s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ── */
.container { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-name:hover { text-decoration: none; color: var(--accent); }
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}
.nav-toggle svg { display: block; }

@media (max-width: 560px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 24px; font-size: 0.95rem; }
}

/* ── Page header ── */
.page-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.page-header .lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
}

/* ── Hero (home) ── */
.hero {
  padding: 72px 0 64px;
}
.hero-nameplate {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.hero-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 4px;
}
.hero-credentials {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.hero-bio {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 620px;
  margin-bottom: 40px;
}
.hero-bio p + p { margin-top: 16px; }
.hero-contact {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Section headings ── */
.section { margin-bottom: 56px; }
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  -webkit-text-stroke: 0.6px currentColor;
}
h2.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

/* ── Research cards ── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.research-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.15s;
  text-decoration: none;
}
.research-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(26,66,120,0.08);
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Research sub-page content ── */
.content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
}
.content h2:first-child { margin-top: 0; }
.content p { margin-bottom: 16px; color: var(--text); }
.content p:last-child { margin-bottom: 0; }

/* ── Publications ── */
.pub-year {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 40px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pub-year:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }
.pub-list { list-style: none; }
.pub-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
}
.pub-list li:last-child { border-bottom: none; }
.pub-mine { font-weight: 600; color: var(--text); }
.pub-journal {
  font-style: italic;
  color: var(--muted);
}
.pub-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}
.pub-link:hover { text-decoration: underline; }

/* ── Inline citation (on sub-pages) ── */
.citation {
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  font-size: 0.85rem;
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}

/* ── References list ── */
.references-list {
  margin: 12px 0 0 0;
  padding-left: 1.4em;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}
.references-list li {
  margin-bottom: 10px;
}

/* ── Content figures ── */
.content-figure {
  margin: 24px 0 0;
}
.content-figure img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.content-figure figcaption {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Content with aside video ── */
.content-with-aside {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.content-aside-text { flex: 1; }
.content-aside-video {
  width: 300px;
  flex-shrink: 0;
}
.content-aside-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  display: block;
}
@media (max-width: 640px) {
  .content-with-aside { flex-direction: column; }
  .content-aside-video { width: 100%; }
}

/* ── Media ── */
.media-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.media-img {
  width: 100%;
  max-width: 340px;
  border-radius: 10px;
  display: block;
  margin-bottom: 14px;
}
.media-item--with-image {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.media-text { flex: 1; }
.media-img--side {
  width: 280px;
  flex-shrink: 0;
  border-radius: 10px;
  margin-bottom: 0;
}
.media-item:last-child { border-bottom: none; }
.media-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.media-item p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.media-outlets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.outlet {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 3px 10px;
  border-radius: 4px;
}
a.outlet:hover { text-decoration: none; opacity: 0.8; }

/* ── Altmetric dark mode ── */
[data-theme="dark"] .altmetric-embed {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  padding: 3px;
}

/* ── Project carousel ── */
.carousel-wrap {
  overflow: hidden;
  margin: 0 -24px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 64px, black calc(100% - 64px), transparent);
  mask-image: linear-gradient(to right, transparent, black 64px, black calc(100% - 64px), transparent);
}
.carousel-track {
  display: flex;
  gap: 16px;
  padding: 4px 24px 8px;
  width: max-content;
  animation: carousel-scroll 28s linear infinite;
  will-change: transform;
}
.carousel-track:hover { animation-play-state: paused; }
.carousel-track .research-card {
  flex-shrink: 0;
  width: 200px;
}
@keyframes carousel-scroll {
  to { transform: translateX(-50%); }
}

/* ── Award / Grant carousel cards ── */
.award-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  user-select: none;
}
.carousel-track .award-card { flex-shrink: 0; width: 200px; }
.award-card-year {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.award-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.award-card-org {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* ── Footer social icons ── */
.footer-social {
  display: flex;
  gap: 16px;
  align-items: center;
}
.social-icon {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
  font-size: 1.25rem;
  line-height: 1;
}
.social-icon:hover { color: var(--accent); text-decoration: none; }
.social-icon svg { display: block; }

/* ── Contact ── */
.contact-block {
  max-width: 480px;
}
.contact-block p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}
.contact-email:hover { text-decoration: underline; }

/* ── Divider ── */
hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { font-size: 0.8rem; color: var(--muted); }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ── Award badge ── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid #EAC8D0;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Presentations ── */
.talk-group { margin-bottom: 28px; }
.talk-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.talk-list { list-style: none; }
.talk-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.5;
}
.talk-list li:last-child { border-bottom: none; }
.talk-date { color: var(--muted); font-size: 0.8rem; padding-top: 1px; }
.talk-title { font-weight: 500; color: var(--text); }
.talk-venue { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

@media (max-width: 500px) {
  .talk-list li { grid-template-columns: 1fr; gap: 3px; }
}

/* ── Pub highlights with Altmetric ── */
.pub-highlights li {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pub-highlights .pub-text { flex: 1; min-width: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .page-header { padding: 40px 0 32px; }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
  .research-grid { grid-template-columns: 1fr; }
}

/* ── Nav dropdown ── */
.nav-dropdown { position: relative; }
.dropdown-caret { font-size: 0.6em; margin-left: 3px; opacity: 0.7; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 190px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 0 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  z-index: 200;
  list-style: none;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu li { width: 100%; }
.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.dropdown-menu a:hover,
.dropdown-menu a.active { color: var(--accent); text-decoration: none; }
[data-theme="dark"] .dropdown-menu { box-shadow: 0 6px 24px rgba(0,0,0,0.3); }
@media (max-width: 560px) {
  .dropdown-menu { display: none !important; }
}

/* ── Nav right controls ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-theme-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--muted);
  border-radius: 4px;
  transition: color 0.15s;
}
.nav-theme-toggle:hover { color: var(--accent); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Dark mode ── */
[data-theme="dark"] {
  --bg:           #141414;
  --bg-subtle:    #1d1d1d;
  --border:       #2b2b2b;
  --text:         #e6e3df;
  --muted:        #8a8f9e;
  --accent:       #c47a93;
  --accent-hover: #d98faa;
  --accent-subtle:#3a1a26;
}
[data-theme="dark"] nav { background: rgba(20,20,20,0.92); }
[data-theme="dark"] .research-card:hover { box-shadow: 0 4px 16px rgba(196,122,147,0.1); }
[data-theme="dark"] .badge { border-color: #5a2a38; }
