:root {
  --bg: #faf8f5;
  --bg-alt: #f2ede6;
  --ink: #201d1a;
  --ink-soft: #55504a;
  --accent: #8a5a3b;
  --line: #e3dcd2;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 18px rgba(32, 29, 26, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1120px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--accent); background: var(--bg-alt); text-decoration: none; }
.main-nav a.active { color: var(--bg); background: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: -6px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 64px;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px;
}

.hero-text h1 {
  font-size: 2.8rem;
  line-height: 1.1;
  margin-bottom: 6px;
}

.role {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin: 0 0 20px;
}

.statement {
  max-width: 60ch;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.hero-links {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
}
.btn:hover { text-decoration: none; background: var(--ink); color: var(--bg); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.social-row {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}
.social-row.centered { justify-content: center; }

/* Sections */
.section {
  padding: 56px 24px;
  border-top: 1px solid var(--line);
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 32px;
}

.sub-heading {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 40px 0 20px;
  color: var(--ink-soft);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}
.about-copy p { margin: 0 0 16px; color: var(--ink-soft); }
.about-photo img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* Interest tags */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.interest-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Research themes */
.theme-cards {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
.theme-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.theme-main { border-color: var(--accent); }
.theme-card h3 { margin: 0 0 8px; }
.theme-card p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.theme-card .theme-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-top: 3px;
}
.timeline-body h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.timeline-body p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.93rem;
}

.test-scores[hidden] { display: none; }

.test-scores {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Publications */
.pub-group { margin-bottom: 32px; }
.pub-kind {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}
.pub-item { margin-bottom: 18px; }
.pub-title { font-weight: 600; margin: 0 0 4px; }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { text-decoration: underline; }
.pub-meta { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 4px; }
.pub-link { font-size: 0.85rem; margin-right: 12px; }
.pub-theme {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 10px;
  margin: 2px 8px 4px 0;
}

/* Writing */
.writing-intro { color: var(--ink-soft); margin-bottom: 18px; }
.writing-list { list-style: none; padding: 0; margin: 0; }
.writing-list li { display: flex; gap: 16px; margin-bottom: 10px; }
.writing-date { flex: 0 0 110px; color: var(--ink-soft); font-size: 0.85rem; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project-card {
  padding: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-card h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.project-card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0;
}
.project-card.small { padding: 16px 20px; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.skill-cat h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--accent);
}
.skill-cat p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.9rem;
}

/* Plain list */
.plain-list {
  color: var(--ink-soft);
  padding-left: 20px;
}
.plain-list li { margin-bottom: 8px; }

/* Contact */
.contact-section { text-align: center; }
.contact-copy {
  max-width: 50ch;
  margin: 0 auto 28px;
  color: var(--ink-soft);
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.contact-details span { color: var(--ink-soft); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* Responsive: tablets and below */
@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .main-nav ul {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: 8px 12px 14px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(32, 29, 26, 0.08);
    display: none;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .main-nav ul.open { display: flex; }
  .main-nav a {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
  }
}

@media (max-width: 720px) {
  .theme-cards { grid-template-columns: 1fr; }
  .writing-list li { flex-direction: column; gap: 2px; }
  .wrap { padding: 0 20px; }

  .header-inner { height: 56px; }
  .wordmark { font-size: 0.95rem; }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 36px;
    padding-bottom: 48px;
    gap: 24px;
  }
  .hero-photo img { width: 148px; margin: 0 auto; }
  .hero-text h1 { font-size: 2.1rem; }
  .role { font-size: 1.05rem; }
  .statement { margin-left: auto; margin-right: auto; }
  .hero-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  .hero-links .btn { flex: 1 1 auto; text-align: center; min-width: 140px; }
  .social-row {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .section { padding: 40px 20px; }
  .section-title { font-size: 1.35rem; margin-bottom: 24px; }
  .sub-heading { margin: 32px 0 16px; }

  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-photo { order: -1; max-width: 200px; margin: 0 auto; }

  .interest-tags { margin-bottom: 28px; }
  .interest-tags span { font-size: 0.78rem; padding: 6px 12px; }

  .timeline { gap: 20px; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; padding-bottom: 16px; }
  .timeline-date { padding-top: 0; }

  .test-scores { flex-direction: column; gap: 8px; margin-top: 24px; }

  .pub-link { word-break: break-word; }

  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .skills-grid { grid-template-columns: 1fr; gap: 20px; }

  .contact-details { font-size: 0.92rem; word-break: break-word; }

}

/* Responsive: small phones */
@media (max-width: 420px) {
  .wrap { padding: 0 16px; }

  .hero-text h1 { font-size: 1.85rem; }
  .eyebrow { font-size: 0.68rem; }
  .statement { font-size: 0.94rem; }

  .hero-links { flex-direction: column; width: 100%; }
  .hero-links .btn { width: 100%; }

  .section { padding: 32px 16px; }

  .project-card { padding: 16px; }
  .skill-cat p { font-size: 0.87rem; }
}
