@font-face { font-family: helveticaNeueReg;    src: url(HelveticaNeue-Regular.otf);       font-display: swap; }
@font-face { font-family: helveticaNeueLight;  src: url(HelveticaNeue-Light.otf);         font-display: swap; }
@font-face { font-family: helveticaNeueItal;   src: url(HelveticaNeue-RegularItalic.otf); font-display: swap; }
@font-face { font-family: helveticaNeueBold;   src: url(HelveticaNeue-Bold.otf);          font-display: swap; }
@font-face { font-family: PPEditorialRegular;  src: url(PPEditorialNew-Ultralight.otf);   font-display: swap; }
@font-face { font-family: PPEditorialItalic;   src: url(PPEditorialNew-Italic.otf);       font-display: swap; }
@font-face { font-family: PPEditorialUltra;    src: url(PPEditorialNew-Ultrabold.otf);    font-display: swap; }

/* -----------------------------------------------------------------
   horse-main.css
   Jonathan Lee — Portfolio / Equestrian Documentary

   BREAKPOINTS (desktop-first, base styles = desktop)
     max-width 1024px  tablet landscape / small laptop (tighten spacing)
     max-width  900px  tablet portrait + phones (stacked layout)
     max-width  480px  small phones
     max-height 500px + landscape   phone held sideways
     hover: none       touch devices (no hover previews)
----------------------------------------------------------------- */

:root {
  --bg: #0e0e0e;
  --fg: #f4f4f2;
  --dim: rgba(244, 244, 242, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---- Hero / splash background ------------------------------------ */

body.splash-river {
  min-height: 100vh;
  min-height: 100svh;
  /* relative path (was "/img/...", which only works at the domain root) */
  background-image: url("../img/Riverrunner/Capture.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---- Top nav ------------------------------------------------------ */

.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  padding: 24px 8vw;
  z-index: 10;
}

.nav-item-alt {
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  transition: opacity 200ms ease;
}

/* ---- Splash intro --------------------------------------------------- */

.page-megan      .video-splash { background-image: url("../img/Riverrunner/untitled-0406.webp"); }
.page-hannah     .video-splash { background-image: url("../img/Riverrunner/h_nemo.webp"); }
.page-nema       .video-splash { 
  filter: grayscale(100);
  background-image: url("../img/Riverrunner/nema.webp"); }
.page-nat .video-splash { 
  filter: grayscale(100);
  background-image: url("../img/Riverrunner/n_reno.webp"); }
.page-intermezzo .video-splash { background-image: url("../img/Riverrunner/horse8.webp"); }

.splash {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: left;
  gap: 28px;
  padding: 0 8vw;
  opacity: 0;
  animation: splash-in 1400ms ease forwards;
}

.splash-title {
  margin: 0;
  font-family: PPEditorialRegular;
  /* scales smoothly from phone (28px) to desktop (96px) */
  font-size: clamp(1.75rem, 0.75rem + 4.4vw, 6rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
  overflow-wrap: break-word;
}

.splash-copy {
  max-width: 560px;
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--dim);
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  animation: splash-in 1000ms ease forwards;
  animation-delay: 900ms;
}

.scroll-cue::after {
  content: '';
  width: 1px;
  height: 34px;
  background: var(--dim);
  animation: cue-pulse 1800ms ease-in-out infinite;
}

@keyframes splash-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cue-pulse {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50%      { transform: scaleY(0.5); opacity: 1; }
}

/* ---- Section intro copy ------------------------------------------- */

section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 100px 0 60px;
}

.index2h122 {
  position: relative;
  z-index: 3;
  margin: 0 8vw 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

section > h2 {
  position: relative;
  z-index: 3;
  margin: 0 8vw 40px;
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 300;
  line-height: 1.2;
}

/* ---- Name list ------------------------------------------------------ */

.name-list {
  position: relative;
  z-index: 3;
  width: 50vw;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 0 8vw;
}

.name-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.designer-link {
  color: var(--fg);
  font-family: PPEditorialRegular;
  text-decoration: none;
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem);
  line-height: 1;
  transition: opacity 250ms ease;
}

.hover-copy {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(13px, 0.6rem + 0.6vw, 18px);
  letter-spacing: 0.06em;
  color: var(--dim);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 300ms ease, transform 300ms ease;
}

/* Hover effects only on devices that can actually hover (stops "sticky hover" on phones) */
@media (hover: hover) {
  .nav-item-alt:hover { opacity: 1; }
  .name-item:hover .designer-link { opacity: 0.85; }
  .name-item:hover .hover-copy { opacity: 1; transform: translateY(0); }
}

/* Touch devices can't hover, so the subtitle is always visible */
@media (hover: none) {
  .nav-item-alt { opacity: 1; padding: 12px 0; }   /* bigger tap target */
  .designer-link { padding: 4px 0; }
  .hover-copy { opacity: 0.75; transform: none; }
}

/* ---- Fullscreen video player (used by older video.js pages) ------- */

video-player {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

video-skin {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 0rem;
  width: 100%;
  height: 100%;
  overflow: hidden;
  --media-border-radius: 0rem;
}

youtube-video,
video-player [slot="poster"] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78dvh);
  height: max(100dvh, 56.25vw);
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
}

video-player [slot="poster"] {
  object-fit: cover;
  object-position: center;
}

/* ---- Bio panel (bottom left) --------------------------------------- */

.bio-panel {
  position: fixed;
  bottom: 32px;
  left: 8vw;
  z-index: 5;
  width: min(360px, 34vw);
}

.bio {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  font-size: 15px;
  color: var(--dim);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}

.bio.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Portrait panel -------------------------------------------------- */

.portrait-layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.portrait {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(8%);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 40px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
}

.portrait.is-active {
  opacity: 1;
  transform: translateX(0);
}

.portrait[data-portrait="megan"]  { background-image: url("../img/Riverrunner/untitled-0406.webp"); }
.portrait[data-portrait="hannah"] { background-image: url("../img/Riverrunner/h_nemo.webp"); }
.portrait[data-portrait="nata"]   { 
  filter:grayscale(100);
  background-image: url("../img/Riverrunner/n_reno.webp"); }
.portrait[data-portrait="stav"]   { background-image: url("../img/Riverrunner/horse8.webp"); }
.portrait[data-portrait="nema"]   { 
  filter:grayscale(100);
  background-image: url("../img/Riverrunner/nema.webp"); }


/* =================================================================
   RESPONSIVE
================================================================= */

/* ---- Tablet landscape / small laptop: max 1024px ------------------- */
@media (max-width: 1024px) {
  .header-nav { padding: 22px 6vw; }

  .splash { padding: 0 6vw; }

  .index2h122,
  section > h2 { margin-left: 6vw; margin-right: 6vw; }

  .name-list { width: 52vw; padding: 0 6vw; gap: 24px; }
  .bio-panel { left: 6vw; width: min(340px, 40vw); }
  .portrait { padding: 28px; }
}

/* ---- Tablet portrait + phones: max 900px --------------------------- */
@media (max-width: 900px) {
  .header-nav { padding: 18px 6vw; gap: 18px; }

  .splash { padding: 0 6vw; gap: 20px; }

  section { padding: 80px 0 40px; }

  .index2h122,
  section > h2 { margin-left: 6vw; margin-right: 6vw; }

  /* names go full width, portraits sit behind them */
  .name-list { width: 100%; padding: 0 6vw; gap: 22px; }
  .portrait-layer { width: 100%; z-index: 0; }
  .portrait::before {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  }

  .bio-panel { left: 6vw; right: 6vw; bottom: 24px; width: auto; }
  .bio { font-size: 14px; }

  /* video.js player stays true fullscreen */
  video-player { width: 100%; height: 100dvh; aspect-ratio: auto; }
  video-skin { width: 100%; height: 100%; }
  youtube-video,
  video-player [slot="poster"] {
    width: max(100vw, 177.78dvh);
    height: max(100dvh, 56.25vw);
  }
  .video-overlay { height: 100dvh; }
}

/* ---- Small phones: max 480px --------------------------------------- */
@media (max-width: 480px) {
  .header-nav { padding: 14px 5vw; gap: 14px; }
  .splash,
  .name-list { padding-left: 5vw; padding-right: 5vw; }
  .index2h122,
  section > h2 { margin-left: 5vw; margin-right: 5vw; }
  .bio-panel { left: 5vw; right: 5vw; }
  .bio { font-size: 13px; }
  .portrait { padding: 20px; }
}

/* ---- Short screens (small phones in portrait, e.g. iPhone SE) ------- */
@media (max-width: 900px) and (max-height: 700px) {
  .name-list { gap: 14px; }
  section { padding: 64px 0 32px; }
}

/* ---- Phones held sideways ------------------------------------------ */
@media (orientation: landscape) and (max-height: 500px) {
  .header-nav { padding: 10px 5vw; }
  .splash { gap: 12px; }
  .splash-title { font-size: clamp(1.25rem, 3.4vw, 2rem); }

  section { padding: 56px 0 20px; min-height: 100vh; min-height: 100svh; }

  /* two columns so all five names fit without scrolling */
  .name-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 24px;
    padding: 0 5vw;
  }
  .designer-link { font-size: 1.25rem; }
  .hover-copy { font-size: 12px; }

  .portrait-layer { width: 100%; z-index: 0; }
  .bio-panel { display: none; }   /* would sit on top of the names */
}

/* ---- Large screens -------------------------------------------------- */
@media (min-width: 1800px) {
  .name-list { padding-left: 10vw; }
  .bio-panel { left: 10vw; }
}

/* ---- Reduced motion ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .splash,
  .scroll-cue { animation: none; opacity: 1; }
  .scroll-cue::after { animation: none; }
  .portrait,
  .bio,
  .hover-copy { transition: none; }
}


/* =================================================================
   VIDEO PAGES  (megan_eq.html and the other *_eq.html pages)
   All rules below are scoped by class, so they only affect pages
   with <body class="video-page">.
================================================================= */

body.video-page {
  margin: 0;
  padding: 0;
  background-color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.hero-video-section {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hero-video-section video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

/* Any portrait screen (phones AND tablets): show the whole frame instead of cropping a 16:9 video */
@media (orientation: portrait) {
  .hero-video-section video { object-fit: contain; }
}

:root {
  --text-main: #c4c4c4;
  --text-muted: #888888;
  --text-hover: #c2c2c2;
}

.nav-container {
  position: absolute;
  top: 25px;
  left: 25px;
  z-index: 50;
}

.menu-btn {
  display: none;
}

/* Permanent Editorial Dropdown Menu with Subtle Gradient & Fade Transition */
.editorial-nav {
  position: relative;
  font-size: 0.75rem;
  padding: 24px;
  box-sizing: border-box;
  
  /* Fade transition configuration */
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/* Hidden state triggered by JS after 15 seconds of inactivity */
.editorial-nav.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: clamp(1.5rem, 4vw, 4rem);
  justify-content: start;
}

.nav-column {
  display: flex;
  flex-direction: column;
}

.nav-header {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

@media (hover: hover) {
  .nav-item a:hover {
    color: var(--text-hover);
    transform: translateX(10px);
  }
}

.video-splash {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: url("../img/Riverrunner/untitled-0406.JPG") center / cover no-repeat;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-play-button {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0;
  color: #fff;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.splash-play-icon {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.splash-play-button:hover .splash-play-icon {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.splash-play-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.splash-play-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.video-controls {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

#playToggle,
#audioToggle {
  position: absolute;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  min-height: 44px;
  pointer-events: auto;
}

#playToggle {
  left: calc(30px + env(safe-area-inset-left, 0px));
}

#audioToggle {
  right: calc(30px + env(safe-area-inset-right, 0px));
}

/* Sleek minimalist video control button styling */
.audio-control-btn {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 16px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.audio-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Hamburger menu on tablets/phones, and on phones held sideways */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .nav-container {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
  }

  .menu-btn {
    display: block;
    min-height: 44px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font: inherit;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
  }

  .editorial-nav {
    display: none;
    margin-top: 8px;
    padding: 12px 16px;
    width: calc(100vw - 24px);
    max-width: 320px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 12px;
  }

  .editorial-nav.open {
    display: block;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
  }

  .nav-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .nav-item a {
    padding: 10px 0;
  }

  #playToggle {
    left: calc(16px + env(safe-area-inset-left, 0px));
  }

  #audioToggle {
    right: calc(16px + env(safe-area-inset-right, 0px));
  }

  #playToggle,
  #audioToggle {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}
/* =================================================================
   SNAP SCROLLING  (index + about)
   One scroll gesture jumps from the intro straight to the names,
   with no in-between dead space. Enabled by <body class="snap-scroll">.
================================================================= */
html:has(body.snap-scroll) {
  scroll-snap-type: y mandatory;
}

.snap-scroll section {
  scroll-snap-align: start;
  scroll-snap-stop: always;   /* one flick = one section, never skips */
}

/* Sideways phones: the name list can be taller than the screen, so don't force snapping */
@media (orientation: landscape) and (max-height: 500px) {
  html:has(body.snap-scroll) { scroll-snap-type: y proximity; }
}


/* =================================================================
   BEHIND THE SCENES PAGE: pinned horizontal-scroll gallery
   Scoped with body:has(.pin), so it only applies to pages that contain
   the gallery (no body class needed) and nothing leaks to other pages.
   Vertical scroll is turned into sideways movement by the script in the page.

   Markup this expects:
     section.pin > .stage > .track > figure.item | .item-tall | .item-short | .item-wide
                         > .foot > .meta (h1 + p#caption) + .bar > i#fill   (floats over .track, bottom-left)
                         > .end > h2
================================================================= */
body:has(.pin) {
  --gap: 10px;
  --pad: 8vw;
  --serif: PPEditorialRegular, "Times New Roman", Georgia, serif;
  --sans: helveticaNeueReg, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans-light: helveticaNeueLight, helveticaNeueReg, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans-bold: helveticaNeueBold, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
  font-family: var(--sans);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html:has(.pin) { scroll-padding-top: env(safe-area-inset-top, 0px); }

/* ---- corner links over the photos, inverted so they read on light or dark images ---- */
body:has(.pin) {
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 26px 12px;
  mix-blend-mode: difference;
  pointer-events: none;
}
body:has(.pin) {
  pointer-events: auto;
  color: #fff;
  opacity: 1;
  font-family: var(--sans-bold);
  font-weight: 400;              /* the bold file is already bold; 700 would fake-bold it twice */
  letter-spacing: 0.1em;
  border-bottom: 1px solid currentColor;
  padding: 8px 0 2px;
}
body:has(.pin) { outline: 2px solid #fff; outline-offset: 4px; }

/* ---- title block over the photos, bottom-left: title + subtitle, progress line across the rest ---- */
body:has(.pin) .foot {
  position: absolute;            /* floats over the photos, bottom-left */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 16px 26px calc(18px + env(safe-area-inset-bottom, 0px));
  color: #fff;
  mix-blend-mode: difference;    /* stays readable on light or dark photos, like the corner links */
  pointer-events: none;
}
body:has(.pin) .meta { flex: 0 0 500px; display: flex; flex-direction: column; }
body:has(.pin) .meta h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 35px;
  line-height: 1.2;
}
body:has(.pin) .meta p {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.3;
  transition: opacity 180ms ease;
}
body:has(.pin) .meta p.swap { opacity: 0; }
body:has(.pin) .meta small {      /* optional line at the bottom, e.g. a location */
  margin-top: auto;
  font-family: var(--sans-bold);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---- pinned scroll: .pin height is set by the script ----
   The global "section" rule (flex, overflow:hidden, min-height:100vh, padding)
   was what broke this: overflow:hidden on an ancestor kills position:sticky,
   so the stage never pinned and nothing moved sideways. Reset it here. */
body:has(.pin) .pin {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  justify-content: normal;
}
body:has(.pin) .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body:has(.pin) .track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--gap);
  flex: 1;
  min-height: 0;
  width: max-content;            /* lets scrollWidth reflect every photo, so the script can measure it */
  padding: 0;
  will-change: transform;
}

/* ---- photos: height varies by class, width follows the image ---- */
body:has(.pin) :is(.item, .item-tall, .item-short, .item-wide) {
  --h: 100%;
  flex: 0 0 auto;
  position: relative;
  height: var(--h);
  margin: 0;
  background: #222;
}
/* all photos run full height; set --h (e.g. 70%) on one of these to vary it */
body:has(.pin) .item-tall  { --h: 100%; }
body:has(.pin) .item-short { --h: 100%; }
body:has(.pin) .item-wide  { --h: 100%; }

/* leave room after the last photo only when there is a "That's a wrap" block to fill it */
body:has(.pin) .stage:has(.end) .track { padding-right: 55vw; }

body:has(.pin) .track img,
body:has(.pin) .track video {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  filter: grayscale(1);          /* remove for color */
}
body:has(.pin) .track figure span {   /* visually hidden: the subtitle shows this text */
  position: absolute;
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---- closing line: sits in the empty space after the last photo and fades in at the end ---- */
body:has(.pin) .stage > .end {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  display: grid;
  place-items: center;
  padding: 0 var(--pad);
  pointer-events: none;
  opacity: 0;
}
body:has(.pin) .end h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 1rem + 4vw, 5rem);
  line-height: 1.05;
  text-align: center;
}
@supports (animation-timeline: scroll()) {
  body:has(.pin) .stage > .end {
    animation: bts-end linear both;
    animation-timeline: scroll(root block);
    animation-range: 88% 100%;
  }
}
@keyframes bts-end {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- progress line ---- */
body:has(.pin) .bar {
  position: relative;
  flex: 1;
  height: 1px;
  margin: 0 7vw 8px 0;
  background: rgba(255, 255, 255, 0.4);
}
body:has(.pin) .bar i {
  position: absolute;
  left: 0;
  top: -1px;
  display: block;
  height: 3px;
  width: 0;
  background: #fff;
}

@media (max-width: 900px) {
  body:has(.pin) { --pad: 6vw; }
  body:has(.pin) .header-nav { padding-left: 6vw; padding-right: 6vw; }
  body:has(.pin) .foot { flex-direction: column; align-items: stretch; padding-left: 6vw; padding-right: 6vw; gap: 12px; }
  body:has(.pin) .bar { flex: none; width: 100%; margin: 0; }
  body:has(.pin) .meta { flex: none; }
}

/* reduced motion: native sideways scrolling instead of the pinned effect */
@media (prefers-reduced-motion: reduce) {
  body:has(.pin) .pin { height: auto !important; }
  body:has(.pin) .track { width: auto; overflow-x: auto; transform: none !important; padding-right: 0; }
  body:has(.pin) .stage > .end,
  body:has(.pin) .bar { display: none; }
}


/* =================================================================
   VIDEO CONTROLS  (play/pause + scrubber + time + mute)
   Lives inside the existing .video-controls overlay, so clicks on
   empty areas still reach the <video> (tap to play/pause).

   Markup (intermezzo_eq.html):
     .video-controls > .vc-bar
        > button.vc-play
        > .vc-scrub[role=slider] > .vc-track > .vc-buffered + .vc-fill
                                 > .vc-thumb + .vc-tip
        > .vc-time
        > #audioToggle
   Fades out after a few seconds of inactivity while playing
   (.video-controls.is-idle, toggled by the page script).
================================================================= */

.vc-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0
           calc(30px + env(safe-area-inset-right, 0px))
           calc(30px + env(safe-area-inset-bottom, 0px))
           calc(30px + env(safe-area-inset-left, 0px));
  isolation: isolate;
  pointer-events: none;            /* only the controls themselves catch clicks */
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.vc-bar > * { pointer-events: auto; }

/* soft shadow behind the bar so it reads over bright frames */
.vc-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: -90px;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.video-controls.is-idle .vc-bar {
  opacity: 0;
  visibility: hidden;
}

.hero-video-section:has(.video-controls.is-idle) { cursor: none; }

/* the mute pill keeps its look; it just flows in the bar instead of floating */
.vc-bar #audioToggle {
  position: static;
  flex: none;
}

/* ---- play / pause ---- */
.vc-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.vc-play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.vc-play .icon-pause { display: none; }
.vc-play.is-playing .icon-play  { display: none; }
.vc-play.is-playing .icon-pause { display: block; }

@media (hover: hover) {
  .vc-play:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
  }
}

.vc-play:focus-visible,
.vc-bar .audio-control-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---- scrubber ---- */
.vc-scrub {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;                    /* tall hit area, thin visible line */
  cursor: pointer;
  touch-action: none;              /* dragging must not scroll the page */
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.vc-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  transition: height 0.15s ease, margin-top 0.15s ease;
}

.vc-buffered,
.vc-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
}

.vc-buffered { background: rgba(255, 255, 255, 0.3); }
.vc-fill     { background: #fff; }

.vc-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.25);
  transform: scale(0);
  transition: transform 0.15s ease;
  pointer-events: none;
}

.vc-scrub:hover .vc-track,
.vc-scrub.is-dragging .vc-track,
.vc-scrub:focus-visible .vc-track {
  height: 6px;
  margin-top: -3px;
}

.vc-scrub:hover .vc-thumb,
.vc-scrub.is-dragging .vc-thumb,
.vc-scrub:focus-visible .vc-thumb {
  transform: scale(1);
}

/* touch screens have no hover, so keep the handle visible */
@media (hover: none) {
  .vc-thumb { transform: scale(1); }
}

/* preview bubble (picture + time) that follows the pointer */
.vc-tip {
  position: absolute;
  bottom: calc(50% + 20px);
  left: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.vc-tip canvas {
  display: block;
  width: 160px;
  height: auto;                    /* follows the canvas's aspect ratio */
  border-radius: 4px;
  background: #000;
}

.vc-tip.show { opacity: 1; }

/* ---- time readout ---- */
.vc-time {
  flex: none;
  color: #fff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Tablets/phones and sideways phones: tighter margins, matching the menu button */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .vc-bar {
    padding: 0
             calc(16px + env(safe-area-inset-right, 0px))
             calc(20px + env(safe-area-inset-bottom, 0px))
             calc(16px + env(safe-area-inset-left, 0px));
  }
}

/* Narrow phones: scrubber gets its own full-width row above the buttons */
@media (max-width: 700px) {
  .vc-bar {
    flex-wrap: wrap;
    gap: 2px 12px;
  }
  .vc-scrub {
    order: -1;
    flex: 1 0 100%;
  }
  .vc-time {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-bar,
  .vc-track,
  .vc-thumb,
  .vc-tip { transition: none; }
}


/* =================================================================
   UP NEXT  (10-second countdown after the video ends)
   Sits below the control bar (z-index 25 vs 30) so the scrubber still
   works; the dimmed area lets clicks through to the video.
================================================================= */
.up-next {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.up-next.is-visible {
  opacity: 1;
  visibility: visible;
}

.up-next-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 420px;
  text-align: center;
  color: #fff;
  pointer-events: auto;
}

.up-next-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.up-next-title {
  margin: 0;
  font-family: PPEditorialRegular, "Times New Roman", Georgia, serif;
  font-size: clamp(1.75rem, 1rem + 3vw, 3rem);
  line-height: 1.1;
}

.up-next-count {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 12px 0 8px;
  display: grid;
  place-items: center;
}

.up-next-count svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);       /* ring starts at 12 o'clock */
}

.up-next-count circle {
  fill: none;
  stroke-width: 3;
}

.up-next-count .ring-bg { stroke: rgba(255, 255, 255, 0.2); }

.up-next-count .ring {
  stroke: #fff;
  stroke-linecap: round;
}

.up-next-count span {
  font-size: 38px;
  font-variant-numeric: tabular-nums;
}

.up-next-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.up-next-actions .audio-control-btn { min-height: 44px; }

.up-next-actions .audio-control-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .up-next { transition: none; }
}

/* =================================================================
   TRANSCRIPT DRAWER & BRIDGE POPOVER
================================================================= */

.tx-drawer[hidden],
.tx-bridge[hidden],
.tx-bridge-img[hidden],
.tx-bridge-jump[hidden] {
  display: none !important;
}

.tx-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60; /* sits above .nav-container (50), .video-splash (40), and .video-controls (30) */
  width: min(460px, 42vw);
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 14, 0.92);
  color: var(--fg);
  border-left: 1px solid rgba(244, 244, 242, 0.14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.tx-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(244, 244, 242, 0.12);
}

.tx-title {
  margin: 0;
  font-family: PPEditorialRegular, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.tx-close {
  position: relative;
  z-index: 3;
  flex: none;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--fg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.tx-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tx-line {
  --tx-time-w: 64px;   /* width of the timestamp column */
  --tx-gap: 14px;      /* space between timestamp and words */
  position: relative;
  margin: 0;
  padding-left: calc(var(--tx-time-w) + var(--tx-gap));
  font-size: 15px;
  line-height: 1.65;
  color: rgba(244, 244, 242, 0.9);
}

.tx-time {
  position: absolute;
  left: 0;
  top: 2px;            /* lines the button up with the first text line */
  width: var(--tx-time-w);
  margin: 0;
  padding: 2px 0;
  text-align: center;
  background: none;
  border: 1px solid rgba(244, 244, 242, 0.22);
  border-radius: 4px;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tx-anchor {
  display: inline;
  padding: 0 0 1px;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(244, 244, 242, 0.45);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color 200ms ease, opacity 200ms ease;
}

@media (hover: hover) {
  .tx-close:hover,
  .tx-time:hover,
  .tx-anchor:hover {
    color: #fff;
    border-color: #fff;
  }
}

.tx-bridge {
  margin: 0 24px calc(24px + env(safe-area-inset-bottom, 0px));
  padding: 16px;
  background: #0e0e0e;
  border: 1px solid rgba(244, 244, 242, 0.2);
}

.tx-bridge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tx-bridge-kind {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.tx-bridge-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 12px;
}

.tx-bridge-title {
  margin: 0 0 6px;
  font-family: PPEditorialRegular, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.tx-bridge-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 244, 242, 0.8);
}

.tx-bridge-jump {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .tx-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 84px; /* clears .vc-bar controls */
    width: 100%;
    max-height: calc(100dvh - 150px);
    border-left: 0;
    border-top: 1px solid rgba(244, 244, 242, 0.16);
  }
}