/* ---------- Design tokens ---------- */
:root {
  --c-bg: #fafbfc;
  --c-bg-alt: #f1f5f8;
  --c-surface: #ffffff;
  --c-text: #1a2733;
  --c-text-muted: #5a6977;
  --c-text-light: #8a98a6;
  --c-border: #e1e8ee;
  --c-border-strong: #c9d4dd;

  /* Coastal palette */
  --c-primary: #0f5e7c;          /* deep teal-blue */
  --c-primary-hover: #0a4a63;
  --c-primary-soft: #e6f1f5;
  --c-accent: #c9722c;            /* warm sand/terracotta */
  --c-accent-soft: #faf3eb;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 30, 50, 0.05);
  --shadow: 0 4px 14px rgba(15, 30, 50, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 30, 50, 0.12);

  --nav-height: 68px;
  --max-width: 1100px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--c-primary-hover); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-sans); line-height: 1.25; margin: 0; letter-spacing: -0.015em; }
ul { padding-left: 1.2em; margin: 0.5em 0; }
ol { padding-left: 1.2em; margin: 0.5em 0; }

/* ---------- Utilities ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--c-text-muted); }
.small { font-size: 0.875rem; }
.light { font-weight: 300; color: var(--c-text-muted); }

/* ---------- Header & Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-border);
  height: var(--nav-height);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: var(--c-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--c-primary); }
.brand-name { font-size: 1.05rem; }
.brand-degree { color: var(--c-text-muted); font-size: 0.85rem; font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
.site-nav ul a {
  color: var(--c-text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
}
.site-nav ul a:hover {
  color: var(--c-primary);
  text-decoration: none;
}
.site-nav ul a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--c-bg-alt);
  padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 0.3rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.15s ease;
}
.lang-switch button:hover { color: var(--c-text); }
.lang-switch button.active {
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--c-text);
  margin: 4px 0;
  transition: transform 0.2s ease;
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 4rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(15, 94, 124, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(201, 114, 44, 0.05) 0%, transparent 50%),
    linear-gradient(to bottom, #ffffff, var(--c-bg));
  border-bottom: 1px solid var(--c-border);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  margin: 0 0 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}
.hero-lede {
  font-size: 1.125rem;
  color: var(--c-text);
  margin: 0 0 1rem;
  max-width: 36em;
  line-height: 1.6;
}
.hero-affiliation {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  margin: 0 0 1.75rem;
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-primary-hover);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-border-strong);
}
.btn-ghost:hover {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border-color: var(--c-primary);
}

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary-soft), var(--c-accent-soft));
  border: 4px solid #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-initials {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-weight: 600;
  color: var(--c-primary);
  letter-spacing: -0.03em;
  display: none;
}
.photo-frame.photo-placeholder .photo-initials {
  display: block;
}

/* ---------- Sections ---------- */
.section {
  padding: 4.5rem 0;
}
.section-alt {
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--c-primary);
  border-radius: 2px;
}
.section-lede {
  font-size: 1.05rem;
  color: var(--c-text-muted);
  max-width: 60ch;
  margin: 0 0 2.5rem;
}

/* About section */
.prose p {
  margin: 0 0 1.25rem;
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 70ch;
}
.prose p:last-child { margin-bottom: 0; }

.education-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.edu-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.edu-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.edu-card p { margin: 0; }
.edu-degree {
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 0.25rem !important;
}
.edu-degree span { font-weight: 400; color: var(--c-text-muted); }
.edu-school {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin-bottom: 0.15rem !important;
}
.edu-note {
  font-size: 0.82rem;
  color: var(--c-text-light);
  font-style: italic;
}

/* Research topics grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.topic-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--c-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.topic-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.topic-card:hover::before { opacity: 1; }
.topic-card h3 {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 0 0 0.6rem;
}
.topic-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* Publications */
.pub-groups { counter-reset: pubs; }   /* one running number across all groups */
.pub-subhead {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  margin: 2.25rem 0 0.25rem;
}
.pub-groups .pub-subhead:first-child { margin-top: 0; }
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pub-list li {
  padding: 1.25rem 0 1.25rem 3rem;
  border-bottom: 1px solid var(--c-border);
  position: relative;
  counter-increment: pubs;
}
.pub-list li::before {
  content: counter(pubs, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--c-primary);
  opacity: 0.5;
}
.pub-list li:last-child { border-bottom: none; }
.pub-authors {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin: 0 0 0.3rem;
}
.pub-title {
  font-weight: 500;
  color: var(--c-text);
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  line-height: 1.45;
}
.pub-venue {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin: 0;
}
.pub-venue em { color: var(--c-text); font-weight: 500; }
.pub-badge {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  border: 1px solid rgba(201, 114, 44, 0.25);
  border-radius: 999px;
}

/* Teaching */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
}
.two-col h3 {
  font-size: 1.15rem;
  color: var(--c-primary);
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.two-col ul {
  margin-top: 1rem;
  padding-left: 1.1rem;
}
.two-col li {
  margin-bottom: 0.5rem;
  color: var(--c-text);
}

/* Experience timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 110px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--c-border);
}
.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2rem;
  position: relative;
  padding: 0.75rem 0 1.5rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 104px;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-primary);
  border: 3px solid var(--c-bg);
  box-shadow: 0 0 0 1px var(--c-border);
}
.section-alt .timeline li::before {
  border-color: var(--c-bg-alt);
}
.tl-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-muted);
  letter-spacing: 0.02em;
  padding-top: 1.2rem;
  text-align: right;
  padding-right: 1rem;
}
.tl-body h3 {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 0.25rem;
}
.tl-body p { margin: 0.35rem 0; }
.tl-body p:first-of-type { font-size: 0.9rem; }

/* Talks */
.talks-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.talks-list li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--c-border);
  align-items: baseline;
}
.talks-list li:last-child { border-bottom: none; }
.talk-year {
  font-weight: 600;
  color: var(--c-primary);
  font-size: 0.95rem;
}
.talk-title { margin: 0; color: var(--c-text); }
.talks-list .muted { margin: 0.15rem 0 0; font-size: 0.88rem; }

/* Awards */
.awards {
  margin-top: 2.5rem;
  padding: 1.75rem 2rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.awards h3 {
  font-size: 1.1rem;
  color: var(--c-primary);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.awards ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.5rem 1.5rem;
}
.awards li {
  padding-left: 1rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--c-text);
}
.awards li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--c-accent);
}

/* CV */
.cv-block {
  text-align: center;
  max-width: 640px;
}
.cv-block .section-title {
  display: inline-block;
}
.cv-block .section-title::after { left: 50%; transform: translateX(-50%); }
.cv-block p {
  font-size: 1.05rem;
  color: var(--c-text-muted);
  margin: 0 0 1.75rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.contact-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all 0.15s ease;
  color: var(--c-text);
  text-decoration: none;
}
.contact-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}
.contact-card.static { cursor: default; }
.contact-card.static:hover { border-color: var(--c-border); box-shadow: none; transform: none; }
.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  font-weight: 600;
}
.contact-value {
  color: var(--c-primary);
  font-weight: 500;
  word-break: break-word;
}
.contact-card.static .contact-value { color: var(--c-text); }

/* Footer */
.site-footer {
  background: var(--c-text);
  color: #b9c3cc;
  padding: 2rem 0;
  margin-top: 3rem;
}
.site-footer .muted { color: #7e8a95; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer p { margin: 0; font-size: 0.9rem; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { justify-content: flex-start; order: -1; }
  .photo-frame { width: 160px; height: 160px; }
  .photo-initials { font-size: 3rem; }

  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--nav-height);
    right: 0;
    left: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    gap: 0;
  }
  .site-nav.open { max-height: 80vh; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }
  .site-nav ul li { border-bottom: 1px solid var(--c-border); }
  .site-nav ul li:last-child { border-bottom: none; }
  .site-nav ul a {
    display: block;
    padding: 0.75rem 0;
  }
  .lang-switch { align-self: flex-start; }

  .timeline::before { left: 6px; }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding-left: 1.75rem;
  }
  .timeline li::before { left: 0; top: 0.4rem; }
  .tl-date { text-align: left; padding: 0; }
}

@media (max-width: 600px) {
  .section { padding: 3rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .awards { padding: 1.25rem 1.5rem; }
  .talks-list li { grid-template-columns: 60px 1fr; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle, .lang-switch, .hero-cta { display: none; }
  body { background: #fff; }
  .section { padding: 1rem 0; page-break-inside: avoid; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
