/* The gallery of video models (/models): the film is the hero, the interface stays quiet around it.
   Phone: a vertical feed, one model per screen, scroll snapping. Desktop: a grid of phone frames.
   Reuses app.css (tokens, .btn, .sr); only the gallery's own pieces live here. */
.wrap.gal { width: min(100% - 2 * var(--gut), 1180px); }
.gallery-page main { padding: 0 0 40px; }
.gal-head { padding: 6px 0 2px; }
.gallery-page header.top { scroll-snap-align: start; }  /* arrival: brand, heading, then the first film */
.gal-head h1 { font-size: 27px; line-height: 1.1; margin: 0; }
.gal-sub { display: none; margin: 4px 0 0; max-width: 40em; color: var(--bone-2); font-size: 17px; line-height: 1.5; }

/* occasion chips: links (they work without JavaScript), sticky over the feed */
.gal-chips { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gut)); padding: 8px var(--gut) 12px; scrollbar-width: none;
  background: linear-gradient(var(--night) 72%, rgba(6, 42, 44, 0)); }
.gal-chips::-webkit-scrollbar { display: none; }
.gal-chips a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border-radius: 999px;
  color: var(--bone); font-weight: 800; font-size: 15.5px; text-decoration: none; white-space: nowrap;
  background: rgba(4, 31, 33, .7); box-shadow: inset 0 0 0 1.5px rgba(255, 244, 224, .32); transition: background-color .18s, box-shadow .18s; }
.gal-chips a:hover { color: var(--bone); box-shadow: inset 0 0 0 1.5px rgba(255, 244, 224, .75); }
.gal-chips a[aria-current="page"] { background: var(--bone); color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold); }
.gal-chips a:focus-visible { outline-offset: -3px; }

.feed { display: grid; gap: 0; }
.gal-more { margin: 26px 0 6px; font-size: 24px; }

/* one model */
.model { --chips: 60px; --fh: min(calc(100svh - var(--chips) - 116px), calc((100vw - 2 * var(--gut)) * 16 / 9));
  display: flex; flex-direction: column; gap: 10px; padding: 0 0 22px;
  scroll-snap-align: start; scroll-margin-top: var(--chips); }
.film { position: relative; isolation: isolate; margin: 0 auto; height: var(--fh); aspect-ratio: 9 / 16; max-width: 100%;
  border-radius: 20px; overflow: hidden; background: var(--deep);
  box-shadow: inset 0 0 0 1px rgba(55, 230, 240, .45), 0 22px 34px -24px rgba(0, 0, 0, .9); }
.film .poster, .film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.film video { background: transparent; z-index: 1; }
.still { position: absolute; inset: 0; display: block; }
html:not(.js) .film video { display: none; }  /* without JavaScript: the poster opens the film in the browser's player */
.mark { position: absolute; left: 50%; top: 42%; display: grid; place-items: center; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; color: var(--ink); background: var(--bone); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7); }
.mark svg { width: 34px; height: 34px; margin-left: 4px; }
.js .mark { display: none; }
.film .tag { position: absolute; z-index: 3; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; font: 800 13px/1.4 var(--text);
  letter-spacing: .04em; color: var(--bone); background: rgba(4, 31, 33, .72); box-shadow: inset 0 0 0 1px rgba(255, 244, 224, .3); }
.js .film .tag { right: 64px; top: 20px; }

/* title over the film's lower edge, under the film's own captions band (y 780 to 900 of 1280) */
.cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 64px 16px 14px; pointer-events: none;
  background: linear-gradient(rgba(4, 31, 33, 0), rgba(4, 31, 33, .82) 46%, rgba(4, 31, 33, .94)); }
.cap h2 { margin: 0 0 4px; font-size: 23px; line-height: 1.12; }
.cap h2 a { color: var(--bone); text-decoration: none; }
.cap h2 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.cap p { margin: 0; font-size: 15.5px; line-height: 1.42; color: var(--bone); font-weight: 600; }
.cap a { pointer-events: auto; }
.cap h2 a, .cap p { text-shadow: 0 1px 2px rgba(2, 16, 15, .8); }
.js .film .cap { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.js .film.tail .cap { opacity: 0; transform: translateY(8px); }  /* the film's own ending (AI notice) stays clear */

/* controls drawn by gallery.js: sound (top right) and a big play button while paused */
.ctl { position: absolute; z-index: 4; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; color: var(--bone);
  background: rgba(4, 31, 33, .66); box-shadow: inset 0 0 0 1.5px rgba(255, 244, 224, .4); }
.ctl svg { width: 24px; height: 24px; }
.ctl:hover { background: rgba(4, 31, 33, .85); box-shadow: inset 0 0 0 1.5px var(--bone); }
.snd { top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; }
.snd .w { display: none; }
.snd[aria-pressed="true"] .w { display: inline; }
.snd[aria-pressed="true"] .x { display: none; }
.big { left: 50%; top: 42%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; color: var(--ink);
  background: var(--bone); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7); transition: transform .2s var(--pop), opacity .2s; }
.big svg { width: 34px; height: 34px; margin-left: 4px; }
.big:hover { background: var(--gold); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7); }
.film.playing .big { opacity: 0; transform: scale(.8); pointer-events: none; }
.film.playing .big:focus-visible { opacity: 1; transform: none; pointer-events: auto; }
.big .ps, .film.playing .big .pl { display: none; }
.film.playing .big .ps { display: inline; }
.js .film video { cursor: pointer; }

/* the action: a first name, the button whose label follows the typing */
.make { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 auto; width: 100%; max-width: calc(var(--fh) * 9 / 16 + 2px); }
.make input { min-width: 0; min-height: 52px; }
.make .btn { min-height: 52px; max-width: 64vw; padding-inline: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: center; margin: 0 auto; width: 100%; max-width: calc(var(--fh) * 9 / 16 + 2px);
  font-size: 14.5px; line-height: 1.4; color: var(--bone-2); font-weight: 700; }
.meta span { font-variant-numeric: tabular-nums lining-nums; }
.meta a { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; color: var(--bone-2); font-weight: 700; }
.meta a:hover { color: var(--bone); }

@media (max-width: 759px) {
  html:has(body.gallery-page) { scroll-snap-type: y proximity; }
  .model { min-height: calc(100svh - var(--chips)); }
  .meta { gap: 0 12px; }
  .meta a { min-height: 32px; }
}

/* desktop: a grid of phone frames, quiet and comfortable */
@media (min-width: 760px) {
  .gallery-page main { padding-top: 8px; }
  .gal-head { padding: 8px 0 2px; }
  .gal-head h1 { font-size: 40px; }
  .gal-sub { display: block; }
  .gal-chips { margin: 0; padding: 12px 0 16px; }
  .feed { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 36px 28px; align-items: start; }
  .gal-more { grid-column: 1 / -1; margin: 6px 0 -12px; }
  .model { padding: 0; }
  .model { --fh: clamp(440px, calc(100svh - 340px), 600px); }
  .make .btn { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .film .cap, .big { transition: none; }
}
