/* Shared chrome for the BCS project pages. Each project keeps its own stage.
   Colors: the four tokens in /theme.css (--ex-n1 base, --ex-n2 surface, --ex-n3 text, --ex-pop) and mixes of them.
   --chapter-muted is 7.6:1 on n2 and 9.2:1 on n1; pop text is 5.0:1 on n2 and 6.1:1 on n1. */
:root { background: var(--ex-n1); }
.bcs-chapter {
  --chapter-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --chapter-inset: clamp(20px, 5vw, 72px);
  --chapter-shell: min(1248px, calc(100% - clamp(40px, 11.5vw, 176px)));
  --chapter-muted: color-mix(in oklab, var(--ex-n3) 72%, var(--ex-n2));
  --chapter-line: color-mix(in oklab, var(--ex-n3) 16%, var(--ex-n1));
  color-scheme: dark;
  margin: 0;
  background: var(--ex-n1);
  color: var(--ex-n3);
  font-family: var(--chapter-font);
  -webkit-font-smoothing: antialiased;
}
.chapter-header {
  position: relative;
  z-index: 3;
  background: var(--ex-n1);
  color: var(--ex-n3);
  border-bottom: 1px solid var(--chapter-line);
}
.chapter-nav {
  width: var(--chapter-shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}
.chapter-nav nav {
  display: flex;
  align-items: center;
  width: auto;
  margin: 0 0 0 auto;
  padding: 0;
  gap: clamp(16px, 2.8vw, 36px);
  border: 0;
}
.chapter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ex-n3);
  font: 500 14px/1 var(--chapter-font);
  letter-spacing: -.012em;
}
.chapter-nav .chapter-brand {
  gap: 8px;
  color: var(--ex-n3);
  font: 750 23px/1 var(--chapter-font);
  letter-spacing: -1.7px;
}
.chapter-brand img { display: block; width: 27px; height: 27px; }
.chapter-site-name {
  color: var(--chapter-muted);
  padding-left: 17px;
  border-left: 1px solid var(--chapter-line);
  font: 400 13px/1.15 var(--chapter-font);
  letter-spacing: -.02em;
}
.chapter-nav a[aria-current] {
  text-decoration: underline 2px var(--ex-pop);
  text-underline-offset: 7px;
}
.chapter-nav a:hover { color: var(--ex-pop); }
.bcs-chapter :focus-visible { outline: 2px solid var(--ex-pop); outline-offset: 3px; }
.chapter-skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.chapter-skip:focus, .bcs-chapter .skip:focus {
  position: absolute;
  z-index: 5;
  top: 5px;
  left: 5px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ex-n3);
  color: var(--ex-n1);
}
/* The electric hero (theme.css .ex-hero) as a band at the top of each project page. It stays shorter than the full
   hero, so a 3D viewer below it has the screen under the scene, never behind it. */
.bcs-chapter .chapter-hero {
  min-height: clamp(280px, 44vh, 460px);
  padding: clamp(56px, 9vh, 112px) 0 clamp(26px, 4.5vh, 48px);
}
.chapter-hero > .ex-hero__content { width: var(--chapter-shell); margin-inline: auto; }
.chapter-kicker {
  margin: 0;
  color: var(--ex-pop);
  font: 650 14px/1.4 var(--chapter-font);
  letter-spacing: .005em;
}
.chapter-tessy .record { width: var(--chapter-shell); max-width: none; margin-inline: auto; }
.chapter-tessy .intro h1,
.chapter-loop .heading h1,
.chapter-lab .caption h1,
.chapter-notebook h1 {
  font-family: var(--chapter-font);
  font-weight: 620;
  letter-spacing: -.065em;
  line-height: .99;
  text-wrap: balance;
}
.chapter-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: var(--chapter-muted);
  font: 600 14px/1.25 var(--chapter-font);
}
.chapter-back:hover { color: var(--ex-n3); text-decoration: underline var(--ex-pop); text-underline-offset: 3px; }
.chapter-tessy .intro h1 {
  margin: 10px 0 18px;
  font-size: clamp(62px, 7.6vw, 122px);
}
.chapter-tessy .standfirst {
  max-width: 17em;
  font-size: clamp(21px, 2.1vw, 31px);
  line-height: 1.18;
}
.chapter-tessy .portrait { border-radius: 22px; }
.chapter-tessy .viewer-actions button {
  min-height: 44px;
  border-radius: 999px;
  font-family: var(--chapter-font);
}
.chapter-tessy .film a {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .27em;
  min-height: 44px;
  margin-block: 4px 0;
  line-height: 1.33;
}
.chapter-tessy .film-line, .chapter-tessy #plate-label {
  font: 500 12px/1.35 var(--chapter-font);
  letter-spacing: 0;
  text-transform: none;
}
.chapter-tessy .film svg { margin-left: .1em; }
.chapter-loop .heading h1 {
  margin: 12px 0 18px;
  font-size: clamp(54px, 6.6vw, 98px);
}
.chapter-loop .desk-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.desk-navigation a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--ex-n3);
  font: 550 14px/1.2 var(--chapter-font);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--ex-pop);
}
.desk-navigation a:hover { color: var(--ex-pop); }
.chapter-loop .film-stage video, .chapter-loop .artwork img { border-radius: 17px; }
.chapter-loop .chamber { border-radius: 20px; }
.chapter-loop .chamber-head h2, .chapter-loop .cut-head h2, .chapter-loop .beat-detail h3 {
  font-family: var(--chapter-font);
  font-weight: 580;
  letter-spacing: -.04em;
}
.chapter-loop .beat-board button,
.chapter-loop select,
.chapter-loop input[type="range"],
.chapter-loop .voices summary { min-height: 44px; }
.chapter-loop .beat-board button,
.chapter-loop .water-controls select { border-radius: 10px; }
.chapter-loop .voices summary { padding-block: 12px; }
.chapter-loop .lead { max-width: 40ch; }
.chapter-lab {
  --sans: var(--chapter-font);
}
.chapter-lab .lab { width: var(--chapter-shell); margin-inline: auto; }
.bcs-chapter.chapter-lab .chapter-hero { min-height: clamp(240px, 34vh, 360px); }
.chapter-lab .caption h1 { font-size: clamp(36px, 4.9vw, 74px); }
.chapter-lab .vision-heading::before { width: clamp(40px, 4.3vw, 67px); }
.chapter-lab .intro { font-size: 16px; line-height: 1.55; margin-top: 14px; }
.chapter-lab .view-switch {
  align-self: flex-start;
  flex-wrap: nowrap;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--chapter-line);
  border-radius: 16px;
  padding: 3px;
  gap: 2px;
  background: var(--ex-n2);
}
.chapter-lab .view-switch button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
}
.chapter-lab .view-switch button[aria-pressed="true"] { background: var(--ex-pop); color: var(--ex-n1); }
.chapter-lab .bottom button, .chapter-lab .bottom summary {
  min-height: 44px;
}
.chapter-lab .bottom summary { display: flex; align-items: center; }
.chapter-lab .notes { border-radius: 14px; }
.chapter-lab .related-character { border-top: 1px solid var(--chapter-line); }
.chapter-lab .related-character a,
.chapter-notebook .note-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-block: 8px;
  color: var(--chapter-muted);
  text-decoration: none;
  font: 550 14px/1.3 var(--chapter-font);
}
.chapter-lab .related-character a:hover, .chapter-notebook .note-actions a:hover { color: var(--ex-n3); text-decoration: underline var(--ex-pop); text-underline-offset: .25em; }
.chapter-notebook h1 { font-size: clamp(41px, 5.6vw, 75px); }
.chapter-notebook h1 + p { margin-bottom: 0; }
.chapter-notebook h2 { font-family: var(--chapter-font); font-weight: 620; }
.chapter-notebook .note-actions { margin: 0 0 1.5rem; }
.chapter-notebook .note-actions a {
  border: 1px solid var(--chapter-line);
  border-radius: 999px;
  color: var(--ex-n3);
  padding-inline: 18px;
}
@media (max-width: 670px) {
  .chapter-nav { min-height: 55px; gap: 12px; }
  .chapter-site-name { display: none; }
  .chapter-tessy .intro h1 { margin: 8px 0 11px; }
  .chapter-tessy .toolbar { flex-wrap: wrap; }
  .chapter-tessy .viewer-actions { flex-wrap: wrap; }
  .chapter-loop .film-stage { width: min(100%, 363px); }
  .chapter-loop .desk-navigation { gap: 11px; }
  .chapter-loop .chamber { border-radius: 16px; }
  .chapter-lab .view-switch button { padding-inline: 9px; }
  .chapter-lab .caption h1 { font-size: clamp(32px, 7.4vw, 48px); }
}
@media (max-width: 370px) {
  .chapter-nav nav { gap: 10px; }
  .chapter-lab .view-switch { width: 100%; }
  .chapter-lab .view-switch button { flex: 1 1 auto; padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .bcs-chapter { scroll-behavior: auto; }
  .bcs-chapter *, .bcs-chapter *::before, .bcs-chapter *::after { transition-duration: 0s !important; }
}
