/* ==== 00-tokens.css ==== */
:root {
  /* Palette (design tokens per brief §3) */
  --c-midnight: #081C2C;
  --c-deep: #123449;
  --c-paper: #FFFFFF;
  --c-ink: #142B38;
  --c-gold: #E9BA58;
  --c-gold-deep: #D9A53B;
  --c-mist: #B6C8D0;
  --c-muted: #52616A;
  --c-rule: #D7DBD6;
  --c-rule-navy: #24455C;

  /* Spacing: 8px scale */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
  --s-5: 40px; --s-6: 48px; --s-8: 64px; --s-9: 72px;
  --s-10: 80px; --s-12: 96px;

  /* Type */
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-h1: clamp(2.5rem, 1.45rem + 3.1vw, 4.625rem);      /* 40 → 74px */
  --fs-h2: clamp(1.875rem, 1.2rem + 2.1vw, 3.25rem);      /* 30 → 52px */
  --fs-h3: clamp(1.3125rem, 1.15rem + 0.5vw, 1.625rem);   /* 21 → 26px */
  --fs-h4: 1.125rem;
  --fs-body: 1.0625rem;                                   /* 17px */
  --fs-small: 0.9375rem;                                  /* 15px */
  --fs-meta: 0.8125rem;                                   /* 13px */

  /* Layout */
  --content-max: 1280px;
  --gutter: clamp(20px, 5vw, 80px);
  --header-h: 88px;
  --toc-h: 52px;
  --radius: 6px;
  --radius-lg: 8px;

  /* Motion */
  --t-fast: 180ms;
  --t-scene: 850ms;
  --ease: cubic-bezier(.33, .1, .2, 1);
}

/* ==== 01-base.css ==== */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Sans";
  src: url("/assets/fonts/geist-sans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.08; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
h4 { font-size: var(--fs-h4); margin: 0 0 0.4em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--c-ink) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--c-gold-deep); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Anchor targets clear the sticky header + toc */
[id] { scroll-margin-top: calc(var(--header-h) + var(--toc-h) + 16px); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px; left: 16px;
  z-index: 100;
  background: var(--c-ink);
  color: var(--c-paper);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; }

::selection { background: var(--c-gold); color: var(--c-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ==== 02-layout.css ==== */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-rule);
}
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: 10px;
}
.brand {
  text-decoration: none;
  display: block;
  line-height: 1.25;
}
.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.375rem;
}
.brand-affil {
  display: block;
  font-size: var(--fs-meta);
  color: var(--c-muted);
  letter-spacing: 0.04em;
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.nav-link:hover { background: color-mix(in srgb, var(--c-ink) 7%, transparent); }
.nav-link.is-active {
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--c-gold-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-link-contact {
  border: 1.5px solid var(--c-ink);
  padding-inline: 16px;
  margin-left: 6px;
}
.nav-link-contact:hover { background: var(--c-ink); color: var(--c-paper); }
.nav-link-portal {
  border: 1.5px solid var(--c-gold-deep);
  padding-inline: 16px;
  margin-left: 6px;
  font-weight: 550;
}
.nav-link-portal:hover {
  background: var(--c-gold);
  border-color: var(--c-gold);
  color: var(--c-ink);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  background: none;
  border: 1.5px solid var(--c-ink);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 550;
}
.site-menu {
  border-top: 1px solid var(--c-rule);
  background: var(--c-paper);
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: var(--s-1) var(--gutter) var(--s-2);
}
.menu-link, .menu-close {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 8px;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid var(--c-rule);
  background: none;
  text-align: left;
}
.menu-link.is-active { font-weight: 650; text-decoration: underline; text-decoration-color: var(--c-gold-deep); text-underline-offset: 5px; }
.menu-close { color: var(--c-muted); border-bottom: 0; }

@media (max-width: 919px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  :root { --header-h: 72px; }
}
@media (min-width: 920px) {
  .site-menu { display: none; }
}

/* ---------------------------------------------------------------- toc */
.toc {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-rule);
}
.toc-inner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 18px;
  min-height: var(--toc-h);
  padding-block: 6px;
}
.toc-label {
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-list a {
  display: inline-block;
  padding: 8px 8px;
  font-size: var(--fs-small);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.toc-list a:hover { border-bottom-color: var(--c-rule); }
.toc-list a[aria-current="true"] {
  font-weight: 650;
  border-bottom-color: var(--c-gold-deep);
}
@media (min-width: 920px) {
  .toc { position: sticky; top: var(--header-h); z-index: 30; }
}
@media (max-width: 919px) {
  :root { --toc-h: 0px; }
}

/* ---------------------------------------------------------------- breadcrumb */
.breadcrumb {
  border-bottom: 1px solid var(--c-rule);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 12px 0;
  font-size: var(--fs-small);
  color: var(--c-muted);
}
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: var(--c-rule); }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb [aria-current="page"] { color: var(--c-ink); }

/* ---------------------------------------------------------------- sections */
.section {
  padding-block: clamp(48px, 3vw + 32px, 96px);
}
.section + .section { border-top: 1px solid var(--c-rule); }
.section-navy {
  background: var(--c-midnight);
  color: var(--c-paper);
}
.section-navy .eyebrow { color: var(--c-mist); }

.eyebrow {
  font-size: var(--fs-meta);
  font-weight: 550;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 var(--s-2);
}
.section-title { margin-bottom: var(--s-3); }
.section-lede {
  max-width: 62ch;
  color: var(--c-muted);
}
.section-navy .section-lede { color: var(--c-mist); }

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: var(--c-midnight);
  color: var(--c-mist);
  padding-block: var(--s-8) var(--s-4);
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: var(--s-5);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--c-rule-navy);
}
.footer-brand {
  font-family: var(--font-serif);
  font-weight: 650;
  font-size: 1.25rem;
  color: var(--c-paper);
  margin-bottom: 6px;
}
.footer-affil { font-size: var(--fs-small); }
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-nav a, .footer-contact a {
  color: var(--c-mist);
  text-decoration-color: color-mix(in srgb, var(--c-mist) 40%, transparent);
}
.footer-nav a:hover, .footer-contact a:hover { color: var(--c-paper); }
.footer-legal {
  padding-top: var(--s-3);
  font-size: var(--fs-meta);
  color: color-mix(in srgb, var(--c-mist) 75%, var(--c-midnight));
}
@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-4); }
}

/* ==== 03-components.css ==== */
/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-size: 1.0625rem;
  font-weight: 550;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.btn-gold {
  background: var(--c-gold);
  color: var(--c-ink);
  border-color: var(--c-gold);
}
.btn-gold:hover { background: var(--c-gold-deep); border-color: var(--c-gold-deep); }
.btn-outline {
  border-color: var(--c-ink);
  color: var(--c-ink);
  background: transparent;
}
.btn-outline:hover { background: var(--c-ink); color: var(--c-paper); }
.section-navy .btn-outline {
  border-color: var(--c-mist);
  color: var(--c-mist);
}
.section-navy .btn-outline:hover { background: var(--c-mist); color: var(--c-midnight); }
.btn-quiet {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 10px 6px;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: var(--c-gold-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
.arrow::after { content: "\2192"; font-family: var(--font-sans); }

/* ---------------------------------------------------------------- masthead */
.masthead {
  padding-block: clamp(40px, 4vw, 72px) clamp(28px, 3vw, 48px);
}
.masthead-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--s-5) var(--s-8);
  align-items: end;
}
.masthead h1 { margin-bottom: 0; }
.masthead-side p { color: var(--c-muted); }
.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
@media (max-width: 919px) {
  .masthead-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- research rows */
.research-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--s-5) var(--s-8);
  align-items: start;
}
.research-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.research-row {
  border-top: 1px solid var(--c-rule);
}
.research-row:last-child { border-bottom: 1px solid var(--c-rule); }
.research-row a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 2rem;
  gap: var(--s-2) var(--s-3);
  align-items: baseline;
  padding: var(--s-4) 4px;
  text-decoration: none;
}
.research-row a:hover .research-name,
.research-row a:focus-visible .research-name {
  text-decoration: underline;
  text-decoration-color: var(--c-gold-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.research-num {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-muted);
}
.research-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: 1.15;
  display: block;
  margin-bottom: 6px;
}
.research-desc {
  color: var(--c-muted);
  margin: 0;
  max-width: 56ch;
}
.research-arrow {
  font-size: 1.5rem;
  color: var(--c-muted);
  justify-self: end;
}
.research-panel {
  position: sticky;
  top: calc(var(--header-h) + var(--toc-h) + 24px);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: var(--s-3);
}
.research-panel img {
  width: 100%;
  height: 260px;
  object-fit: contain;
}
.research-panel figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-meta);
  color: var(--c-muted);
  font-family: var(--font-mono);
}
@media (max-width: 919px) {
  .research-layout { grid-template-columns: 1fr; }
  .research-panel { display: none; }
  .research-row a { grid-template-columns: 2.5rem minmax(0, 1fr) 2rem; }
}

/* ---------------------------------------------------------------- projects */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--s-4) var(--s-8);
  align-items: center;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.feature-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-rule);
}
.feature-label {
  font-size: var(--fs-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--s-1);
}
.feature-title { margin-bottom: 0.4em; }
.secondary-features {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s-5) var(--s-8);
  align-items: start;
}
.mini-feature .feature-media img {
  height: clamp(220px, 26vw, 320px);
  object-fit: cover;
}
.mini-feature h3 { margin-top: var(--s-3); }
@media (max-width: 919px) {
  .feature, .secondary-features { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- methods */
.methods-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
  list-style: none;
  margin: var(--s-5) 0 0;
  padding: 0;
}
.method {
  border-top: 2px solid var(--c-ink);
  padding-top: var(--s-2);
}
.method-fig {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--c-muted);
  display: block;
  margin-bottom: 6px;
}
.method h3 { font-size: 1.25rem; margin-bottom: 0.35em; }
.method p { font-size: var(--fs-small); color: var(--c-muted); margin: 0; }
@media (max-width: 1023px) {
  .methods-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .methods-strip { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- team */
.pi-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: center;
  margin-bottom: var(--s-6);
}
.pi-row img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-rule);
}
.pi-name { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 650; margin: 0 0 2px; }
.pi-role { color: var(--c-muted); margin: 0 0 var(--s-1); }
@media (max-width: 599px) {
  .pi-row { grid-template-columns: 1fr; }
  .pi-row img { max-width: 220px; }
}

.team-preview-grid, .team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s-4) var(--s-3);
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
}
.team-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.preview-card img, .member-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--c-rule);
  margin-bottom: var(--s-1);
}
/* Stand-in for a member whose portrait hasn't been shot yet: same frame, initials. */
.member-photo-none {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  border: 1px solid var(--c-rule);
  margin-bottom: var(--s-1);
  background: var(--c-mist);
  color: var(--c-deep);
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.member-name { font-weight: 650; margin: 0; }
.member-role { font-size: var(--fs-small); color: var(--c-muted); margin: 0 0 4px; }
.member-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--c-muted);
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 0 0 8px;
}
.member-fact { font-size: var(--fs-small); margin: 0 0 8px; }
.member-fact span { font-weight: 650; }
.member-mail { font-size: var(--fs-small); }
.team-tools { margin: var(--s-4) 0; }
.team-search-label { display: block; font-size: var(--fs-small); font-weight: 550; margin-bottom: 6px; }
.team-search {
  width: min(360px, 100%);
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1.5px solid var(--c-muted);
  border-radius: var(--radius);
  margin-bottom: var(--s-2);
}
.team-count { font-size: var(--fs-small); color: var(--c-muted); margin: var(--s-2) 0 0; }
.team-empty {
  border: 1px dashed var(--c-rule);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  text-align: center;
}

/* Roster groups: team leads, lab members, then the collapsed student archive. */
.team-group { margin-bottom: var(--s-5); }
.team-group .section-title { margin-bottom: var(--s-3); }

.team-archive {
  border-top: 1px solid var(--c-rule);
  padding-top: var(--s-4);
  margin-bottom: var(--s-5);
}
.team-archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1.5px solid var(--c-ink);
  border-radius: var(--radius);
  color: var(--c-ink);
  background: transparent;
  font-size: 1.0625rem;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.team-archive-toggle::-webkit-details-marker { display: none; }
.team-archive-toggle:hover { background: var(--c-ink); color: var(--c-paper); }
.team-archive-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-fast) var(--ease);
}
.team-archive[open] > .team-archive-toggle::after { transform: translateY(2px) rotate(225deg); }
.team-archive-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 9px;
}
.team-archive > .team-grid { margin-top: var(--s-4); }

/* ---------------------------------------------------------------- citations */
.cite-list {
  list-style: none;
  margin: var(--s-4) 0;
  padding: 0;
}
.cite {
  border-top: 1px solid var(--c-rule);
  padding: var(--s-3) 0;
}
.cite:last-child { border-bottom: 1px solid var(--c-rule); }
.cite-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.1875rem; margin: 0 0 4px; }
.cite-authors { margin: 0 0 2px; font-size: var(--fs-small); }
.cite-venue { margin: 0; font-size: var(--fs-small); color: var(--c-muted); }
.cite-doi { font-family: var(--font-mono); font-size: 0.8125rem; }

/* ---------------------------------------------------------------- contact */
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }

/* ---------------------------------------------------------------- misc */
.page-hero { padding-block: clamp(36px, 4vw, 64px) 0; }
.return-link { display: inline-block; margin-top: var(--s-4); }
.figure-note {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--c-muted);
}
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.75rem; margin-top: var(--s-5); }
.error-page { text-align: center; padding-block: var(--s-12); }

/* ==== 04-scenes.css ==== */
/* ---------------------------------------------------------------- ambient field
   Fixed drift of lab-motif glyphs, coloured from whatever is on screen
   (js/ambient.js). z-index -1 keeps it above the propagated <body> paper
   background and below every section, so it can never overlap text. */
.ambient-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}
@media print { .ambient-field { display: none; } }

/* ---------------------------------------------------------------- hero stage
   A tab strip over one canvas. js/hero-gallery.js owns both: it builds the
   tabs from its scene list and draws the active scene into the canvas. */
.stage-wrap { padding-block: 0 clamp(40px, 4vw, 64px); }

.stage-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--s-1);
  overflow-x: auto;
  scrollbar-width: none;
  /* the strip scrolls sideways on narrow screens rather than wrapping into
     a second row that would push the canvas below the fold */
  -webkit-overflow-scrolling: touch;
}
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 8px 14px;
  min-height: 40px;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.02em;
  color: var(--c-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.stage-tab:hover { color: var(--c-ink); }
.stage-tab[aria-selected="true"] {
  color: var(--c-ink);
  border-bottom-color: var(--c-gold-deep);
}
.stage-tab:focus-visible {
  outline: 3px solid var(--c-ink);
  outline-offset: -3px;
}
.stage {
  background: var(--c-midnight);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stage:focus-visible {
  outline: 3px solid var(--c-ink);
  outline-offset: 3px;
}
.hero-canvas {
  display: block;
  border-radius: var(--radius-lg);
  width: 100%;
  height: clamp(320px, 42vw, 540px);
  /* the scene is the affordance; no text selection or scroll-stealing on touch */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.stage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.stage-caption {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--c-muted);
  margin: 0;
  max-width: 72ch;
}
.stage-note {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--c-muted);
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hero-canvas { height: clamp(300px, 78vw, 400px); }
}

/* ---------------------------------------------------------------- litho scene */
.litho-figure {
  background: var(--c-deep);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
}
.litho-svg { display: block; width: 100%; height: auto; }
.litho-svg text {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--c-mist);
}
.litho-trace {
  fill: none;
  stroke: var(--c-gold);
  stroke-width: 7;
  stroke-linecap: square;
}
.litho-tip { opacity: 0; }
.litho-tip.is-writing { opacity: 1; }

/* ---------------------------------------------------------------- inspector */
.inspector { margin-top: var(--s-3); }
.inspector-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
}
@media (min-width: 768px) {
  .inspector-panes.is-open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.inspector-source { position: relative; }
.inspector-source img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--c-rule);
}
.inspector-rect {
  position: absolute;
  padding: 0;
  border: 2px solid var(--c-gold-deep);
  outline: 1px solid rgba(0,0,0,0.55);
  background: rgba(233, 186, 88, 0.12);
  border-radius: 2px;
  cursor: grab;
  touch-action: none;
}
.inspector-rect:active { cursor: grabbing; }
.inspector-rect:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 2px; }
.inspector-zoom {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  background: #fff;
  transition: opacity 200ms var(--ease);
}
.inspector-zoom img {
  position: absolute;
  top: 0; left: 0;
  max-width: none;
  transform-origin: 0 0;
}
.inspector-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-2);
}
.inspector-controls .btn {
  min-height: 40px;
  padding: 6px 14px;
  font-size: var(--fs-small);
}
.inspector-hint {
  font-size: var(--fs-meta);
  color: var(--c-muted);
  margin: var(--s-1) 0 0;
}

/* ==== 05-pages.css ==== */
.anchor-alias { display: block; height: 0; }

.prose figure { margin: var(--s-4) 0; }
.prose figure img {
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  background: #fff;
}
.prose figcaption { margin-top: var(--s-1); }

/* ==== 06-motion.css ==== */
/* ================================================================
   Motion & visual-emphasis layer. Everything here is progressive:
   with no JavaScript or with prefers-reduced-motion, content is
   simply visible and static.
   ================================================================ */

/* ---------------------------------------------------------------- scroll reveal */
.rv {
  transition:
    opacity 650ms var(--ease),
    transform 650ms var(--ease);
  transition-delay: var(--rv-delay, 0ms);
}
html.js-reveal .rv:not(.in-view) {
  opacity: 0;
  transform: translateY(22px);
}

/* Gold rule that draws itself under section titles as they reveal */
.section-title::after {
  content: "";
  display: block;
  width: 76px;
  height: 3px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--c-gold), var(--c-gold-deep));
  border-radius: 2px;
  transform-origin: left center;
  transition: transform 800ms var(--ease) 200ms;
}
html.js-reveal .section-title:not(.in-view)::after { transform: scaleX(0); }

/* ---------------------------------------------------------------- masthead entrance */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.masthead .eyebrow        { animation: rise-in 600ms var(--ease) 60ms both; }
.masthead h1              { animation: rise-in 700ms var(--ease) 160ms both; }
.masthead-side            { animation: rise-in 700ms var(--ease) 340ms both; }
.stage-wrap .stage-tabs   { animation: rise-in 700ms var(--ease) 260ms both; }
.stage-wrap .stage        { animation: rise-in 800ms var(--ease) 300ms both; }
.stage-wrap .stage-footer { animation: rise-in 700ms var(--ease) 480ms both; }

/* ---------------------------------------------------------------- header */
.site-header {
  transition: box-shadow 250ms var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 2px 18px rgba(8, 28, 44, 0.10);
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--c-gold), var(--c-gold-deep));
  z-index: 60;
  pointer-events: none;
}

/* ---------------------------------------------------------------- eyebrow ticks */
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--c-gold-deep);
  vertical-align: middle;
  margin-right: 10px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(217, 165, 59, 0.35); }
.btn-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 550ms var(--ease);
  pointer-events: none;
}
.btn-gold:hover::before { transform: translateX(130%); }

.arrow::after {
  display: inline-block;
  transition: transform 250ms var(--ease);
}
.arrow:hover::after { transform: translateX(6px); }

/* ---------------------------------------------------------------- research rows */
.research-row a {
  transition: background 300ms var(--ease);
}
.research-row a:hover,
.research-row a:focus-visible {
  background: color-mix(in srgb, var(--c-gold) 9%, transparent);
}
.research-num,
.research-arrow {
  transition: color 250ms var(--ease), transform 300ms var(--ease);
}
.research-row a:hover .research-num { color: var(--c-gold-deep); }
.research-row a:hover .research-arrow,
.research-row a:focus-visible .research-arrow {
  color: var(--c-gold-deep);
  transform: translateX(8px);
}
.research-panel img { transition: opacity 250ms var(--ease); }

/* ---------------------------------------------------------------- feature media */
.feature-media {
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.feature-media img {
  transition: transform 700ms var(--ease);
}
.feature:hover .feature-media img,
.mini-feature:hover .feature-media img {
  transform: scale(1.025);
}

/* ---------------------------------------------------------------- methods */
.method {
  transition: border-color 300ms var(--ease), transform 300ms var(--ease);
}
.method:hover {
  border-top-color: var(--c-gold-deep);
  transform: translateY(-4px);
}

/* ---------------------------------------------------------------- people cards */
.preview-card,
.member-card {
  transition: transform 300ms var(--ease);
}
.preview-card:hover,
.member-card:hover {
  transform: translateY(-5px);
}
.preview-card img,
.member-card img,
.pi-row img {
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.preview-card:hover img,
.member-card:hover img {
  border-color: var(--c-gold);
  box-shadow: 0 10px 28px rgba(8, 28, 44, 0.16);
}

/* ---------------------------------------------------------------- citations */
.cite {
  position: relative;
  padding-left: 0;
  transition: padding-left 300ms var(--ease);
}
.cite::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--c-gold);
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 300ms var(--ease);
}
.cite:hover { padding-left: 18px; }
.cite:hover::before { transform: scaleY(1); }

/* ---------------------------------------------------------------- nanotube lattice texture on navy */
.section-navy,
.site-footer,
.stage {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 0 V34 M28 34 L0 50 V84 M28 34 L56 50 V84 M0 84 L28 100 M56 84 L28 100' fill='none' stroke='%23B6C8D0' stroke-opacity='0.055' stroke-width='1.2'/%3E%3C/svg%3E");
  background-color: var(--c-midnight);
}
.litho-figure {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 0 V34 M28 34 L0 50 V84 M28 34 L56 50 V84 M0 84 L28 100 M56 84 L28 100' fill='none' stroke='%23B6C8D0' stroke-opacity='0.05' stroke-width='1.2'/%3E%3C/svg%3E");
  background-color: var(--c-deep);
}

/* ---------------------------------------------------------------- toc */
.toc-list a {
  transition: border-color 200ms var(--ease), font-weight 200ms var(--ease);
}

/* ---------------------------------------------------------------- reduced motion: no reveal hiding, no drift */
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .rv:not(.in-view) { opacity: 1; transform: none; }
  html.js-reveal .section-title:not(.in-view)::after { transform: none; }
  .masthead .eyebrow, .masthead h1, .masthead-side,
  .stage-wrap .stage, .stage-wrap .stage-footer { animation: none; }
  .btn:hover, .method:hover, .preview-card:hover, .member-card:hover { transform: none; }
}
