/* ==========================================================================
   Motion — full-bleed dark panel holding the vertical content gallery
   The one inverted section on the page; it gives the scroll a change of key
   and lets 9:16 stills read the way they do on a phone.
   ========================================================================== */

.motion {
  position: relative;
  z-index: 2;
  background: var(--ink-panel);
  color: var(--on-dark);
  padding-block: var(--space-section);
  overflow: hidden;
}

.motion::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 12% 0%,
              oklch(30% 0.05 40 / 0.55), transparent 62%);
  pointer-events: none;
}

.motion > * { position: relative; }

.motion .section-head {
  border-bottom-color: var(--rule-dark);
}

.motion .section-head__title { color: var(--on-dark); }
.motion .section-head__note { color: var(--on-dark-mute); }
.motion .display em { color: var(--accent-on-dark); }

/* --- Ticker seam ----------------------------------------------------------- */

.ticker {
  position: relative;
  z-index: 2;
  background: var(--ink-panel);
  color: var(--on-dark);
  overflow: hidden;
  padding-block: 1.1rem;
  border-block: 1px solid var(--rule-dark);
}

/* Four copies of the name set: the track scrolls by half its width, so each half
   has to be wider than the widest screen or a gap opens at the end of the loop. */
.ticker__track {
  display: inline-flex;
  align-items: center;
  gap: 2.75rem;
  white-space: nowrap;
  padding-right: 2.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--on-dark-soft);
  animation: ticker-roll 64s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker__track { animation-play-state: paused; }

.ticker__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-on-dark);
  flex: none;
}

@keyframes ticker-roll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* --- Gallery -------------------------------------------------------------- */

/* Four reels: a swipeable row on phones (the next card peeks in so it reads as
   scrollable), one even row of four from tablet up. The phone row carries a
   little padding (cancelled by a negative margin) so focus rings are not clipped. */
.reel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 17rem);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
  scrollbar-width: none;
  padding: 6px;
  margin: -6px;
}

.reel::-webkit-scrollbar { display: none; }

.reel__item {
  scroll-snap-align: start;
  scroll-margin-block: 8px; /* keeps the focus ring on screen when focus scrolls the page */
}

/* Cards scrolled out of the phone row would otherwise wait, blank, for the
   reveal observer; in the swipe row they simply start visible. */
@media (max-width: 45.99rem) {
  .js .reel .reveal { opacity: 1; transform: none; }
}

@media print, (min-width: 46rem) {
  .reel {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
    margin: 0;
  }
}

.reel__item,
.reel-wide__item {
  position: relative;
  display: block;
  border-radius: 3px;
  overflow: hidden;
  background: var(--ink-panel-2);
  text-decoration: none;
}

.reel__item:focus-visible,
.reel-wide__item:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 3px;
}

.reel__item img,
.reel-wide__item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out-expo),
              filter var(--duration-normal) linear;
  filter: saturate(0.94) contrast(1.02);
}

.reel__item img { aspect-ratio: 9 / 16; }
.reel-wide__item img { aspect-ratio: 16 / 9; }

.reel__item:hover img,
.reel__item:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.06) contrast(1.04);
}

.reel-wide__item:hover img,
.reel-wide__item:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.06) contrast(1.04);
}

/* The gradient darkens early so the caption keeps its contrast over bright frames. */
.reel__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 3rem 0.85rem 0.85rem;
  background: linear-gradient(180deg,
              transparent,
              oklch(12% 0.01 62 / 0.72) 40%,
              oklch(12% 0.01 62 / 0.92));
  display: grid;
  gap: 0.15rem;
}

.reel__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--on-dark);
  line-height: 1.3;
}

.reel__handle {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: var(--accent-on-dark);
}

/* --- Wide film-edit row ---------------------------------------------------- */

.reel-wide {
  display: grid;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-top: clamp(1.25rem, 2.4vw, 2rem);
}

@media (min-width: 46rem) {
  .reel-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.reel-wide__item .reel__caption {
  padding: 3rem 1.1rem 1rem;
}

.reel-wide__item .reel__title { font-size: 0.9375rem; }

@media print {
  .reel__caption { padding: 1rem 0.5rem 0.5rem; }
}

/* --- Footnote under the gallery ------------------------------------------- */

.motion__footnote {
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: clamp(1.5rem, 2.5vw, 2rem);
  border-top: 1px solid var(--rule-dark);
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 56rem) {
  .motion__footnote {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2.5rem;
  }
}

.motion__footnote p {
  color: var(--on-dark-soft);
  max-width: 60ch;
}

.motion__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.motion .btn--ghost {
  color: var(--on-dark);
  border-color: var(--rule-dark);
}

.motion .btn--ghost:hover {
  border-color: var(--accent-on-dark);
  color: var(--accent-on-dark);
  background: transparent;
}
