:root {
  --bg: #0a1f1c;
  --bg-alt: #0f2b26;
  --surface: #123833;
  --surface-2: #16443c;
  --border: #1e4a43;
  --border-soft: rgba(79, 209, 165, 0.16);
  --text: #e7f3ef;
  --text-dim: #a9c4bd;
  --accent: #4fd1a5;
  --accent-2: #2f9d78;
  --accent-soft: rgba(79, 209, 165, 0.12);
  --max-width: 1040px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-color: 160, 40%, 3%;
  --font-display: 'Cabinet Grotesk', 'Satoshi', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font: 'Satoshi', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--accent);
  color: #06231d;
}

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

/* topographic background */
.topo-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(79,209,165,0.08), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(79,209,165,0.06), transparent 45%),
    repeating-radial-gradient(circle at 50% 0%, transparent 0, transparent 60px, rgba(79,209,165,0.035) 61px, transparent 62px);
  background-size: auto, auto, 140px 140px;
}

/* header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 31, 28, 0.75);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--text);
  transition: color 0.2s ease;
}
.logo:hover { text-decoration: none; color: var(--accent); }

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

.nav-links a {
  position: relative;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* hero */
.hero {
  padding: 120px 24px 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.hero-photo-wrap {
  display: flex;
  justify-content: center;
}
.hero-photo {
  width: 224px;
  height: 224px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-soft), 0 0 0 8px var(--accent-soft), 0 24px 48px -20px rgba(0, 0, 0, 0.65);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.hero-photo:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 1px var(--border-soft), 0 0 0 11px var(--accent-soft), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
}
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-photo-wrap { order: -1; }
  .hero-photo { width: 160px; height: 160px; }
  .hero-links, .hero-actions, .eyebrow-row { justify-content: center; }
  .resume-links { justify-content: center; }
}
.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.eyebrow-pill {
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 999px;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 4.1rem);
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.hero-lede {
  max-width: 620px;
  color: var(--text-dim);
  font-size: 1.12rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06231d;
  box-shadow: 0 10px 24px -12px rgba(79, 209, 165, 0.55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(79, 209, 165, 0.7); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.hero-links {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 24px 0 0;
  flex-wrap: wrap;
}
.hero-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.hero-links a:hover { color: var(--accent); }

.resume-links {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.resume-label { color: var(--text-dim); font-weight: 600; }
.resume-sep { color: var(--border); }

/* research focus banner */
.banner-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.banner-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  display: block;
}

/* sections */
.section { padding: 88px 24px; border-top: 1px solid var(--border); }
.section h2 {
  font-size: 1.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.section-lede {
  color: var(--text-dim);
  max-width: 680px;
  margin-top: -18px;
  margin-bottom: 32px;
  font-size: 1.02rem;
}

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
}
.about-text p { color: var(--text-dim); margin-bottom: 18px; }
.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}
.fact {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.fact:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 32px -20px rgba(79, 209, 165, 0.35);
}
.fact-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
}
.fact-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* timeline */
.timeline {
  border-left: 2px solid var(--border);
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -39.5px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--bg), 0 0 0 5px var(--accent-soft);
  animation: timelinePulse 3s ease-in-out infinite;
}
@keyframes timelinePulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--bg), 0 0 0 5px var(--accent-soft); }
  50%      { box-shadow: 0 0 0 1px var(--bg), 0 0 0 9px var(--accent-soft); }
}
.timeline-when {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  margin-left: 8px;
}
.timeline-org {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 12px;
}
.timeline-content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
}
.timeline-content li { margin-bottom: 8px; }

/* project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 36px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-soft);
}

/* photo project cards */
.project-card.has-media {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.project-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
.project-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 31, 28, 0.55) 100%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.project-card.has-media:hover .project-card-media img {
  transform: scale(1.07);
  filter: saturate(1.08);
}
.project-card.has-media:hover .project-card-media::after {
  opacity: 0.7;
}
.project-card-body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 218px;
  box-sizing: border-box;
}
.project-card-body h3 {
  min-height: 2.5rem;
}
.project-card-body p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
  min-height: calc(1.55em * 3);
}
.project-card-body .project-meta {
  margin-top: auto;
}
.project-tag {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.project-card-media .project-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  background: rgba(10, 31, 28, 0.55);
  border: 1px solid rgba(231, 243, 239, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}
.project-card.has-media:hover .project-card-media .project-tag {
  transform: translateY(-2px);
  background: rgba(10, 31, 28, 0.75);
}
.project-card h3 { font-size: 1.05rem; }
.project-card p { color: var(--text-dim); font-size: 0.92rem; margin: 0; }
.project-meta { font-size: 0.85rem !important; color: var(--text-dim); }

/* research */
.research-block {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.research-block:last-child { border-bottom: none; }
.research-block h3 { font-size: 1rem; color: var(--accent); }
.research-block p, .research-block li { color: var(--text-dim); font-size: 0.95rem; }
.research-block ul { padding-left: 20px; }
.research-block li { margin-bottom: 10px; }

/* skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}
.skill-group:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.skill-group h3 { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.skill-note { color: var(--text-dim); font-weight: 400; font-size: 0.78rem; text-transform: none; }
.skill-group-wide { grid-column: 1 / -1; }

.subsection-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 44px 0 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.training-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}
.training-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.training-year {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
}
.training-card h4 {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
}
.training-provider {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}
.membership-line {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.skill-group p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.contact-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 30px -18px rgba(79, 209, 165, 0.3);
}
.contact-label { font-size: 0.76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.contact-value { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; word-break: break-word; }

/* footer */
.site-footer {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* responsive */
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    box-shadow: 0 16px 24px -18px rgba(0, 0, 0, 0.6);
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav-links.open { max-height: 400px; }
  .nav-links li {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open li {
    opacity: 1;
    transform: translateY(0);
  }
  .nav-links.open li:nth-child(1) { transition-delay: 0.04s; }
  .nav-links.open li:nth-child(2) { transition-delay: 0.08s; }
  .nav-links.open li:nth-child(3) { transition-delay: 0.12s; }
  .nav-links.open li:nth-child(4) { transition-delay: 0.16s; }
  .nav-links.open li:nth-child(5) { transition-delay: 0.2s; }
  .nav-links.open li:nth-child(6) { transition-delay: 0.24s; }
  .nav-links li a { display: block; font-size: 1rem; padding: 4px 0; }
  .hero { padding-top: 90px; }
  .section { padding: 56px 20px; }
  .btn { width: 100%; text-align: center; }
  .hero-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .about-facts { grid-template-columns: 1fr 1fr; gap: 12px; }
  .fact { padding: 16px; }
  .fact-num { font-size: 1.6rem; }
  .project-grid,
  .skills-grid,
  .training-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo { width: 132px; height: 132px; }
  .section h2 { font-size: 1.4rem; }
  .container { padding: 0 18px; }
  .hero { padding: 90px 18px 56px; }
}

/* ===== hero entrance ===== */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-text > * {
  opacity: 0;
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.15s; }
.hero-text > *:nth-child(3) { animation-delay: 0.25s; }
.hero-text > *:nth-child(4) { animation-delay: 0.35s; }
.hero-text > *:nth-child(5) { animation-delay: 0.45s; }
.hero-text > *:nth-child(6) { animation-delay: 0.55s; }
.hero-photo-wrap {
  opacity: 0;
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* ===== scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
.stagger > *:nth-child(1) { transition-delay: 0.02s; }
.stagger > *:nth-child(2) { transition-delay: 0.08s; }
.stagger > *:nth-child(3) { transition-delay: 0.14s; }
.stagger > *:nth-child(4) { transition-delay: 0.2s; }
.stagger > *:nth-child(5) { transition-delay: 0.26s; }
.stagger > *:nth-child(6) { transition-delay: 0.32s; }
.stagger > *:nth-child(7) { transition-delay: 0.38s; }
.stagger > *:nth-child(8) { transition-delay: 0.44s; }
.stagger > *:nth-child(9) { transition-delay: 0.5s; }
.stagger > *:nth-child(10) { transition-delay: 0.56s; }
.stagger > *:nth-child(n+11) { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > *, .hero-text > *, .hero-photo-wrap {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .timeline-item::before { animation: none !important; }
  .fact, .project-card, .skill-group, .training-card, .contact-card, .hero-photo, .btn, .project-card-media img {
    transition: none !important;
  }
}
