/* =========================================================================
   CREST · Center for Research on Emotion, Stress, and Technology
   Material 3 design system — tokens mirror heartt.crestresearch.org
   ========================================================================= */

:root {
  --md-primary: #1e6b4c;
  --md-on-primary: #ffffff;
  --md-primary-container: #b4f0cf;
  --md-on-primary-container: #002114;
  --md-secondary: #2f6a50;
  --md-on-secondary: #ffffff;
  --md-secondary-container: #cfe8d9;
  --md-on-secondary-container: #0c2a1d;
  --md-tertiary: #7a5900;
  --md-on-tertiary: #ffffff;
  --md-tertiary-container: #ffdf93;
  --md-on-tertiary-container: #261a00;
  --md-surface: #fff9f1;
  --md-surface-dim: #e2d9cc;
  --md-surface-container-lowest: #ffffff;
  --md-surface-container-low: #fcf1e3;
  --md-surface-container: #f6ebdc;
  --md-surface-container-high: #f0e5d6;
  --md-surface-container-highest: #eadfd0;
  --md-on-surface: #1f1b16;
  --md-on-surface-variant: #4e453a;
  --md-outline: #80756a;
  --md-outline-variant: #d3c4b4;
  --md-inverse-surface: #34302a;
  --md-inverse-on-surface: #f9efe4;
  --brand-green: #154734;
  --brand-gold: #ffd416;

  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 28px;
  --md-shape-full: 999px;
  --md-elev-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-elev-2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-elev-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);
  --md-ease-emphasized: cubic-bezier(.2, 0, 0, 1);
  --md-ease-decel: cubic-bezier(.05, .7, .1, 1);

  --content-width: 1080px;
  --reading-width: 760px;
  --bar-height: 64px;
  color-scheme: light;
}

/* Dark theme: follows the system unless the user picks one with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --md-primary: #98d4b4;
    --md-on-primary: #003824;
    --md-primary-container: #005237;
    --md-on-primary-container: #b4f0cf;
    --md-secondary: #b3ccbd;
    --md-on-secondary: #1f3529;
    --md-secondary-container: #354b3f;
    --md-on-secondary-container: #cfe8d9;
    --md-tertiary: #f0c048;
    --md-on-tertiary: #402d00;
    --md-tertiary-container: #5c4300;
    --md-on-tertiary-container: #ffdf93;
    --md-surface: #17130e;
    --md-surface-dim: #17130e;
    --md-surface-container-lowest: #110e09;
    --md-surface-container-low: #1f1b16;
    --md-surface-container: #231f1a;
    --md-surface-container-high: #2e2924;
    --md-surface-container-highest: #39342e;
    --md-on-surface: #eae1d6;
    --md-on-surface-variant: #d3c4b4;
    --md-outline: #9c8f82;
    --md-outline-variant: #4e453a;
    --md-inverse-surface: #eae1d6;
    --md-inverse-on-surface: #34302a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --md-primary: #98d4b4;
  --md-on-primary: #003824;
  --md-primary-container: #005237;
  --md-on-primary-container: #b4f0cf;
  --md-secondary: #b3ccbd;
  --md-on-secondary: #1f3529;
  --md-secondary-container: #354b3f;
  --md-on-secondary-container: #cfe8d9;
  --md-tertiary: #f0c048;
  --md-on-tertiary: #402d00;
  --md-tertiary-container: #5c4300;
  --md-on-tertiary-container: #ffdf93;
  --md-surface: #17130e;
  --md-surface-dim: #17130e;
  --md-surface-container-lowest: #110e09;
  --md-surface-container-low: #1f1b16;
  --md-surface-container: #231f1a;
  --md-surface-container-high: #2e2924;
  --md-surface-container-highest: #39342e;
  --md-on-surface: #eae1d6;
  --md-on-surface-variant: #d3c4b4;
  --md-outline: #9c8f82;
  --md-outline-variant: #4e453a;
  --md-inverse-surface: #eae1d6;
  --md-inverse-on-surface: #34302a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-height) + 64px); }
body {
  margin: 0;
  font-family: "Roboto Flex", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--md-on-surface);
  background: var(--md-surface);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--md-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--md-primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.2; }
p { margin: 0 0 1em; }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--md-primary); color: var(--md-on-primary);
  padding: 12px 20px; border-radius: var(--md-shape-full);
}
.skip-link:focus { top: 12px; }

.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 24px; line-height: 1; user-select: none; flex-shrink: 0;
}
.icon-fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* ---------- Type scale (M3) ---------- */
.display-l { font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; }
.display-m { font-size: clamp(2.1rem, 4.4vw, 2.8rem); line-height: 1.15; letter-spacing: -.01em; }
.headline-l { font-size: clamp(1.75rem, 3.4vw, 2.2rem); line-height: 1.2; }
.headline-s { font-size: 1.5rem; line-height: 1.3; }
.title-l { font-size: 1.375rem; line-height: 1.35; font-weight: 500; }
.title-m { font-size: 1rem; line-height: 1.5; font-weight: 500; letter-spacing: .01em; }
.body-l { font-size: 1.125rem; line-height: 1.65; }
.label-l { font-size: .875rem; font-weight: 500; letter-spacing: .01em; }
.muted { color: var(--md-on-surface-variant); }

/* ---------- Top app bar ---------- */
.top-bar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--md-surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.top-bar.scrolled { border-bottom-color: var(--md-outline-variant); }
.top-bar__row {
  max-width: var(--content-width); margin: 0 auto;
  height: var(--bar-height); padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; }
.brand__mark { width: 40px; height: 40px; flex-shrink: 0; display: block; border-radius: 50%; }   /* assets/favicon.svg, the CREST burst icon */
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; }
.brand__sub { font-size: .75rem; color: var(--md-on-surface-variant); }

.nav-chips {
  max-width: var(--content-width); margin: 0 auto;
  display: flex; gap: 8px; padding: 0 16px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.nav-chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; white-space: nowrap;
  border: 1px solid var(--md-outline-variant); border-radius: var(--md-shape-sm);
  color: var(--md-on-surface-variant); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
}
.chip .material-symbols-rounded { font-size: 18px; }
.chip:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.chip[aria-current="true"], .chip.is-active {
  background: var(--md-secondary-container); color: var(--md-on-secondary-container);
  border-color: transparent;
}
button.chip { background: transparent; font-family: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: var(--md-shape-full);
  font: 500 .875rem/1 inherit; font-family: inherit; letter-spacing: .01em;
  text-decoration: none; border: 0; cursor: pointer; position: relative; overflow: hidden;
  transition: box-shadow .2s, background .2s;
}
.btn .material-symbols-rounded { font-size: 18px; margin-left: -6px; }
.btn--lg { height: 52px; padding: 0 28px; font-size: 1rem; }
.btn--filled { background: var(--md-primary); color: var(--md-on-primary); }
.btn--filled:hover { box-shadow: var(--md-elev-1); }
.btn--tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn--tonal:hover { box-shadow: var(--md-elev-1); }
.btn--outlined { background: transparent; color: var(--md-primary); box-shadow: inset 0 0 0 1px var(--md-outline); }
.btn--outlined:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.btn--text { background: transparent; color: var(--md-primary); padding: 0 12px; }
.btn--text:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.btn::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .2s; }
.btn:hover::after { opacity: .08; }
.btn:active::after { opacity: .12; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--md-on-surface-variant);
}
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }

/* ---------- Layout ---------- */
.container { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tint { background: var(--md-surface-container-low); }
.section__head { max-width: var(--reading-width); margin-bottom: 40px; }
.section__head p { margin-top: 16px; }
.section__head:last-child, .section__head:last-child p:last-child { margin-bottom: 0; }
.eyebrow {
  display: block; margin-bottom: 12px;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--md-primary);
}
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(8px); z-index: -1; pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px; left: -180px; top: -140px;
  background: radial-gradient(circle at 60% 50%, color-mix(in srgb, var(--md-primary-container) 80%, transparent), transparent 70%);
}
.hero::after {
  width: 420px; height: 420px; right: -120px; bottom: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--md-tertiary-container) 70%, transparent), transparent 70%);
}
/* Sparse home hero: title only, centered on a full screen */
.hero--sparse {
  min-height: calc(100svh - var(--bar-height) - 52px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 64px 0 96px; text-align: center;
}
.hero--sparse::before { width: 640px; height: 640px; left: -220px; top: -200px; }
.hero--sparse::after { width: 560px; height: 560px; right: -180px; bottom: -220px; }
.hero__title {
  font-size: clamp(2.6rem, 7.2vw, 5.5rem); line-height: 1.05; letter-spacing: -.025em; font-weight: 300;
  max-width: 14em; margin: 0 auto; text-wrap: balance;
}
.hero__title .accent { color: var(--md-primary); font-weight: 400; }
/* Impact numbers under the hero title */
.impact {
  display: flex; justify-content: center; flex-wrap: wrap;
  margin: 56px auto 0; padding: 0;
}
.impact__item {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 6px;
  padding: 4px 40px; min-width: 200px;
}
.impact__item + .impact__item { border-left: 1px solid var(--md-outline-variant); }
.impact dd {
  margin: 0; font-size: clamp(2.25rem, 4.5vw, 3.25rem); line-height: 1; font-weight: 300;
  letter-spacing: -.02em; color: var(--md-on-surface); font-variant-numeric: tabular-nums;
}
.impact dt {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--md-primary);
}
.footer__note { margin: 32px 0 0; font-size: .8125rem; color: var(--md-on-surface-variant); }
.footer__note a { font-size: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--md-outline-variant); text-underline-offset: 3px; }
.footer__note + .footer__base { margin-top: 16px; }
@media (max-width: 600px) {
  .impact { flex-direction: column; gap: 20px; margin-top: 40px; }
  .impact__item { padding: 0; min-width: 0; }
  .impact__item + .impact__item { border-left: 0; }
}

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  color: var(--md-on-surface-variant); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--md-outline-variant);
  animation: hero-bob 2.4s var(--md-ease-emphasized) infinite;
}
.hero__scroll:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
@keyframes hero-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .hero__scroll { animation: none; } }

.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero__pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: var(--md-shape-full);
  background: var(--md-tertiary-container); color: var(--md-on-tertiary-container);
  font-size: .8125rem; font-weight: 500; margin-bottom: 24px;
}
.hero__pill .material-symbols-rounded { font-size: 18px; }
.hero h1 .accent { color: var(--md-primary); }
.hero__lead { margin: 24px 0 32px; max-width: 34em; color: var(--md-on-surface-variant); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__art { position: relative; aspect-ratio: 1; }
.hero__art img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  box-shadow: 0 0 0 10px var(--md-surface), 0 0 0 12px var(--md-outline-variant), var(--md-elev-3);
}
.hero__badge {
  position: absolute; left: -8px; bottom: 12%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 12px; border-radius: var(--md-shape-lg);
  background: var(--md-surface-container-lowest); box-shadow: var(--md-elev-2);
}
.hero__badge .material-symbols-rounded {
  width: 40px; height: 40px; border-radius: var(--md-shape-md); display: grid; place-items: center;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.hero__badge strong { display: block; font-size: 1.25rem; line-height: 1.1; }
.hero__badge span.small { font-size: .75rem; color: var(--md-on-surface-variant); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.stat {
  padding: 20px; border-radius: var(--md-shape-lg);
  background: var(--md-surface-container); display: flex; gap: 16px; align-items: flex-start;
}
.stat .material-symbols-rounded { color: var(--md-primary); font-size: 28px; }
.stat strong { display: block; font-size: 1.125rem; font-weight: 500; }
.stat span.small { font-size: .875rem; color: var(--md-on-surface-variant); }

/* ---------- Cards ---------- */
.card {
  background: var(--md-surface-container-low); border-radius: var(--md-shape-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid transparent; transition: box-shadow .25s var(--md-ease-emphasized), transform .25s var(--md-ease-emphasized);
}
.section--tint .card { background: var(--md-surface-container-lowest); }
.card--outlined { background: var(--md-surface); border-color: var(--md-outline-variant); }
.card--interactive { text-decoration: none; color: inherit; }
.card--interactive:hover { box-shadow: var(--md-elev-2); transform: translateY(-2px); }
.card__icon {
  width: 48px; height: 48px; border-radius: var(--md-shape-md); display: grid; place-items: center;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.card__icon--gold { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.card__icon--sage { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.card h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
.card p { margin: 0; color: var(--md-on-surface-variant); }
.card__media { margin: -24px -24px 4px; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--md-shape-lg) var(--md-shape-lg) 0 0; background: var(--md-surface-container-high); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--contain img { object-fit: contain; padding: 16px; }
.card__foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card__link { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: .875rem; text-decoration: none; }
.card__link .material-symbols-rounded { font-size: 18px; transition: transform .2s; }
.card--interactive:hover .card__link .material-symbols-rounded,
.card__link:hover .material-symbols-rounded { transform: translateX(3px); }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px;
  border-radius: var(--md-shape-sm); font-size: .75rem; font-weight: 500;
  background: var(--md-secondary-container); color: var(--md-on-secondary-container);
}
.tag--gold { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--md-outline-variant); color: var(--md-on-surface-variant); }

/* Pillars (psychology / neuroscience / computer science) */
.pillar { padding: 28px; }
.pillar h3 { margin-top: 4px; }

/* Featured findings */
.feature {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  padding: 24px; border-radius: var(--md-shape-lg); background: var(--md-surface-container-lowest);
  text-decoration: none; color: inherit; transition: box-shadow .25s;
}
.feature:hover { box-shadow: var(--md-elev-2); }
.feature__num {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--md-primary); color: var(--md-on-primary); font-weight: 600;
}
.feature h3 { font-size: 1.125rem; font-weight: 500; margin-bottom: 6px; }
.feature p { margin: 0; font-size: .9rem; color: var(--md-on-surface-variant); }

/* ---------- People ---------- */
.people-group + .people-group { margin-top: 48px; }
.people-group > h3 { font-size: 1rem; font-weight: 600; letter-spacing: .04em; color: var(--md-on-surface-variant); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.people-group > h3 .material-symbols-rounded { font-size: 20px; color: var(--md-primary); }
.avatar {
  width: 112px; height: 112px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--md-surface-container-lowest), 0 0 0 6px var(--md-primary);
  background: var(--md-primary-container); color: var(--md-on-primary-container);
  display: grid; place-items: center; font-size: 2rem; font-weight: 500; margin-bottom: 8px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Team cards (home): photo on top, then name, role, one-line focus, and the bio behind "Full bio". */
.team-grid { display: grid; gap: 20px; align-items: stretch; }
.team-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.member {
  border-radius: var(--md-shape-xl); overflow: hidden;
  background: var(--md-surface-container-lowest);
  transition: transform .25s var(--md-ease-decel), box-shadow .25s var(--md-ease-decel);
}
.member:hover { transform: translateY(-3px); box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 12px 28px rgba(0,0,0,.08); }
.member__photo { aspect-ratio: 4 / 5; background: var(--md-primary-container); overflow: hidden; }
.team-grid--3 .member__photo { aspect-ratio: 1; }
.member__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform .5s var(--md-ease-decel); }
.member:hover .member__photo img { transform: scale(1.03); }
.member__body { padding: 18px 20px 14px; border-top: 3px solid var(--md-tertiary); }
.member h4 { font-size: 1.1rem; font-weight: 600; }
.member__role { font-size: .8125rem; font-weight: 500; letter-spacing: .02em; color: var(--md-primary); margin: 2px 0 10px; }
.member__focus { font-size: .9rem; line-height: 1.45; color: var(--md-on-surface-variant); margin: 0; }
.member summary, .pi-card__more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 2px;
  font-size: .8125rem; font-weight: 500; color: var(--md-primary);
  padding: 6px 10px; margin: 8px 0 0 -10px; border-radius: var(--md-shape-full);
}
.member summary::-webkit-details-marker, .pi-card__more summary::-webkit-details-marker { display: none; }
.member summary:hover, .pi-card__more summary:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.member summary .material-symbols-rounded, .pi-card__more summary .material-symbols-rounded { font-size: 18px; transition: transform .2s; }
.member details[open] summary .material-symbols-rounded, .pi-card__more[open] summary .material-symbols-rounded { transform: rotate(180deg); }
.member details p { font-size: .875rem; line-height: 1.55; color: var(--md-on-surface-variant); margin: 6px 0 4px; }

/* Director: the same faded-backdrop card as the papers, tools, and projects. */
.potd.pi-card {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; align-items: center;
  max-width: none; margin: 0 0 48px; padding: 36px 40px;
}
.pi-card > div:last-child { max-width: 40em; }
.pi-card__photo {
  width: 200px; aspect-ratio: 4 / 5; border-radius: var(--md-shape-lg); overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.1);
}
.pi-card__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.pi-card h3 { font-size: 1.75rem; }
.pi-card .role { color: var(--md-primary); font-weight: 500; margin: 4px 0 16px; }
.pi-card p { color: var(--md-on-surface-variant); margin: 0; }
.pi-card__more { margin-bottom: 12px; }
.pi-card__more p { margin-top: 6px; }
.pi-card .card__foot { padding-top: 0; }

/* Alumni list (separate page) */
.alum { display: grid; grid-template-columns: 88px 1fr; gap: 20px; align-items: start; text-align: left; }
.alum .avatar { width: 88px; height: 88px; font-size: 1.5rem; margin: 4px 0 0; }
.alum h4 { font-size: 1.1rem; font-weight: 600; }
.alum p { margin: 6px 0 0; font-size: .925rem; }

/* ---------- Join / CTA banner ---------- */
.cta {
  border-radius: var(--md-shape-xl); padding: 48px;
  background: var(--brand-green); color: #f3efe6;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  position: relative; overflow: hidden;
}
.cta::after {
  content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,212,22,.28), transparent 70%);
}
.cta h2 { color: #fff; }
.cta .eyebrow { color: var(--brand-gold); }
.cta p { color: #d8e6dd; }
.cta .btn--filled { background: var(--brand-gold); color: #241a00; }
.cta .btn--outlined { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.cta__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.cta__list li {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--md-shape-lg);
  background: rgba(255,255,255,.08);
}
.cta__list .material-symbols-rounded { color: var(--brand-gold); }
.cta__list strong { color: #fff; display: block; font-weight: 500; }
.cta__list span.small { font-size: .875rem; color: #cfdcd3; }
.cta .hero__actions { margin-top: 24px; }

/* ---------- Page header (sub-pages) ---------- */
.page-head { padding: 48px 0 40px; position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; width: 460px; height: 460px; right: -160px; top: -220px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--md-primary-container) 80%, transparent), transparent 70%);
}
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .875rem; margin-bottom: 24px; color: var(--md-on-surface-variant); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs .material-symbols-rounded { font-size: 18px; }
.page-head p.body-l { max-width: var(--reading-width); margin-top: 16px; color: var(--md-on-surface-variant); }
.page-body { padding-top: 24px; padding-bottom: 96px; }   /* top/bottom only: keeps .container side padding */
.prose { max-width: var(--reading-width); }
.prose h2 { margin: 48px 0 16px; }
.prose h3 { margin: 32px 0 12px; font-weight: 500; font-size: 1.25rem; }
.prose img.figure { border-radius: var(--md-shape-lg); border: 1px solid var(--md-outline-variant); margin: 16px 0 8px; background: #fff; }
.prose figcaption { font-size: .85rem; color: var(--md-on-surface-variant); margin-bottom: 24px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: 6px 0; }
.callout {
  display: flex; gap: 16px; padding: 20px 24px; border-radius: var(--md-shape-lg); margin: 24px 0;
  background: var(--md-secondary-container); color: var(--md-on-secondary-container);
}
.callout--gold { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.code {
  font-family: "Roboto Mono", ui-monospace, Consolas, monospace; font-size: .875rem;
  background: var(--md-surface-container-high); padding: 2px 6px; border-radius: var(--md-shape-xs); word-break: break-all;
}
pre.code { display: block; padding: 16px 20px; border-radius: var(--md-shape-md); white-space: pre-wrap; }
.placeholder {
  border: 2px dashed var(--md-outline-variant); border-radius: var(--md-shape-lg);
  padding: 32px; text-align: center; color: var(--md-on-surface-variant); margin: 16px 0 24px; font-size: .9rem;
}
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding: 20px 24px 20px 72px; border-radius: var(--md-shape-lg); background: var(--md-surface-container-low); margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 20px; top: 20px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--md-primary); color: var(--md-on-primary); font-weight: 600;
}
.steps h3 { margin: 4px 0 8px !important; font-size: 1.1rem !important; }

.resource-list { display: grid; gap: 12px; margin: 16px 0; }
.resource {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 20px; border-radius: var(--md-shape-lg); background: var(--md-surface-container-low);
  text-decoration: none; color: inherit; transition: box-shadow .2s;
}
.resource:hover { box-shadow: var(--md-elev-1); }
.resource .card__icon { width: 48px; height: 48px; }
.resource strong { display: block; font-weight: 500; }
.resource span.small { font-size: .875rem; color: var(--md-on-surface-variant); }
.resource > .material-symbols-rounded { color: var(--md-on-surface-variant); }

/* ---------- Publications ---------- */
.pub-tools {
  position: sticky; top: calc(var(--bar-height) + 52px); z-index: 10;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 12px 0; background: var(--md-surface);
}
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px;
  border-radius: var(--md-shape-full); background: var(--md-surface-container-high);
}
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: inherit; outline: none; min-width: 0; }
.search .material-symbols-rounded { color: var(--md-on-surface-variant); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-count { font-size: .875rem; color: var(--md-on-surface-variant); margin: 4px 0 24px; }
.pub-section { margin-top: 40px; }
.pub-section > h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pub-section > h2 .material-symbols-rounded { color: var(--md-primary); }
.pub-year {
  font-size: .8125rem; font-weight: 600; letter-spacing: .1em; color: var(--md-primary);
  margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--md-outline-variant);
}
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pub {
  padding: 16px 20px; border-radius: var(--md-shape-md); background: var(--md-surface-container-low);
  font-size: .95rem; line-height: 1.55; border-left: 3px solid transparent; transition: border-color .2s, background .2s;
}
.pub:hover { border-left-color: var(--md-primary); background: var(--md-surface-container); }
.pub .pub-title a { font-weight: 500; color: var(--md-on-surface); text-decoration: none; }
.pub .pub-title a:hover { color: var(--md-primary); text-decoration: underline; }
.pub mark { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); border-radius: 2px; padding: 0 1px; }
.pub .me { font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pub-links a {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: var(--md-shape-sm);
  font-size: .8rem; font-weight: 500; text-decoration: none;
  background: var(--md-secondary-container); color: var(--md-on-secondary-container);
}
.pub-links a .material-symbols-rounded { font-size: 16px; }
.pub-links a.pub-pdf { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.empty { padding: 48px; text-align: center; color: var(--md-on-surface-variant); }

/* ---------- Paper of the day (home) ---------- */
.potd {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 860px; margin: 0 auto; padding: 40px 44px; border-radius: var(--md-shape-xl);
  background: var(--md-surface-container-lowest); border-left: 4px solid var(--md-tertiary);
}
/* The journal cover as a soft backdrop: anchored right, blurred, fading out toward the text. */
.potd__backdrop {
  position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 62%;
  background-size: cover; background-position: center 30%;
  filter: blur(3px) saturate(.85);
  transform: scale(1.06);
  opacity: 0;
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.6) 45%, transparent 100%);
  mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.6) 45%, transparent 100%);
  transition: opacity .8s var(--md-ease-decel);
}
.potd__backdrop.is-loaded { opacity: .48; }
:root[data-theme="dark"] .potd__backdrop.is-loaded { opacity: .4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .potd__backdrop.is-loaded { opacity: .4; } }
.potd__head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.potd__head .eyebrow { margin-bottom: 2px; }
.potd__date { margin: 0; font-size: .875rem; color: var(--md-on-surface-variant); }
.potd__title {
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; font-weight: 400; letter-spacing: -.01em;
  max-width: 30em; margin: 0 0 16px; text-wrap: balance;
}
.potd__title a { color: var(--md-on-surface); text-decoration: none; }
.potd__title a:hover { color: var(--md-primary); text-decoration: underline; text-decoration-thickness: 1px; }
.potd__citation { font-size: .95rem; line-height: 1.6; margin: 0; max-width: 46em; color: var(--md-on-surface-variant); }
.potd__citation .me { font-weight: 600; color: var(--md-on-surface); }
.potd__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.potd__all { margin: 16px 0 0 -12px; }
/* Latest findings (home): a stack of the same cards, full width, slightly smaller titles. */
.latest { display: grid; gap: 16px; }
.latest[hidden] { display: none; }
.latest .potd { max-width: none; margin: 0; padding: 32px 40px; }
.latest .potd__title { font-size: clamp(1.25rem, 2.4vw, 1.625rem); }
.latest .potd__actions { margin-top: 20px; }
.latest__all { margin: 16px 0 0 -12px; }
@media (max-width: 600px) { .latest .potd { padding: 28px 22px; } }
/* Publications page: peer-reviewed papers as the same cards, a little more compact. */
.pub-list:has(.pub-card) { gap: 12px; }
.pub.pub-card {
  max-width: none; margin: 0; padding: 26px 32px;
  font-size: 1rem; background: var(--md-surface-container-lowest);
  border-left: 4px solid var(--md-tertiary); border-radius: var(--md-shape-lg);
  transition: transform .25s var(--md-ease-decel), box-shadow .25s var(--md-ease-decel);
}
.pub.pub-card:hover { background: var(--md-surface-container-lowest); border-left-color: var(--md-tertiary);
  transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0,0,0,.05), 0 10px 24px rgba(0,0,0,.07); }
.pub-card .potd__title { font-size: clamp(1.125rem, 2vw, 1.3125rem); line-height: 1.3; max-width: 34em; margin-bottom: 10px; }
.pub-card .potd__citation { font-size: .875rem; max-width: 52em; }
.pub-card .potd__actions { margin-top: 16px; }
.pub-card .btn { height: 36px; padding: 0 16px; font-size: .8125rem; }
.pub-card .btn .material-symbols-rounded { font-size: 18px; }
.pub-card .potd__backdrop { width: 48%; }
.pub-card .potd__actions:empty { display: none; }
/* Logos (talks, posters, and journals with only a wordmark): shown whole and soft on the right
   instead of cropped like a journal cover. */
.pub-card--event { border-left-color: var(--md-primary); }
.pub.pub-card--event:hover { border-left-color: var(--md-primary); }
.potd--logo .potd__backdrop {
  width: 34%; right: 24px; background-size: contain; background-repeat: no-repeat; background-position: right center;
  filter: blur(1.5px) saturate(.9); transform: none;
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.7) 55%, transparent 100%);
  mask-image: linear-gradient(to left, #000 0%, rgba(0,0,0,.7) 55%, transparent 100%);
}
.potd--logo .potd__backdrop.is-loaded { opacity: .38; }
/* Dark theme: most logos sit on white, so flip them to light-on-dark and let the background
   drop away instead of showing as a gray box. */
:root[data-theme="dark"] .potd--logo .potd__backdrop { filter: blur(1.5px) grayscale(1) invert(1); mix-blend-mode: screen; }
:root[data-theme="dark"] .potd--logo .potd__backdrop.is-loaded { opacity: .32; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .potd--logo .potd__backdrop { filter: blur(1.5px) grayscale(1) invert(1); mix-blend-mode: screen; }
  :root:not([data-theme="light"]) .potd--logo .potd__backdrop.is-loaded { opacity: .32; }
}
@media (max-width: 600px) {
  .pub.pub-card { padding: 22px 20px; }
  .pub-card .potd__backdrop { width: 100%; }
  .potd--logo .potd__backdrop {
    width: 60%; height: 64px; top: 14px; right: 14px; background-position: right top;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,.8) 0%, transparent 100%);
    mask-image: linear-gradient(to left, rgba(0,0,0,.8) 0%, transparent 100%);
  }
  .potd--logo .potd__backdrop.is-loaded { opacity: .28; }
}
/* Projects (home): same cards, with the project's logo on a crisp tile over the backdrop. */
.project { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 40px; align-items: center; }
.project__logo {
  grid-column: 2; grid-row: 1; width: 176px; aspect-ratio: 1; padding: 18px;
  display: grid; place-items: center; border-radius: var(--md-shape-lg);
  background: #fff;   /* logos are drawn for a white background, in both themes */
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 20px rgba(0,0,0,.08);
}
.project__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.project__logo--icon { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.project__logo--icon .material-symbols-rounded { font-size: 72px; }
.project__body { grid-column: 1; grid-row: 1; }
.project__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
@media (max-width: 600px) {
  /* Phones: the logo becomes a small badge above the tags, so the text keeps the full width. */
  .project { display: block; }
  .project__logo { width: 88px; padding: 10px; margin-bottom: 16px; border-radius: var(--md-shape-md); }
  .project__logo--icon .material-symbols-rounded { font-size: 40px; }
}
@media (max-width: 600px) {
  .potd { padding: 28px 22px; }
  /* On phones the card is narrow and tall: fade the cover in from the top instead. */
  .potd__backdrop {
    width: 100%; bottom: auto; height: 60%; background-position: center 20%;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.8) 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8) 0%, transparent 100%);
  }
}

/* ---------- Abbreviated PCL-5 page ---------- */
.pcl-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 40px; align-items: end; }
/* The 20-item strip, one group per symptom cluster (B–E), each bar labelled with its item
   (B1 … E6). Faint = full PCL-5 only, green = 8-item version, gold = in both versions. */
.pcl-items { margin: 0; padding: 22px 22px 16px; border-radius: var(--md-shape-xl); background: var(--md-surface-container-lowest); box-shadow: var(--md-elev-1); }
.pcl-items__groups { display: flex; gap: 10px; }
.pcl-items__group { display: flex; flex-direction: column; min-width: 0; }
.pcl-items__group:nth-child(1) { flex: 5; }
.pcl-items__group:nth-child(2) { flex: 2; }
.pcl-items__group:nth-child(3) { flex: 7; }
.pcl-items__group:nth-child(4) { flex: 6; }
.pcl-items__bars { display: flex; gap: 4px; }
.pcl-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.pcl-bar i {
  display: block; height: 120px; position: relative;
}
.pcl-bar i::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 38%; border-radius: 6px 6px 3px 3px;
  background: var(--md-surface-container-high); transform-origin: bottom; animation: pcl-rise .7s var(--md-ease-decel) both;
}
.pcl-bar[data-v="8"] i::before { height: 74%; background: var(--md-primary); }
.pcl-bar[data-v="4"] i::before { height: 100%; background: var(--md-tertiary); }
.pcl-bar small {
  margin-top: 5px; text-align: center; font: 500 .625rem/1 "Roboto Mono", monospace; letter-spacing: -.04em;
  white-space: nowrap;
  color: var(--md-on-surface-variant); font-variant-numeric: tabular-nums;
}
.pcl-bar[data-v] small { color: var(--md-on-surface); font-weight: 700; }
@keyframes pcl-rise { from { transform: scaleY(0); } }
.pcl-items figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: .75rem; color: var(--md-on-surface-variant); }
.pcl-items figcaption span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; background: var(--md-surface-container-high); display: inline-block; }
.key--8 { background: var(--md-primary); }
.key--4 { background: var(--md-tertiary); }

.pcl-h2 { margin: 56px 0 18px; }
.page-body > .pcl-h2:first-child { margin-top: 8px; }
.pcl-text { max-width: var(--reading-width); color: var(--md-on-surface-variant); }
.pcl-note { margin: 10px 0 0; font-size: .875rem; color: var(--md-on-surface-variant); }

.pcl-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcl-version {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 28px; border-radius: var(--md-shape-xl); background: var(--md-surface-container-lowest);
  border-top: 4px solid var(--md-tertiary);
}
.pcl-version--8 { border-top-color: var(--md-primary); }
.pcl-version h3 { font-size: 1.5rem; font-weight: 400; margin: 4px 0 0; }
.pcl-version p { margin: 0; color: var(--md-on-surface-variant); }
.pcl-chips { list-style: none; padding: 0; margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.pcl-chips li {
  font: 600 .8125rem/1 "Roboto Mono", monospace; padding: 7px 10px; border-radius: var(--md-shape-sm);
  background: var(--md-tertiary-container); color: var(--md-on-tertiary-container);
}
.pcl-chips li.is-8 { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.pcl-version__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }

/* Calculator: the featured, colorful block on the page. */
.pcl-calc {
  position: relative; isolation: isolate; margin-top: 56px; padding: 36px;   /* no overflow:hidden: it would stop the sticky result */
  border-radius: var(--md-shape-xl); color: var(--md-on-primary-container);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--md-tertiary) 35%, transparent), transparent 60%),
    linear-gradient(160deg, var(--md-primary-container), color-mix(in srgb, var(--md-primary-container) 55%, var(--md-surface-container-lowest)));
  box-shadow: var(--md-elev-2);
}
.pcl-calc__intro { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.pcl-calc__intro p { margin: 4px 0 0; opacity: .85; }
.pcl-calc__badge {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--md-primary); color: var(--md-on-primary); box-shadow: var(--md-elev-1);
}
.pcl-calc__badge .material-symbols-rounded { font-size: 30px; }
.pcl-calc__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.pcl-scale { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; font-size: .75rem; font-weight: 500; opacity: .8; }
.pcl-prompt { margin: 0 0 12px; font-weight: 500; }
.pcl-questions { display: grid; gap: 10px; }
.pcl-q {
  padding: 14px 16px; border-radius: var(--md-shape-lg);
  background: color-mix(in srgb, var(--md-surface-container-lowest) 82%, transparent);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center;
  transition: box-shadow .2s, background .2s;
}
.pcl-q.is-answered { background: var(--md-surface-container-lowest); box-shadow: inset 4px 0 0 var(--md-primary); }
.pcl-q__text { margin: 0; font-size: .9375rem; line-height: 1.4; color: var(--md-on-surface); }
.pcl-q__text b { font: 600 .75rem "Roboto Mono", monospace; color: var(--md-primary); margin-right: 8px; }
.pcl-q__scale { display: flex; gap: 6px; }
.pcl-q__scale label { position: relative; cursor: pointer; }
.pcl-q__scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pcl-q__scale span {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-weight: 600; color: var(--md-on-surface-variant);
  background: var(--md-surface-container-high); transition: transform .15s var(--md-ease-emphasized), background .15s, color .15s;
}
.pcl-q__scale label:hover span { transform: scale(1.08); background: var(--md-surface-container-highest); }
.pcl-q__scale input:checked + span { background: var(--md-primary); color: var(--md-on-primary); transform: scale(1.12); box-shadow: var(--md-elev-1); }
.pcl-q__scale input:focus-visible + span { outline: 3px solid var(--md-tertiary); outline-offset: 2px; }

.pcl-result {
  position: sticky; top: calc(var(--bar-height) + 72px);
  padding: 24px; border-radius: var(--md-shape-xl); text-align: center;
  background: var(--md-surface-container-lowest); color: var(--md-on-surface); box-shadow: var(--md-elev-2);
}
.pcl-result__label { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--md-on-surface-variant); }
.pcl-result__score { margin: 6px 0 14px; line-height: 1; }
.pcl-result__score span {
  font-size: 4.5rem; font-weight: 300; letter-spacing: -.03em; color: var(--md-primary);
  font-variant-numeric: tabular-nums; display: inline-block; transition: color .3s;
}
.pcl-result__score small { font-size: 1.125rem; color: var(--md-on-surface-variant); margin-left: 4px; }
.pcl-result.is-bump .pcl-result__score span { animation: pcl-bump .35s var(--md-ease-emphasized); }
@keyframes pcl-bump { 40% { transform: scale(1.08); } }
.pcl-result.is-high .pcl-result__score span { color: var(--md-tertiary); }
.pcl-gauge { position: relative; height: 12px; border-radius: 99px; background: var(--md-surface-container-high); overflow: hidden; }
.pcl-gauge__fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--md-primary), color-mix(in srgb, var(--md-primary) 50%, var(--md-tertiary)) 45%, var(--md-tertiary));
  background-size: 300px 100%; transition: width .45s var(--md-ease-emphasized);
}
/* 31–33 of 0–80 */
.pcl-gauge__band { position: absolute; top: 0; bottom: 0; left: 38.75%; width: 2.5%; background: var(--md-on-surface); opacity: .35; z-index: 1; }
.pcl-gauge__labels { position: relative; display: flex; justify-content: space-between; margin-top: 6px; font-size: .6875rem; color: var(--md-on-surface-variant); }
.pcl-gauge__cut { position: absolute; left: 40%; transform: translateX(-50%); font-weight: 600; }
.pcl-result__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 6px; }
.pcl-result__meta div { padding: 10px; border-radius: var(--md-shape-md); background: var(--md-surface-container-low); }
.pcl-result__meta dt { font-size: .6875rem; color: var(--md-on-surface-variant); }
.pcl-result__meta dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pcl-result__note { margin: 10px 0 0; font-size: .75rem; line-height: 1.45; color: var(--md-on-surface-variant); text-align: left; }
.pcl-reset { margin-top: 4px; }

.pcl-formula {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 20px 24px;
  border-radius: var(--md-shape-xl); background: var(--md-surface-container-lowest); border: 1px solid var(--md-outline-variant);
}
.pcl-formula__lhs { font-weight: 600; }
.pcl-weights { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.pcl-weights li {
  font: 500 .875rem/1 "Roboto Mono", monospace; padding: 8px 10px; border-radius: var(--md-shape-sm);
  background: var(--md-surface-container); color: var(--md-on-surface);
}
.pcl-weights li + li::before { content: "+"; margin-right: 8px; color: var(--md-on-surface-variant); }
.pcl-weights b { color: var(--md-primary); margin-right: 4px; }
.pcl-refs { margin-top: 0; }

@media (max-width: 900px) {
  .pcl-hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .pcl-items { max-width: 420px; }
  .pcl-calc__grid { grid-template-columns: 1fr; }
  /* The floating "Join CREST" button would sit on top of the result bar here. */
  body:has(#pcl-calc) .fab { display: none; }
  /* Phones and tablets: the result rides along at the bottom of the screen while answering. */
  .pcl-result {
    position: sticky; top: auto; bottom: 12px; z-index: 5;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; text-align: left; padding: 14px 18px;
  }
  .pcl-result__label { grid-column: 1 / -1; }
  .pcl-result__score { margin: 0; }
  .pcl-result__score span { font-size: 2.5rem; }
  .pcl-gauge, .pcl-gauge__labels { grid-column: 2; }
  .pcl-gauge__labels { margin-top: -2px; }
  .pcl-result__meta, .pcl-result__note { grid-column: 1 / -1; }
  .pcl-result__meta { margin: 6px 0 0; }
  .pcl-reset { grid-row: 2; grid-column: 3; margin: 0; }
  .pcl-gauge { grid-row: 2; }
}
@media (max-width: 600px) {
  .pcl-versions { grid-template-columns: 1fr; }
  .pcl-calc { padding: 22px 16px; margin-left: -4px; margin-right: -4px; }
  .pcl-q { grid-template-columns: 1fr; }
  .pcl-q__scale { justify-content: space-between; }
  .pcl-q__scale span { width: 46px; height: 46px; }
  .pcl-result__note { display: none; }
}

/* ---------- Cyborg Method page (reuses the PCL-5 hero, cards, and featured-block styles) ---------- */
/* How it works: four steps joined by a line, each with a colored icon. */
.cy-flow { margin: 0; padding: 24px; border-radius: var(--md-shape-xl); background: var(--md-surface-container-lowest); box-shadow: var(--md-elev-1); }
.cy-flow ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; }
.cy-flow ol::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--md-outline-variant); }
.cy-flow li { position: relative; display: flex; align-items: center; gap: 14px; animation: cy-in .6s var(--md-ease-decel) both; }
.cy-flow li:nth-child(2) { animation-delay: .12s; }
.cy-flow li:nth-child(3) { animation-delay: .24s; }
.cy-flow li:nth-child(4) { animation-delay: .36s; }
@keyframes cy-in { from { opacity: 0; transform: translateX(12px); } }
.cy-flow__icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--md-surface-container-high); color: var(--md-on-surface-variant);
}
.cy-flow .is-bot .cy-flow__icon { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.cy-flow .is-human .cy-flow__icon { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.cy-flow .is-done .cy-flow__icon { background: var(--md-primary); color: var(--md-on-primary); }
.cy-flow b { display: block; font-weight: 600; font-size: .9375rem; }
.cy-flow small { display: block; font-size: .8125rem; color: var(--md-on-surface-variant); }

.cy-logos { display: flex; gap: 10px; margin-top: auto; padding-top: 10px; }
.cy-logos img { height: 34px; width: auto; border-radius: var(--md-shape-sm); }
.cy-lede { margin-top: 18px; }

/* Cost comparison: a static graphic of cost per valid participant against the $4.80 budget. */
.cy-bars { display: grid; gap: 20px; margin: 4px 0 0; }
.cy-bar__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 500; }
.cy-bar__head strong { font-size: 2.5rem; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.cy-bar--with .cy-bar__head strong { color: var(--md-primary); }
.cy-bar--without .cy-bar__head strong { color: var(--md-tertiary); }
.cy-bar__track { position: relative; height: 26px; border-radius: 99px; background: color-mix(in srgb, var(--md-surface-container-lowest) 70%, transparent); }
.cy-bar__fill { height: 100%; border-radius: 99px; }
.cy-bar--with .cy-bar__fill { width: 24.9%; background: var(--md-primary); }   /* $4.86 of $19.53 */
.cy-bar--without .cy-bar__fill { width: 100%; background: var(--md-tertiary); }   /* $19.53, the longest bar */
/* $4.80 budget, as a share of $19.53 */
.cy-bar__budget { position: absolute; top: -5px; bottom: -5px; left: 24.6%; width: 2px; background: var(--md-on-surface); border-radius: 2px; }
.cy-bars__legend { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .875rem; }
.cy-bars__legend i { flex-shrink: 0; width: 2px; height: 16px; background: var(--md-on-surface); }

/* Figure */
.cy-figure { margin: 20px 0 0; padding: 16px; border-radius: var(--md-shape-xl); background: #fff; border: 1px solid var(--md-outline-variant); }
.cy-figure img { display: block; width: 100%; height: auto; border-radius: var(--md-shape-md); }
.cy-figure figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: .8125rem; color: #444; }
.cy-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cy-key--valid { background: #6fcfcf; }
.cy-key--invalid { background: #f5a09b; margin-left: 8px; }

/* Setup guide: numbered parts with a stepper inside */
.cy-part { margin-top: 28px; padding: 28px; border-radius: var(--md-shape-xl); background: var(--md-surface-container-lowest); }
.cy-part__head { display: flex; gap: 18px; align-items: flex-start; }
.cy-part__head h3 { font-size: 1.375rem; font-weight: 500; margin: 6px 0 6px; }
.cy-part__head p { margin: 0; max-width: 46em; color: var(--md-on-surface-variant); }
.cy-part__num {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.375rem; font-weight: 600; background: var(--md-primary); color: var(--md-on-primary);
}
.cy-steps { list-style: none; counter-reset: cy; margin: 24px 0 0; padding: 0 0 0 66px; display: grid; gap: 22px; position: relative; }
.cy-steps::before { content: ""; position: absolute; left: 23px; top: 6px; bottom: 6px; width: 2px; background: var(--md-outline-variant); }
.cy-steps > li {
  counter-increment: cy; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start;
}
.cy-steps > li::before {
  content: counter(cy); position: absolute; left: -58px; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .875rem; font-weight: 600;
  background: var(--md-primary-container); color: var(--md-on-primary-container); box-shadow: 0 0 0 4px var(--md-surface-container-lowest);
}
.cy-steps--single { padding-left: 66px; }
.cy-steps--single::before, .cy-steps--single > li::before { display: none; }
.cy-steps--single > li { grid-template-columns: minmax(0, 560px); }
.cy-step__text h4 { font-size: 1.0625rem; font-weight: 600; margin: 4px 0 6px; }
.cy-step__text p { margin: 0 0 10px; color: var(--md-on-surface-variant); }
.cy-steps img { display: block; width: 100%; height: auto; border-radius: var(--md-shape-md); border: 1px solid var(--md-outline-variant); box-shadow: var(--md-elev-1); background: #fff; }
.cy-step__shots { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; align-items: start; }
.cy-part code, .cy-rules code, .cy-code code {
  font: .8125rem "Roboto Mono", monospace; padding: 2px 6px; border-radius: 6px;
  background: var(--md-surface-container); color: var(--md-on-surface); word-break: break-all;
}
.cy-code {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 8px 8px 12px;
  border-radius: var(--md-shape-md); background: var(--md-surface-container);
}
.cy-code code { flex: 1; padding: 0; background: none; }
.cy-code .btn { flex-shrink: 0; height: 32px; padding: 0 10px; }
.cy-rules { margin: 0; padding-left: 1.2em; color: var(--md-on-surface-variant); }
.cy-rules li { margin: 6px 0; }

.cy-quote {
  margin: 16px 0 0; padding: 24px 28px; border-radius: var(--md-shape-xl); max-width: 52em;
  background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); border-left: 4px solid var(--md-tertiary);
}
.cy-quote p { margin: 0 0 16px; font-size: 1.0625rem; line-height: 1.6; font-style: italic; }

@media (max-width: 900px) {
  .cy-flow { max-width: 460px; }
  .cy-steps > li { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cy-part { padding: 20px 16px; }
  .cy-part__head { gap: 12px; }
  .cy-part__num { width: 40px; height: 40px; border-radius: 13px; font-size: 1.125rem; }
  .cy-steps, .cy-steps--single { padding-left: 42px; }
  .cy-steps::before { left: 13px; }
  .cy-steps > li::before { left: -42px; width: 28px; height: 28px; }
  .cy-step__shots { grid-template-columns: 1fr; }
  .cy-bar__head strong { font-size: 1.75rem; }
  .cy-quote { padding: 20px; }
}

/* ---------- Completed projects page (reuses the home page Projects cards) ---------- */
/* An image tile instead of a logo tile: the picture fills it edge to edge. */
.project__logo--photo { padding: 0; overflow: hidden; background: var(--md-surface-container-high); }
.project__logo--photo img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.project__logo--photo.is-left img { object-position: 12% 50%; }   /* one of the two brain scans */
.project__logo--photo.is-top img { object-position: 50% 0; }      /* the app's question */
.done-list { margin-top: 8px; }
.done-list .potd__title { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
.done-support {
  display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0;
  font-size: .8125rem; color: var(--md-on-surface-variant);
}
.done-support .material-symbols-rounded { font-size: 18px; color: var(--md-primary); }
.done-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.done-cta .pcl-calc__intro { margin: 0; }
@media (max-width: 600px) {
  .done-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Footer ---------- */
.footer { background: var(--md-surface-container); padding: 56px 0 32px; margin-top: 0; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--md-on-surface-variant); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--md-on-surface); text-decoration: none; font-size: .9rem; }
.footer a:hover { color: var(--md-primary); text-decoration: underline; }
.footer__contact { display: flex; align-items: center; gap: 10px; }
.footer__contact .material-symbols-rounded { color: var(--md-primary); font-size: 20px; }
.footer__base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--md-outline-variant); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .8125rem; color: var(--md-on-surface-variant); }
.footer__base a { font-size: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--md-outline-variant); text-underline-offset: 3px; }
.footer__base a:hover { color: var(--md-primary); text-decoration-color: currentColor; }

/* Extended FAB */
.fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px;
  border-radius: var(--md-shape-lg); text-decoration: none; font-weight: 500;
  background: var(--md-primary-container); color: var(--md-on-primary-container); box-shadow: var(--md-elev-3);
  transform: translateY(120px); transition: transform .35s var(--md-ease-emphasized);
}
.fab.show { transform: none; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--md-ease-decel), transform .6s var(--md-ease-decel); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 280px; width: 100%; margin: 8px auto 0; }
  .stats { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; padding: 32px; }
  .potd.pi-card { grid-template-columns: 1fr; gap: 24px; }
  .pi-card__photo { width: 160px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  /* Two people per row on tablets and phones. */
  .team-grid--3, .team-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid--3 .member__photo { aspect-ratio: 4 / 5; }
}
@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .container { padding: 0 16px; }
  .brand__sub { display: none; }
  .top-cta-label { display: none; }
  .top-cta { padding: 0 10px; }
  .top-cta .material-symbols-rounded { margin: 0; }
  .alum { grid-template-columns: 1fr; }
  .team-grid { gap: 12px; }
  .member__body { padding: 12px 14px 8px; }
  .member h4 { font-size: 1rem; }
  .member__role { margin-bottom: 6px; }
  .member__focus { font-size: .8125rem; }
  .potd.pi-card { padding: 28px 22px; }
  .pi-card__photo { width: 128px; }
  .resource { grid-template-columns: 40px 1fr; }
  .resource > .material-symbols-rounded { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .pub-tools { position: static; }
}
@media print {
  .top-bar, .fab, .pub-tools, .footer { display: none; }
  .reveal { opacity: 1; transform: none; }
}
