html:has(#screening[open]) {
  overflow: hidden;
}

#screening {
  --screen-ink: #101010;
  --screen-paper: #f3efe6;
  --screen-hot: var(--orange, #ff623e);
  width: min(960px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid #68665f;
  border-radius: 5px;
  color: var(--screen-paper);
  background: var(--screen-ink);
  box-shadow: 0 28px 110px #000b;
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: dark;
}

#screening[open] {
  animation: screening-in 440ms cubic-bezier(.18,.82,.18,1) both;
}

#screening.portrait-entry[open] { animation: screening-fade 380ms ease both; }
#screening.portrait-entry .profile-photo img { animation: none; }

.portrait-flight:popover-open {
  position: fixed;
  inset: 0 auto auto 0;
  margin: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  background: #24231e;
  contain: strict;
}

.portrait-flight img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-flight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cover-shade);
  animation: flight-shade 380ms ease-out both;
}

.portrait-flight::backdrop { pointer-events: none; background: transparent; }

#screening::backdrop {
  background: rgb(8 8 8 / 83%);
  backdrop-filter: blur(11px);
}

#screening [data-close] {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #fcf7e976;
  border-radius: 50%;
  background: #131312cf;
  color: var(--screen-paper);
  font: 24px/1 Arial, sans-serif;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}

#screening [data-close]:hover {
  background: var(--screen-paper);
  color: var(--screen-ink);
}

#screening :focus-visible {
  outline: 2px solid var(--screen-paper);
  outline-offset: -3px;
}

#screening .screen-kicker {
  margin: 0;
  font: 600 .76rem/1.4 "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .095em;
  text-transform: uppercase;
  color: var(--screen-hot);
}

#screening #screen-title,
#screening .film-line {
  font-family: inherit;
}

.film-picture {
  isolation: isolate;
  position: relative;
  height: clamp(300px, min(54vw, 66dvh), 528px);
  overflow: hidden;
  background-color: #151513;
}

.film-images,
.film-still,
.film-picture::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.film-still {
  object-fit: cover;
  object-position: center 38%;
  opacity: 0;
  filter: grayscale(1);
  transition: opacity 800ms ease;
}

.film-still.portrait-still {
  width: 70%;
  left: auto;
  object-position: 50% 30%;
  mask-image: linear-gradient(90deg, transparent, #000 24%);
}

.film-still.is-current {
  opacity: 1;
  animation: film-settle 7.2s linear both;
}

.film-paused .film-still { animation-play-state: paused; }

.film-picture::after {
  content: "";
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg, #080808e8 0%, #1212111c 70%, #0a0a0ac7 100%),
              linear-gradient(90deg, #1515138c 0%, transparent 70%);
}

.film-heading,
.film-subtitle {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 4.4vw, 48px);
}

#screening .film-heading {
  top: clamp(20px, 3.2vw, 32px);
  right: 70px;
  display: block;
  height: auto;
  background: none;
  border: 0;
}

#screening .film-heading #screen-title {
  margin: 3px 0 0;
  font-size: clamp(1.05rem, 2.3vw, 1.5rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.035em;
  color: var(--screen-paper);
}

.film-subtitle {
  bottom: clamp(23px, 4.3vw, 46px);
  right: 24px;
}

.film-caption {
  animation: caption-in 460ms cubic-bezier(.2,.7,.2,1) both;
}

#screening .film-line {
  max-width: 19ch;
  margin: 9px 0 0;
  color: var(--screen-paper);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.4vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -.05em;
  text-wrap: balance;
}

.film-controls {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  padding: 12px clamp(18px, 3.7vw, 40px);
  border-top: 1px solid #474540;
}

#screening .screen-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 15px;
  border: 0;
  border-radius: 3px;
  background: var(--screen-hot);
  color: #121211;
  font-family: inherit;
  font-weight: 650;
  line-height: 1.3;
  font-size: .875rem;
  cursor: pointer;
}

#screening .screen-action:hover {
  filter: brightness(1.12);
}

#screening .film-toggle {
  min-width: 104px;
  justify-content: flex-start;
  padding-inline: 0;
  background: transparent;
  color: var(--screen-paper);
}

.playback-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  color: var(--screen-hot);
  font-size: 1.12em;
}

.film-track {
  appearance: none;
  flex: 1 1 90px;
  min-width: 36px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, var(--screen-hot) var(--played, 0%), #65635d var(--played, 0%)) center / 100% 3px no-repeat;
  cursor: pointer;
}

.film-track::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--screen-paper);
}

.film-track::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--screen-paper);
}

.film-time {
  white-space: nowrap;
  color: #e5e2d8;
  font: .77rem/1.2 "IBM Plex Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.screen-profile {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
}

.profile-photo {
  min-height: 460px;
  position: relative;
  overflow: hidden;
  background: #24231e;
}

.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 26%;
  filter: grayscale(1);
  animation: portrait-settle 850ms ease-out both;
}

.profile-copy {
  align-self: center;
  padding: 68px clamp(26px, 4vw, 56px) 46px;
}

#screening .profile-copy #screen-title {
  margin: 12px 0 25px;
  color: var(--screen-paper);
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: .94;
  font-weight: 800;
  letter-spacing: -.06em;
}

.profile-copy blockquote {
  margin: 0 0 18px;
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  line-height: 1.18;
  letter-spacing: -.035em;
  color: var(--screen-paper);
}

.profile-bio {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.48;
  color: #c5c2b9;
}

@keyframes screening-in {
  from { opacity: 0; transform: translateY(20px) scale(.978); }
  to { opacity: 1; transform: none; }
}

@keyframes screening-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes flight-shade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes caption-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes portrait-settle {
  from { transform: scale(1.045); }
  to { transform: none; }
}

@keyframes film-settle {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}

@media (max-width: 640px) {
  #screening {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
  .film-picture { height: clamp(270px, 59dvh, 510px); }
  .film-still.portrait-still { width: 100%; mask-image: none; }
  .film-picture::after {
    background: linear-gradient(0deg, #090909ef, #10100f08 70%, #0b0b0bba);
  }
  .film-track { flex-basis: 45px; }
  #screening .film-toggle { min-width: 88px; font-size: .8rem; gap: 5px; }
  .film-controls { gap: 10px; padding-inline: 14px; }
  .film-time { font-size: .72rem; }
  .screen-profile { display: flex; flex-direction: column; }
  .profile-photo { min-height: 0; height: min(30dvh, 250px); }
  .profile-photo img { object-position: 50% 27%; }
  .profile-copy { padding: 23px; }
  #screening .profile-copy #screen-title { margin: 7px 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #screening[open], #screening.portrait-entry[open], .film-caption, .profile-photo img { animation: none; }
  .film-still, .film-still.is-current { transform: none; transition: none; animation: none; }
}
