/* ARM — Mind, Medicine & Making */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto-italic-latin.woff2') format('woff2');
}
/* Only the dawn clock's digits keep the serif. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/fraunces-digits.woff2') format('woff2');
  unicode-range: U+0020, U+0030-003A;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0b1118;
  --ink-2: #111a24;
  --ink-3: #18242f;
  --fog: #ece7df;
  --fog-dim: rgba(236, 231, 223, 0.74);
  --fog-faint: rgba(236, 231, 223, 0.58);
  --line: rgba(236, 231, 223, 0.14);
  --line-strong: rgba(236, 231, 223, 0.28);
  --gate: #e4572e;
  --gate-hover: #f06a43;
  --gate-deep: #c0362c;
  --gate-ink: #a8321f;
  --dawn: #f2b880;
  --bay: #1d4651;
  --dti-blue: #6d93ff;
  --studio: #120e0b;
  --earth: #15100c;
  --earth-2: #1e1712;
  --maiz: #e3b23c;
  --maiz-soft: #f0cf72;
  --nopal: #8fbf6a;
  --chile: #b5432f;
  --paper: #efe9df;
  --paper-2: #e6dfd2;
  --paper-ink: #16202a;
  --paper-dim: rgba(22, 32, 42, 0.76);
  --paper-line: rgba(22, 32, 42, 0.14);

  --font-display: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-text: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  
  --font-coord: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-clock: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;

  --gutter: clamp(16px, 4.6vw, 64px);
  --wrap: 1360px;
  --masthead-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --section-pad: clamp(5rem, 11vw, 10rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--masthead-h);
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--fog);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: italic; }

:focus-visible {
  outline: 2px solid var(--gate);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.visually-hidden {
  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: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--fog);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ───────── Type ───────── */

.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
  font-variation-settings: 'opsz' 144;
  text-wrap: balance;
}
.display em { color: var(--gate); font-weight: 300; }
.display { overflow-wrap: break-word; }
.chapter-head > * { min-width: 0; }
/* Roboto sets wider than the old serif: on the narrowest phones, long words like "Neuropsychology," must still fit. */
@media (max-width: 360px) { .display { font-size: 2.25rem; } }

.body-lg {
  font-size: clamp(1.125rem, 1.55vw, 1.375rem);
  line-height: 1.5;
  color: var(--fog-dim);
  max-width: 40ch;
  text-wrap: pretty;
}
.body {
  color: var(--fog-dim);
  max-width: 58ch;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-dim);
}
.eyebrow__mark {
  position: relative;
  width: 2px;
  height: 14px;
  background: var(--gate);
  flex: none;
}
.eyebrow__mark::after {
  content: '';
  position: absolute;
  left: 2px; top: 0;
  width: 14px; height: 7px;
  border-top: 1.5px solid var(--gate);
  border-radius: 100% 0 0 0;
  opacity: 0.8;
}

/* ───────── Buttons ───────── */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--gate);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
.button:hover { background: var(--gate-hover); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(228, 87, 46, 0.7); }
.button:active { transform: translateY(0); }
.button--small { padding: 0.6rem 1.05rem; font-size: 0.875rem; }
.button--ink { background: var(--paper-ink); color: var(--paper); }
.button--ink:hover { background: #24313d; box-shadow: 0 10px 30px -14px rgba(22, 32, 42, 0.7); }
.button--maiz { background: var(--maiz); color: var(--earth); }
.button--maiz:hover { background: var(--maiz-soft); box-shadow: 0 10px 30px -12px rgba(227, 178, 60, 0.6); }

/* ───────── Masthead ───────── */

.masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--masthead-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top, 0);
  color: var(--fog);
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.masthead.is-scrolled {
  background: rgba(11, 17, 24, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
html[data-masthead='light'] .masthead.is-scrolled {
  background: rgba(239, 233, 223, 0.86);
  color: var(--paper-ink);
  border-bottom-color: var(--paper-line);
}
.no-js .masthead { background: rgba(11, 17, 24, 0.88); border-bottom-color: var(--line); }
html.menu-open .masthead { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--fog); }

.brand {
  transition: opacity 0.35s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  font-variation-settings: 'opsz' 48;
}
.brand__glyph { width: 46px; height: 18px; overflow: visible; }
.brand__glyph path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.brand__deck { opacity: 0.55; }
.brand__tower { stroke-width: 2.2 !important; }
.brand__cable--base { opacity: 0.32; }
.brand__cable--progress {
  stroke: var(--gate) !important;
  stroke-width: 2 !important;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--page-progress, 0));
}

.nav__list { display: flex; gap: clamp(1rem, 2.2vw, 2.25rem); }
.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0;
  font-size: 0.9375rem;
  text-decoration: none;
  opacity: 0.86;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.1rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.nav__link:hover { opacity: 1; }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link[aria-current='true'] { opacity: 1; color: var(--gate); }
.nav__link[aria-current='true']::after { transform: scaleX(1); }
html[data-masthead='light'] .masthead.is-scrolled .nav__link[aria-current='true'] { color: var(--gate-ink); }

.masthead__actions { display: flex; align-items: center; gap: 0.75rem; }

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { border-color: currentColor; }
html[data-masthead='light'] .masthead.is-scrolled .motion-toggle { border-color: var(--paper-line); }
.motion-toggle__icon {
  position: relative;
  width: 9px; height: 10px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.motion-toggle[aria-pressed='true'] .motion-toggle__icon {
  border: 0;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.menu-button {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}
.menu-button span {
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.menu-button span:nth-child(1) { top: 17px; }
.menu-button span:nth-child(2) { top: 25px; }
.menu-button[aria-expanded='true'] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-button[aria-expanded='true'] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  align-content: center;
  gap: 2.5rem;
  padding: calc(var(--masthead-h) + 2rem) var(--gutter) 3rem;
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(228, 87, 46, 0.16), transparent 60%),
    var(--ink);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-out), visibility 0s linear 0.7s;
}
.mobile-menu.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.7s var(--ease-out), visibility 0s;
}
.mobile-menu__list { display: grid; gap: 0.35rem; }
.mobile-menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  line-height: 1.1;
  text-decoration: none;
  font-variation-settings: 'opsz' 144;
}
.mobile-menu__num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gate); letter-spacing: 0.1em; width: 1.6rem; flex: none; }
.mobile-menu__coords { font-family: var(--font-coord); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--fog-faint); }

/* ───────── Scenes (pinned scroll stages) ───────── */

.scene-track { position: relative; }
.scene-stage { position: relative; overflow: hidden; }

.arm-ready .scene-track { height: var(--track, 300vh); }
.arm-ready .scene-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}

/* ───────── Hero ───────── */

.hero { position: relative; background: var(--ink); }
.hero__track { --track: 290vh; }
.hero__stage { min-height: 100vh; min-height: 100svh; }

.hero__poster, .hero__poster img, .hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__poster img { object-fit: cover; object-position: 42% 50%; }
.hero__canvas { opacity: 0; transition: opacity 0.6s ease; }
.hero__canvas.is-live { opacity: 1; }

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 17, 24, 0.6) 0%, rgba(11, 17, 24, 0.08) 24%, rgba(11, 17, 24, 0.18) 46%, rgba(11, 17, 24, 0.88) 100%),
    linear-gradient(90deg, rgba(11, 17, 24, 0.62) 0%, rgba(11, 17, 24, 0.34) 38%, rgba(11, 17, 24, 0) 68%),
    radial-gradient(90% 70% at 0% 100%, rgba(11, 17, 24, 0.7), transparent 70%);
}

.hero__fog { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: calc(0.55 + var(--hp, 0) * 0.35); }
.hero__fog span {
  position: absolute;
  width: 90vmax; height: 40vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(236, 231, 223, 0.2), rgba(236, 231, 223, 0));
  mix-blend-mode: screen;
  animation: fog-drift 46s ease-in-out infinite alternate;
}
.hero__fog span:nth-child(1) { left: -30vmax; bottom: 4vh; }
.hero__fog span:nth-child(2) { right: -40vmax; bottom: 22vh; animation-duration: 62s; animation-delay: -18s; opacity: 0.7; }
@keyframes fog-drift {
  from { transform: translate3d(-6vw, 0, 0) scale(1); }
  to { transform: translate3d(14vw, -3vh, 0) scale(1.15); }
}

.hero__content {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(5.5rem, 14vh, 9.5rem);
  transform: translate3d(0, calc(var(--hp, 0) * -16vh), 0);
  opacity: calc(1 - clamp(0, (var(--hp, 0) - 0.66) * 3.6, 1));
}
.hero__eyebrow { color: var(--fog); margin-bottom: clamp(1rem, 2.5vh, 1.75rem); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.3rem, 11.5vw, 11rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 144;
  text-shadow: 0 0 48px rgba(11, 17, 24, 0.55), 0 2px 14px rgba(11, 17, 24, 0.35);
}
.hero__line { display: block; }
.hero__line--indent { padding-left: 0.62em; font-style: italic; }
.hero__lede {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  max-width: 30ch;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.4;
  color: var(--fog);
}
.hero__lede em { font-family: var(--font-display); font-style: italic; color: var(--dawn); font-size: 1.08em; }
.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: clamp(1.4rem, 3.4vh, 2.4rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line-strong);
  max-width: 64rem;
  font-size: 0.9375rem;
  color: var(--fog-dim);
}
.hero__roles li { display: inline-flex; gap: 0.6rem; align-items: baseline; }
.hero__role-num { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--gate); letter-spacing: 0.08em; }

.hero__meta {
  position: absolute;
  top: calc(var(--masthead-h) + clamp(1rem, 4vh, 2.5rem));
  right: var(--gutter);
  display: grid;
  gap: 1rem;
  justify-items: end;
  text-align: right;
  font-family: var(--font-coord);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-dim);
}
.hero__clock { display: grid; gap: 0.2rem; justify-items: end; }
.hero__clock-time {
  font-family: var(--font-clock);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0;
  color: var(--fog);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'opsz' 72;
}

.hero__cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fog);
  opacity: calc(1 - var(--hp, 0) * 3);
}
.hero__cue-line {
  position: relative;
  width: 1px; height: 46px;
  background: var(--line-strong);
  overflow: hidden;
}
.hero__cue-line::after {
  content: '';
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: var(--gate);
  animation: cue 2.2s var(--ease-in-out) infinite;
}
@keyframes cue { to { top: 100%; } }

.hero__veil {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: clamp(0, (var(--hp, 0) - 0.84) * 6.5, 1);
  pointer-events: none;
}

/* Hero arrival after the intro (without the class, text is simply visible) */
.hero-arrive .hero__line,
.hero-arrive .hero__lede,
.hero-arrive .hero__roles,
.hero-arrive .hero__eyebrow {
  animation: rise 1.3s var(--ease-out) both;
}
.hero-arrive .hero__eyebrow { animation-delay: 0.1s; }
.hero-arrive .hero__line:nth-child(1) { animation-delay: 0.18s; }
.hero-arrive .hero__line:nth-child(2) { animation-delay: 0.3s; }
.hero-arrive .hero__lede { animation-delay: 0.48s; }
.hero-arrive .hero__roles { animation-delay: 0.62s; }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 0.6em, 0); }
  to { opacity: 1; transform: none; }
}

/* ───────── The Bridge ───────── */

.bridge { position: relative; background: var(--ink); color: var(--fog); }
.bridge__track { --track: 680vh; }
.bridge__stage {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(70% 55% at 62% 42%, rgba(29, 70, 81, 0.35), transparent 70%),
    var(--ink);
}
.bridge__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.bridge__hud {
  position: absolute;
  inset: calc(var(--masthead-h) + 1.25rem) var(--gutter) 1.5rem;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-faint);
}
.bridge__fig { position: absolute; top: 0; right: 0; display: grid; text-align: right; }
.bridge__fig span { grid-area: 1 / 1; transition: opacity 0.6s ease; }
.bridge__fig-b { opacity: 0; }
.bridge__stage[data-phase='brain'] .bridge__fig-a { opacity: 0; }
.bridge__stage[data-phase='brain'] .bridge__fig-b { opacity: 1; }
.bridge__legend {
  position: absolute;
  top: 2.2rem; right: 0;
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.bridge__stage[data-phase='brain'] .bridge__legend { opacity: 1; }
.bridge__legend li { display: inline-flex; gap: 0.5rem; align-items: center; }
.swatch { width: 18px; height: 2px; border-radius: 2px; }
.swatch--red { background: var(--gate); }
.swatch--blue { background: var(--dti-blue); }
.swatch--fog { background: var(--fog); opacity: 0.6; }
.bridge__hint { position: absolute; right: 0; bottom: 0; display: none; }
@media (hover: hover) and (pointer: fine) {
  .arm-ready .bridge__hint { display: block; }
}

.bridge__captions { position: relative; padding-block: calc(var(--masthead-h) + 2rem) 3rem; display: grid; gap: 2.5rem; }
.bridge__title { margin-bottom: 0.5rem; }
.caption__kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--fog);
  font-variation-settings: 'opsz' 96;
}
.caption__text {
  margin-top: 0.9rem;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.5;
  color: var(--fog-dim);
}

.arm-ready .bridge__captions {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--masthead-h) + 1.25rem);
  bottom: clamp(2rem, 9vh, 6rem);
  padding: 0;
  display: block;
  pointer-events: none;
}
.arm-ready .bridge__title { position: absolute; left: 0; top: 0; margin: 0; }
.arm-ready .caption {
  position: absolute;
  left: 0; bottom: 0;
  width: min(34rem, 100%);
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.55s ease, transform 0.9s var(--ease-out);
}
.arm-ready .caption.is-active { opacity: 1; transform: none; }

.bridge__meter {
  position: absolute;
  left: calc(var(--gutter) * 0.45);
  top: 50%;
  width: 1px;
  height: 28vh;
  transform: translateY(-50%);
  background: var(--line);
  display: none;
}
.arm-ready .bridge__meter { display: block; }
.bridge__meter span {
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  height: 100%;
  background: var(--gate);
  transform-origin: top;
  transform: scaleY(var(--bp, 0));
}

/* ───────── About ───────── */

.about {
  position: relative;
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 6.5rem);
  align-items: center;
}
.about__portrait { position: relative; }
.about__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 40% 50%;
  border-radius: 3px;
  filter: saturate(0.92) contrast(1.02);
}
.about__portrait::before {
  content: '';
  position: absolute;
  left: -14px; top: 8%;
  width: 2px; height: 84%;
  background: var(--gate);
}
.about__text { display: grid; gap: 1.5rem; }
.about__title { font-size: clamp(2.4rem, 5vw, 5rem); }
.about__text .body-lg { max-width: 46ch; }

.practice-links { margin-top: 1rem; border-bottom: 1px solid var(--line); }
.practice-links a {
  display: grid;
  grid-template-columns: 2.4rem minmax(7rem, 10rem) 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.3s ease, padding 0.45s var(--ease-out);
}
.practice-links a:hover { padding-left: 0.5rem; }
.practice-links__num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gate); }
.practice-links__name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; line-height: 1.1; }
.practice-links__desc { color: var(--fog-dim); font-size: 0.975rem; }
.practice-links__arrow { color: var(--fog-faint); transition: transform 0.4s var(--ease-out), color 0.3s ease; }
.practice-links a:hover .practice-links__arrow { color: var(--gate); transform: translateX(4px); }

/* ───────── Chapter heads ───────── */

.chapter-head {
  display: grid;
  gap: 1.5rem;
  padding-block: var(--section-pad) clamp(3rem, 7vw, 6rem);
}
.chapter-head__title { max-width: 14ch; }
.chapter-head__lede { max-width: 46ch; }
.cable-rule { width: 100%; height: 44px; margin-bottom: 1rem; overflow: visible; }
.cable-rule path { fill: none; stroke: var(--line-strong); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.arm-ready .cable-rule path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s var(--ease-out); }
.arm-ready .cable-rule.is-in path { stroke-dashoffset: 0; }

/* Span drawings above the chapter heads: the Hollywood Hills and the Coronado Bridge. */
.chapter-head { --span-art-h: clamp(118px, 19vw, 272px); }
.span-art { position: relative; height: var(--span-art-h); margin-bottom: 1.25rem; touch-action: pan-y; }
.span-art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.span-art .cable-rule { position: absolute; left: 0; bottom: 0; margin: 0; }
.span-art.is-live .cable-rule { visibility: hidden; }
.no-js .span-art, .span-art.is-failed { height: auto; }
.no-js .span-art canvas, .span-art.is-failed canvas { display: none; }
.no-js .span-art .cable-rule, .span-art.is-failed .cable-rule { position: static; margin-bottom: 1rem; }
.span-art__label {
  position: absolute;
  right: 0;
  bottom: -1.4rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog-dim);
}
.no-js .span-art__label, .span-art.is-failed .span-art__label { position: static; text-align: right; }
.mind .span-art__label { color: var(--paper-dim); }

.chapter-cta { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* ───────── Span I: Making ───────── */

.making { position: relative; background: var(--studio); color: var(--fog); }

.studio__track { --track: 470vh; }
.studio__stage {
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(80% 60% at 40% 45%, #2a1f17 0%, var(--studio) 70%);
}
.studio__rig {
  position: relative;
  width: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}
.studio__photo img { width: 100%; height: auto; }
.studio__rig[data-cover='partial']:not([data-mode='static']) .studio__photo {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
}
.arm-ready .studio__rig { position: absolute; left: 0; top: 0; transform: scale(var(--zoom, 1)); }
.arm-ready .studio__photo img { height: 100%; }

.screen { display: none; }
.arm-ready .screen {
  display: block;
  position: absolute;
  left: 0; top: 0;
  width: 1600px;
  height: 1000px;
  transform-origin: 0 0;
  overflow: hidden;
  background: #f7f3ec;
  color: #1b1712;
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  box-shadow: 0 0 0 7px #121314;
}
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 40%), linear-gradient(0deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.screen__chat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
  padding: 0 170px;
  background: #1d1915;
  transition: opacity 0.6s ease;
}
.bubble {
  max-width: 900px;
  padding: 30px 42px;
  border-radius: 40px;
  font-size: 46px;
  line-height: 1.28;
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.7s var(--ease-out);
}
.bubble--me { align-self: flex-start; background: #f3ede4; color: #1b1712; border-bottom-left-radius: 10px; }
.bubble--you { align-self: flex-end; background: var(--gate); color: #170d08; border-bottom-right-radius: 10px; }
.screen[data-step='0'] .bubble:nth-child(1) { opacity: 1; transform: none; }
.screen[data-step='0'][data-sub='1'] .bubble:nth-child(2),
.screen[data-step='0'][data-sub='2'] .bubble:nth-child(2),
.screen[data-step='0'][data-sub='2'] .bubble:nth-child(3) { opacity: 1; transform: none; }
.screen:not([data-step='0']) .screen__chat { opacity: 0; }

.screen__site { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; }
.screen:not([data-step='0']) .screen__site { opacity: 1; }
.mock-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 78px;
  padding: 0 34px;
  background: #e9e3d9;
  border-bottom: 2px solid #ddd5c8;
}
.mock-bar i { width: 22px; height: 22px; border-radius: 50%; background: #cfc6b8; }
.mock-url {
  margin-left: 22px;
  flex: 1;
  height: 44px;
  border-radius: 22px;
  background: #f7f3ec;
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 44px;
  padding-left: 26px;
  color: #6d6457;
}
.mock-live {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f6a32;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.mock-live::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #48a14c; box-shadow: 0 0 0 6px rgba(72, 161, 76, 0.2); }
.screen[data-step='4'] .mock-live { opacity: 1; }

.mock-nav {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 104px;
  padding: 0 80px;
  font-size: 26px;
  color: #5d5448;
}
.mock-nav b { margin-right: auto; font-family: var(--font-display); font-size: 36px; font-weight: 500; color: #1b1712; }

.mock-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  height: 470px;
  margin: 0 80px;
}
.mock-copy { position: relative; display: grid; align-content: center; gap: 26px; padding-right: 20px; }
.mock-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 104px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #1b1712;
  font-variation-settings: 'opsz' 144;
}
.mock-sub { font-size: 30px; line-height: 1.35; color: #5d5448; max-width: 560px; }
.mock-btn {
  justify-self: start;
  padding: 22px 40px;
  border-radius: 60px;
  background: var(--gate);
  color: #170d08;
  font-weight: 600;
  font-size: 28px;
}
.mock-art {
  position: relative;
  border-radius: 20px;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(255, 214, 160, 0.85), transparent 70%),
    linear-gradient(160deg, #e9a15d 0%, #c0362c 55%, #3a1d16 100%);
  overflow: hidden;
}
.mock-art::after {
  content: '';
  position: absolute;
  left: 8%; right: 8%; bottom: 18%;
  height: 34%;
  border-top: 5px solid rgba(255, 240, 220, 0.85);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin: 46px 80px 0; height: 210px; }
.mock-cards div { position: relative; border-radius: 18px; background: #ece4d7; }
.mock-cards div:nth-child(2) { background: #e3d3bd; }
.mock-cards div:nth-child(3) { background: #d9e2d3; }
.mock-label {
  position: absolute;
  left: 22px; top: 18px;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b4a2c;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.mock-swatches {
  position: absolute;
  right: 80px; top: 214px;
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.5s ease, transform 0.7s var(--ease-out);
}
.mock-swatches i { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #f7f3ec; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.mock-swatches i:nth-child(1) { background: var(--gate); }
.mock-swatches i:nth-child(2) { background: #1b1712; }
.mock-swatches i:nth-child(3) { background: #e9a15d; }
.mock-swatches i:nth-child(4) { background: #8fbf6a; }
.mock-score {
  position: absolute;
  left: 80px; right: 80px; bottom: 30px;
  display: flex;
  gap: 40px;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3b7a3d;
  opacity: 0;
  transition: opacity 0.5s ease 0.2s;
}
.mock-score span::before { content: '✓ '; }
.screen[data-step='4'] .mock-score { opacity: 1; }

/* Map step: wireframe only */
.screen[data-step='1'] .mock-art,
.screen[data-step='1'] .mock-cards div,
.screen[data-step='1'] .mock-btn {
  background: transparent;
  outline: 4px dashed #b9ad9c;
  outline-offset: -4px;
}
.screen[data-step='1'] .mock-title,
.screen[data-step='1'] .mock-sub,
.screen[data-step='1'] .mock-btn,
.screen[data-step='1'] .mock-nav,
.screen[data-step='1'] .mock-url { color: transparent; }
.screen[data-step='1'] .mock-title { background: repeating-linear-gradient(180deg, #d8cfc1 0 70px, transparent 70px 100px); border-radius: 8px; }
.screen[data-step='1'] .mock-sub { background: repeating-linear-gradient(180deg, #e2dacd 0 26px, transparent 26px 40px); border-radius: 6px; }
.screen[data-step='1'] .mock-nav b { color: transparent; background: #d8cfc1; border-radius: 6px; }
.screen[data-step='1'] .mock-label { opacity: 1; }
.screen[data-step='1'] .mock-art::after { opacity: 0; }
.mock-art, .mock-cards div, .mock-btn, .mock-title, .mock-sub, .mock-nav, .mock-nav b {
  transition: background-color 0.6s ease, color 0.6s ease, outline-color 0.6s ease;
}
.screen[data-step='2'] .mock-swatches { opacity: 1; transform: none; }

/* Build step: the code editor slides in */
.screen__code {
  position: absolute;
  top: 78px; right: 0; bottom: 0;
  width: 58%;
  padding: 64px 56px;
  background: #16120f;
  color: #e9e1d4;
  font-family: var(--font-mono);
  font-size: 30px;
  line-height: 1.75;
  white-space: nowrap;
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.3);
  transform: translateX(105%);
  transition: transform 0.8s var(--ease-out);
}
.screen__code p {
  clip-path: inset(0 calc((1 - clamp(0, var(--sp, 0) * 9 - var(--i), 1)) * 100%) 0 0);
}
.screen__code em { color: #f08a64; font-style: normal; }
.screen__code b { color: #f0cf72; font-weight: 400; }
.screen__code i { color: #8fbf6a; font-style: normal; }
.screen[data-step='3'] .screen__code { transform: none; }

.studio__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(18, 14, 11, 0) 46%, rgba(18, 14, 11, 0.86) 74%, rgba(18, 14, 11, 0.94) 100%);
  display: none;
}
.arm-ready .studio__shade { display: block; }

.studio__steps {
  display: grid;
  gap: 1.1rem;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin: 2rem auto 0;
  padding-bottom: 3rem;
}
.studio__step {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.studio__num { grid-row: span 2; font-family: var(--font-mono); font-size: 0.75rem; color: var(--gate); padding-top: 0.45rem; }
.studio__name { font-family: var(--font-display); font-size: clamp(1.5rem, 2.3vw, 2.1rem); font-weight: 300; line-height: 1.1; }
.studio__desc { color: var(--fog-dim); font-size: 0.975rem; max-width: 30ch; }

.arm-ready .studio__steps {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  width: min(24rem, 30vw);
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
}
.arm-ready .studio__step .studio__name { opacity: 0.62; transition: opacity 0.45s ease; }
.arm-ready .studio__step .studio__desc {
  display: grid;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s var(--ease-out), opacity 0.4s ease;
}
.arm-ready .studio__step.is-active .studio__name { opacity: 1; }
.arm-ready .studio__step.is-active .studio__desc { max-height: 22rem; overflow: visible; opacity: 1; }
.arm-ready .studio__step.is-done .studio__num::after { content: ' ✓'; }

/* Services */
.services {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: var(--section-pad) clamp(3rem, 6vw, 5rem);
}
.services__intro { display: grid; gap: 1.25rem; align-content: start; }
.services__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 14ch;
  font-variation-settings: 'opsz' 144;
}
.services__list { border-bottom: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1rem 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}
.service__num { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--gate); }
.service__name { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 1.9vw, 1.65rem); line-height: 1.15; }
.service__desc { color: var(--fog-dim); font-size: 0.975rem; }

/* Pricing & care: the same rows as "What I build", numbered, then the payment button. */
.services--pricing { padding-top: clamp(1rem, 3vw, 2rem); }
.pricing__pay { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.pricing__note { max-width: 44ch; color: var(--fog-dim); font-size: 0.9rem; }
.pay-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.05rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gate) 0%, var(--gate-hover) 60%, var(--maiz) 150%);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  animation: pay-glow 3.2s ease-in-out infinite;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
/* A shine that sweeps across on hover or keyboard focus. */
.pay-button::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 -60%;
  z-index: -1;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s var(--ease-out);
}
/* A soft flash from the centre when the button is pressed or tapped. */
.pay-button::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 65%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.pay-button:hover, .pay-button:focus-visible {
  animation: none;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -12px rgba(228, 87, 46, 0.8), 0 0 0 4px rgba(228, 87, 46, 0.18);
}
.pay-button:hover::before, .pay-button:focus-visible::before { left: 120%; }
.pay-button:active { transform: translateY(0) scale(0.97); box-shadow: 0 6px 16px -10px rgba(228, 87, 46, 0.8); transition-duration: 0.12s; }
.pay-button:active::after { opacity: 1; transform: scale(1.4); transition-duration: 0s; }
.pay-button__arrow { transition: transform 0.35s var(--ease-out); }
.pay-button:hover .pay-button__arrow, .pay-button:focus-visible .pay-button__arrow { transform: translate(2px, -2px); }
@keyframes pay-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 87, 46, 0.45); }
  55% { box-shadow: 0 0 0 12px rgba(228, 87, 46, 0); }
}

.included {
  grid-column: 2;
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(236, 231, 223, 0.03);
}
.included__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fog-faint); }
.included__list { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.included__list li { display: flex; }

/* Work */
.work { padding-block: clamp(2rem, 4vw, 3rem) var(--section-pad); display: grid; gap: 1.75rem; }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
.work-card {
  display: grid;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(236, 231, 223, 0.025);
  transition: border-color 0.35s ease, transform 0.6s var(--ease-out);
}
.work-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.work-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #0d0b09; }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; transition: object-position 7s linear, transform 0.8s var(--ease-out); }
.work-card__media--tall img { object-position: 50% 0%; }
.work-card:hover .work-card__media--tall img,
.work-card:focus-visible .work-card__media--tall img { object-position: 50% 100%; }
.work-card__media--dark img { object-fit: contain; object-position: 50% 50%; padding: 6%; }
.work-card:hover .work-card__media--dark img { transform: scale(1.04); }
.work-card__body { display: grid; gap: 0.45rem; padding: 1.4rem 1.5rem 1.6rem; }
.work-card__type { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gate); }
.work-card__title { font-family: var(--font-display); font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 400; line-height: 1.1; }
.work-card__desc { color: var(--fog-dim); font-size: 0.975rem; }
.work-card__url { margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--fog-faint); }

/* ───────── Span II: Mind (light) ───────── */

.mind {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  padding-bottom: var(--section-pad);
}
.mind .eyebrow { color: var(--paper-dim); }
.mind .eyebrow__mark { background: var(--gate-deep); }
.mind .eyebrow__mark::after { border-top-color: var(--gate-deep); }
.mind .display em { color: var(--gate-ink); }
.mind .body-lg, .mind .body { color: var(--paper-dim); }
.mind .cable-rule path { stroke: rgba(22, 32, 42, 0.28); }
.mind :focus-visible { outline-color: var(--gate-ink); }

.mind__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
}
.lab-card, .bayes {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  background: #f8f4ee;
}
.lab-card__media { margin-bottom: 1rem; padding: 1rem; background: #fff; border-radius: 3px; }
.lab-card__label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gate-ink); }
.lab-card__title { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 300; line-height: 1; }
.lab-card__sub { color: var(--paper-dim); }

.bayes__plot { width: 100%; height: auto; overflow: visible; }
.bayes__grid path { fill: none; stroke: rgba(22, 32, 42, 0.22); stroke-width: 1; }
.bayes__grid .bayes__axis-mid { stroke-dasharray: 3 5; }
.bayes__prior { fill: none; stroke: rgba(22, 32, 42, 0.55); stroke-width: 1.6; stroke-dasharray: 5 6; }
.bayes__post { fill: none; stroke: var(--gate-deep); stroke-width: 2.6; stroke-linejoin: round; }
.bayes__post-fill { fill: rgba(192, 54, 44, 0.12); stroke: none; }
.bayes__dots circle { fill: var(--paper-ink); opacity: 0; transition: opacity 0.3s ease; }
.bayes__dots circle.is-on { opacity: 0.75; }
.bayes__label { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; fill: var(--paper-dim); }
.bayes__label--post { fill: var(--gate-ink); }
.bayes__caption { color: var(--paper-dim); font-size: 0.975rem; max-width: 52ch; }
.bayes__caption strong { color: var(--paper-ink); font-weight: 600; }

.research, .talks { display: grid; gap: 1.75rem; padding-top: clamp(4rem, 8vw, 7rem); }
.research__list, .talks__list { border-bottom: 1px solid var(--paper-line); }
.paper, .talk {
  display: grid;
  grid-template-columns: minmax(0, 16rem) 4.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.25rem, 2.5vw, 2rem) 0;
  border-top: 1px solid var(--paper-line);
}
.paper__media, .talk__media { position: relative; display: block; border-radius: 3px; overflow: hidden; background: #fff; border: 1px solid var(--paper-line); }
.paper__media img, .talk__media img { width: 100%; aspect-ratio: 21 / 9; object-fit: contain; }
.paper__media, .talk__media { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.paper__media:is(:hover, :focus-visible), .talk__media:is(:hover, :focus-visible) { border-color: var(--gate-ink); box-shadow: 0 5px 18px -10px var(--paper-ink); }
.paper__open { position: absolute; right: 0.3rem; bottom: 0.2rem; color: var(--gate-ink); background: #fff; padding-inline: 0.2rem; }
.paper__year, .talk__year { font-family: var(--font-mono); font-size: 0.875rem; color: var(--gate-ink); }
.paper__title, .talk__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2vw, 1.8rem); line-height: 1.18; text-wrap: balance; }
.paper__venue, .talk__venue { margin-top: 0.5rem; color: var(--paper-dim); font-size: 0.975rem; }

.interests { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.5rem; }
.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(22, 32, 42, 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--paper-ink);
  text-align: left;
  font-size: 0.875rem;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}
.topic-pill__mark { flex: none; font-family: var(--font-mono); color: var(--gate-ink); transition: transform 0.25s ease; }
.topic-pill[aria-expanded='true'] { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }
.topic-pill[aria-expanded='true'] .topic-pill__mark { transform: rotate(45deg); color: inherit; }
.topic-detail { margin-top: 1rem; max-width: 72ch; padding: 0.9rem 1.1rem; border-left: 2px solid var(--gate-ink); background: rgba(255, 255, 255, 0.35); color: var(--paper-ink); font-size: 0.975rem; }
.topic-detail[hidden] { display: none; }
.included .topic-pill { border-color: var(--line-strong); color: var(--fog); }
.included .topic-pill__mark { color: var(--gate-hover); }
.included .topic-pill[aria-expanded='true'] { background: var(--fog); border-color: var(--fog); color: var(--ink); }
.included .topic-pill[aria-expanded='true'] .topic-pill__mark { color: inherit; }
.included .topic-detail { border-color: var(--gate); background: rgba(236, 231, 223, 0.05); color: var(--fog); }

/* ───────── Cortex (inside Mind) ───────── */

.cortex__track { --track: 300vh; margin-bottom: clamp(1rem, 3vw, 2.5rem); }
.cortex__panel {
  position: relative;
  display: grid;
  margin-inline: var(--gutter);
  border-radius: 6px;
  overflow: hidden;
  color: var(--fog);
  background:
    radial-gradient(55% 62% at 64% 50%, rgba(29, 70, 81, 0.5), transparent 72%),
    radial-gradient(90% 70% at 0% 100%, rgba(228, 87, 46, 0.08), transparent 65%),
    var(--ink);
  box-shadow: 0 40px 90px -50px rgba(11, 17, 24, 0.7);
}
.arm-ready .cortex__panel {
  position: absolute;
  inset: calc(var(--masthead-h) + 0.75rem) var(--gutter) clamp(0.75rem, 2vh, 1.25rem);
  margin: 0;
}
.cortex__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cortex__still { width: min(100%, 720px); margin: 2rem auto 0; mix-blend-mode: lighten; }
.arm-ready .cortex__still { display: none; }
.arm-ready.cortex-unavailable .cortex__still {
  display: block;
  position: absolute;
  top: 50%; right: 4%;
  width: min(52%, 118vh);
  margin: 0;
  transform: translateY(-50%);
}
.cortex-unavailable .cortex__canvas { display: none; }

.cortex__panel .eyebrow { color: var(--fog-dim); }
.cortex__panel .eyebrow__mark { background: var(--gate); }
.cortex__panel .eyebrow__mark::after { border-top-color: var(--gate); }

.cortex__hud {
  position: absolute;
  inset: clamp(1.1rem, 2.4vw, 1.75rem);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-faint);
}
.cortex__fig { position: absolute; top: 0; right: 0; text-align: right; }
.cortex__yaw { position: absolute; top: 1.7rem; right: 0; font-variant-numeric: tabular-nums; }
.cortex__yaw span { color: var(--gate-hover); }
.cortex__credit { position: absolute; right: 0; bottom: 0; }

.cortex__captions { position: relative; display: grid; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); }
.arm-ready .cortex__captions {
  position: absolute;
  inset: clamp(1.1rem, 2.4vw, 1.75rem) clamp(1.25rem, 3.5vw, 3rem) clamp(1.75rem, 6vh, 4rem);
  display: block;
  padding: 0;
  pointer-events: none;
}
.arm-ready .cortex__title { position: absolute; left: 0; top: 0; }
.arm-ready .cortex__captions .caption { width: min(28rem, 40%); }

/* ───────── Span III: Medicine ───────── */

.medicine { position: relative; background: var(--earth); color: var(--fog); }

.band {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 88vh;
  min-height: 88svh;
  overflow: hidden;
  isolation: isolate;
}
.band__video {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  z-index: -2;
  transform: translate3d(0, calc((var(--p, 0.5) - 0.5) * -12%), 0);
  filter: saturate(0.95);
}
.band__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(21, 16, 12, 0.55) 0%, rgba(21, 16, 12, 0.05) 30%, rgba(21, 16, 12, 0.35) 62%, var(--earth) 100%),
    radial-gradient(80% 60% at 0% 100%, rgba(21, 16, 12, 0.8), transparent 70%);
}
.band__content { display: grid; gap: 1.25rem; padding-block: 8rem clamp(3rem, 8vh, 6rem); }
.band__content .eyebrow { color: var(--fog); }
.band__content .eyebrow__mark { background: var(--maiz); }
.band__content .eyebrow__mark::after { border-top-color: var(--maiz); }
.band__title { max-width: 13ch; }
.band__title em, .medicine .display em { color: var(--maiz); }
.band__words { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--fog-dim); }

.medicine__intro { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); }
.medicine__intro .body-lg { max-width: 44ch; font-size: clamp(1.25rem, 2.1vw, 1.9rem); line-height: 1.4; color: var(--fog); font-family: var(--font-display); font-weight: 300; }
.medicine .eyebrow__mark { background: var(--maiz); }
.medicine .eyebrow__mark::after { border-top-color: var(--maiz); }

.milpa__track { --track: 400vh; }
.milpa__stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  background:
    radial-gradient(55% 45% at 70% 72%, rgba(227, 178, 60, 0.12), transparent 70%),
    radial-gradient(80% 60% at 70% 100%, rgba(160, 82, 45, 0.18), transparent 70%),
    var(--earth);
}
.milpa__art {
  width: min(100%, 720px);
  height: auto;
  margin-inline: auto;
  overflow: visible;
}
.milpa__art path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.milpa__art .m-ground { stroke: #a0522d; stroke-width: 2; }
.milpa__art .m-soil { stroke: #6b4a33; }
.milpa__art .m-root { stroke: #8a5a3b; stroke-width: 1.2; }
.milpa__art .m-root--bean { stroke: #b07a4f; }
.milpa__art .m-stalk { stroke: var(--maiz); stroke-width: 2.4; }
.milpa__art .m-stalk--edge { stroke-width: 1.2; opacity: 0.6; }
.milpa__art .m-node { stroke: var(--maiz-soft); stroke-width: 2; }
.milpa__art .m-leaf { stroke: #c9b04a; }
.milpa__art .m-vein { stroke: #c9b04a; opacity: 0.45; stroke-width: 1; }
.milpa__art .m-ear { stroke: #f2c14e; }
.milpa__art .m-silk, .milpa__art .m-tassel { stroke: #f6dc8f; stroke-width: 1.2; }
.milpa__art .m-bean { stroke: var(--nopal); }
.milpa__art .m-bean--back { opacity: 0.35; }
.milpa__art .m-pod { stroke: var(--chile); stroke-width: 1.8; }
.milpa__art .m-squash { stroke: #7aa64a; }
.milpa__art .m-squash--veins { opacity: 0.5; stroke-width: 1; }
.milpa__art .m-fruit { stroke: #e07b2e; stroke-width: 2; }
.milpa__art .m-fruit--rib { stroke-width: 1.2; opacity: 0.7; }
.milpa__art .m-flower { stroke: #f4b63f; }
.milpa__art .m-nodule { fill: #e8a86b; transition: opacity 0.6s ease, transform 0.6s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.milpa-animated .milpa__art path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.milpa-animated .milpa__art .m-nodule { opacity: 0; transform: scale(0.2); }
.milpa-animated .milpa__art.nodules-on .m-nodule { opacity: 1; transform: none; }
.milpa__art.is-whole path { filter: drop-shadow(0 0 6px rgba(227, 178, 60, 0.25)); }

.milpa__captions { display: grid; gap: 2.25rem; width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto; padding-block: 3rem; }
.milpa__captions .eyebrow { margin-bottom: 0.25rem; }
.medicine .caption__kicker { color: var(--fog); }

.arm-ready .milpa__stage { display: block; }
.arm-ready .milpa__art {
  position: absolute;
  right: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  bottom: 0;
  width: auto;
  height: min(92svh, 980px);
  max-width: 62vw;
}
.arm-ready .milpa__captions {
  position: absolute;
  left: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  top: 50%;
  width: min(30rem, 38vw);
  margin: 0;
  padding: 0;
  display: block;
  transform: translateY(-50%);
  min-height: 16rem;
}
.arm-ready .milpa__title { margin-bottom: 1.5rem; }
.arm-ready .milpa__captions .caption { top: 3rem; bottom: auto; }

/* Offerings */
.offerings { display: grid; gap: 1.75rem; padding-block: var(--section-pad) clamp(3rem, 6vw, 5rem); }
.offerings__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); }
.offering {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.6rem 1.4rem 1.8rem;
  border: 1px solid rgba(227, 178, 60, 0.18);
  border-top: 2px solid var(--maiz);
  border-radius: 2px 2px 4px 4px;
  background: linear-gradient(180deg, rgba(227, 178, 60, 0.06), rgba(227, 178, 60, 0));
}
.offering__name { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: clamp(1.7rem, 2.3vw, 2.2rem); line-height: 1.05; }
.offering__en { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--maiz); }
.offering__desc { color: var(--fog-dim); font-size: 0.975rem; }

/* Pantry */
.pantry { display: grid; gap: 2rem; padding-block: clamp(3rem, 6vw, 5rem); }
.pantry__head { display: grid; gap: 0.75rem; }
.pantry__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(227, 178, 60, 0.22);
  border-left: 1px solid rgba(227, 178, 60, 0.22);
}
.seed {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1.4rem 1.3rem 1.6rem;
  border-right: 1px solid rgba(227, 178, 60, 0.22);
  border-bottom: 1px solid rgba(227, 178, 60, 0.22);
  transition: background-color 0.35s ease;
}
.seed:hover { background: rgba(227, 178, 60, 0.05); }
.seed__es { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2vw, 1.9rem); line-height: 1.1; }
.seed__nah { font-family: var(--font-mono); font-size: 0.8125rem; font-style: italic; color: var(--maiz); }
.seed__note { margin-top: 0.5rem; color: var(--fog-dim); font-size: 0.9375rem; line-height: 1.5; }

/* Boundaries */
.boundaries {
  display: grid;
  gap: 1.25rem;
  margin-bottom: var(--section-pad);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid rgba(236, 231, 223, 0.16);
  border-left: 3px solid var(--maiz);
  border-radius: 2px 4px 4px 2px;
  background: rgba(236, 231, 223, 0.03);
}
.boundaries__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.1; }
.boundaries__list { display: grid; gap: 0.85rem; max-width: 75ch; }
.boundaries__list li { position: relative; padding-left: 1.4rem; color: var(--fog-dim); }
.boundaries__list li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1.5px; background: var(--maiz); }
.boundaries__list a { color: var(--fog); font-weight: 600; }
.boundaries .chapter-cta { margin-top: 0.75rem; }

/* ───────── Contact ───────── */

.contact { position: relative; background: var(--ink); color: var(--fog); }
.contact__frame {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  clip-path: inset(calc((1 - var(--p, 1)) * 9%) calc((1 - var(--p, 1)) * 7%) round calc((1 - var(--p, 1)) * 36px));
}
.contact__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(calc(1.12 - var(--p, 1) * 0.12)); }
.contact__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 17, 24, 0.4) 0%, rgba(11, 17, 24, 0) 30%, rgba(11, 17, 24, 0.45) 65%, var(--ink) 100%),
    radial-gradient(70% 60% at 0% 100%, rgba(11, 17, 24, 0.7), transparent 70%);
}
.contact__hero { display: grid; gap: 1.4rem; padding-block: 10rem clamp(3rem, 9vh, 6rem); }
.contact__hero .eyebrow { color: var(--fog); }
.contact__title { max-width: 12ch; font-size: clamp(3rem, 8vw, 8.4rem); }
.contact__lede { color: var(--fog); max-width: 44ch; }

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  padding-block: clamp(3rem, 7vw, 6rem);
}

.composer { display: grid; gap: 2rem; }
.composer__topics { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; border: 0; min-width: 0; }
.composer__legend { margin-bottom: 1rem; padding: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.1; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.chip:hover span { border-color: var(--fog); }
.chip input:checked + span { background: var(--fog); color: var(--ink); border-color: var(--fog); }
.chip input:focus-visible + span { outline: 2px solid var(--gate); outline-offset: 3px; }
.composer__field { display: grid; gap: 0.6rem; }
.composer__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fog-dim); }
.composer__optional { text-transform: none; letter-spacing: 0; color: var(--fog-faint); }
.composer textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.9rem 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  font-size: 1.125rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.3s ease;
}
.composer textarea::placeholder { color: var(--fog-faint); }
.composer textarea:focus { outline: none; border-bottom-color: var(--gate); }
.composer textarea:focus-visible { outline: 2px solid var(--gate); outline-offset: 4px; }
.composer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.composer__note { font-size: 0.875rem; color: var(--fog-faint); }

.contact__direct { display: grid; align-content: start; gap: 0.6rem; }
.contact__label { margin-top: 1rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fog-faint); }
.contact__label:first-child { margin-top: 0; }
.contact__email { font-family: var(--font-display); font-size: clamp(1.15rem, 1.8vw, 1.5rem); overflow-wrap: anywhere; text-decoration-color: var(--gate); }
.contact__social { display: grid; gap: 0.35rem; }
.contact__social a { text-decoration-color: var(--line-strong); }
.contact__social a:hover { text-decoration-color: var(--gate); }

.land {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}
.land__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gate); }
.land__text { max-width: 70ch; color: var(--fog-dim); font-family: var(--font-display); font-weight: 300; font-size: clamp(1.1rem, 1.6vw, 1.4rem); line-height: 1.5; }

/* ───────── Footer ───────── */

.footer { background: var(--ink-2); border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0));
  font-size: 0.875rem;
  color: var(--fog-dim);
}
.footer__word { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.08em; color: var(--fog); margin-right: 0.5rem; }
.footer__meta { font-family: var(--font-coord); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--fog-faint); }
.footer__links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.footer__links a { text-decoration-color: var(--line-strong); }
.footer__links a:hover { color: var(--fog); text-decoration-color: var(--gate); }

.noscript-notice {
  margin: 0;
  padding: 1rem var(--gutter);
  background: var(--ink-3);
  color: var(--fog-dim);
  font-size: 0.875rem;
  text-align: center;
}

/* ───────── Reveal on scroll ───────── */

.arm-ready .reveal:not(.is-in) { opacity: 0; transform: translate3d(0, 28px, 0); }
.arm-ready .reveal.is-in { transition: opacity 0.9s ease, transform 1.1s var(--ease-out); }

/* ───────── Ambient motion paused ───────── */

.motion-paused .hero__fog span,
.motion-paused .hero__cue-line::after { animation-play-state: paused; }

/* ───────── Responsive ───────── */

@media (max-width: 1080px) {
  .offerings__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pantry__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --masthead-h: 62px; }
  .nav, .masthead__cta { display: none; }
  .menu-button { display: inline-block; }
  .motion-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .motion-toggle { width: 44px; height: 44px; justify-content: center; padding: 0; }

  .hero__meta { display: none; }
  .hero__roles { flex-direction: column; gap: 0.45rem; }
  .hero__cue { left: var(--gutter); right: auto; bottom: 1.25rem; }
  .hero__content { bottom: clamp(4.5rem, 11vh, 6rem); }

  .about__grid, .services, .mind__grid, .contact__grid, .land { grid-template-columns: minmax(0, 1fr); }
  .about__portrait { max-width: 30rem; }
  .about__portrait img { aspect-ratio: 5 / 4; }
  .practice-links a { grid-template-columns: 2rem 1fr auto; }
  .practice-links__desc { grid-column: 2 / 3; }
  .practice-links__arrow { grid-row: 1; grid-column: 3; }
  .included { grid-column: auto; }
  .pricing__pay { grid-column: auto; }
  .work__grid { grid-template-columns: minmax(0, 1fr); }
  .paper, .talk { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .paper__media, .talk__media { grid-column: 1 / -1; max-width: 26rem; }
  .service { grid-template-columns: 2rem minmax(0, 1fr); }
  .service__desc { grid-column: 2; }

  .arm-ready .bridge__captions { bottom: clamp(1.5rem, 5vh, 3rem); }
  .bridge__fig { display: none; }
  .bridge__legend { top: 0; }
  .bridge__meter { display: none !important; }

  .studio__shade { background: linear-gradient(180deg, rgba(18, 14, 11, 0) 0%, rgba(18, 14, 11, 0) 52%, rgba(18, 14, 11, 0.92) 70%, var(--studio) 100%); }
  .arm-ready .studio__steps {
    top: auto;
    bottom: clamp(1.5rem, 5vh, 3rem);
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    transform: none;
    min-height: 9.5rem;
  }
  .arm-ready .studio__step {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition: opacity 0.45s ease, transform 0.7s var(--ease-out);
  }
  .arm-ready .studio__step.is-active { opacity: 1; transform: none; }
  .arm-ready .studio__step .studio__desc { max-height: none; opacity: 1; }

  .arm-ready .milpa__art {
    left: 50%;
    right: auto;
    top: calc(var(--masthead-h) + 0.5rem);
    bottom: auto;
    height: min(56svh, 600px);
    max-width: 96vw;
    transform: translateX(-50%);
  }
  .arm-ready .milpa__captions {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: clamp(1.25rem, 4vh, 2.5rem);
    width: auto;
    transform: none;
    min-height: 13rem;
  }
  .arm-ready .milpa__title { margin-bottom: 0.75rem; }
  .arm-ready .milpa__captions .caption { top: 2.5rem; }
}

@media (max-width: 560px) {
  .offerings__grid, .pantry__list { grid-template-columns: minmax(0, 1fr); }
  .hero__title { font-size: clamp(3rem, 15.5vw, 5rem); }
  .hero__line--indent { padding-left: 0.32em; }
  .caption__kicker { font-size: clamp(1.6rem, 7.4vw, 2.2rem); }
  .caption__text { font-size: 1rem; }
  .composer__actions .button { width: 100%; justify-content: center; }
}

@media (max-height: 640px) and (min-width: 901px) {
  .hero__roles { display: none; }
}

/* ───────── Reduced motion: every scene becomes a still page ───────── */

.reduce-motion { scroll-behavior: auto; }
.reduce-motion .scene-track { height: auto !important; }
.reduce-motion .scene-stage { position: relative !important; height: auto !important; min-height: 100svh; }
.reduce-motion .hero__content { transform: none; opacity: 1; }
.reduce-motion .hero__veil, .reduce-motion .hero__fog, .reduce-motion .hero__cue-line::after { display: none; }
.reduce-motion .hero__line, .reduce-motion .hero__lede, .reduce-motion .hero__roles, .reduce-motion .hero__eyebrow { animation: none !important; }
.reduce-motion .bridge__stage { display: grid; grid-template-rows: minmax(60svh, 70svh) auto; padding-top: calc(var(--masthead-h) + 2.5rem); }
.reduce-motion .bridge__canvas { position: relative; inset: auto; height: 100%; min-height: 60svh; }
.reduce-motion .bridge__captions { position: relative !important; inset: auto !important; display: grid !important; gap: 2rem; padding: 2rem 0 4rem !important; pointer-events: auto; }
.reduce-motion .bridge__title { position: static !important; }
.reduce-motion .caption { position: static !important; opacity: 1 !important; transform: none !important; }
.reduce-motion .bridge__meter, .reduce-motion .bridge__hint { display: none !important; }
.reduce-motion .studio__stage { display: grid; align-content: start; padding-bottom: 3rem; }
.reduce-motion .studio__rig { position: relative !important; transform: none !important; }
.reduce-motion .studio__shade { display: none; }
.reduce-motion .studio__steps { position: static !important; transform: none !important; width: min(100% - 2 * var(--gutter), var(--wrap)) !important; margin: 2rem auto 0 !important; min-height: 0; }
.reduce-motion .studio__step { position: static !important; opacity: 1 !important; transform: none !important; }
.reduce-motion .studio__step .studio__desc { max-height: none !important; opacity: 1 !important; }
.reduce-motion .milpa__stage { display: grid !important; padding-block: 3rem; }
.reduce-motion .milpa__art { position: relative !important; inset: auto !important; transform: none !important; width: min(100%, 640px) !important; height: auto !important; max-width: 100% !important; margin-inline: auto; }
.reduce-motion .milpa__captions { position: relative !important; inset: auto !important; transform: none !important; width: min(100% - 2 * var(--gutter), var(--wrap)) !important; display: grid !important; gap: 2rem; margin: 2rem auto 0 !important; min-height: 0; }
.reduce-motion .milpa__captions .caption { position: static !important; }
.reduce-motion .contact__frame { clip-path: none; }
.reduce-motion .contact__video { transform: none; }
.reduce-motion .band__video { transform: none; }
.reduce-motion .reveal { opacity: 1 !important; transform: none !important; }

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

/* ───────── Small standalone pages (privacy, 404) ───────── */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 1.5rem;
  padding: calc(var(--masthead-h) + 2rem) var(--gutter) 4rem;
  background:
    radial-gradient(70% 50% at 80% 0%, rgba(228, 87, 46, 0.14), transparent 70%),
    var(--ink);
}
.page__inner { width: min(100%, 46rem); margin-inline: auto; display: grid; gap: 1.25rem; }
.page__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -0.02em; }
.page p { color: var(--fog-dim); }
.page a:not(.button) { color: var(--fog); text-decoration-color: var(--gate); }
.page .button { justify-self: start; margin-top: 0.5rem; }
.page__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 1.5rem; font-size: 0.9375rem; }

/* ───────── Privacy and legal pages (long-form, on paper) ───────── */

.legal-body { background: var(--paper); color: var(--paper-ink); }
.legal-top { border-bottom: 1px solid var(--paper-line); }
.legal-top__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; min-height: var(--masthead-h); padding-block: 0.75rem; }
.legal-top__brand { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; letter-spacing: 0.08em; text-decoration: none; }
.legal-top__brand .brand__glyph path { stroke: var(--gate-deep); }
.legal-top__nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.9375rem; }
.legal-top__nav a, .legal-top__nav button { color: var(--paper-dim); text-decoration: none; background: none; border: 0; padding: 0.2rem 0; }
.legal-top__nav a:hover, .legal-top__nav button:hover, .legal-top__nav [aria-current='page'] { color: var(--paper-ink); text-decoration: underline; text-decoration-color: var(--gate-deep); text-underline-offset: 0.3em; }

.legal { padding-bottom: var(--section-pad); }
.legal :focus-visible { outline-color: var(--gate-ink); }
.legal__head { display: grid; gap: 1rem; padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3.5rem); }
.legal__head .eyebrow { color: var(--paper-dim); }
.legal__head .eyebrow__mark { background: var(--gate-deep); }
.legal__head .eyebrow__mark::after { border-top-color: var(--gate-deep); }
.legal__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 0.98; letter-spacing: -0.025em; max-width: 16ch; }
.legal__meta { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-dim); }
/* Written by scripts/compliance.js when a third-party service is switched on. */
.legal__notice { margin-top: 1rem; max-width: 70ch; padding: 0.85rem 1rem; border-left: 3px solid var(--gate-ink); background: rgba(255, 255, 255, 0.45); color: var(--paper-ink); }
.consent-embed { display: grid; place-items: center; gap: 0.75rem; min-height: 12rem; padding: 1.5rem; border: 1px solid currentColor; border-radius: 6px; text-align: center; }
.consent-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.consent-embed__note { max-width: 46ch; }
.legal__layout { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 46rem); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.legal__toc { position: sticky; top: 1.5rem; font-size: 0.875rem; }
.legal__toc-title { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gate-ink); margin-bottom: 0.8rem; }
.legal__toc ol { display: grid; gap: 0.45rem; counter-reset: toc; }
.legal__toc a { color: var(--paper-dim); text-decoration: none; }
.legal__toc a:hover { color: var(--paper-ink); text-decoration: underline; text-decoration-color: var(--gate-deep); }

.legal__body { display: grid; gap: 3rem; font-size: 1.0625rem; line-height: 1.7; }
.legal__body section { display: grid; gap: 1rem; scroll-margin-top: 1.5rem; min-width: 0; }
.legal__body h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; }
.legal__body h3 { font-family: var(--font-text); font-weight: 600; font-size: 1.0625rem; margin-top: 0.5rem; }
.legal__body p, .legal__body li { color: rgba(22, 32, 42, 0.86); }
.legal__body ul { display: grid; gap: 0.5rem; padding-left: 1.2rem; list-style: disc; }
.legal__body ul li::marker { color: var(--gate-deep); }
.legal__body a { color: var(--paper-ink); text-decoration-color: var(--gate-deep); }
.legal__body strong { color: var(--paper-ink); font-weight: 600; }
.legal__body blockquote { margin: 0; padding: 1rem 1.25rem; border-left: 2px solid var(--gate-deep); background: #f8f4ee; font-size: 0.9375rem; }
.legal__summary { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--paper-line); border-radius: 6px; background: #f8f4ee; }
.legal__summary h2 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
.legal__table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.legal__table th, .legal__table td { padding: 0.75rem 0.75rem 0.75rem 0; border-top: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.legal__table th { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-dim); font-weight: 500; }
.legal__scroll { overflow-x: auto; }
.legal__status { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin-top: 0.25rem; font-size: 0.9375rem; }
.legal__status dt { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-dim); padding-top: 0.2rem; }
.legal__status dd { margin: 0; color: var(--paper-ink); }
.legal .button--ink { justify-self: start; color: var(--paper); }

.footer__links button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
.footer__links button:hover { color: var(--fog); text-decoration-color: var(--gate); }

/* "Buy me a cup of coffee": the steam rises on hover, and the cup settles when tapped. */
.footer__coffee { margin: 0; }
.coffee-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.7rem 1.2rem 0.7rem 0.95rem;
  border-radius: 999px;
  background: var(--maiz);
  color: var(--earth);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
.coffee-button__cup { width: 1.5em; height: 1.5em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.coffee-button__steam { opacity: 0.4; transform: translateY(2px); transition: opacity 0.4s ease, transform 0.6s var(--ease-out); }
.coffee-button:hover, .coffee-button:focus-visible { background: var(--maiz-soft); transform: translateY(-2px) rotate(-1.5deg); box-shadow: 0 12px 30px -14px rgba(227, 178, 60, 0.75); }
.coffee-button:hover .coffee-button__steam, .coffee-button:focus-visible .coffee-button__steam { opacity: 1; transform: translateY(-1px); animation: steam-rise 1.6s ease-in-out infinite; }
.coffee-button:active { transform: scale(0.96); transition-duration: 0.12s; }
@keyframes steam-rise {
  0%, 100% { transform: translateY(0); opacity: 0.95; }
  50% { transform: translateY(-2.5px); opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .pay-button, .coffee-button__steam { animation: none !important; }
  .pay-button::before { display: none; }
}
.reduce-motion .pay-button, .motion-paused .pay-button,
.reduce-motion .coffee-button__steam, .motion-paused .coffee-button__steam { animation: none !important; }
.choices-icon { display: inline-block; width: 1.9em; height: 0.95em; margin-right: 0.45em; vertical-align: -0.12em; }

/* ───────── Privacy choices: dialog and banner ───────── */

.consent {
  width: min(100% - 2rem, 34rem);
  max-height: min(100% - 2rem, 46rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-2);
  color: var(--fog);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.75);
  overflow: auto;
  overscroll-behavior: contain;
}
.consent::backdrop { background: rgba(6, 10, 14, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.consent__inner { position: relative; display: grid; gap: 1.1rem; padding: clamp(1.4rem, 4vw, 2.2rem); }
.consent__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.05; }
.consent__lede, .consent__region, .consent__status { color: var(--fog-dim); font-size: 0.9375rem; }
.consent__status:empty { display: none; }
.consent__region { padding: 0.8rem 1rem; border-radius: 6px; background: rgba(236, 231, 223, 0.05); border: 1px solid var(--line); }
.consent__row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: 0.9rem; border-top: 1px solid var(--line); }
.consent__label { display: grid; gap: 0.25rem; cursor: pointer; }
.consent__name { display: block; font-weight: 600; color: var(--fog); }
.consent__desc { display: block; color: var(--fog-dim); font-size: 0.875rem; line-height: 1.5; }
.consent__fixed { flex: none; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fog-faint); }
.consent__switch {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 3rem; height: 1.7rem;
  margin: 0;
  border-radius: 999px;
  background: rgba(236, 231, 223, 0.18);
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.consent__switch::after {
  content: '';
  position: absolute;
  top: 0.2rem; left: 0.2rem;
  width: 1.3rem; height: 1.3rem;
  border-radius: 50%;
  background: var(--fog);
  transition: transform 0.3s var(--ease-out);
}
.consent__switch:checked { background: var(--gate); }
.consent__switch:checked::after { transform: translateX(1.3rem); }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button--quiet { background: transparent; color: var(--fog); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button--quiet:hover { background: rgba(236, 231, 223, 0.08); }
.consent__links { font-size: 0.875rem; color: var(--fog-faint); }
.consent__links a { color: var(--fog-dim); }
.consent__close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  width: 2.5rem; height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fog-dim);
  font-size: 1.6rem;
  line-height: 1;
}
.consent__close:hover { background: rgba(236, 231, 223, 0.08); color: var(--fog); }

.consent-banner {
  position: fixed;
  left: clamp(0.75rem, 2.5vw, 1.5rem);
  bottom: clamp(0.75rem, 2.5vw, 1.5rem);
  z-index: 90;
  width: min(100% - 1.5rem, 25rem);
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 26, 36, 0.96);
  color: var(--fog);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}
.consent-banner.is-in { opacity: 1; transform: none; }
.consent-banner.is-leaving { opacity: 0; transform: translate3d(0, 12px, 0); }
.consent-banner__text { color: var(--fog-dim); }
.consent-banner__text strong { color: var(--fog); font-weight: 600; }
.consent-banner__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.consent-banner__choice {
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fog);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.consent-banner__choice:hover { background: rgba(236, 231, 223, 0.1); }
.consent-banner__more { margin-left: auto; border: 0; padding: 0.3rem 0; background: none; color: var(--fog-dim); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
.consent-banner__more:hover { color: var(--fog); }
.reduce-motion .consent-banner { transition: none; transform: none; }
html.has-consent-banner { scroll-padding-bottom: 12rem; }


/* ───────── Loading intro: the name pops out, then becomes ARM ───────── */

.intro { display: none; }
.js .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  animation: intro-failsafe 0.5s ease 7s forwards;
}
.js .intro.is-running { animation: none; }
.js .intro[hidden] { display: none; }
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }
.intro-active .masthead .brand { opacity: 0; }

.intro__curtain {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 45% at 50% 56%, rgba(228, 87, 46, 0.16), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(29, 70, 81, 0.55), transparent 72%),
    var(--ink);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.05s var(--ease-in-out);
}
.intro.is-docking .intro__curtain { clip-path: inset(0 0 100% 0); }

.intro__lockup {
  position: relative;
  display: flex;
  align-items: center;
  font-size: clamp(3rem, 12.5vw, 11.5rem);
  transition: transform 0.95s var(--ease-in-out), opacity 0.28s ease;
  will-change: transform;
}
.intro.is-landed .intro__lockup { opacity: 0; }

.intro__glyph {
  flex: none;
  width: 0;
  height: 0.865em;
  margin-right: 0;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.intro__glyph path { fill: none; stroke-linecap: round; stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro__deck { stroke: rgba(236, 231, 223, 0.55); }
.intro__tower { stroke: var(--fog); stroke-width: 2.2 !important; }
.intro__cable { stroke: var(--gate); stroke-width: 2 !important; }
.intro.is-initials .intro__glyph { width: 2.21em; margin-right: 0.54em; opacity: 1; }
.intro.is-initials .intro__glyph path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--ease-out) 0.25s; }
.intro.is-initials .intro__cable { transition-delay: 0.45s; }

.intro__name {
  display: grid;
  justify-items: center;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1em;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--gate);
  font-variation-settings: 'opsz' 144;
  white-space: nowrap;
}
.intro__line {
  display: block;
  opacity: 0;
  transform: translate3d(-55vw, 0, 0) rotate(-3deg);
}
.intro__line--last { transform: translate3d(55vw, 0, 0) rotate(3deg); }
.intro.is-in .intro__line {
  opacity: 1;
  transform: none;
  transition: transform 1.05s var(--ease-out), opacity 0.5s ease;
}
.intro.is-in .intro__line--last { transition-delay: 0.16s; }

.intro__char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.42em, 0) scale(0.55);
  filter: blur(12px);
}
.intro.is-in .intro__char {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition: opacity 0.45s ease, transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s ease;
  transition-delay: calc(var(--i) * 32ms + 140ms);
}
.intro.is-in .intro__line--last .intro__char { transition-delay: calc(var(--i) * 32ms + 300ms); }
.intro.is-glow .intro__char {
  color: var(--fog);
  text-shadow: 0 0 34px rgba(242, 184, 128, 0.5);
  transition: color 0.5s ease, text-shadow 0.8s ease;
  transition-delay: calc(var(--i) * 26ms);
}

.intro.is-initials .intro__name { display: flex; align-items: baseline; }
.intro.is-initials .intro__line { display: contents; }
.intro.is-initials .intro__char:not(.is-initial) { display: none; }
.intro.is-initials .intro__char.is-initial {
  margin-right: 0.08em;
  font-weight: 500;
  color: var(--fog);
  text-shadow: none;
  transition: transform 0.85s var(--ease-in-out), color 0.5s ease, font-weight 0.8s ease, text-shadow 0.5s ease;
  transition-delay: 0s;
}
.intro.is-initials .intro__line--last .intro__char.is-initial:last-child,
.intro.is-initials .intro__char.is-initial:last-of-type { margin-right: 0; }

.intro__dust { position: fixed; inset: 0; pointer-events: none; }
.intro__mote {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--fog);
  font-variation-settings: 'opsz' 144;
  white-space: nowrap;
  transition: transform 1.05s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.9s ease, filter 0.9s ease;
  transition-delay: var(--delay);
}
.intro__dust.is-drifting .intro__mote {
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(0.6);
}
.intro.is-docking .intro__dust { opacity: 0; transition: opacity 0.3s ease; }

.intro__skip {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-faint);
  opacity: 0;
  animation: intro-hint 0.6s ease 1s forwards;
}
.intro.is-docking .intro__skip { opacity: 0 !important; animation: none; transition: opacity 0.2s ease; }
@keyframes intro-hint { to { opacity: 1; } }
.intro.is-skipped { opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }

/* ───────── Metamorfosis: the monarch flies out of the frame ───────── */

.monarch__track { --track: 440vh; }
.monarch__stage {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(50% 46% at 70% 50%, rgba(240, 138, 36, 0.13), transparent 72%),
    radial-gradient(60% 50% at 10% 20%, rgba(227, 178, 60, 0.06), transparent 70%),
    var(--earth);
}
.monarch__frame {
  position: relative;
  width: min(100% - 2 * var(--gutter), 720px);
  margin: 3rem auto 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 46% 46% 14px 14px / 34% 34% 14px 14px;
  background: #2a2016;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(227, 178, 60, 0.28);
  isolation: isolate;
}
.monarch__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 200, 0.12), inset 0 -40px 60px -30px rgba(21, 16, 12, 0.6);
  pointer-events: none;
}
.monarch__video,
.monarch__plate,
.monarch__plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.monarch__plate { opacity: 0; transform: scale(1.06); transition: opacity 0.9s ease, transform 6s var(--ease-out); }
.monarch__stage.is-airborne .monarch__plate { opacity: 1; transform: scale(1); }

.monarch {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.monarch.is-visible { opacity: 1; visibility: visible; }
.monarch__flyer {
  position: absolute;
  left: 0; top: 0;
  perspective: 900px;
  will-change: transform;
}
.monarch__rig { position: absolute; inset: 0; transform-style: preserve-3d; }
.monarch__wing {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform, filter;
}
.monarch__wing svg { display: block; width: 100%; height: 100%; overflow: visible; }
.monarch__wing--left { left: 0; transform-origin: 100% 28.4%; }
.monarch__wing--right { left: 50%; transform-origin: 0 28.4%; }
.monarch__body { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; transform: translateZ(1px); }

.monarch__captions { display: grid; gap: 2.25rem; width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 2rem auto 0; padding-bottom: 3rem; }
.medicine .monarch__captions .caption__kicker { color: var(--fog); }

.arm-ready .monarch__stage { display: block; }
.arm-ready .monarch__frame {
  position: absolute;
  right: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  top: 50%;
  width: min(48vw, 720px);
  margin: 0;
  transform: translateY(-44%);
}
.arm-ready .monarch__captions {
  position: absolute;
  left: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  top: 50%;
  width: min(28rem, 34vw);
  margin: 0;
  padding: 0;
  display: block;
  min-height: 17rem;
  transform: translateY(-30%);
}
.arm-ready .monarch__title { margin-bottom: 1.5rem; }
.arm-ready .monarch__captions .caption { top: 3rem; bottom: auto; }

/* ───────── The black cat, in letters ───────── */

.catdata {
  position: relative;
  justify-self: end;
  width: min(78vw, 320px);
  margin-top: 0.5rem;
  color: var(--paper-ink);
}
.catdata:focus { outline: none; }
.catdata:focus-visible { outline: 2px solid var(--gate-deep); outline-offset: 6px; border-radius: 4px; }
.catdata__frame { position: relative; aspect-ratio: 600 / 704; }
.catdata__still, .catdata__video, .catdata__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.catdata__video { opacity: 0; pointer-events: none; }
.catdata__still { object-fit: cover; transition: opacity 0.5s ease; }
.arm-ready .catdata__still { opacity: 0; }
.arm-ready.reduce-motion .catdata__still, .arm-ready .catdata.is-still .catdata__still { opacity: 1; }
.catdata__label {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  color: var(--paper-dim);
  transition: opacity 1.4s ease;
}
.catdata__label i { text-transform: none; letter-spacing: 0.02em; }
.catdata.is-gone .catdata__label { opacity: 0; }
.catdata__again {
  position: relative;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--paper-ink);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(22, 32, 42, 0.28);
  transition: background-color 0.25s ease;
}
.catdata__again:hover { background: rgba(22, 32, 42, 0.06); }
.catdata__again[hidden] { display: none; }
@media (min-width: 901px) {
  .mind .chapter-head {
    --cat-w: clamp(260px, 27vw, 420px);
    position: relative;
    min-height: calc(var(--section-pad) + var(--span-art-h) + 2.75rem + var(--cat-w) / 0.853 + 2.5rem + clamp(3rem, 7vw, 6rem));
  }
  .catdata {
    position: absolute;
    top: calc(var(--section-pad) + var(--span-art-h) + 2.75rem);
    right: 0;
    width: var(--cat-w);
    margin: 0;
  }
}

/* ───────── Clinical inquiries: TBD ───────── */

.clinical-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin-top: 2.5rem;
  padding: 1.1rem 1.3rem;
  border: 1px dashed rgba(22, 32, 42, 0.32);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
}
.clinical-note__label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gate-ink); }
.clinical-note__text { color: var(--paper-ink); }
.clinical-note__aside { margin-top: 0.35rem; font-size: 0.875rem; color: var(--paper-ink); }
.tbd {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: var(--paper-ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  vertical-align: 0.12em;
}
.contact__tbd { color: var(--fog-dim); font-size: 0.9375rem; max-width: 32ch; }
.contact__tbd .tbd { background: var(--fog); color: var(--ink); }
.contact__tbd-aside { margin-top: 0.35rem; max-width: 32ch; font-size: 0.875rem; color: var(--fog-dim); }

@media (max-width: 560px) {
  .intro__lockup { font-size: clamp(3rem, 15vw, 5rem); }
}

@media (max-width: 900px) {
  .arm-ready .monarch__frame {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--masthead-h) + 1rem);
    width: auto;
    transform: none;
  }
  .arm-ready .monarch__captions {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: clamp(1.25rem, 4vh, 2.5rem);
    width: auto;
    transform: none;
    min-height: 14rem;
  }
  .arm-ready .monarch__title { margin-bottom: 0.75rem; }
  .arm-ready .monarch__captions .caption { top: 2.5rem; }
}

.reduce-motion .monarch__stage { display: grid !important; align-content: start; padding-block: calc(var(--masthead-h) + 2rem) 3rem; }
.reduce-motion .monarch__frame { position: relative !important; inset: auto !important; transform: none !important; width: min(100% - 2 * var(--gutter), 720px) !important; margin: 0 auto !important; }
.reduce-motion .monarch__captions { position: relative !important; inset: auto !important; transform: none !important; width: min(100% - 2 * var(--gutter), var(--wrap)) !important; display: grid !important; gap: 2rem; margin: 2rem auto 0 !important; min-height: 0; }
.reduce-motion .monarch__captions .caption { position: static !important; }
.reduce-motion .monarch { display: none; }
.reduce-motion .intro { display: none !important; }

.cortex__panel[data-layout='narrow'] .cortex__fig,
.cortex__panel[data-layout='narrow'] .cortex__credit { display: none; }
.arm-ready .cortex__panel[data-layout='narrow'] .cortex__captions .caption { width: 100%; }
.arm-ready.cortex-unavailable .cortex__panel[data-layout='narrow'] .cortex__still {
  top: 9%; left: 50%; right: auto;
  width: min(92%, 70vh);
  transform: translateX(-50%);
}

.reduce-motion .cortex__panel { position: relative !important; inset: auto !important; margin-inline: var(--gutter) !important; grid-template-rows: minmax(56svh, 66svh) auto; }
.reduce-motion .cortex__canvas { position: relative; inset: auto; height: 100%; min-height: 56svh; }
.reduce-motion .cortex__captions { position: relative !important; inset: auto !important; display: grid !important; gap: 2rem; padding: 0 clamp(1.25rem, 3.5vw, 3rem) 3rem !important; pointer-events: auto; }
.reduce-motion .cortex__title { position: static !important; }
.reduce-motion .cortex__captions .caption { width: auto !important; }
.reduce-motion .cortex__yaw { display: none; }
.cortex__panel[data-layout='narrow'] {
  background:
    radial-gradient(85% 42% at 50% 38%, rgba(29, 70, 81, 0.5), transparent 72%),
    radial-gradient(100% 50% at 0% 100%, rgba(228, 87, 46, 0.08), transparent 65%),
    var(--ink);
}
.cortex__panel[data-layout='narrow'] .cortex__yaw { top: 1.9rem; left: 0.15rem; right: auto; }
.cortex-unavailable .cortex__yaw { display: none; }

@media (max-width: 900px) {
  .legal__layout { grid-template-columns: minmax(0, 1fr); }
  .legal__toc { position: static; padding: 1.1rem 1.25rem; border: 1px solid var(--paper-line); border-radius: 6px; background: #f8f4ee; }
  .legal__toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; font-size: 0.8125rem; }
  .consent__inner { gap: 0.9rem; }
  .consent__title { font-size: 1.7rem; }
}

/* Shared cookie and privacy access. */
.privacy-launcher {
  position: fixed;
  left: max(0.8rem, env(safe-area-inset-left));
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 110;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid #607080;
  border-radius: 999px;
  background: #111a24;
  color: #ece7df;
  font: 500 0.8125rem/1.4 var(--font-text);
  text-decoration: none;
  box-shadow: 0 8px 24px #060a0e30;
}
.privacy-launcher:hover { background: #203041; color: #fff; }
.privacy-launcher:focus-visible { outline: 3px solid var(--gate); outline-offset: 4px; }
.consent-banner { bottom: max(4.6rem, calc(env(safe-area-inset-bottom) + 4.6rem)); max-height: calc(100dvh - 6rem); overflow: auto; }
.consent__text-action { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; padding: 0; border: 0; background: none; color: var(--fog); font: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
.consent__text-action[hidden] { display: none; }
.consent__text-action:disabled { color: var(--fog-dim); cursor: default; }
.consent__switch:disabled { cursor: default; }
#ag-privacy-trigger[data-arm-replaced] { clip-path: inset(50%) !important; }
@media (forced-colors: active) {
  .privacy-launcher { background: ButtonFace; color: ButtonText; border-color: ButtonText; }
  .privacy-launcher:focus-visible { outline-color: Highlight; }
  .consent__text-action { color: LinkText; }
}

/* Tactile controls: highlight and arrow movement stay within each hit area. */
.button, .topic-pill, .scene-control, .catdata__again { position: relative; isolation: isolate; overflow: hidden; min-height: 44px; -webkit-tap-highlight-color: transparent; }
.button::before, .topic-pill::before, .scene-control::before, .catdata__again::before {
  content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.22), transparent 68%);
  opacity: 0; transition: opacity 0.25s ease;
}
.button:focus-visible::before, .topic-pill:focus-visible::before, .scene-control:focus-visible::before { opacity: 1; }
.button > span[aria-hidden] { display: inline-block; transition: transform 0.3s var(--ease-out); }
.button:is(:hover, :focus-visible) > span[aria-hidden] { transform: translateX(4px); }
.button:active, .topic-pill:active, .scene-control:active, .catdata__again:active { transform: scale(0.97); }
.control-ripple { position: absolute; z-index: -1; left: var(--pointer-x, 50%); top: var(--pointer-y, 50%); width: 24px; height: 24px; border-radius: 50%; pointer-events: none; background: currentColor; animation: control-ripple 0.6s ease-out both; }
@keyframes control-ripple { from { transform: translate(-50%, -50%) scale(0); opacity: 0.2; } to { transform: translate(-50%, -50%) scale(22); opacity: 0; } }
.scene-control { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 44px; padding: 0.55rem 1rem; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font-size: 0.875rem; transition: background-color 0.25s ease, transform 0.25s ease; }
.scene-control[hidden] { display: none; }
.cortex__spark { position: absolute; right: clamp(1.1rem, 2.4vw, 1.75rem); top: 4.7rem; z-index: 2; color: var(--fog); border-color: var(--line-strong); background: rgba(11, 17, 24, 0.65); }
.cortex__spark:is(:hover, :focus-visible) { background: rgba(228, 87, 46, 0.2); border-color: var(--gate-hover); }
.catdata__controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.65rem; }
.catdata__pet { color: var(--paper-ink); border-color: rgba(22, 32, 42, 0.28); }
.catdata__response { min-height: 1.4em; margin-top: 0.4rem; text-align: right; color: var(--gate-ink); font-size: 0.875rem; }
.catdata__frame { transition: transform 0.45s var(--ease-out), filter 0.45s ease; }
.catdata.is-petted .catdata__frame { filter: drop-shadow(0 0 12px rgba(228, 87, 46, 0.24)); }
@media (hover: hover) and (pointer: fine) {
  .button:hover::before, .topic-pill:hover::before, .scene-control:hover::before, .catdata__again:hover::before { opacity: 1; }
  .topic-pill:hover { border-color: var(--gate-ink); box-shadow: 0 4px 14px -10px var(--paper-ink); }
  .included .topic-pill:hover { border-color: var(--gate-hover); }
  html:not(.reduce-motion):not(.motion-paused) .topic-pill:hover { transform: translateY(-2px); }
  html:not(.reduce-motion):not(.motion-paused) .catdata.is-curious .catdata__frame { transform: perspective(900px) rotateX(var(--cat-pitch, 0deg)) rotateY(var(--cat-yaw, 0deg)) translateY(-3px); filter: drop-shadow(0 6px 10px rgba(228, 87, 46, 0.16)); }
}
.reduce-motion .control-ripple, .motion-paused .control-ripple { display: none; }
.reduce-motion :is(.button, .topic-pill, .scene-control, .catdata__again), .motion-paused :is(.button, .topic-pill, .scene-control, .catdata__again) { transform: none !important; }
.reduce-motion .button > span[aria-hidden], .motion-paused .button > span[aria-hidden] { transform: none; }

@media (max-width: 900px) and (max-height: 600px) and (orientation: landscape) {
  .arm-ready .monarch__frame { left: auto; right: var(--gutter); top: calc(var(--masthead-h) + 1rem); width: min(44vw, calc((100svh - var(--masthead-h) - 2rem) * 1.5)); }
  .arm-ready .monarch__captions { left: var(--gutter); right: auto; top: calc(var(--masthead-h) + 1.5rem); bottom: auto; width: 42vw; min-height: 13rem; }
  .monarch__captions .caption__kicker { font-size: 1.65rem; }
  .monarch__captions .caption__text { font-size: 0.9375rem; }
}
