/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #fafaf8;
  --bg-alt:      #f3f1ec;
  --surface:     #ffffff;
  --border:      #e8e5de;
  --text:        #1a1916;
  --text-muted:  #6b6860;
  --accent:      #2d5a3d;
  --accent-light:#4a7c5a;
  --accent-pale: #e8f0eb;
  --gold:        #b8953e;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 32px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.06);
  --nav-h:       68px;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-display:'Playfair Display', Georgia, serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Nav ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
  height: var(--nav-h);
}
#navbar.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 48px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .02em;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform .3s, opacity .3s;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: all .2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn-full { width: 100%; }

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 60px) 32px 80px;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(45,90,61,.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 72px;
}
.hero-avatar {
  flex-shrink: 0;
  width: 220px; height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.avatar-fallback {
  display: none;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  align-items: center;
  justify-content: center;
}
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--text);
}
.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  margin-bottom: 20px;
}
.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.75;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: .4; transform: scaleY(1); }
  50%       { opacity: 1;  transform: scaleY(1.1); }
}

/* ── Sections ── */
.section { padding: 100px 32px; }
.section-alt { background: var(--bg-alt); }

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 56px;
}
.section-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 14px;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* ── Research ── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .25s, transform .25s;
}
.research-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.research-card.featured {
  border-color: var(--accent);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-pale) 100%);
}
.card-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-pale);
  padding: 3px 10px;
  border-radius: 100px;
  align-self: flex-start;
}
.research-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}
.research-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-size: .72rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 100px;
}
.card-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
  transition: color .2s;
  align-self: flex-start;
}
.card-link:hover { color: var(--accent-light); }

/* ── Publications ── */
.pub-category {
  margin-bottom: 48px;
}
.pub-cat-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.pub-list {
  list-style: none;
  counter-reset: pub-counter;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}
.pub-list li {
  counter-increment: pub-counter;
  display: flex;
  gap: 14px;
  font-size: .9rem;
  line-height: 1.7;
}
.pub-list li::before {
  content: counter(pub-counter) ".";
  color: var(--accent);
  font-weight: 600;
  font-size: .82rem;
  min-width: 22px;
  flex-shrink: 0;
  padding-top: 3px;
}
.pub-content {
  color: var(--text);
}
.pub-content em {
  color: var(--text-muted);
}

/* ── AI Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .25s, transform .25s;
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.project-icon {
  width: 44px; height: 44px;
  background: var(--accent-pale);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.project-icon svg { width: 22px; height: 22px; }
.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.project-card p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-stack span {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .04em;
  background: #1a1916;
  color: #e8f0eb;
  padding: 3px 9px;
  border-radius: 5px;
}

/* ── Hobbies ── */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.hobby-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .25s, transform .25s;
}
.hobby-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.hobby-icon {
  width: 40px; height: 40px;
  color: var(--accent);
  flex-shrink: 0;
}
.hobby-icon svg { width: 100%; height: 100%; }
.hobby-item h3 {
  font-size: 1rem;
  font-weight: 600;
}
.hobby-item p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Photos ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
}
.photo-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
  aspect-ratio: 4/3;
}
.photo-item.tall {
  grid-row: span 2;
  aspect-ratio: unset;
}
.photo-item.wide {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.photo-item:hover img { transform: scale(1.04); }
.photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
  color: #fff;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity .3s;
}
.photo-item:hover .photo-caption { opacity: 1; }

/* placeholder when image 404s */
.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  min-height: 160px;
}
.photo-placeholder::after {
  content: 'Photo';
  font-size: .8rem;
  color: var(--border);
  font-weight: 500;
}

.photo-more {
  margin-top: 24px;
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
}
.photo-more a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.contact-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}
.contact-icon {
  width: 40px; height: 40px;
  background: var(--accent-pale);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-icon svg { width: 20px; height: 20px; }
.contact-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.contact-value {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .9rem;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, .12);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--border); }
.form-note {
  font-size: .82rem;
  color: var(--accent);
  text-align: center;
  min-height: 1.2em;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 36px 32px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; gap: 40px; text-align: center; }
  .hero-bio { margin: 0 auto 32px; }
  .hero-cta { justify-content: center; }
  .hero-avatar { width: 160px; height: 160px; }

  .contact-grid { grid-template-columns: 1fr; gap: 40px; }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-item.tall { grid-row: span 1; aspect-ratio: 4/3; }
  .photo-item.wide { grid-column: span 2; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px 32px 28px; gap: 20px; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }

  #hero { padding-top: calc(var(--nav-h) + 40px); }
  .section { padding: 72px 20px; }
  .research-grid,
  .projects-grid,
  .hobbies-grid { grid-template-columns: 1fr; }

  .photo-grid { grid-template-columns: 1fr; }
  .photo-item.wide { grid-column: span 1; aspect-ratio: 4/3; }
}
