/* Science lab — one 4:1 film across the header, then the dossier. */
html.lab-root .nav {
  background: none;
}
html.lab-root,
body.lab-root {
  height: 100%;
}
body.lab-root {
  --lab-copy-min: 17.5rem;
  --lab-film-h: calc(100vw / 4);
  padding: var(--nav-h) 0 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 48px;
}

.lab-film {
  position: relative;
  z-index: 1;
  left: 50%;
  width: 100vw;
  max-width: none;
  min-width: 0;
  height: var(--lab-film-h);
  margin: 0 0 0 -50vw;
  background: #030304;
  overflow: hidden;
  display: block;
}
.lab-film-vid {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10%;
  display: block;
  width: 118%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  opacity: 0;
  pointer-events: none;
}
.lab-film.is-live .lab-film-vid {
  opacity: 1;
}
.lab-film::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, #030304 0%, rgba(3, 3, 4, .5) 7%, transparent 18%),
    linear-gradient(180deg, transparent 58%, rgba(5, 5, 6, .45) 82%, #050506 100%);
}
.lab-film-ph {
  position: absolute;
  left: var(--pad);
  bottom: 18px;
  z-index: 1;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, .32);
  pointer-events: none;
}
.lab-film.is-live .lab-film-ph { display: none; }
.lab-film-ph::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: rgba(var(--accent-rgb), .55);
  margin-bottom: 10px;
}

.lab-room {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  padding: clamp(12px, 1.8vh, 24px) var(--pad) 8px;
  overflow: auto;
}
.lab-copy {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.lab-mast {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  flex-shrink: 0;
  margin-bottom: clamp(10px, 1.6vh, 20px);
}
.lab-kicker {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0;
}
.lab-n {
  font-family: Michroma, "IBM Plex Sans", sans-serif;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(245, 248, 252, .38);
  margin: 0;
}
.lab-copy h1 {
  font-size: clamp(18px, 2.2vw, 34px);
  margin: 0;
  color: #f5f8fc;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}
.lab-pack {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, .4);
  margin: 0;
}
.lab-back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0 16px 0 0;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, .55);
  border-bottom: 1px solid rgba(var(--accent-rgb), .35);
}
.lab-dossier {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.lab-dossier .lab-lead {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, .38);
  margin: 0 0 clamp(10px, 1.4vh, 16px);
  flex-shrink: 0;
}
.lab-qas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(28px, 4vw, 64px);
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  align-content: start;
}
.lab-qas::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(var(--accent-rgb), .16);
  transform: translateX(-0.5px);
  pointer-events: none;
}
.lab-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vh, 22px);
}
.lab-qa h3 {
  font-family: Michroma, "IBM Plex Sans", sans-serif;
  font-size: clamp(9px, 0.72vw, 11px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.lab-a p {
  font-size: clamp(11.5px, 0.42vw + 0.95vh, 14px);
  font-weight: 300;
  line-height: 1.38;
  color: rgba(245, 248, 252, .72);
  margin: 0 0 0.55em;
  max-width: none;
}
.lab-a p:last-child { margin-bottom: 0; }
.lab-refs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lab-refs a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  color: #f5f8fc;
  text-decoration: none;
  border-left: 1px solid rgba(var(--accent-rgb), .45);
  padding: 6px 0 6px 12px;
}
.lab-refs a:hover,
.lab-refs a:focus-visible {
  color: var(--accent);
}
.lab-refs em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, .42);
  margin-top: 4px;
}
.lab-formula { display: none; }

.lab-index {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 6;
  display: flex;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--pad);
  background: transparent;
  border-top: 1px solid rgba(var(--accent-rgb), .16);
  scrollbar-width: none;
}
.lab-index::-webkit-scrollbar { display: none; }
.lab-index a {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  font-family: Michroma, "IBM Plex Sans", sans-serif;
  font-size: 9px;
  letter-spacing: .08em;
  color: rgba(245, 248, 252, .38);
}
.lab-index a.is-on { color: var(--accent); }

@media (max-width: 900px) {
  html.lab-root,
  body.lab-root {
    height: auto;
    overflow: auto;
    display: block;
  }
  .lab-film {
    display: block;
    left: 50%;
    width: 100vw;
    max-width: none;
    height: auto;
    aspect-ratio: 4 / 1;
    min-height: 0;
    max-height: none;
    margin: 0 0 0 -50vw;
  }
  .lab-film-vid {
    top: 0;
    bottom: 0;
    left: -8%;
    width: 116%;
    height: 100%;
    transform: none;
    object-fit: cover;
    object-position: left center;
  }
  .lab-film::after {
    background:
      linear-gradient(90deg, #030304 0%, rgba(3, 3, 4, .45) 8%, transparent 20%),
      linear-gradient(180deg, transparent 52%, rgba(5, 5, 6, .5) 80%, #050506 100%);
  }
  .lab-room {
    display: block;
    overflow: visible;
    padding: 24px var(--pad) calc(24px + env(safe-area-inset-bottom));
  }
  .lab-mast {
    display: block;
  }
  .lab-back { min-height: 44px; margin-bottom: 8px; }
  .lab-kicker { margin: 8px 0 6px; }
  .lab-n { margin-bottom: 6px; }
  .lab-copy h1 { font-size: 22px; margin-bottom: 8px; white-space: nowrap; }
  .lab-pack { margin-bottom: 16px; }
  .lab-qas {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .lab-qas::before { display: none; }
  .lab-col { gap: 22px; }
  .lab-qa h3 { font-size: 10px; }
  .lab-a p {
    font-size: 15px;
    line-height: 1.55;
  }
  .lab-index {
    position: sticky;
    bottom: 0;
    justify-content: flex-start;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(5, 5, 6, .92));
    border-top: 0;
  }
}
