/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */
:root {
  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --text: #17191d;
  --text-2: #4b5058;
  --muted: #7a7f88;
  --line: rgba(20, 22, 26, 0.09);
  --line-strong: rgba(20, 22, 26, 0.22);
  --accent: #c2501f;
  --accent-soft: rgba(194, 80, 31, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px -14px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 800px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0e0f11;
  --bg-elev: #16181b;
  --text: #ebe9e4;
  --text-2: #b7bac0;
  --muted: #868b94;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.26);
  --accent: #ea875d;
  --accent-soft: rgba(234, 135, 93, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 36px -14px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

/* Soft accent glow behind the header. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 40% at 50% -10%, var(--accent-soft), transparent 70%);
}

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

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

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

h1, h2, h3 { margin: 0; }

/* ---------------------------------------------------------------------------
   Navigation
   --------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.scrolled { border-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
}
.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--accent); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: block; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }
html:not(.js) .icon-btn { display: none; }

/* ---------------------------------------------------------------------------
   Hero / About
   --------------------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 8vw, 5rem) 0 1.5rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 2.25rem;
  align-items: start;
}

.portrait {
  width: 168px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 24px;
  box-shadow: var(--shadow);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.role {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.6rem 0 0;
  font-size: 1rem;
  color: var(--text-2);
}
.role .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.bio {
  margin-top: 1.25rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-2);
}
.bio p { margin: 0 0 0.75rem; }
.bio p:last-child { margin-bottom: 0; }
.bio a, .news a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.bio a:hover, .news a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.pill svg { width: 15px; height: 15px; }
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */
.section { padding: 2.75rem 0 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
}

.count {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   News
   --------------------------------------------------------------------------- */
.news {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
  line-height: 1.55;
}
.news li:last-child { border-bottom: none; }
.news li[data-extra][hidden] { display: none; }

.news time {
  padding-top: 0.2em;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }
.more-btn svg { width: 14px; height: 14px; transition: transform 0.25s ease; }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------------------------------------------------------------------------
   Publications
   --------------------------------------------------------------------------- */
.pub {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: none; }

.pub-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  outline: 1px solid var(--line);
  outline-offset: -1px;
  isolation: isolate;
}
.pub-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pub:hover .pub-media video { transform: scale(1.04); }

.pub-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.pub-title a { transition: color 0.2s ease; }
.pub-title a:hover { color: var(--accent); }

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge svg { width: 11px; height: 11px; }

.pub-authors {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-2);
}
.pub-authors a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pub-authors .me { color: var(--text); font-weight: 600; }

.pub-desc {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-2);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  color: var(--text-2);
  transition: color 0.2s ease;
}
.pub-links a:hover { color: var(--accent); }
.pub-links svg { width: 14px; height: 14px; opacity: 0.85; }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3.5rem;
  padding: 1.75rem 0 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer .social { display: flex; gap: 1.4rem; }
.footer .social a { color: var(--text-2); transition: color 0.2s ease; }
.footer .social a:hover { color: var(--accent); }
.footer .social svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   Scroll reveal (progressive: only when JS is present)
   --------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pub-media video, .pill, .icon-btn, .more-btn svg { transition: none; }
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { width: 128px; border-radius: 20px; }
  .nav-links { gap: 0.9rem; font-size: 0.85rem; }
  .nav-links a[href="#about"] { display: none; }
  .brand { font-size: 1.15rem; }
  .pub { grid-template-columns: 1fr; gap: 1rem; }
  .pub-media { max-width: 420px; }
  .news li { grid-template-columns: 1fr; gap: 0.15rem; }
}

@media print {
  .nav, .more-btn, .footer .social { display: none; }
  .news li[data-extra][hidden] { display: grid; }
  .pub-media { display: none; }
  .pub { grid-template-columns: 1fr; }
  body::before { display: none; }
}
