:root {
  --bg: #ffffff;
  --bg-tint: #f4fbff;
  --surface: #f6fbff;
  --text: #0a1929;
  --muted: #5a7185;
  --rule: #dde7ee;
  --primary: #0c4a6e;
  --primary-rgb: 12, 74, 110;
  --primary-soft: #135b85;
  --accent: #14b8a6;
  --accent-rgb: 20, 184, 166;
  --accent-soft: #5eead4;
  --highlight: #67e8f9;
  --shadow: 0 1px 2px rgba(10, 25, 41, 0.05), 0 12px 32px rgba(12, 74, 110, 0.08);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061625;
    --bg-tint: #0a1f33;
    --surface: #0e273e;
    --text: #e6f3fb;
    --muted: #7f9ab3;
    --rule: #1d3548;
    --primary: #4ba3e8;
    --primary-rgb: 75, 163, 232;
    --primary-soft: #67b6f0;
    --accent: #2dd4bf;
    --accent-rgb: 45, 212, 191;
    --accent-soft: #5eead4;
    --highlight: #67e8f9;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 92% -10%, rgba(var(--accent-rgb), 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 25%, rgba(var(--primary-rgb), 0.12), transparent 60%);
  background-attachment: fixed;
}

::selection { background: var(--primary); color: #fff; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--accent); }

/* ── Top nav ───────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: transparent;
  transition: background 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease, padding 0.2s ease;
  border-bottom: 1px solid transparent;
}
.topnav.scrolled {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.nav-brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: var(--primary); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  padding: 0;
  margin: 0;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 6rem 0 7rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.hero.in { opacity: 1; transform: none; }

.eyebrow {
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.display-name {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3.4rem, 9.5vw, 7.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.display-name span {
  display: inline-block;
  padding-bottom: 0.06em;
}
.display-name .italic {
  font-style: italic;
  background: linear-gradient(95deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  padding-bottom: 0.16em;
  line-height: 1.1;
}

.lede {
  margin: 2rem 0 2rem;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 44ch;
}
.lede a {
  border-bottom: 1px solid var(--primary);
  padding-bottom: 1px;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--text);
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 8px 22px color-mix(in oklab, var(--primary) 18%, transparent);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(95deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
}

.hero-photo {
  margin: 0;
  justify-self: end;
  position: relative;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -14px -14px 14px 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 6px;
  z-index: 0;
  opacity: 0.85;
}
.hero-photo img {
  position: relative;
  width: min(340px, 36vw);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: var(--shadow);
  filter: saturate(0.98);
  transform: rotate(-1.5deg);
  transition: transform 0.4s ease;
  z-index: 1;
}
.hero-photo img:hover { transform: rotate(0deg) translateY(-3px); }

/* ── Sections (adaptive, asymmetric) ───────────────────── */
.section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem;
  padding: 5rem 0;
  border-top: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section.in { opacity: 1; transform: none; }

.section-rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.55rem;
  position: sticky;
  top: 5rem;
  align-self: start;
}
.section-rail .num {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.section-rail .rail-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 80;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 1.75rem;
}

.section-content { min-width: 0; }

.prose {
  max-width: 64ch;
  font-size: 1.07rem;
  line-height: 1.7;
  color: var(--text);
}

/* ── Themes (stacked rows) ─────────────────────────────── */
.themes {
  list-style: none;
  padding: 0;
  margin: 4rem 0 0;
}

.theme {
  display: block;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}
.theme:first-child {
  padding-top: 0;
  border-top: 0;
}

.theme-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.theme-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.7rem;
  background: linear-gradient(95deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding-bottom: 0.05em;
}

.theme-text h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.theme-text p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 65ch;
}

/* ── Education ────────────────────────────────────────── */
.education { list-style: none; padding: 0; margin: 0; }
.education li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  transition: padding-left 0.2s ease;
}
.education li:first-child { border-top: 0; padding-top: 0; }
.education li:hover { padding-left: 0.4rem; }
.ed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.ed-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}
.ed-meta {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Contact (3 + 2 centered) ─────────────────────────── */
.links {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
}
.links li {
  flex: 0 0 calc((100% - 4rem) / 3);
  min-width: 220px;
}
.links a {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0;
  color: var(--text);
  transition: padding-left 0.2s ease, color 0.2s ease;
}
.links a:hover {
  padding-left: 0.4rem;
  color: var(--primary);
}
.link-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
footer p { margin: 0.2rem 0; }
footer .credits {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 980px) {
  .section { grid-template-columns: 1fr; gap: 1.25rem; padding: 4rem 0; }
  .section-rail { position: static; flex-direction: row; gap: 0.75rem; align-items: baseline; }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding: 3rem 0 4rem;
  }
  .hero-photo { justify-self: start; order: -1; }
  .hero-photo img { width: 200px; }
  .hero-photo::before { inset: -10px -10px 10px 10px; }
}

@media (max-width: 540px) {
  main { padding: 0 1.25rem 4rem; }
  .topnav { padding: 0.85rem 1.25rem; }
  .nav-links { gap: 1.1rem; }
  .ed-head { flex-direction: column; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
