/* The films gallery — the front door.
 *
 * Posters carry this page, so everything else gets out of their way: no card
 * borders competing with frame edges, no colour that is not in the artwork,
 * and titles that sit under the image rather than on top of it, because a
 * caption over a film frame hides the part worth looking at.
 */

/* -- hero --------------------------------------------------------------- */

.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  isolation: isolate;
}

.hero-media {
  position: relative;
  aspect-ratio: 1344 / 768;
  width: 100%;
  background: var(--bg-sunken);
}
.hero-media img,
.hero-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-media video { z-index: 2; background: #000; }

.hero-scrim {
  position: absolute; inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to top, rgb(4 5 8 / .92) 0%, rgb(4 5 8 / .55) 34%,
                    rgb(4 5 8 / 0) 68%),
    linear-gradient(to right, rgb(4 5 8 / .6) 0%, rgb(4 5 8 / 0) 55%);
}
.hero.is-playing .hero-scrim,
.hero.is-playing .hero-body { opacity: 0; pointer-events: none; }
.hero-scrim, .hero-body { transition: opacity var(--slow); }

.hero-body {
  position: absolute;
  z-index: 4;
  left: clamp(20px, 4vw, 46px);
  right: clamp(20px, 4vw, 46px);
  bottom: clamp(20px, 3.4vw, 40px);
  max-width: 62ch;
}

.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: -.035em;
  font-weight: 680;
  margin: 0 0 12px;
  text-wrap: balance;
}

.hero-logline {
  font-size: clamp(15px, 1.35vw, 18px);
  color: #cfd6e4;
  margin: 0 0 20px;
  text-wrap: pretty;
}

.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: inherit; font-weight: 580;
  cursor: pointer;
  transition: transform var(--fast), background var(--fast), border-color var(--fast);
}
.btn:active { transform: translateY(1px); }
.btn-play { background: #fff; color: #0a0b0e; }
.btn-play:hover { background: #e7ebf2; }
.btn-ghost {
  background: rgb(255 255 255 / .1);
  color: #fff;
  border-color: rgb(255 255 255 / .22);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgb(255 255 255 / .18); }

/* -- meta --------------------------------------------------------------- */

.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
        color: var(--text-dim); font-size: 13px; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.hero .meta { color: #b7c0d0; margin-bottom: 16px; }

.tag {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 560;
  color: var(--text-dim);
}
.hero .tag { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .2); color: #fff; }

/* -- grid --------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 26px 20px;
}

.card { display: flex; flex-direction: column; gap: 11px; }

.card-media {
  position: relative;
  aspect-ratio: 1344 / 768;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: var(--shadow);
  transition: transform var(--slow), box-shadow var(--slow);
}
.card:hover .card-media,
.card:focus-within .card-media {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-media img,
.card-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.card-media video { z-index: 2; background: #000; }

.card-media::after {          /* keeps white posters from blowing out */
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
}

.play-badge {
  position: absolute;
  z-index: 4;
  left: 12px; bottom: 12px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgb(10 11 14 / .62);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);
  color: #fff;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--fast), transform var(--fast);
}
.card:hover .play-badge,
.card:focus-within .play-badge { opacity: 1; transform: none; }
.card-media.is-playing .play-badge { display: none; }

.dur {
  position: absolute;
  z-index: 4;
  right: 10px; bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: rgb(10 11 14 / .74);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 600 12px/1.4 var(--mono);
  letter-spacing: .02em;
}

.card-title {
  font-size: 16px; font-weight: 620; letter-spacing: -.015em;
  margin: 0; text-wrap: balance;
}
.card-logline {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 48%, var(--surface) 66%);
  background-size: 260% 100%;
  animation: sheen 1.35s infinite linear;
}
@keyframes sheen { to { background-position: -160% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media (max-width: 860px) {
  /* The hero caption is absolutely positioned over the frame, which only works
   * while the frame is taller than the words. At phone widths a 1344x768 image
   * is ~245px tall and the logline alone is taller than that, so the caption
   * overflowed the image and the title was pushed out of view entirely.
   * Below this width it goes back into normal flow, under the picture. */
  .hero { background: var(--surface); }
  .hero-body {
    position: static;
    max-width: none;
    padding: 16px 16px 18px;
  }
  .hero-scrim { display: none; }
  .hero-title { font-size: clamp(24px, 7vw, 34px); }
  .hero-logline { color: var(--text-dim); }
  .hero .meta { color: var(--text-dim); }
  .hero .tag { background: var(--surface-2); border-color: var(--line); color: var(--text-dim); }
  .hero.is-playing .hero-body { opacity: 1; pointer-events: auto; }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px 14px; }
}

@media (max-width: 560px) {
  .eb-page { padding: 20px 16px 56px; }
  .eb-status { display: none; }       /* three words on three lines is worse than none */
  .grid { grid-template-columns: 1fr; }
}
