:root {
  --bg: #f5fdf7;
  --bg-deep: #dae6fe;
  --surface: rgba(245, 253, 247, 0.74);
  --surface-strong: rgba(239, 252, 255, 0.88);
  --ink: #0e2869;
  --muted: #3c719f;
  --line: rgba(60, 113, 159, 0.2);
  --line-strong: rgba(14, 40, 105, 0.36);
  --steel: #95b2d4;
  --accent-rose: #95b2d4;
  --accent-blue: #3c719f;
  --accent-teal: #7ad5c3;
  --accent-gold: #0e2869;
  --accent-violet: #8979b4;
  --shadow: 0 1px 0 rgba(14, 40, 105, 0.12), 0 16px 40px rgba(88, 161, 181, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151712;
    --bg-deep: #1d2118;
    --surface: rgba(28, 31, 24, 0.9);
    --surface-strong: rgba(34, 37, 29, 0.96);
    --ink: #f4efe2;
    --muted: #c3bbaa;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.36);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(245, 253, 247, 0.78), transparent 34%),
    linear-gradient(
      90deg,
      rgba(122, 213, 195, 0.16),
      transparent 26%,
      rgba(60, 113, 159, 0.14) 62%,
      transparent 100%
    ),
    linear-gradient(180deg, rgba(137, 121, 180, 0.07), transparent 38%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(14, 40, 105, 0.075) 0.6px, transparent 0.7px),
    radial-gradient(rgba(239, 252, 255, 0.42) 0.7px, transparent 0.8px),
    linear-gradient(90deg, rgba(60, 113, 159, 0.075) 1px, transparent 1px),
    linear-gradient(0deg, rgba(88, 161, 181, 0.06) 1px, transparent 1px);
  background-position:
    0 0,
    9px 7px,
    0 0,
    0 0;
  background-size:
    18px 18px,
    23px 23px,
    96px 96px,
    96px 96px;
  mix-blend-mode: multiply;
  opacity: 0.72;
}

#molecule-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.96;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background-image:
      radial-gradient(rgba(244, 239, 224, 0.07) 0.6px, transparent 0.7px),
      radial-gradient(rgba(0, 0, 0, 0.22) 0.8px, transparent 0.9px);
    mix-blend-mode: screen;
    opacity: 0.34;
  }

  #molecule-canvas {
    opacity: 0.78;
  }
}

.page-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(244, 251, 250, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(135%);
}

@media (prefers-color-scheme: dark) {
  .topbar {
    background: rgba(21, 23, 18, 0.84);
  }
}

.wordmark,
nav a,
a {
  color: var(--ink);
  text-decoration: none;
}

.wordmark {
  font-family: "IBM Plex Serif", serif;
  font-size: 0.95rem;
  font-weight: 500;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  color: var(--muted);
  font-size: 0.9rem;
}

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

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
  min-height: calc(100vh - 9rem);
  margin-top: 0;
  padding: 1.4rem 0 1rem;
}

.hero-copy {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  align-self: center;
}

.hero-note {
  padding: 1.5rem;
  align-self: end;
}

.panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  backdrop-filter: blur(16px) saturate(126%);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 34%),
    repeating-linear-gradient(0deg, rgba(38, 52, 58, 0.024) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(38, 52, 58, 0.018) 0 1px, transparent 1px 11px);
  mix-blend-mode: multiply;
  opacity: 0.72;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel::selection,
.button::selection {
  background: rgba(185, 134, 54, 0.28);
}

.eyebrow,
.note-label,
.project-chip {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--accent-teal);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  margin-top: 0.5rem;
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(2.2rem, 4.8vw, 4.25rem);
  font-weight: 600;
  max-width: 17ch;
}

h2 {
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 500;
  max-width: 19ch;
}

h3 {
  font-size: 1.18rem;
  margin-bottom: 0.8rem;
}

.hero-signature {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-family: "IBM Plex Serif", serif;
  font-size: 1rem;
}

.lede,
.section-card p,
.project-card p,
.interest-card p,
.hero-note p,
.experience-card p {
  color: var(--muted);
  line-height: 1.75;
}

.lede {
  max-width: 60ch;
  font-size: 1.02rem;
  margin: 1.2rem 0 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 0.93rem;
}

.button.primary {
  background: #13242a;
  color: var(--bg);
}

@media (prefers-color-scheme: dark) {
  .button.primary {
    color: var(--ink);
  }
}

.button.secondary {
  background: rgba(255, 255, 255, 0.56);
}

.identity-list,
.project-card ul,
.evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.identity-list li,
.project-card li,
.evidence-list li {
  padding: 0.45rem 0.62rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

@media (prefers-color-scheme: dark) {
  .identity-list li,
  .project-card li,
  .evidence-list li {
    background: rgba(255, 255, 255, 0.03);
  }
}

section {
  margin-top: 3.75rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin-top: 0.6rem;
}

.section-grid {
  display: grid;
  gap: 1.25rem;
}

.section-card {
  padding: 1.6rem;
}

.section-card.wide {
  max-width: 900px;
}

.project-grid,
.experience-grid,
.interest-grid {
  display: grid;
  gap: 1rem;
}

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

.experience-card {
  grid-column: span 4;
  padding: 1.5rem;
}

.experience-card.experience-lead {
  grid-column: span 4;
}

.experience-kicker {
  margin: 0 0 0.75rem;
  color: var(--accent-blue) !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evidence-list {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 1.2rem;
}

.evidence-list li {
  width: 100%;
  line-height: 1.45;
}

.confidentiality-note {
  max-width: 900px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.availability-note {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink) !important;
  font-weight: 600;
}

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

.project-card {
  grid-column: span 4;
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
}

.project-card::before,
.interest-card::before,
.molecular-map::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 22%, rgba(126, 107, 167, 0.13) 0 10px, transparent 11px),
    radial-gradient(ellipse at 78% 18%, rgba(67, 167, 160, 0.17) 0 15px, transparent 16px),
    radial-gradient(ellipse at 82% 78%, rgba(40, 111, 183, 0.13) 0 12px, transparent 13px),
    repeating-linear-gradient(135deg, rgba(38, 52, 58, 0.032) 0 1px, transparent 1px 12px);
  opacity: 0.74;
}

.project-card > *,
.interest-card > *,
.molecular-map > * {
  position: relative;
  z-index: 1;
}

.project-card.featured {
  grid-column: span 5;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.2rem;
}

.project-links a,
.contact-card a {
  font-weight: 600;
  color: var(--accent-blue);
}

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

.interest-card {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.micro-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.micro-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.micro-legend span::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--dot);
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-note {
    align-self: start;
  }

  .project-card,
  .project-card.featured,
  .experience-card,
  .experience-card.experience-lead {
    grid-column: span 6;
  }

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

@media (max-width: 720px) {
  .topbar {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
  }

  main {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  nav {
    gap: 0.75rem;
  }

  .hero-copy,
  .hero-note,
  .project-card,
  .interest-card,
  .section-card {
    padding: 1.25rem;
  }

  .project-card,
  .project-card.featured {
    grid-column: 1 / -1;
  }

  .experience-card,
  .experience-card.experience-lead {
    grid-column: 1 / -1;
  }

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

  h1 {
    max-width: none;
  }

  .micro-legend {
    grid-template-columns: 1fr;
  }
}
