.page-section {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--header-height) + clamp(1rem, 3vh, 2.5rem)) 0 clamp(1.25rem, 3vh, 2.5rem);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 40%),
    var(--bg);
}

.page-section:nth-of-type(odd) {
  background:
    radial-gradient(circle at 10% 50%, rgba(217, 45, 32, 0.055), transparent 24rem),
    #080808;
}

.section-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  width: calc(100% - (2 * var(--page-pad)));
  margin: 0 auto clamp(1.25rem, 3vh, 2.5rem);
}

.section-kicker {
  margin-bottom: 0.55rem;
}

.section-heading {
  margin: 0;
  font-size: clamp(2.2rem, 5.4vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.9;
  text-transform: uppercase;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.section-count {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.rail-controls {
  display: flex;
  gap: 0.5rem;
}

.rail-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.rail-button:hover,
.rail-button:focus-visible {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.video-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(20rem, 52vw, 44rem);
  gap: clamp(0.85rem, 1.8vw, 1.75rem);
  width: 100%;
  padding: 0 var(--page-pad) clamp(0.75rem, 1.8vh, 1.25rem);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: var(--page-pad);
  scroll-snap-type: x proximity;
  scrollbar-color: rgb(245 243 237 / 78%) #11111100;
  scrollbar-width: thin;
}

.video-grid:focus-visible {
  outline-offset: -0.2rem;
}

.video-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  scroll-snap-align: start;
  text-align: left;
}

.video-card::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent 52%, rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.video-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 600ms ease, transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.video-card__img--hover {
  opacity: 0;
}

.video-card__topline,
.video-card__caption,
.video-card__play {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.video-card__topline {
  top: clamp(0.8rem, 2vw, 1.35rem);
  right: clamp(0.8rem, 2vw, 1.35rem);
  left: clamp(0.8rem, 2vw, 1.35rem);
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.video-card__play {
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(3.25rem, 5vw, 4.75rem);
  height: clamp(3.25rem, 5vw, 4.75rem);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  font-size: clamp(0.8rem, 1.2vw, 1.1rem);
  line-height: 1;
  backdrop-filter: blur(0.35rem);
  transform: translate(-50%, -50%);
  transition: background-color 240ms ease, transform 320ms ease;
}

.video-card__caption {
  right: clamp(0.8rem, 2vw, 1.35rem);
  bottom: clamp(0.8rem, 2vw, 1.35rem);
  left: clamp(0.8rem, 2vw, 1.35rem);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  font-size: clamp(0.95rem, 1.55vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.video-card__caption span:first-child {
  max-width: 80%;
}

.video-card__caption span:last-child {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.video-card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -0.3rem;
}

.rail-hint {
  width: calc(100% - (2 * var(--page-pad)));
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: #ffffff00;
}

.rail-hint span {
  margin-right: 0.55rem;
  color: var(--text);
}

.empty-section-note {
  width: calc(100% - (2 * var(--page-pad)));
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

@media (hover: hover) {
  .video-card:hover .video-card__img--hover,
  .video-card:focus-visible .video-card__img--hover {
    opacity: 1;
    transform: scale(1.025);
  }

  .video-card:hover .video-card__img--base,
  .video-card:focus-visible .video-card__img--base {
    transform: scale(1.045);
  }

  .video-card:hover .video-card__play,
  .video-card:focus-visible .video-card__play {
    background: var(--accent);
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@media (max-width: 56rem) {
  .section-header {
    margin-bottom: 1.25rem;
  }

  .section-heading {
    font-size: clamp(2.25rem, 9vw, 4.5rem);
  }

  .rail-controls {
    display: none;
  }

  .video-grid {
    grid-auto-columns: min(84vw, 38rem);
  }
}

@media (max-width: 35rem) {
  .page-section {
    padding-top: calc(var(--header-height) + 1rem);
    padding-bottom: 1.25rem;
  }

  .section-header {
    align-items: end;
  }

  .section-kicker {
    margin-bottom: 0.45rem;
  }

  .section-heading {
    font-size: clamp(2.15rem, 10.5vw, 3.7rem);
  }

  .video-grid {
    grid-auto-columns: 84vw;
  }

  .video-card__caption span:first-child {
    max-width: 85%;
  }
}

@media (max-height: 35rem) and (orientation: landscape) {
  .page-section {
    padding-top: calc(var(--header-height) + 0.75rem);
    padding-bottom: 0.75rem;
  }

  .section-header {
    margin-bottom: 0.75rem;
  }

  .section-kicker,
  .rail-hint {
    display: none;
  }

  .section-heading {
    font-size: clamp(1.8rem, 5vw, 3rem);
  }

  .video-grid {
    grid-auto-columns: min(46vw, 31rem);
    padding-bottom: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-grid {
    scroll-behavior: auto;
    scroll-snap-type: x proximity;
  }
}
