/* ==========================================================================
   Magic in the Mind — site styles
   Strict black / white / grayscale palette, no accent colour. (The only real
   colours on the site live inside the Stroop game board, in brain-lab.css.)
   Icons are inline SVG from Lucide (lucide.dev, ISC licence), sized and coloured here.
   Contrast notes (WCAG 2.x):
     #ffffff on #161616  18.1:1      #ffffff on #0a0a0a  19.8:1
     #d0d0d0 on #161616  12.0:1      (body copy on dark, ~ white at 82%)
     #0a0a0a on #ffffff  19.8:1      #4a4a4a on #ffffff   8.9:1
   Colour roles are custom properties so every component inverts
   cleanly between dark bands (default) and light bands.

   Motion rules: only transform and opacity are ever animated, durations stay
   between 150 and 600 ms, and prefers-reduced-motion collapses everything to
   its final, static state (see the end of this file).
   ========================================================================== */

/* Metric-matched local fallbacks, so text barely reflows when the web fonts
   arrive (font-display: swap). Sizes were measured against Times New Roman and
   Arial (Liberation Serif/Sans share their metrics). */
@font-face { font-family: "Fraunces Fallback"; font-weight: 100 500; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"); size-adjust: 107%; }
@font-face { font-family: "Fraunces Fallback"; font-weight: 501 900; src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Liberation Serif Bold"); size-adjust: 106%; }
@font-face { font-family: "Figtree Fallback"; font-weight: 100 550; src: local("Arial"), local("ArialMT"), local("Liberation Sans"); size-adjust: 100.6%; }
@font-face { font-family: "Figtree Fallback"; font-weight: 551 900; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"); size-adjust: 96.4%; }

:root {
  --black: #0a0a0a;
  --charcoal: #161616;
  --graphite: #262626;
  --white: #ffffff;
  --paper: #f4f4f4;
  --ink: #0a0a0a;
  --ink-soft: #4a4a4a;
  --line-paper: #e2e2e2;

  /* Role tokens — dark context (default) */
  --fg: var(--white);
  --fg-soft: rgba(255, 255, 255, 0.82);
  --rule: rgba(255, 255, 255, 0.22);
  --focus: var(--white);
  --accent-bg: var(--white);
  --accent-fg: var(--black);
  --accent-hover: #dedede;
  --ghost-line: rgba(255, 255, 255, 0.55);
  --ghost-hover: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-line: rgba(255, 255, 255, 0.14);

  --font-display: "Fraunces", "Fraunces Fallback", Georgia, serif;
  --font-body: "Figtree", "Figtree Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-small: 0.875rem;
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-lede: clamp(1.125rem, 1.04rem + 0.45vw, 1.375rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-h2: clamp(2rem, 1.55rem + 2vw, 3.25rem);
  --fs-h1: clamp(2.25rem, 1.4rem + 4.2vw, 5.25rem);

  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 2.5rem;
  --s6: 3rem; --s8: 4rem; --s10: 5rem; --s12: 6rem;
  --band-pad: clamp(4rem, 2.8rem + 5vw, 7.5rem);

  --maxw: 1160px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --header-h: 76px;
  --radius-card: 14px;
  --radius-img: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px -12px rgba(0, 0, 0, 0.45);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 160ms;
  --dur-2: 240ms;
  --dur-3: 400ms;
  --dur-4: 560ms;
}

/* Light context: flip the role tokens */
.band--light, .band--paper {
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --rule: rgba(0, 0, 0, 0.14);
  --focus: var(--ink);
  --accent-bg: var(--black);
  --accent-fg: var(--white);
  --accent-hover: #2e2e2e;
  --ghost-line: rgba(0, 0, 0, 0.5);
  --ghost-hover: rgba(0, 0, 0, 0.06);
  --card-bg: var(--white);
  --card-line: var(--line-paper);
  color: var(--fg);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--white);
  background: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--white); color: var(--black); }
.band--light ::selection, .band--paper ::selection { background: var(--black); color: var(--white); }

/* One consistent focus ring. Outlines follow each element's own radius. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--white); color: var(--black); font-weight: 700;
  padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

/* ---------- Cross-page view transitions (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: site-header; }
main { view-transition-name: page; }
::view-transition-old(page) { animation: vt-out var(--dur-1) var(--ease) both; }
::view-transition-new(page) { animation: vt-in 320ms var(--ease-out) both; }
::view-transition-group(site-header) { animation-duration: 0s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(780px + 2 * var(--gutter)); }

.band { padding-block: var(--band-pad); position: relative; }
.band--deep { background: var(--black); }
.band--dark { background: var(--charcoal); }
.band--light { background: var(--white); }
.band--paper { background: var(--paper); }
.band--tight { padding-block: clamp(3rem, 2.4rem + 2.5vw, 4.5rem); }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.02em; margin: 0 0 var(--s3);
  color: var(--fg);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; flex: none; }

.h2 { font-size: var(--fs-h2); margin-bottom: var(--s3); }
.h3 { font-size: var(--fs-h3); }
.lede { font-size: var(--fs-lede); line-height: 1.55; max-width: 44rem; color: var(--fg-soft); }
.prose { max-width: 42rem; }
.prose p + p { margin-top: 1.1em; }
.prose a, .link {
  color: inherit; text-decoration: underline; text-decoration-color: var(--ghost-line);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.prose a:hover, .link:hover { text-decoration-color: currentColor; }
.prose a:focus-visible, .link:focus-visible { border-radius: 3px; }

.section-head { margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head--center { text-align: center; }
.section-head--center .lede { margin-inline: auto; }

/* ---------- Buttons ----------
   Hover fills fade in on a ::before layer (opacity only); the button itself
   only ever moves with transform. */
.btn {
  --btn-bg: var(--accent-bg); --btn-fg: var(--accent-fg); --btn-hover: var(--accent-hover); --btn-line: var(--btn-bg);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.75rem 1.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; border-radius: 999px; border: 2px solid var(--btn-line);
  background: var(--btn-bg); color: var(--btn-fg); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-2) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
  background: var(--btn-hover); opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) {
  .btn:hover { transform: translate3d(0, -2px, 0); }
  .btn:hover::before { opacity: 1; }
  .btn:hover .lucide-arrow-right { transform: translate3d(3px, 0, 0); }
}
.btn:active { transform: translate3d(0, 0, 0) scale(0.97); transition-duration: 90ms; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); --btn-hover: var(--ghost-hover); --btn-line: var(--ghost-line); }
.btn--ghost::before { inset: 0; }
.btn--lg { min-height: 56px; padding: 0.9rem 1.8rem; font-size: 1.06rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem var(--s2); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/* Soft drop shadow that fades in once the page scrolls. */
.site-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.9);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.site-header.is-scrolled::before { opacity: 1; }
/* Scroll-progress hairline (scroll-driven animation where supported). */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: rgba(255, 255, 255, 0.9); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .site-header::after { animation: scroll-progress linear both; animation-timeline: scroll(root block); }
}
@keyframes scroll-progress { to { transform: scaleX(1); } }

.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--white); border-radius: 12px; }
.brand__mark {
  width: 46px; height: 46px; border-radius: 50%; background: var(--white);
  display: grid; place-items: center; flex: none; overflow: hidden;
  transition: transform var(--dur-3) var(--ease-out);
}
@media (hover: hover) { .brand:hover .brand__mark { transform: rotate(-8deg) scale(1.04); } }
.brand__mark img { width: 30px; height: 36px; object-fit: contain; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; white-space: nowrap; line-height: 1.05; letter-spacing: -0.01em; }

.nav__links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav__links a:not(.btn) {
  position: relative; isolation: isolate; display: inline-block; padding: 0.55rem 0.85rem; border-radius: 8px;
  color: rgba(255, 255, 255, 0.86); text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.nav__links a:not(.btn)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: rgba(255, 255, 255, 0.09); opacity: 0; transition: opacity var(--dur-1) var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--white); }
.nav__links a:not(.btn):hover::before { opacity: 1; }
.nav__links a[aria-current="page"]:not(.btn) { color: var(--white); }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.2rem;
  height: 2px; background: var(--white); border-radius: 2px;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--dur-2) var(--ease-out);
}
.nav__links a[aria-current="page"]:not(.btn)::after { transform: scaleX(1); }
.nav__links .btn { min-height: 42px; padding: 0.55rem 1.2rem; margin-left: 0.5rem; }
.nav__links .btn[aria-current="page"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }

.nav__toggle {
  position: relative; display: none; width: 48px; height: 48px; border-radius: 10px;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer;
  align-items: center; justify-content: center; color: var(--white);
  -webkit-tap-highlight-color: transparent; transition: transform var(--dur-1) var(--ease-out);
}
.nav__toggle::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 255, 255, 0.09);
  opacity: 0; transition: opacity var(--dur-1) var(--ease);
}
.nav__toggle:hover::before { opacity: 1; }
.nav__toggle:active { transform: scale(0.94); }
.nav__toggle svg {
  position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out);
}
.nav__toggle .icon-close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.nav__toggle[aria-expanded="true"] .icon-open { opacity: 0; transform: rotate(90deg) scale(0.6); }
.nav__toggle[aria-expanded="true"] .icon-close { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .js .nav__toggle { display: inline-flex; margin-left: auto; }
  .nav { flex-wrap: wrap; }
  /* The <nav> wrapper is an empty flex item once its list is absolutely positioned;
     drop the gap so the toggle sits flush with the right gutter. */
  .js .nav { column-gap: 0; }
  /* Without JS the links simply wrap under the brand */
  .nav__links { flex-wrap: wrap; width: 100%; padding-bottom: var(--s2); }
  .js .nav__links {
    display: flex; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--black); padding: var(--s1) var(--gutter) var(--s3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.6);
    visibility: hidden; opacity: 0; transform: translate3d(0, -10px, 0);
    transition: opacity var(--dur-1) var(--ease), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
  }
  .js .nav__links.is-open {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out), visibility 0s;
  }
  .js .nav__links li { opacity: 0; transform: translate3d(0, -6px, 0); transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
  .js .nav__links.is-open li {
    opacity: 1; transform: none;
    transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out);
  }
  .js .nav__links.is-open li:nth-child(2) { transition-delay: 40ms; }
  .js .nav__links.is-open li:nth-child(3) { transition-delay: 80ms; }
  .js .nav__links.is-open li:nth-child(4) { transition-delay: 120ms; }
  .js .nav__links a:not(.btn) { display: block; padding: 0.85rem 0.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; font-size: 1.05rem; }
  .js .nav__links a:not(.btn)::after { left: 0.25rem; right: auto; width: 28px; bottom: 0.45rem; }
  .js .nav__links .btn { margin: var(--s2) 0 0; width: 100%; min-height: 48px; }
}
@media (max-width: 420px) {
  .brand__name { font-size: 1.02rem; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__mark img { width: 26px; height: 31px; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--charcoal);
  padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(4rem, 2.5rem + 6vw, 7.5rem);
  min-height: min(calc(100svh - var(--header-h)), 880px);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}
/* Neuron network canvas (assets/js/neurons.js). Masked so it stays behind the
   photo side and fades out under the headline. */
.net {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  pointer-events: none; opacity: 0; transition: opacity var(--dur-4) var(--ease);
  -webkit-mask-image: linear-gradient(100deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.5) 35%, #000 62%);
          mask-image: linear-gradient(100deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.5) 35%, #000 62%);
}
.net.is-ready { opacity: 1; }
@media (max-width: 900px) {
  .net {
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 45%, #000 100%);
            mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 45%, #000 100%);
  }
}
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem); align-items: center; position: relative;
}
.hero__title { font-size: var(--fs-h1); font-weight: 600; line-height: 1.03; letter-spacing: -0.028em; margin-bottom: var(--s4); text-wrap: initial; }
.hero__title .typed-line { display: block; min-height: 1.1em; }
.type-word {
  font-style: italic; font-weight: 500; color: var(--white);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.caret {
  display: inline-block; width: 0.07em; height: 0.82em; margin-left: 0.06em;
  background: var(--white); vertical-align: -0.04em; border-radius: 1px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__sub { font-size: var(--fs-lede); line-height: 1.55; color: var(--fg-soft); max-width: 36rem; margin-bottom: var(--s5); }

/* "New: Brain Lab" pill under the hero buttons */
.pill-link {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 0.7rem; margin-top: var(--s4);
  padding: 0.4rem 0.9rem 0.4rem 0.4rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22); text-decoration: none; color: var(--white);
  font-weight: 600; font-size: 0.95rem; line-height: 1.25;
  transition: transform var(--dur-2) var(--ease-out);
}
.pill-link::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: rgba(255, 255, 255, 0.08); opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.pill-link__tag {
  background: var(--white); color: var(--black); border-radius: 999px; padding: 0.2rem 0.6rem;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.pill-link svg { width: 16px; height: 16px; flex: none; transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) {
  .pill-link:hover { transform: translate3d(0, -2px, 0); }
  .pill-link:hover::before { opacity: 1; }
  .pill-link:hover svg { transform: translate3d(3px, 0, 0); }
}
.pill-link:active { transform: scale(0.98); }

.hero__media { position: relative; justify-self: end; width: 100%; max-width: 460px; }
.hero__photo {
  aspect-ratio: 1 / 1; border-radius: var(--radius-img); overflow: hidden;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.6);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.hero__badge {
  position: absolute; left: -38px; bottom: 36px; z-index: 2;
  width: 124px; height: 124px; border-radius: 50%; background: var(--white);
  display: grid; place-items: center; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.55);
  border: 6px solid var(--charcoal);
}
.hero__badge img { width: 68px; height: 84px; object-fit: contain; }
.hero__caption {
  margin-top: var(--s2); font-size: var(--fs-small); color: rgba(255, 255, 255, 0.8);
  padding-left: 110px;
}

/* Load-in choreography for the hero (motion-safe only). */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__intro > * { animation: rise var(--dur-4) var(--ease-out) both; }
  .js .hero__intro > :nth-child(2) { animation-delay: 70ms; }
  .js .hero__intro > :nth-child(3) { animation-delay: 140ms; }
  .js .hero__intro > :nth-child(4) { animation-delay: 210ms; }
  .js .hero__intro > :nth-child(5) { animation-delay: 280ms; }
  .js .hero__media { animation: rise var(--dur-4) var(--ease-out) 160ms both; }
  .js .hero__badge { animation: pop var(--dur-4) var(--ease-out) 380ms both; }
}
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.7) rotate(-12deg); } }

@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__media { justify-self: start; max-width: 520px; margin-top: 1.25rem; }
  .hero__photo { aspect-ratio: 4 / 3; }
  .hero__photo img { object-position: 50% 50%; }
  .hero__badge { left: auto; right: 18px; bottom: auto; top: -46px; width: 96px; height: 96px; border-width: 5px; }
  .hero__badge img { width: 52px; height: 64px; }
  .hero__caption { padding-left: 0; }
}

/* ---------- Photos: grayscale that eases to colour ----------
   A zero-saturation layer in "saturation" blend mode greys the photo out; fading
   that layer's opacity reveals the colour, so only opacity is animated. On
   touch screens (no hover) main.js adds .is-color once the photo is in view. */
.photo { position: relative; isolation: isolate; }
.photo::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: #808080; mix-blend-mode: saturation;
  transition: opacity var(--dur-4) var(--ease);
}
.photo:hover::after, .photo:focus-within::after, .photo.is-color::after { opacity: 0; }
.photo img { transition: transform 600ms var(--ease-out); }
@media (hover: hover) { .photo:hover img { transform: scale(1.025); } }

/* ---------- Stats ---------- */
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: var(--s2) clamp(1rem, 0.5rem + 1.5vw, 2rem); border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__num {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.75rem, 2rem + 3vw, 4.25rem); line-height: 1; letter-spacing: -0.03em;
  color: var(--white); margin-bottom: var(--s2); font-variant-numeric: lining-nums tabular-nums;
}
.stat__label { display: block; color: var(--fg-soft); font-size: 1rem; line-height: 1.45; max-width: 17rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: minmax(0, 1fr); row-gap: var(--s4); }
  .stat, .stat:first-child { border-left: 0; padding: 0 0 var(--s4); border-bottom: 1px solid var(--rule); }
  .stat:last-child { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 480px) {
  .btn-row .btn { flex: 1 1 100%; }
}

/* ---------- Mission ---------- */
.mission { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.mission .h2 { position: sticky; top: calc(var(--header-h) + 2rem); }
.mission .prose { font-size: var(--fs-lede); line-height: 1.6; max-width: none; }
@media (max-width: 900px) {
  .mission { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .mission .h2 { position: static; }
}

/* ---------- Split (image + text) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 5vw, 6rem); align-items: center; }
.split__media { border-radius: var(--radius-img); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow); max-width: 560px; width: 100%; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: var(--s4); }
.chip {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--ghost-line); font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  transition: transform var(--dur-2) var(--ease-out);
}
.chip::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--ghost-hover); opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.chip svg { width: 16px; height: 16px; flex: none; transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) {
  .chip:hover { transform: translate3d(0, -2px, 0); }
  .chip:hover::before { opacity: 1; }
  .chip:hover svg { transform: rotate(-10deg) scale(1.15); }
}

/* ---------- Statement (large centred copy) ---------- */
.statement {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.35rem); line-height: 1.3; letter-spacing: -0.01em;
  max-width: 48rem; margin: 0 auto var(--s3); text-wrap: balance;
}
.statement + .lede { margin-inline: auto; }

/* ---------- Brain Lab promo (home) ---------- */
.labpromo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.labpromo .lede { margin-bottom: var(--s4); }
.labpromo__list { list-style: none; display: grid; gap: 0.75rem; counter-reset: lab; }
.lab-link {
  --fg: var(--white); --fg-soft: rgba(255, 255, 255, 0.78); --focus: var(--ink);
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.1rem;
  padding: 1.15rem 1.35rem; border-radius: var(--radius-card);
  background: var(--black); color: var(--fg); text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out);
}
.lab-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.7); opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.lab-link__icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); color: var(--black); transition: transform var(--dur-3) var(--ease-out);
}
.lab-link__icon svg { width: 24px; height: 24px; }
.lab-link__title { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.lab-link__desc { display: block; color: var(--fg-soft); font-size: 0.98rem; line-height: 1.4; margin-top: 0.15rem; }
.lab-link > svg { width: 20px; height: 20px; transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) {
  .lab-link:hover { transform: translate3d(0, -3px, 0); }
  .lab-link:hover::before { opacity: 1; }
  .lab-link:hover .lab-link__icon { transform: rotate(-8deg) scale(1.06); }
  .lab-link:hover > svg { transform: translate3d(4px, 0, 0); }
}
.lab-link:active { transform: scale(0.985); transition-duration: 90ms; }
@media (max-width: 900px) { .labpromo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) {
  .lab-link { gap: 0.85rem; padding: 1rem; }
  .lab-link__icon { width: 44px; height: 44px; }
}

/* ---------- CTA band ---------- */
.cta { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.cta__title { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3.1rem); max-width: 15.5em; } /* ~24ch of Fraunces, in em so the limit is the same in the fallback font */
.cta__text { color: var(--fg-soft); margin-top: var(--s2); max-width: 40rem; }
.cta--center { flex-direction: column; text-align: center; justify-content: center; }
.cta--center .cta__title { margin-inline: auto; }

/* ---------- Page header ---------- */
.page-head { background: var(--charcoal); padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem) clamp(3rem, 2rem + 3.5vw, 5rem); position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; width: 640px; height: 640px; right: -240px; top: -300px; border-radius: 50%;
  background: repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 30px);
  pointer-events: none;
}
.page-head h1 { font-size: clamp(2.5rem, 1.8rem + 3.4vw, 4.5rem); letter-spacing: -0.025em; margin-bottom: var(--s3); max-width: 11.65em; position: relative; } /* ~18ch of Fraunces */
.page-head .lede { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .js .page-head .container > * { animation: rise var(--dur-4) var(--ease-out) both; }
  .js .page-head .container > :nth-child(2) { animation-delay: 70ms; }
  .js .page-head .container > :nth-child(3) { animation-delay: 140ms; }
  .js .page-head .container > :nth-child(4) { animation-delay: 210ms; }
}

/* ---------- Locations ---------- */
.loc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4.5vw, 5.5rem); align-items: center; }
.loc--flip .loc__media { order: 2; }
.loc__name { font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.6rem); margin-bottom: var(--s2); }
.loc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 var(--s3); font-weight: 600; font-size: 0.98rem; }
.loc__meta .place { display: inline-flex; align-items: center; gap: 0.4rem; }
.loc__meta svg { width: 18px; height: 18px; flex: none; }
.loc__text p { max-width: 36rem; }
.loc__text p:not(.loc__meta) { color: var(--fg-soft); }

.frame { border-radius: var(--radius-img); overflow: hidden; background: rgba(0, 0, 0, 0.15); box-shadow: var(--shadow); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.loc__media { width: 100%; }
.loc__media > .frame--landscape { aspect-ratio: 4 / 3; }

.gallery { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; }
.gallery .frame { aspect-ratio: 3 / 4; }
.gallery .frame--wide { grid-column: 1 / -1; aspect-ratio: 3 / 2; }

@media (max-width: 900px) {
  .loc { grid-template-columns: minmax(0, 1fr); }
  .loc--flip .loc__media { order: 0; }
}
@media (max-width: 480px) {
  .gallery { gap: 0.6rem; }
}

/* Libraries without photos: clean text cards */
.loc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s4); }
.loc-card {
  border-radius: var(--radius-card); border: 1px solid var(--line-paper); background: var(--paper);
  padding: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  display: flex; flex-direction: column; gap: var(--s2);
}
.loc-card .loc__name { margin-bottom: 0; }
.loc-card .loc__meta { margin: 0; }
.loc-card p:not(.loc__meta) { color: var(--ink-soft); }

/* Locations run as a long sequence of bands: tighter rhythm than marketing sections */
.band--loc { padding-block: clamp(3.5rem, 2.6rem + 3.5vw, 5.5rem); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-person { margin-bottom: var(--s4); }
.contact-person h2 { font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem); margin-bottom: 0.2rem; }
.contact-person .role { font-weight: 700; color: var(--fg-soft); }
.contact-list { list-style: none; display: grid; gap: var(--s2); }
.contact-list a {
  display: flex; align-items: center; gap: 0.9rem; text-decoration: none;
  padding: 0.35rem 0; border-radius: 8px; word-break: break-word;
}
.contact-list a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.contact-list .ico {
  position: relative; isolation: isolate;
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--rule);
  transition: transform var(--dur-2) var(--ease-out);
}
.contact-list .ico::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--ghost-hover); opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
@media (hover: hover) {
  .contact-list a:hover .ico { transform: rotate(-8deg); }
  .contact-list a:hover .ico::before { opacity: 1; }
}
.contact-list .ico svg { width: 20px; height: 20px; }
.contact-list small { display: block; font-size: 0.85rem; color: var(--fg-soft); }

/* Dark card on a light band — the inverse of the band around it */
.contact-card {
  --fg: var(--white); --fg-soft: rgba(255, 255, 255, 0.82); --rule: rgba(255, 255, 255, 0.22); --focus: var(--white);
  --accent-bg: var(--white); --accent-fg: var(--black); --accent-hover: #dedede;
  --ghost-line: rgba(255, 255, 255, 0.55); --ghost-hover: rgba(255, 255, 255, 0.1);
  background: var(--black); color: var(--fg); border-radius: var(--radius-card);
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}
.contact-card h2 { font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem); margin-bottom: 0.4rem; }
.contact-card .card-intro { color: var(--fg-soft); margin-bottom: var(--s4); }
.contact-card .address {
  font-family: var(--font-display); font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); line-height: 1.3;
  margin-bottom: var(--s4); word-break: break-word;
}
.copy-btn { display: none; }
.js .copy-btn { display: inline-flex; }
.copy-status { margin-top: var(--s2); font-size: 0.95rem; color: var(--fg-soft); min-height: 1.5em; }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100svh - var(--header-h) - 280px); display: flex; align-items: center; overflow: hidden; }
.notfound .container { position: relative; }
.notfound__code { font-family: var(--font-display); font-size: clamp(5rem, 3rem + 10vw, 10rem); line-height: 0.9; color: var(--white); font-weight: 600; font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; margin-bottom: var(--s3); }
.notfound .btn-row { margin-top: var(--s4); }
@media (prefers-reduced-motion: no-preference) {
  .js .notfound .container > * { animation: rise var(--dur-4) var(--ease-out) both; }
  .js .notfound .container > :nth-child(2) { animation-delay: 70ms; }
  .js .notfound .container > :nth-child(3) { animation-delay: 140ms; }
  .js .notfound .container > :nth-child(4) { animation-delay: 210ms; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--black); padding-block: clamp(3.5rem, 2.5rem + 3vw, 5rem) var(--s4); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.footer-logo { display: block; width: 150px; background: var(--white); border-radius: var(--radius-card); padding: 0.75rem 1rem; margin-bottom: var(--s3); transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) { .footer-logo:hover { transform: rotate(-2deg) scale(1.02); } }
.footer-logo img { width: 100%; height: auto; }
.footer-tag { color: rgba(255, 255, 255, 0.85); max-width: 22rem; }
.site-footer h2 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--white); letter-spacing: 0.01em; margin-bottom: var(--s2); }
.footer-links { list-style: none; display: grid; gap: 0.35rem; }
.footer-links a { text-decoration: none; color: rgba(255, 255, 255, 0.85); padding: 0.15rem 0; display: inline-block; border-radius: 4px; word-break: break-word; }
.footer-links a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { padding-top: var(--s4); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Reveal (JS-only enhancement) ----------
   main.js adds .is-visible via IntersectionObserver; children of [data-stagger]
   get an increasing --reveal-delay. */
.js .reveal {
  opacity: 0; transform: translate3d(0, 18px, 0);
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion: everything instant and static ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: 0.01ms !important; transition-delay: 0s !important;
  }
  /* The progress hairline is driven by scrolling itself, not by time. */
  .site-header::after { animation-duration: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .caret { display: none; }
  .net { opacity: 1; }
}
