/* The film and its opening share one stable viewport-sized stage. */
:root {
  --header-height: 98px;
  --hero-gutter: clamp(24px, 4.2vw, 72px);
}
html { scroll-padding-top: var(--header-height); }
.site-header {
  height: var(--header-height);
  padding-left: max(var(--hero-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--hero-gutter), env(safe-area-inset-right, 0px));
}
.mobile-menu { top: var(--header-height); }
.cinema { height: 100svh; min-height: 0; }
.cinema-ready { height: 430svh; }
.cinema-stage,
.cinema-ready .cinema-stage {
  height: 100svh;
  min-height: 0;
  overflow: clip;
  background: var(--cream);
}
.hero-topline {
  top: calc(var(--header-height) + 28px);
  left: var(--hero-gutter);
  right: var(--hero-gutter);
  font-size: clamp(9px, .85vw, 12px);
}
.hero-topline span:last-child { max-width: none; font-size: inherit; }
.hero-title {
  inset: calc(var(--header-height) + 72px) var(--hero-gutter) 142px;
  width: auto;
  padding: 0;
  gap: clamp(18px, 2.5vw, 42px);
}
.hero-title h1 {
  height: auto;
  padding: 0;
  font-size: clamp(24px, min(3.2vw, 4.8svh), 44px);
  line-height: 1.65;
  letter-spacing: .11em;
  gap: .35em;
}
.hero-title p {
  display: block;
  height: auto;
  margin: 0;
  font-size: clamp(10px, 1vw, 14px);
  letter-spacing: .18em;
  white-space: nowrap;
}
.hero-bottom {
  inset: auto var(--hero-gutter) calc(48px + env(safe-area-inset-bottom, 0px));
  min-height: 76px;
}
.hero-caption {
  display: block;
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.9;
}
.scroll-cue {
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 12px;
  font-size: 10px;
  white-space: nowrap;
}
.scroll-line { width: 1px; height: 32px; }
.hero-edition { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.video-layers, .film-image { inset: 0; width: 100%; height: 100%; }
.film-video { object-fit: contain; object-position: center; }
.film-image { background-size: contain; background-repeat: no-repeat; background-position: center; }
.film-caption {
  top: auto;
  bottom: 28%;
  left: 8%;
  max-width: 84%;
  font-size: clamp(20px, 2.8vw, 35px);
  line-height: 1.8;
  white-space: pre;
}

@media (max-width: 760px) {
  :root {
    --header-height: calc(76px + env(safe-area-inset-top, 0px));
    --hero-gutter: 24px;
  }
  .site-header { padding-top: env(safe-area-inset-top, 0px); }
  .cinema-ready { height: 360svh; }
  .hero-topline { display: flex; top: calc(var(--header-height) + 22px); }
  .hero-topline span:last-child { max-width: 136px; line-height: 1.5; }
  .hero-title { inset: calc(var(--header-height) + 58px) var(--hero-gutter) 146px; gap: 20px; }
  .hero-title h1 { font-size: clamp(26px, min(7.5vw, 5svh), 34px); }
  .hero-title p { font-size: 11px; }
  .hero-bottom {
    display: block;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    min-height: 96px;
  }
  .hero-caption { font-size: 12px; }
  .scroll-cue { left: 0; transform: none; flex-direction: row; gap: 12px; }
  .scroll-line { height: 24px; }
  .hero-edition { display: none; }
}

/* A wider portrait frame keeps both people visible in the meeting scene. */
@media (orientation: portrait) {
  .cinema-stage {
    --film-height: min(75vw, 68svh);
    --film-top: calc(50% + 50px - var(--film-height) / 2);
  }
  .video-layers, .film-image {
    inset: var(--film-top) 0 auto;
    height: var(--film-height);
  }
  .film-video { object-fit: cover; object-position: 60% center; }
  .film-image { background-size: cover; background-position: 60% center; }
  .cinema-stage[data-chapter="3"] .film-video { object-position: left center; }
  .cinema-stage[data-chapter="3"] .film-image { background-position: left center; }
  .cinema-stage[data-chapter="4"] .film-video { object-position: 75% center; }
  .cinema-stage[data-chapter="4"] .film-image { background-position: 75% center; }
  .film-shade { display: none; }
  .film-caption {
    top: calc(var(--film-top) - 3.5em - 28px);
    bottom: auto;
    left: 7%;
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.75;
    max-width: 86%;
    text-shadow: none;
  }
}

@media (orientation: portrait) and (min-width: 761px) {
  .hero-title h1 { font-size: clamp(32px, min(4.5vw, 5svh), 44px); }
}

@media (orientation: landscape) and (max-height: 600px) {
  :root { --header-height: calc(64px + env(safe-area-inset-top, 0px)); }
  .site-header { padding-top: env(safe-area-inset-top, 0px); }
  .hero-topline, .hero-title p, .hero-caption, .hero-edition { display: none; }
  .hero-title { inset: calc(var(--header-height) + 24px) var(--hero-gutter) 64px; }
  .hero-title h1 { font-size: clamp(14px, 5svh, 28px); line-height: 1.5; }
  .hero-bottom {
    left: var(--hero-gutter);
    right: var(--hero-gutter);
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    min-height: 20px;
  }
  .scroll-cue { left: 50%; transform: translateX(-50%); flex-direction: row; gap: 10px; font-size: 9px; }
  .scroll-line { height: 18px; }
  .film-caption { top: 22%; bottom: auto; left: 6%; font-size: clamp(16px, 4.5svh, 24px); max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  .cinema-ready { height: 200svh; }
}
