/* Short films on the home page, 2026-10-06.
   Two upright films side by side in the hero (farming first), thirteen more in
   a row under "See it work". Nothing on the home page runs longer than 35 seconds. */

/* A film, upright. */
.short-player {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border: 1px solid #d9dc9447;
  border-radius: 14px;
  background: #0e1510;
}
.short-player video {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.short-player .play-film::after { background: linear-gradient(0deg, #091108c4, transparent 22%); }
.short-player .play-circle { width: 64px; height: 64px; }
.short-player .film-overlay { justify-content: flex-end; bottom: 14px; left: 14px; right: 14px; }
.short-player .film-status { inset: auto 8px 58px; padding: 10px 12px; }
/* The ring is drawn inside the frame: the frame clips whatever is drawn outside it. */
.short-player .play-film:focus-visible,
.short-player video:focus-visible { outline-offset: -5px; }

/* The hero: the farming film, and one more beside it, a step lower. */
.hero-shorts {
  --short-w: clamp(196px, min(19.6vw, calc((100vh - 200px) * .5625)), 272px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}
.hero-shorts .short-player {
  flex: none;
  width: var(--short-w);
  box-shadow: 0 24px 64px #000a;
}
.hero-shorts .short-player + .short-player { margin-top: 38px; }
.hero-shorts .play-circle { width: 74px; height: 74px; }

/* The row. */
.shorts-steps { display: flex; flex: none; gap: 10px; }
.shorts-steps[hidden] { display: none; }
.shorts-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #56634c;
  border-radius: 50%;
  background: transparent;
  color: var(--vellum);
  transition: border-color .18s, color .18s, opacity .18s;
}
.shorts-step svg { width: 18px; height: 18px; }
.shorts-step:first-child svg { transform: scaleX(-1); }
.shorts-step:hover { border-color: var(--brass); color: var(--brass); }
.shorts-step[aria-disabled="true"] { opacity: .3; border-color: #56634c; color: var(--vellum); cursor: default; }
.shorts-step:focus-visible { outline-offset: 3px; }

.shorts-track {
  --per: 5.4; /* films in view: the last one is cut off, which is what says the row goes on */
  --gap: 18px;
  position: relative;
  display: flex;
  gap: var(--gap);
  margin: 0;
  padding: 2px 0 20px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #4b563c transparent;
}
.short-card {
  flex: none;
  width: calc((100% - var(--gap) * (var(--per) - .4)) / var(--per));
  max-width: 280px;
  scroll-snap-align: start;
}

.shorts-after {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 18px;
}
.shorts-after .film-footnote,
.shorts-after .guide-links { margin-top: 0; }
/* The line under a row of films on a feature page. */
.shorts-note { margin: 16px 0 0; color: #aeb9a6; font-size: 14px; line-height: 1.6; }

@media (max-width: 1200px) {
  .shorts-track { --per: 4.4; }
}
@media (max-width: 999px) {
  .shorts-track { --per: 3.4; }
}
@media (max-width: 980px) {
  /* One column: the films stand under the words, on the same left edge. */
  .hero-shorts {
    --short-w: clamp(196px, min(30vw, calc((100vh - 150px) * .5625)), 272px);
    justify-content: flex-start;
  }
}
@media (max-width: 759px) {
  .shorts-track { --per: 2.4; --gap: 14px; }
}
@media (max-width: 680px) {
  /* Phones: both rows run to the edges of the screen and are moved by thumb. */
  .shorts-track {
    margin-inline: -20px;
    padding-inline: 20px;
    scroll-padding-inline: 20px;
  }
  .shorts-steps { display: none; }
  .short-player .play-circle,
  .hero-shorts .play-circle { width: 60px; height: 60px; }
}
@media (max-width: 640px) {
  .hero-shorts {
    --short-w: min(64vw, 280px);
    gap: 14px;
    margin-inline: -20px;
    padding: 0 20px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
  }
  .hero-shorts .short-player { scroll-snap-align: start; box-shadow: none; }
  .hero-shorts .short-player + .short-player { margin-top: 0; }
}
@media (max-width: 519px) {
  .shorts-track { --per: 1.4; }
}
@media (max-width: 360px) {
  .shorts-track,
  .hero-shorts {
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }
}
@media (hover: none) {
  .shorts-steps { display: none; }
}
