:root {
  --ink: #1c2430;
  --muted: #5b6673;
  --accent: #1f6f4a;
  --line: #e3e7ec;
  --bg: #fbfbf9;
  --card: #ffffff;
  --badge-bg: #eef5f0;
  --badge-line: #cfe3d6;
  --header-bg: rgba(251, 251, 249, 0.94);
}

:root[data-theme="dark"] {
  --ink: #e6ebf0;
  --muted: #9aa7b4;
  --accent: #5cbd8e;
  --line: #2a333d;
  --bg: #131920;
  --card: #1b232c;
  --badge-bg: #1d2a24;
  --badge-line: #2e4438;
  --header-bg: rgba(19, 25, 32, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6ebf0;
    --muted: #9aa7b4;
    --accent: #5cbd8e;
    --line: #2a333d;
    --bg: #131920;
    --card: #1b232c;
    --badge-bg: #1d2a24;
    --badge-line: #2e4438;
    --header-bg: rgba(19, 25, 32, 0.94);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

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

.site-header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

main { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem 3rem; }

section { padding: 3rem 0 0.5rem; }

h1 { font-size: 2.6rem; line-height: 1.15; }
h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
h3 { font-size: 1.1rem; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding-top: 3.5rem;
}

.hero-text p { margin-top: 1rem; }
.tagline { font-size: 1.2rem; color: var(--muted); }

.badge {
  display: inline-block;
  background: var(--badge-bg);
  border: 1px solid var(--badge-line);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
}
.cta:hover { text-decoration: none; opacity: 0.9; }

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.hero-photo img,
.gallery img,
.cert img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.45rem;
}

.section-note { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.2rem; }

.conference-list { list-style: none; }
.conference-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.gallery {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.experience-list { list-style: none; }
.experience-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.experience-list span { color: var(--muted); }

.cert { max-width: 420px; margin-top: 1.8rem; }

.authorship-list { list-style: none; }
.authorship-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.authorship-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
}
.card p { margin-top: 0.5rem; font-size: 0.95rem; }

.project-list { list-style: none; }
.project-list li { padding: 0.45rem 0; }

.address { color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  h1 { font-size: 2rem; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .nav { padding: 0.75rem 1rem; justify-content: center; text-align: center; }
  .nav-links { justify-content: center; gap: 0.85rem; row-gap: 0.4rem; }
  .nav-links a { padding: 0.15rem 0.1rem; }
  section { padding: 2.2rem 0 0.5rem; }
  .experience-list li { flex-direction: column; gap: 0.1rem; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  .tagline { font-size: 1.05rem; }
  .cert { max-width: 100%; }
}
