/* ===== Theme ===== */
:root {
  --bg: #fbfaf7;
  --bg-alt: #f2efe8;
  --surface: #ffffff;
  --ink: #17232e;
  --ink-soft: #4a5866;
  --muted: #6f7b86;
  --line: #e3ded3;
  --brand: #0f5560;        /* deep teal */
  --brand-dark: #0a3d45;
  --brand-tint: #e3efef;
  --accent: #b5652b;       /* warm copper */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 35, 46, .05), 0 6px 20px rgba(23, 35, 46, .06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; color: var(--ink); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover, .nav a.active { color: var(--brand); background: var(--brand-tint); }
.nav a.nav-cta { background: var(--brand); color: #fff; margin-left: 6px; }
.nav a.nav-cta:hover { background: var(--brand-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1.5px solid transparent; transition: .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-small { padding: 7px 12px; font-size: .85rem; }

/* ===== Hero ===== */
.hero { padding: 72px 0 48px; background:
  radial-gradient(900px 400px at 85% 0%, var(--brand-tint), transparent 70%), var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -.01em; }
.hero-title { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.45rem); color: var(--brand); margin: 10px 0 20px; }
.hero-motto { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); margin: -6px 0 14px; }
.hero-lead { color: var(--ink-soft); font-size: 1.06rem; max-width: 60ch; }
.role-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.role-tags li { font-size: .82rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-photo img {
  width: 100%; height: auto; max-width: 380px; aspect-ratio: 1; object-fit: cover; margin-left: auto;
  border-radius: 28px; box-shadow: var(--shadow); border: 6px solid var(--surface);
}

.profile-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.profile-links.center { justify-content: center; margin-top: 18px; }
.profile-links a { font-size: .9rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.profile-links a:hover { color: var(--brand); border-color: var(--brand); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 56px 0 0;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats div { background: var(--surface); padding: 22px 24px; display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dd { margin: 0; font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.stats dt { font-size: .86rem; color: var(--muted); margin-top: 4px; }

/* ===== Sections ===== */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 28px; position: relative; padding-bottom: 14px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; background: var(--accent); border-radius: 2px; }
.center .section-title::after { left: 50%; transform: translateX(-50%); }
.section-intro { color: var(--ink-soft); max-width: 70ch; }
.sub-title { font-size: 1.3rem; margin: 40px 0 18px; }

.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li { background: var(--brand-tint); color: var(--brand-dark); padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 500; }

/* ===== Latest ===== */
.news-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.news-list li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; }
.news-date { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.news-list p { margin: 0; font-size: .95rem; }
.note { margin-top: 16px; color: var(--ink-soft); font-style: italic; }

/* ===== Tabs ===== */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 32px; }
.tabs button {
  font: inherit; font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  background: none; border: 0; padding: 9px 18px; border-radius: 9px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }

/* ===== Timeline ===== */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-bottom: 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -28px; top: 6px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--brand);
}
.tl-date { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.tl-title { font-size: 1.12rem; font-weight: 600; }
.tl-org { color: var(--brand); font-weight: 500; font-size: .95rem; margin: 2px 0 6px; }
.tl-desc { color: var(--ink-soft); font-size: .95rem; max-width: 75ch; margin: 0; }

/* ===== Education ===== */
.edu-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.edu-list li { display: flex; gap: 18px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.edu-year { font-family: var(--serif); font-weight: 700; color: var(--accent); font-size: 1.1rem; min-width: 46px; }
.edu-list h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.edu-list p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

/* ===== Publications ===== */
.pub-list { counter-reset: pub; list-style: none; }
.pub-list li {
  counter-increment: pub; position: relative; padding: 18px 0 18px 48px; border-bottom: 1px solid var(--line);
}
.pub-list li::before {
  content: counter(pub); position: absolute; left: 0; top: 18px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; color: var(--muted);
}
.pub-title { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; margin-bottom: 4px; }
.pub-authors { font-size: .9rem; color: var(--ink-soft); margin-bottom: 2px; }
.pub-authors strong { color: var(--ink); }
.pub-journal { font-size: .9rem; color: var(--muted); margin: 0; }
.doi { font-style: normal; font-weight: 600; font-size: .8rem; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--brand-tint); text-decoration: none; }
.badge { display: inline-block; vertical-align: middle; font-family: var(--sans); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; background: #f6e7da; color: var(--accent); }

/* ===== Cards ===== */
.card-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 6px; }
.card p { font-size: .93rem; color: var(--ink-soft); margin: 0 0 6px; }
.card .card-sub { color: var(--brand); font-weight: 500; }
.card-kicker { font-size: .78rem !important; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent) !important; }

.simple-list { list-style: none; }
.simple-list li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); position: relative; }
.simple-list li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ===== Certificates ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.filters button:hover { border-color: var(--brand); color: var(--brand); }
.filters button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.cert-grid { list-style: none; display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .18s; }
.cert:has(.cert-open):hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfd8d8; }
.cert-open { all: unset; display: flex; flex-direction: column; width: 100%; height: 100%; cursor: pointer; }
.cert-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cert-media { aspect-ratio: 4 / 3; background: var(--bg-alt); display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.cert-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pdf-icon {
  width: 64px; height: 80px; border-radius: 6px; background: var(--surface); border: 2px solid var(--brand);
  display: grid; place-items: end center; padding-bottom: 12px; font-weight: 700; font-size: .85rem; color: var(--brand);
  box-shadow: 6px 6px 0 var(--brand-tint);
}
.cert-info { display: block; padding: 16px 18px; text-decoration: none; color: inherit; }
.cert-info h3 { font-family: var(--sans); font-size: .97rem; font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.cert-info p { font-size: .85rem; color: var(--muted); margin: 0; }
.cert-text { border-style: dashed; background: transparent; }
.cert-verify { display: inline-block; margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--brand); }

/* ===== Viewer ===== */
.viewer {
  width: min(1000px, 94vw); height: min(90vh, 900px); padding: 0; border: 0; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(15, 25, 32, .7); backdrop-filter: blur(3px); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.viewer-title { font-weight: 600; margin: 0; }
.viewer-meta { font-size: .85rem; color: var(--muted); margin: 0; }
.viewer-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.viewer-close { font-size: 1.8rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ink-soft); padding: 0 6px; }
.viewer-body { flex: 1; background: var(--bg-alt); display: grid; place-items: center; overflow: auto; }
.viewer-body img { max-height: 100%; max-width: 100%; object-fit: contain; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; }

/* ===== Contact & footer ===== */
.contact { background: var(--brand-dark); color: #dbe8e8; }
.contact .section-title { color: #fff; }
.contact .muted { color: #9fbcbe; }
.contact-email { font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.8rem); color: #fff; text-decoration: none; border-bottom: 2px solid var(--accent); }
.contact-email:hover { color: #fff; border-color: #fff; }
.contact .profile-links a { color: #dbe8e8; border-color: rgba(255,255,255,.25); }
.contact .profile-links a:hover { color: #fff; border-color: #fff; }
.site-footer { background: var(--brand-dark); color: #9fbcbe; border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; font-size: .85rem; text-align: center; }
.site-footer p { margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; }
  .hero-photo img { max-width: 200px; margin: 0; border-radius: 50%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .edu-list { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 24px 20px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav a.nav-cta { margin: 8px 0 0; text-align: center; }
  .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); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 40px; }
  .stats div { padding: 16px; }
  .stats dd { font-size: 1.7rem; }
  .pub-list li { padding-left: 0; }
  .pub-list li::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, .nav-toggle, .hero-actions, .filters, .viewer { display: none !important; }
  .section, .hero { padding: 24px 0; }
  .contact, .site-footer { background: none; color: var(--ink); }
}
