:root {
  --bg: #f6f1e8;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: rgba(255, 252, 247, 0.98);
  --text: #1a1714;
  --muted: #62584f;
  --line: rgba(92, 79, 66, 0.14);
  --accent: #145c57;
  --accent-soft: #ddece8;
  --accent-warm: #b87432;
  --accent-warm-soft: #f3e1cf;
  --accent-rose: #b65c6d;
  --accent-rose-soft: #f1dde2;
  --accent-indigo: #496170;
  --shadow: 0 16px 40px rgba(45, 35, 25, 0.06);
  --shadow-strong: 0 24px 56px rgba(45, 35, 25, 0.1);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #f8f4ed 0%, #f3ede3 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto;
}

.hero,
.card,
.contact-card,
.footer,
.stats-grid article,
.card-grid article,
.stack-list article {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 248, 240, 0.78);
  box-shadow: var(--shadow);
}

#about .card {
  background: linear-gradient(180deg, rgba(244, 249, 244, 0.96), rgba(235, 242, 233, 0.88));
}

#about .section-label {
  color: #3f6b52;
}

#current-work .card-grid article {
  background: linear-gradient(180deg, rgba(252, 247, 238, 0.96), rgba(245, 234, 216, 0.88));
}

#current-work .section-label {
  color: #9a6431;
}

#research .card-grid article {
  background: linear-gradient(180deg, rgba(241, 248, 247, 0.96), rgba(226, 239, 237, 0.88));
}

#research .section-label {
  color: #145c57;
}

#proposal .stack-list article {
  background: linear-gradient(180deg, rgba(248, 242, 238, 0.96), rgba(239, 227, 221, 0.88));
}

#proposal .section-label {
  color: #96615a;
}

#highlights .card-grid article {
  background: linear-gradient(180deg, rgba(248, 245, 236, 0.96), rgba(239, 233, 214, 0.88));
}

#highlights .section-label {
  color: #8a6a20;
}

#projects .card-grid article {
  background: linear-gradient(180deg, rgba(248, 242, 236, 0.96), rgba(240, 228, 217, 0.88));
}

#projects .section-label {
  color: #8a5d3b;
}

#photos .photo-card {
  background: linear-gradient(180deg, rgba(243, 245, 241, 0.96), rgba(231, 235, 228, 0.88));
}

#photos .section-label {
  color: #5a6952;
}

#teaching .card-grid article {
  background: linear-gradient(180deg, rgba(246, 241, 246, 0.96), rgba(235, 226, 235, 0.88));
}

#teaching .section-label {
  color: #7c5876;
}

#resume .contact-card {
  background: linear-gradient(180deg, rgba(249, 246, 242, 0.96), rgba(241, 235, 227, 0.88));
}

#resume .section-label {
  color: #78604d;
}

#updates .stack-list article {
  background: linear-gradient(180deg, rgba(250, 244, 239, 0.96), rgba(243, 231, 223, 0.88));
}

#updates .section-label,
#updates .update-date {
  color: #a05e36;
}

#publications .stack-list article {
  background: linear-gradient(180deg, rgba(243, 245, 248, 0.96), rgba(230, 235, 241, 0.88));
}

#publications .section-label {
  color: #5d6b7b;
}

#contact .contact-card {
  background: linear-gradient(180deg, rgba(240, 246, 242, 0.96), rgba(228, 238, 232, 0.88));
}

#contact .section-label {
  color: #406455;
}

.hero {
  min-height: 56vh;
  padding: 24px;
  border-radius: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 252, 247, 0.9), rgba(245, 239, 230, 0.92)),
    url("heropp.webp") center / contain no-repeat;
}

.hero::after {
  content: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 12px;
  z-index: 10;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(244, 238, 229, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(208, 198, 185, 0.9);
  box-shadow: 0 10px 24px rgba(45, 35, 25, 0.05);
  animation: none;
}

.brand,
.button {
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  width: 100%;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 0 0 6px;
  border-radius: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  text-align: left;
  transition: color 180ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a:hover {
  color: var(--text);
}

.hero-content {
  padding: 24px 12px 16px;
  animation: rise 700ms ease both;
  position: relative;
  z-index: 1;
}

@media (min-width: 1100px) {
  .hero-content {
    padding-top: 12px;
  }
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero-copy {
  max-width: 760px;
}

.hero-photo-shell {
  width: min(100%, 260px);
  aspect-ratio: 4 / 5;
  padding: 14px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.94), rgba(242, 234, 224, 0.82));
  border: 1px solid rgba(255, 248, 240, 0.8);
  box-shadow: var(--shadow);
  animation: none;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

.eyebrow,
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3,
.stat-number {
  font-family: "Newsreader", serif;
  font-weight: 700;
  line-height: 0.98;
  margin: 0;
}

h1 {
  font-size: clamp(3.3rem, 9vw, 6.2rem);
  margin-top: 14px;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  line-height: 1.75;
}

.hero-summary,
.card p,
.contact-card p,
.stack-list p,
.card-grid p {
  color: var(--muted);
}

.hero-summary {
  font-size: 1.12rem;
  max-width: 620px;
  margin-top: 20px;
  animation: none;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(92, 79, 66, 0.14);
  background: rgba(255, 252, 247, 0.92);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  width: min(100%, 760px);
}

.hero-actions .button {
  flex: 1 1 220px;
  min-width: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid rgba(92, 79, 66, 0.16);
  font-weight: 650;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  backdrop-filter: none;
}

.button:hover,
.brand:hover {
  transform: translateY(-2px);
}

.button::before {
  content: none;
}

.button::after {
  content: none;
}

.button:hover::after {
  left: auto;
}

.button-primary {
  background: var(--text);
  color: white;
  box-shadow: 0 10px 22px rgba(26, 23, 20, 0.14);
}

.button-secondary {
  background: rgba(255, 252, 247, 0.96);
  border-color: rgba(92, 79, 66, 0.16);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(26, 23, 20, 0.08);
}

.button-primary:hover {
  box-shadow: 0 16px 28px rgba(26, 23, 20, 0.18);
}

.button-secondary:hover {
  background: white;
  border-color: rgba(92, 79, 66, 0.22);
  box-shadow: 0 12px 24px rgba(26, 23, 20, 0.12);
}

.section {
  padding: 96px 0 0;
}

#about.section {
  padding-top: 48px;
}

.intro-grid,
.split-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}

.section-heading {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  max-width: 760px;
}

.card,
.contact-card,
.stats-grid article,
.card-grid article,
.stack-list article {
  border-radius: var(--radius-lg);
  padding: 30px;
}

.card,
.contact-card,
.card-grid article,
.stack-list article,
.footer {
  position: relative;
  overflow: hidden;
}

.card::before,
.contact-card::before,
.card-grid article::before,
.stack-list article::before,
.footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  opacity: 0.65;
}

.stats-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.stats-grid article,
.card-grid article,
.stack-list article {
  animation: rise 500ms ease both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-grid article:nth-child(1),
.stack-list article:nth-child(1) {
  animation-delay: 80ms;
}

.card-grid article:nth-child(2),
.stack-list article:nth-child(2) {
  animation-delay: 160ms;
}

.card-grid article:nth-child(3),
.stack-list article:nth-child(3) {
  animation-delay: 240ms;
}

.card-grid article:nth-child(4),
.stack-list article:nth-child(4) {
  animation-delay: 320ms;
}

.card-grid article:nth-child(5),
.stack-list article:nth-child(5) {
  animation-delay: 400ms;
}

.card-grid article:nth-child(6),
.stack-list article:nth-child(6) {
  animation-delay: 480ms;
}

.card-grid article:hover,
.stack-list article:hover,
.card:hover,
.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(45, 35, 25, 0.08);
  border-color: rgba(92, 79, 66, 0.18);
}

.card-grid article {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 241, 234, 0.86));
}

.card-grid article:nth-child(3n + 1) .meta {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-grid article:nth-child(3n + 2) .meta {
  background: var(--accent-warm-soft);
  color: #b45309;
}

.card-grid article:nth-child(3n) .meta {
  background: var(--accent-rose-soft);
  color: #be123c;
}

.card-visual {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 20px;
  border-radius: 20px;
  border: 1px solid rgba(29, 27, 24, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(215, 243, 238, 0.6));
}

.card-visual-button,
.photo-card {
  cursor: zoom-in;
}

.card-visual-button {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.stat-number {
  display: block;
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.meta {
  display: inline-flex;
  margin-top: 20px;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.stack-list {
  display: grid;
  gap: 18px;
}

.publications-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.publication-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.publication-title a {
  text-decoration: none;
}

.publication-card {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 241, 234, 0.86));
}

.publication-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publication-taxonomy span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(92, 79, 66, 0.12);
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
}

.update-card {
  display: grid;
  gap: 12px;
}

.update-date {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.publication-meta {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.publication-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 600;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.publication-link:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.25);
}

.publication-link-primary {
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.95));
}

.card-link {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 600;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.card-actions .card-link {
  margin-top: 0;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.card-link-primary {
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.95));
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.photo-card {
  display: block;
  overflow: hidden;
  min-height: 230px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 241, 234, 0.86));
  border: 1px solid rgba(255, 248, 240, 0.76);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
  animation: rise 500ms ease both;
}

.photo-card:nth-child(1) { animation-delay: 120ms; }
.photo-card:nth-child(2) { animation-delay: 180ms; }
.photo-card:nth-child(3) { animation-delay: 240ms; }
.photo-card:nth-child(4) { animation-delay: 300ms; }
.photo-card:nth-child(5) { animation-delay: 360ms; }
.photo-card:nth-child(6) { animation-delay: 420ms; }
.photo-card:nth-child(7) { animation-delay: 480ms; }
.photo-card:nth-child(8) { animation-delay: 540ms; }

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(45, 35, 25, 0.08);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.photo-card:hover img {
  transform: scale(1.03);
}

.photo-card-featured {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 480px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.98);
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-links a:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 116, 144, 0.22);
}

.contact-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.footer {
  margin: 88px 0 28px;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 241, 234, 0.86));
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1220px);
  max-height: 92vh;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.lightbox-figure {
  margin: 0;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.6;
}

.lightbox-close,
.lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  position: absolute;
  top: -8px;
  right: 8px;
  font-size: 1.7rem;
  line-height: 1;
}

.lightbox-nav {
  font-size: 1.6rem;
  line-height: 1;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .intro-grid,
  .split-layout,
  .stats-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .publications-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-photo-shell {
    max-width: 320px;
    margin-bottom: 28px;
  }

  .hero {
    min-height: auto;
  }

  .topbar {
    position: static;
    border-radius: 28px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    margin: 10px auto;
  }

  .hero,
  .card,
  .contact-card,
  .stats-grid article,
  .card-grid article,
  .stack-list article,
  .footer {
    padding: 22px;
    border-radius: 24px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 10px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-card-featured {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 280px;
  }

  .lightbox-panel {
    width: min(100vw - 20px, 1220px);
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 10px 16px;
  }

  .lightbox-close {
    top: -2px;
    right: 4px;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-image {
    max-height: 68vh;
  }
}
