:root {
  --ink: #172124;
  --muted: #63706d;
  --paper: #f8f6f0;
  --surface: #ffffff;
  --line: #d8d3c7;
  --teal: #0c6b63;
  --blue: #245f9f;
  --rust: #b5583b;
  --gold: #c99328;
  --shadow: 0 20px 60px rgba(22, 30, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(248, 246, 240, 0.88);
  border-bottom: 1px solid rgba(23, 33, 36, 0.08);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 16px clamp(20px, 4vw, 58px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
}

.brand-photo,
.hero-photo {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: var(--paper);
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.headshot-photo {
  perspective: 1000px;
}

.headshot-flipper {
  display: block;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  width: 100%;
  animation: headshot-coin-flip 9s ease-in-out infinite;
}

.brand-photo {
  border: 2px solid rgba(23, 33, 36, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  height: 34px;
  width: 34px;
}

.brand-photo::before,
.hero-photo::before {
  content: attr(data-fallback);
  font-weight: 800;
  position: absolute;
}

.headshot-photo img {
  backface-visibility: hidden;
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.headshot-photo .headshot-a {
  object-position: center 18%;
}

.headshot-photo .headshot-b {
  object-position: center 22%;
  transform: rotateY(180deg);
}

@keyframes headshot-coin-flip {
  0%,
  38% {
    transform: rotateY(0deg);
  }

  50%,
  88% {
    transform: rotateY(180deg);
  }

  100% {
    transform: rotateY(360deg);
  }
}

.brand-photo.is-fallback .headshot-flipper,
.hero-photo.is-fallback .headshot-flipper {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .headshot-flipper {
    animation: none;
    transform: none;
  }

  .headshot-photo .headshot-b {
    display: none;
  }
}

.hero-photo {
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 5.46rem;
  height: clamp(273px, 39vw, 351px);
  width: clamp(273px, 39vw, 351px);
}

nav {
  align-items: center;
  display: flex;
  gap: clamp(14px, 2.5vw, 30px);
}

nav a,
.nav-menu summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  list-style: none;
}

nav a:hover,
.nav-menu summary:hover,
.nav-menu[open] summary {
  color: var(--teal);
}

.nav-menu {
  position: relative;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 30;
}

.nav-dropdown a {
  border-radius: 6px;
  padding: 8px 10px;
}

.nav-dropdown a:hover {
  background: #f1eee6;
}

.hero {
  display: grid;
  gap: clamp(28px, 5vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  grid-template-areas:
    "intro intro"
    "copy visual";
  min-height: calc(100vh - 68px);
  padding: clamp(42px, 7vw, 92px) clamp(20px, 5vw, 76px) 42px;
}

.hero-intro {
  align-items: center;
  display: flex;
  gap: clamp(18px, 3vw, 28px);
  grid-area: intro;
}

.hero-identity {
  min-width: 0;
}

.hero-identity .eyebrow {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  margin: 0;
}

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

.hero-greeting {
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 0 0 10px;
}

.hero-name {
  color: var(--ink);
  display: inline-block;
  font-weight: 800;
}

.hero-copy {
  align-self: center;
  grid-area: copy;
  max-width: 780px;
}

.eyebrow,
.section-kicker,
.tag {
  color: var(--rust);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.8rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 28px;
  max-width: 14ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 4.35rem);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.18rem;
  line-height: 1.25;
  margin-bottom: 12px;
}

.lead {
  color: #34413f;
  font-size: clamp(1.05rem, 1.7vw, 1.34rem);
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  min-height: 48px;
  padding: 12px 18px;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary {
  background: transparent;
}

.hero-visual {
  align-self: stretch;
  background: #e9e4d7;
  grid-area: visual;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.visual-caption {
  bottom: 18px;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 8px;
  left: 18px;
  position: absolute;
  text-transform: uppercase;
}

.visual-caption span {
  background: rgba(23, 33, 36, 0.7);
  border-radius: 6px;
  padding: 7px 9px;
}

.proof-band {
  background: var(--ink);
  color: var(--paper);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
}

.proof-band div {
  background: rgba(255, 255, 255, 0.04);
  min-height: 150px;
  padding: 28px;
}

.proof-band strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1;
  margin-bottom: 12px;
}

.proof-band span {
  color: rgba(248, 246, 240, 0.78);
  display: block;
  max-width: 270px;
}

.section {
  padding: clamp(64px, 10vw, 126px) clamp(20px, 5vw, 76px);
}

.two-column {
  display: grid;
  gap: 28px;
  grid-template-columns: 0.3fr 1fr;
}

.two-column p,
.section-intro,
.contact-section p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 850px;
}

.case-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 clamp(20px, 5vw, 76px) clamp(64px, 9vw, 110px);
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 420px;
  padding: clamp(24px, 3.4vw, 42px);
}

.case-card p,
.case-card li,
.research-list p,
.recognition-grid p,
.timeline p {
  color: var(--muted);
}

.case-card ul {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding-left: 18px;
}

.split-band {
  background: #ebe7db;
  display: grid;
  gap: 36px;
  grid-template-columns: 0.88fr 1.12fr;
}

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

.research-list article {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.recognition-section {
  background: var(--surface);
}

.recognition-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 38px;
}

.recognition-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.recognition-grid span {
  color: var(--gold);
  display: block;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 800;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.credential-list {
  color: var(--muted);
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.credential-list li {
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.5;
  padding-top: 14px;
}

.credential-list strong {
  color: var(--ink);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.credential-list a {
  color: var(--teal);
  font-weight: 600;
}

.credential-list a:hover {
  color: var(--blue);
}

.inline-link {
  color: var(--teal);
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 18px;
}

.inline-link:hover {
  color: var(--blue);
}

.page-hero {
  align-items: center;
  display: grid;
  gap: clamp(20px, 4vw, 36px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  padding: clamp(48px, 7vw, 86px) clamp(20px, 5vw, 76px) clamp(28px, 4vw, 44px);
}

.page-hero h1 {
  font-size: clamp(1.9rem, 3.2vw, 3.25rem);
  line-height: 1.05;
  margin-bottom: 0;
  max-width: 18ch;
}

.page-hero .lead {
  align-self: center;
  margin-bottom: 0;
}

.research-page-hero,
.ccrrt-hero {
  background: var(--paper);
}

.research-overview,
.ccrrt-animation-section,
.research-detail-grid {
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 76px);
}

.page-hero + .research-overview,
.page-hero + .research-detail-grid {
  padding-top: clamp(28px, 5vw, 54px);
}

.research-feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  padding: clamp(28px, 4vw, 48px);
}

.research-feature[id] {
  scroll-margin-top: 96px;
}

.research-feature p,
.research-card p,
.research-detail-grid p,
.animation-header p {
  color: var(--muted);
}

.research-feature h2,
.research-detail-grid h2,
.animation-header h2,
.result-gallery-section h2,
.mentee-section h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.75rem);
  line-height: 1.08;
}

.research-highlight-grid {
  align-self: center;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, 1fr);
}

.research-highlight-grid div,
.research-highlight-grid a {
  background: #f1eee6;
  border: 1px solid var(--line);
  color: inherit;
  min-height: 150px;
  padding: 22px;
  text-decoration: none;
}

.research-highlight-grid strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.research-highlight-grid a:hover,
.research-highlight-grid a:focus-visible {
  background: #e8e2d4;
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.publication-nav-section .tag {
  display: block;
  margin-bottom: 14px;
}

.publication-nav-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.publication-nav-grid a {
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 28px;
  text-decoration: none;
}

.publication-nav-grid a:hover,
.publication-nav-grid a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--paper);
  outline-offset: -2px;
}

.publication-nav-grid strong {
  color: var(--paper);
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1;
  margin-bottom: 12px;
}

.publication-nav-grid span {
  color: rgba(248, 246, 240, 0.78);
  max-width: 270px;
}

.publication-nav-grid em {
  color: var(--paper);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  margin-top: auto;
  padding-top: 18px;
  text-transform: uppercase;
}

.publication-nav-grid em::after {
  content: " ->";
}

.research-highlight-grid span {
  color: var(--muted);
}

.research-highlight-grid .inventor-name {
  color: var(--text);
  font-weight: 600;
}

.research-card-grid,
.research-detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

.research-card-grid {
  margin-top: 16px;
}

.research-feature + .research-feature,
.research-feature + .research-card-grid {
  margin-top: 16px;
}

.research-card,
.research-detail-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 34px);
}

.research-detail-grid {
  grid-template-columns: repeat(2, 1fr);
}

.animation-header {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.75fr);
  margin-bottom: 28px;
}

.ccrrt-animation-section {
  background: #ebe7db;
}

.ccrrt-replay {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 260px;
}

.ccrrt-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 540px;
  overflow: hidden;
}

#ccrrtCanvas,
#adaptiveCanvas {
  display: block;
  height: 100%;
  min-height: 540px;
  width: 100%;
}

.ccrrt-panel {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.ccrrt-panel div {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.ccrrt-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ccrrt-panel strong {
  font-size: 1.18rem;
}

.ccrrt-panel .button {
  border-radius: 0;
  justify-content: center;
  width: 100%;
}

.compact-result-list {
  color: var(--muted);
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-left: 18px;
}

.compact-result-list strong {
  color: var(--ink);
}

.result-gallery-section {
  background: var(--surface);
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 76px);
}

.result-gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.result-gallery figure {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.result-gallery img {
  background: #fff;
  display: block;
  width: 100%;
}

.result-gallery figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 14px 16px 16px;
}

.impact-proof-band {
  grid-template-columns: repeat(4, 1fr);
}

.mentorship-overview {
  display: grid;
  gap: 16px;
}

.mentee-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 3.6vw, 42px);
}

.mentee-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 26px;
}

.mentee-grid.two-up {
  grid-template-columns: repeat(2, 1fr);
}

.mentee-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.mentee-card p {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0;
}

.mentee-card span {
  color: var(--muted);
  display: block;
  margin-top: 14px;
}

.mentorship-principles {
  padding: 0;
}

.timeline-section {
  background: #f1eee6;
}

.timeline {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
}

.timeline li {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: 180px 1fr;
  padding: 28px 0;
}

.timeline span {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-section {
  background: var(--ink);
  color: var(--paper);
  display: grid;
  gap: 38px;
  grid-template-columns: 1fr 0.58fr;
  padding: clamp(64px, 10vw, 126px) clamp(20px, 5vw, 76px);
}

.contact-section p {
  color: rgba(248, 246, 240, 0.75);
}

.contact-panel {
  align-self: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
}

.contact-panel a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 800;
  overflow-wrap: anywhere;
  padding: 18px 20px;
}

.contact-panel a:last-child {
  border-bottom: 0;
}

.contact-panel a:hover {
  background: rgba(255, 255, 255, 0.08);
}

footer {
  align-items: center;
  background: #101719;
  color: rgba(248, 246, 240, 0.72);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 76px);
}

.footer-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.footer-copy {
  font-size: 0.75em;
}

.back-to-top {
  align-items: center;
  background: var(--ink);
  border: 1px solid rgba(248, 246, 240, 0.14);
  border-radius: 50%;
  bottom: clamp(20px, 4vw, 28px);
  box-shadow: var(--shadow);
  color: var(--paper);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: clamp(20px, 4vw, 28px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
  visibility: hidden;
  width: 48px;
  z-index: 20;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--teal);
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.not-found-page {
  min-height: 100vh;
}

.not-found {
  align-content: center;
  display: grid;
  min-height: 100vh;
  padding: clamp(42px, 7vw, 92px) clamp(20px, 5vw, 76px);
}

.not-found h1 {
  max-width: 12ch;
}

.not-found p:not(.section-kicker) {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 620px;
}

.not-found .button {
  justify-self: start;
  margin-top: 14px;
}

@media (max-width: 1000px) {
  .hero,
  .split-band,
  .contact-section,
  .page-hero,
  .research-feature,
  .animation-header,
  .ccrrt-replay {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .hero-intro,
  .hero-copy,
  .hero-visual {
    grid-area: auto;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: 12ch;
  }

  .proof-band,
  .case-grid,
  .recognition-grid,
  .result-gallery,
  .mentee-grid,
  .mentee-grid.two-up,
  .research-card-grid,
  .research-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .publication-nav-section .publication-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    gap: 14px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero {
    padding-top: 34px;
  }

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

  .hero-visual {
    min-height: 360px;
  }

  .proof-band,
  .case-grid,
  .recognition-grid,
  .result-gallery,
  .impact-proof-band,
  .mentee-grid,
  .mentee-grid.two-up,
  .research-card-grid,
  .research-detail-grid,
  .research-highlight-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .ccrrt-canvas-wrap,
  #ccrrtCanvas,
  #adaptiveCanvas {
    min-height: 380px;
  }

  .case-grid {
    padding-left: 20px;
    padding-right: 20px;
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-meta {
    align-self: stretch;
    text-align: right;
  }
}

@media (max-width: 460px) {
  .site-header {
    position: static;
  }

  .brand span:last-child {
    display: none;
  }

  nav a {
    font-size: 0.86rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .button {
    justify-content: center;
    width: 100%;
  }
}
