:root {
  /* Core design tokens (colors, spacing, radii, container width). */
  --bg: #eef2f5;
  --bg-soft: #f8fafc;
  --paper: #ffffff;
  --paper-strong: #ffffff;
  --ink: #151b26;
  --muted: #4f5a6c;
  --line: #cfd7e3;
  --line-strong: #1e2a3a;
  /* Official lab logo palette used across site-wide accents. */
  --lab-maker: #4fadb9;
  --lab-maker-strong: #2f7f89;
  --lab-dsl: #d7de50;
  --lab-dsl-strong: #8f9528;
  --lab-automation: #93c2e3;
  --lab-automation-strong: #57748b;
  --lab-engineering: #d53553;
  --lab-engineering-strong: #8f2337;
  --cardinal: var(--lab-engineering);
  --gold: var(--lab-dsl);
  --cyan: var(--lab-maker);
  --blue: var(--lab-automation);
  --green: #3a8f62;
  --radius: 18px;
  --radius-sm: 12px;
  --container: min(1280px, calc(100vw - 2.6rem));
  --shadow: 0 14px 34px rgba(22, 30, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  line-height: 1.58;
  background:
    radial-gradient(circle at 6% -18%, rgba(213, 53, 83, 0.2), transparent 35%),
    radial-gradient(circle at 100% 0, rgba(147, 194, 227, 0.22), transparent 34%),
    radial-gradient(circle at 84% 112%, rgba(79, 173, 185, 0.2), transparent 34%),
    radial-gradient(circle at 18% 115%, rgba(215, 222, 80, 0.24), transparent 30%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(18, 18, 18, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18, 18, 18, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  z-index: -1;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
  border-radius: 6px;
  border: 2px solid var(--line-strong);
  padding: 0.42rem 0.72rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--line-strong);
  outline-offset: 2px;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  /* Sticky global header with quick links + section nav. */
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 2px solid var(--line-strong);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(7px);
}

.top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.62rem 0 0.34rem;
}

.identity-name {
  margin: 0;
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.75rem, 2.5vw, 2.45rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.identity-name:hover {
  color: var(--cardinal);
}

.identity-name:focus-visible {
  outline: 2px solid var(--cardinal);
  outline-offset: 4px;
}

.identity-role {
  margin: 0.26rem 0 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.35;
}

.identity-role-second {
  display: block;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-links a {
  text-decoration: none;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.32rem 0.74rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.quick-links a:nth-child(1) {
  background: rgba(213, 53, 83, 0.16);
}

.quick-links a:nth-child(2) {
  background: rgba(79, 173, 185, 0.2);
}

.quick-links a:nth-child(3) {
  background: rgba(215, 222, 80, 0.24);
}

.quick-links a:hover {
  transform: translateY(-2px);
  background: #fff;
}

.nav-row {
  padding: 0 0 0.42rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cardinal);
  font-weight: 700;
  padding: 0.14rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--cardinal);
  border-bottom-color: var(--cardinal);
}

.hero {
  /* Hero layout: content column + stacked image column. */
  min-height: 0;
  padding: 0.72rem 0 0.42rem;
  display: grid;
  grid-template-columns: 0.96fr 1.04fr;
  gap: 0.92rem;
  align-items: start;
}

.hero-copy {
  /* Intro copy card in hero area. */
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--line-strong);
  background: linear-gradient(158deg, #ffffff, #f2f6fb);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  height: auto;
  align-self: start;
}

.hero-copy::before {
  content: "";
  position: absolute;
  top: -42px;
  right: -44px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(215, 222, 80, 0.44), rgba(215, 222, 80, 0.08));
}

.eyebrow {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cardinal);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  color: var(--ink);
  line-height: 0.95;
}

h1 {
  margin-top: 0.45rem;
  max-width: 12ch;
  font-size: clamp(2.1rem, 4.7vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.08;
}

p {
  margin: 0;
  color: var(--muted);
}

#hero-summary {
  margin-top: 0.56rem;
  max-width: 66ch;
  font-size: 0.93rem;
}

.hero-actions {
  margin-top: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.button {
  text-decoration: none;
  border-radius: 10px;
  padding: 0.62rem 1rem;
  font-size: 0.81rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  border: 2px solid var(--line-strong);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(18, 18, 18, 0.18);
}

.button-primary {
  background: var(--cardinal);
  color: #fff;
}

.button-secondary {
  background: #edf3fb;
  color: var(--ink);
}

.hero-media {
  /* Two-image stack; height is synced to hero-copy in script.js (desktop). */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 0.58rem;
  align-items: stretch;
  height: auto;
  align-self: start;
}

.hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius);
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow);
  object-fit: cover;
  object-position: center;
  background: transparent;
  min-height: 0;
}

.hero-media img:first-child {
  width: auto;
  max-width: 100%;
  justify-self: start;
  /* Show full headshot without cropping while preserving slot alignment. */
  object-fit: contain;
  object-position: center top;
}

.hero-media img.secondary {
  width: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: none;
  border-style: solid;
  border-color: var(--line-strong);
}

section.container {
  /* Default section spacing below hero. */
  padding: 2.55rem 0 0.32rem;
}

.metrics {
  padding-top: 1rem;
}

.metric-grid {
  /* Impact statistics cards. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.metric {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-strong);
  padding: 0.95rem;
  background: var(--paper-strong);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 9px;
  background: var(--gold);
}

.metric:nth-child(3n + 1)::after {
  background: var(--cardinal);
}

.metric:nth-child(3n + 2)::after {
  background: var(--cyan);
}

.metric:nth-child(3n + 3)::after {
  background: var(--blue);
}

.metric-number {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.95rem, 3.2vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 0.98;
}

.metric p {
  margin-top: 0.35rem;
  font-size: 0.91rem;
}

.source {
  display: block;
  margin-top: 0.5rem;
  font-family: "Space Mono", monospace;
  font-size: 0.64rem;
  color: #57534c;
}

.section-head {
  margin-bottom: 1rem;
}

.section-intro {
  margin-bottom: 0.95rem;
}

.timeline-list {
  /* Career / institution-building timeline. */
  display: grid;
  gap: 0.56rem;
}

.timeline-item {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-strong);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.76rem;
  padding: 0.88rem;
}

.timeline-item:nth-child(4n + 1) {
  border-left: 11px solid var(--cardinal);
}

.timeline-item:nth-child(4n + 2) {
  border-left: 11px solid var(--cyan);
}

.timeline-item:nth-child(4n + 3) {
  border-left: 11px solid var(--blue);
}

.timeline-item:nth-child(4n + 4) {
  border-left: 11px solid var(--gold);
}

.timeline-year {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.timeline-content h3 {
  margin-bottom: 0.35rem;
}

.timeline-content p {
  margin-bottom: 0.5rem;
}

.timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timeline-links a {
  color: var(--cardinal);
  font-size: 0.8rem;
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.84rem;
}

.show-more-row {
  margin-top: 0.82rem;
  display: flex;
  justify-content: center;
}

.show-more-btn {
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.show-more-btn:hover {
  background: #ffffff;
  color: var(--cardinal);
  border-color: var(--cardinal);
}

#project-search {
  min-width: 300px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.55rem 0.88rem;
  background: var(--paper-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
}

#project-search::placeholder {
  color: #79736a;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.chip {
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.26rem 0.62rem;
  font-size: 0.74rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 700;
}

.chip.active {
  background: var(--gold);
}

.card-grid {
  /* Shared grid for courses, talks, and project cards. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}
.card-grid2x {
  /* Shared grid for labs */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.card {
  position: relative;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-strong);
  padding: 0.95rem;
  display: grid;
  gap: 0.43rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #e5ebf5;
}

.card-thumb-small {
  height: 110px;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(18, 18, 18, 0.16);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  border-radius: 10px 10px 0 0;
  background: var(--gold);
}

.card:not(.lab-card):nth-child(4n + 1)::before {
  background: var(--cardinal);
}

.card:not(.lab-card):nth-child(4n + 2)::before {
  background: var(--cyan);
}

.card:not(.lab-card):nth-child(4n + 3)::before {
  background: var(--blue);
}

.card:not(.lab-card):nth-child(4n + 4)::before {
  background: var(--gold);
}

.meta {
  font-family: "Space Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cardinal);
  font-weight: 700;
}

.card h3 {
  font-size: 1.2rem;
}

/* Lab cards are color-themed from official lab logos. */
.card.lab-card {
  background: var(--lab-surface);
}

.card.lab-card::before {
  background: var(--lab-accent);
}

.lab-card-logo {
  width: min(100%, 360px);
  height: auto;
  max-height: 82px;
  object-fit: contain;
  object-position: left center;
  border: 0;
  background: transparent;
  padding: 0;
  display: block;
}

.card.lab-card .meta {
  color: var(--lab-accent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f2e9;
  color: #2f2b27;
  font-size: 0.66rem;
  padding: 0.14rem 0.42rem;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.54rem;
}

.card-links a {
  color: var(--cardinal);
  font-size: 0.81rem;
  font-weight: 700;
}

.link-list {
  /* News/interview link list rows. */
  display: grid;
  gap: 0.56rem;
}

.link-row {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-strong);
  padding: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.6rem;
  align-items: center;
}

.link-row:nth-child(3n + 1) {
  border-left: 10px solid var(--cardinal);
}

.link-row:nth-child(3n + 2) {
  border-left: 10px solid var(--cyan);
}

.link-row:nth-child(3n + 3) {
  border-left: 10px solid var(--blue);
}

.link-row a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.link-row a:hover {
  color: var(--cardinal);
  text-decoration: underline;
}

.link-row small {
  color: var(--muted);
}

.link-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #eef2f8;
}

.collab-grid {
  /* Partnership pathway cards. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.collab-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-strong);
  padding: 0.95rem;
}

.collab-card:nth-child(1) {
  background: #fff4da;
}

.collab-card:nth-child(2) {
  background: #e8f7f8;
}

.collab-card:nth-child(3) {
  background: #e9eefc;
}

.collab-card p {
  margin-top: 0.42rem;
}

.contact-bar {
  margin-top: 0.76rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #f7f3e9;
  padding: 0.82rem 0.96rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-bar p,
.contact-bar a {
  color: #1a1714;
}

.contact-bar a {
  font-weight: 700;
}

.site-footer {
  margin-top: 2.12rem;
  border-top: 3px solid var(--line-strong);
  padding: 0.92rem 0 1.34rem;
}

.site-footer p {
  font-size: 0.79rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px) scale(0.992);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 1140px) {
  /* Tablet breakpoint adjustments. */
  .top-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero {
    height: auto;
    max-height: none;
    min-height: auto;
    padding-top: 1rem;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-media {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .hero-media img:first-child {
    width: 100%;
    height: clamp(260px, 48vw, 430px);
  }

  .hero-media img.secondary {
    width: 100%;
    height: clamp(220px, 42vw, 360px);
  }

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

  .hero-media img:first-child {
    max-height: 420px;
  }
}

@media (max-width: 780px) {
  /* Mobile breakpoint adjustments. */
  :root {
    --container: min(1280px, calc(100vw - 1.3rem));
  }

  h1 {
    font-size: clamp(2.3rem, 11.5vw, 3.6rem);
  }

  .hero-media img:first-child {
    width: 100%;
    height: clamp(240px, 66vw, 380px);
  }

  .hero-media img.secondary {
    height: clamp(200px, 56vw, 320px);
  }

  .metric-grid,
  .card-grid,
  .collab-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.46rem;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .link-row-thumb {
    width: 100%;
    height: 120px;
  }

  #project-search {
    min-width: 100%;
  }
}
