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

:root {
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --fg-subtle: #999;
  --bg: #faf9f7;
  --bg-warm: #f3f1ed;
  --accent: #2c4a2e;
  --accent-light: #3d6b40;
  --rule: #d4d0c8;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'DM Sans', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
  --fg: #e8e6e3;
  --fg-muted: #a8a8a8;
  --fg-subtle: #777;
  --bg: #1a1a1a;
  --bg-warm: #222220;
  --accent: #6abf6e;
  --accent-light: #8fd992;
  --rule: #333;
}
[data-theme="dark"] nav {
  background: rgba(26, 26, 26, 0.92);
}
[data-theme="dark"] .nav-links {
  background: rgba(26, 26, 26, 0.97);
}
[data-theme="dark"] ::selection {
  background: var(--accent);
  color: #1a1a1a;
}
[data-theme="dark"] .media-card {
  background: var(--bg);
}
[data-theme="dark"] .hero-image-frame img {
  filter: grayscale(10%) contrast(1.0);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-light); }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after { width: 100%; }

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--fg-muted);
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.menu-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: 4px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--fg); margin: 5px 0;
  transition: 0.3s;
}

/* ── SECTION COMMONS ── */
section {
  padding: 5rem 2rem;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-rule {
  width: 100%;
  height: 1px;
  background: var(--rule);
  margin-bottom: 3rem;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.section-number {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--fg-subtle);
  font-style: italic;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── PAGE HEADER (sub-pages) ── */
.page-header {
  padding: 8rem 2rem 3rem;
  background: var(--bg-warm);
}
.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.page-header p {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.8;
  max-width: 640px;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem 4rem;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-text { animation: fadeUp 0.8s ease both; }
.hero-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-subtle);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.hero-bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-muted);
  max-width: 520px;
}
.hero-bio + .hero-bio { margin-top: 1rem; }
.hero-cta {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image-wrap {
  position: relative;
  animation: fadeUp 0.8s 0.15s ease both;
}
.hero-image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 5;
  background: var(--bg-warm);
}
.hero-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%) contrast(1.02);
}
.hero-image-caption {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--fg-subtle);
  font-style: italic;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--rule);
}
.btn-outline:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* ── ABOUT BANNER ── */
.about-banner {
  width: 100%;
  margin-bottom: 3rem;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  max-height: 320px;
}
.about-banner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(10%) contrast(1.02);
}
.about-banner-caption {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
}

/* ── ABOUT ── */
#about { background: var(--bg-warm); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.about-col p {
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.85;
}
.about-col p + p { margin-top: 1rem; }

.milestones {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.milestone {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  align-items: start;
}
.milestone-year {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--accent);
  padding-top: 2px;
}
.milestone-text {
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── PAPERS / RESEARCH LIST ── */
.papers-list { display: flex; flex-direction: column; }
.paper-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  align-items: start;
}
.paper-item:first-child { border-top: 1px solid var(--rule); }
.paper-year {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--fg-subtle);
}
.paper-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.paper-title a { color: var(--fg); }
.paper-title a:hover { color: var(--accent); }
.paper-meta {
  font-size: 0.85rem;
  color: var(--fg-subtle);
}
.paper-authors {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}

/* ── MEDIA ── */
.media-note {
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.8;
  max-width: 640px;
  margin-bottom: 2rem;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.media-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.75rem;
  transition: border-color 0.25s;
}
.media-card:hover { border-color: var(--accent); }
.media-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.media-card-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.media-card-desc {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── MEDIA LIST (full media page) ── */
.media-list { display: flex; flex-direction: column; }
.media-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 2rem;
  align-items: start;
}
.media-item:first-child { border-top: 1px solid var(--rule); }
.media-date {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--fg-subtle);
  padding-top: 2px;
}
.media-item-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.media-item-title a { color: var(--fg); }
.media-item-title a:hover { color: var(--accent); }
.media-item-desc {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── TALKS LIST ── */
.talks-list { display: flex; flex-direction: column; }
.talk-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: start;
}
.talk-item:first-child { border-top: 1px solid var(--rule); }
.talk-date {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--fg-subtle);
  padding-top: 2px;
}
.talk-info-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.talk-info-venue {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
}
.talk-info-venue a { font-weight: 400; }

/* ── BOOK ── */
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.book-card {
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2.5rem;
}
.book-card h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.book-card p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}
.book-card .book-links {
  margin-top: 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.book-card .book-links a {
  font-size: 0.88rem;
  font-weight: 500;
}

/* ── CONTACT ── */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.contact-text p {
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.8;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--fg-muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s;
}
.contact-link:hover { color: var(--accent); }
.contact-link-label {
  width: 100px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  font-weight: 500;
  flex-shrink: 0;
}

/* ── FOOTER ── */
footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--rule);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--fg-subtle);
}
.footer-socials {
  display: flex;
  gap: 1.5rem;
}
.footer-socials a {
  font-size: 0.8rem;
  color: var(--fg-subtle);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}
.footer-socials a:hover { color: var(--fg); }

/* ── SUBSECTION HEADER ── */
.subsection-header {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}
.subsection-header h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--accent); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: rgba(250, 249, 247, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--rule);
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }

  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-image-wrap { order: -1; max-width: 360px; }
  .hero { padding-top: 7rem; min-height: auto; }

  .about-grid { grid-template-columns: 1fr; }
  .contact-content { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }

  .paper-item { grid-template-columns: 60px 1fr; gap: 1rem; }
  .talk-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .media-item { grid-template-columns: 1fr; gap: 0.5rem; }

  .page-header { padding: 6rem 2rem 2rem; }
}
