:root {
  --color-bg: #faf7f0;
  --color-surface: #ffffff;
  --color-text: #1c1c1c;
  --color-muted: #5c5c5c;
  --color-border: #e8e3d6;
  --color-accent: #1e3a5f;
  --color-accent-hover: #15294a;

  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 760px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--color-accent-hover); }

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

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
}

.brand:hover { color: var(--color-accent); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover { color: var(--color-text); }

.nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-muted);
  transition: color 0.15s;
  text-decoration: none;
}

.nav-social:hover { color: var(--color-accent); }

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

@media (max-width: 640px) {
  .site-nav { gap: 10px; padding: 12px 20px; }
  .nav-group { gap: 12px; }
  .nav-links { gap: 8px 16px; }
  .nav-links a { font-size: 14px; }
}

/* Hero */
.hero {
  padding: 96px 24px 64px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.tagline {
  font-size: 17px;
  color: var(--color-muted);
  margin: 0 0 28px;
  font-weight: 500;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-surface);
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-surface);
}

.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--color-muted);
  font-size: 14px;
}

.hero-meta li { position: relative; }

.hero-meta li:not(:last-child)::after {
  content: '·';
  position: absolute;
  right: -13px;
  top: 0;
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px;
  border-top: 1px solid var(--color-border);
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 28px;
}

.section h3 {
  font-size: 1.15rem;
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: 4px;
}

.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }

/* Experience + Education + Publications */
.role, .edu, .pub { margin-bottom: 32px; }
.role:last-child, .edu:last-child, .pub:last-child { margin-bottom: 0; }

.role-meta, .pub-meta, .edu-detail {
  color: var(--color-muted);
  font-size: 14px;
  margin: 0 0 10px;
}

.org {
  color: var(--color-text);
  font-weight: 500;
}

.role ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.role li { margin-bottom: 6px; }
.role li:last-child { margin-bottom: 0; }

/* Publications */
.pub h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.35;
}

.pub h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.pub h3 a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.pub p:last-child { margin: 8px 0 0; }

/* Skills */
.skills {
  display: grid;
  gap: 20px;
  margin: 0;
}

.skills > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: start;
}

.skills dt {
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}

.skills dd {
  margin: 0;
  color: var(--color-text);
  font-size: 15px;
}

@media (max-width: 600px) {
  .skills > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Contact */
.section--contact { padding-bottom: 72px; }

.contact-lead {
  color: var(--color-muted);
  margin-bottom: 16px;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-list a { font-size: 17px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}

.site-footer p {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Images */
.hero-inner {
  display: grid;
  gap: 32px;
}

@media (min-width: 720px) {
  .hero-inner {
    grid-template-columns: 260px 1fr;
    align-items: center;
  }
}

.hero-photo {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  display: block;
}

@media (max-width: 719px) {
  .hero-photo {
    max-width: 200px;
    justify-self: center;
  }
}

.section-banner {
  margin: 0 0 36px;
  padding: 0;
}

.section-banner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: right center;
  border-radius: 8px;
  display: block;
}

.section-banner figcaption {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 10px;
  font-style: italic;
}

@media (max-width: 600px) {
  .section-banner img {
    height: 220px;
  }
}

.pub--with-image {
  display: grid;
  gap: 20px;
}

@media (min-width: 600px) {
  .pub--with-image {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.pub-image img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

/* Email reveal with CAPTCHA */
.email-reveal {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.email-reveal .btn-copy {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.email-reveal .btn-copy:hover {
  color: var(--color-text);
  border-color: var(--color-muted);
}

.email-reveal .btn-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 17px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.email-reveal .btn-link:hover {
  color: var(--color-accent-hover);
}

.email-shown:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.email-link {
  font-size: 17px;
}

.reveal-error {
  font-size: 14px;
  color: var(--color-muted);
  margin: 0;
}
