:root {
  --ink: #15202b;
  --ink-soft: #3a4654;
  --muted: #667585;
  --paper: #f4f7f8;
  --paper-2: #e8eef1;
  --line: rgba(21, 32, 43, 0.12);
  --accent: #1f6f6a;
  --accent-deep: #14524e;
  --glow-a: rgba(31, 111, 106, 0.18);
  --glow-b: rgba(58, 90, 128, 0.16);
  --glow-c: rgba(196, 140, 72, 0.1);
  --max: 720px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  background:
    radial-gradient(900px 520px at 8% -10%, var(--glow-a), transparent 60%),
    radial-gradient(760px 480px at 92% 8%, var(--glow-b), transparent 55%),
    radial-gradient(640px 420px at 70% 95%, var(--glow-c), transparent 50%),
    linear-gradient(180deg, #f7fafb 0%, var(--paper) 42%, var(--paper-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    repeating-linear-gradient(
      115deg,
      transparent 0,
      transparent 14px,
      rgba(21, 32, 43, 0.015) 14px,
      rgba(21, 32, 43, 0.015) 15px
    );
  animation: drift 28s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-1.5%, 1%, 0); }
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(244, 247, 248, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent-deep);
}

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

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 560;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
}

main {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4.5rem;
}

.hero {
  padding: 2.2rem 0 2.4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.4rem;
}

.hero h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.6rem, 7vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.lede,
.research-statement {
  margin: 0 0 1.1rem;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.12rem;
}

.research-statement {
  font-size: 1.08rem;
  line-height: 1.55;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.meta a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.section {
  margin: 0 0 2.6rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.section p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.section > p:last-child {
  margin-bottom: 0;
}

.year-block {
  margin: 0 0 1.35rem;
}

.year {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pub,
.job,
.project {
  margin: 0 0 1.15rem;
  padding: 0;
}

.pub:last-child,
.job:last-child,
.project:last-child {
  margin-bottom: 0;
}

.pub h3,
.job h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.pub .venue,
.job .org {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

/* Projects: title → links → body+image → metadata → separator */
.page-projects .hero-compact {
  padding: 1.6rem 0 1.5rem;
  margin-bottom: 1.75rem;
}

.page-projects .hero-compact h1 {
  font-size: clamp(2.1rem, 5.5vw, 3rem);
}

.page-projects .lede {
  margin-bottom: 0;
  font-size: 0.98rem;
  max-width: 34rem;
}

.project-group {
  margin-bottom: 2.8rem;
}

.project-group > h2 {
  margin: 0 0 1.25rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-projects .project {
  margin: 0 0 1.75rem;
  padding: 0 0 1.75rem;
  border-bottom: 1px solid var(--line);
}

.page-projects .project:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.page-projects .project > h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-projects .project > .links {
  margin: 0 0 0.85rem;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.35;
}

.page-projects .project-body {
  margin: 0;
  font-family: var(--font-body);
}

.page-projects .project-body p {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.page-projects .project-body p:last-child {
  margin-bottom: 0;
}

.page-projects .project-meta {
  margin: 0.85rem 0 0;
  font-family: var(--font-body);
}

.page-projects .project-meta p {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
}

.page-projects .project-meta p:first-child {
  margin-top: 0;
}

.page-projects .project-figure {
  margin: 0;
  padding: 0;
}

.page-projects .project-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* ≥3:1: full-bleed image, then paragraph */
.page-projects .project--media-full .project-figure {
  margin: 0 0 0.85rem;
}

/* <3:1: text ~70% left, image ~30% right */
.page-projects .project-media-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 1.15rem 1.35rem;
  align-items: start;
}

.page-projects .project--media-side .project-figure {
  margin: 0;
  width: 100%;
}

@media (max-width: 720px) {
  .page-projects .project-media-row {
    grid-template-columns: 1fr;
  }

  .page-projects .project--media-side .project-figure {
    order: 2;
    max-width: 18rem;
  }

  .page-projects .project--media-side .project-body {
    order: 1;
  }
}

.hero-identity {
  display: flex;
  align-items: flex-start;
  gap: 1.35rem 1.75rem;
}

.portrait {
  flex: 0 0 auto;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 2px;
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.hero-copy h1 {
  margin-top: 0;
}

@media (max-width: 560px) {
  .hero-identity {
    flex-direction: column;
    gap: 1rem;
  }

  .portrait {
    width: 5.75rem;
    height: 5.75rem;
  }
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.25rem;
}

.job-head h3 {
  margin: 0;
}

.dates {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.job ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.job li {
  margin: 0.2rem 0;
}

.page-projects .project ul.links {
  padding-left: 0;
  list-style: none;
}

.skills {
  display: grid;
  gap: 0.85rem;
}

.skills dt {
  margin: 0;
  font-weight: 680;
  font-size: 0.95rem;
}

.skills dd {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
}

.site-footer {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a {
  color: inherit;
}

/* Motion: entrance */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero.reveal { animation-delay: 40ms; }
.section.reveal:nth-of-type(1) { animation-delay: 120ms; }
.section.reveal:nth-of-type(2) { animation-delay: 190ms; }
.section.reveal:nth-of-type(3) { animation-delay: 250ms; }
.section.reveal:nth-of-type(4) { animation-delay: 310ms; }
.section.reveal:nth-of-type(5) { animation-delay: 360ms; }
.section.reveal:nth-of-type(6) { animation-delay: 400ms; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .nav-links a::after { transition: none; }
}

@media (max-width: 560px) {
  .nav {
    padding: 0.85rem 1.1rem;
  }

  main {
    padding: 1.75rem 1.1rem 3.5rem;
  }

  .hero {
    padding-top: 1.4rem;
  }

  .job-head {
    flex-direction: column;
  }
}
