/* The poster paints first; only an active sequence adds a scroll runway. */
/* No overflow clip here: this section is an ancestor of the sticky pin (Safari). The pin clips itself. */
.film-opening { --film-header-h: 80px; position: relative; isolation: isolate; color: var(--paper); background: #f3f2ee; }
/* Runway: pinned stage + film scroll (--opening-film). Nothing slides over the film: the pin
   releases after the last frame and the next row (consent, then services) follows in flow. */
/* 150svh is the pin budget (1.5 screens). js/film/opening-bloom.mjs splits it: the film plays
   over the first 78%, the light grows out of the aperture over the rest. */
.film-opening { --opening-film: 150svh; }
.film-opening.is-sequenced { height: calc(100svh + var(--opening-film)); }
.film-opening-pin {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  /* The header is in document flow, outside the first-screen stage. */
  min-height: calc(100svh - var(--film-header-h));
  padding-block: clamp(40px, 8svh, 96px);
  overflow: clip;
  background: var(--deep);
}
/* The stage owns the whole screen once the in-flow header scrolls away; the extra bottom
   padding keeps first-screen copy where it sat under the header. */
.is-sequenced .film-opening-pin {
  position: sticky; top: 0; height: 100svh;
  padding-block-end: calc(clamp(40px, 8svh, 96px) + var(--film-header-h));
}
/* The whole 16:9 frame is always visible (contain, never cover): no layout crops the film.
   Wide screens: the frame box stops one header height short of the pin's bottom, because at
   the first screen the in-flow header pushes the pin's last header-height below the fold;
   opening.mjs (frameShift) re-centres it once the header has scrolled away. */
.film-opening-poster, .film-opening-canvas { position: absolute; inset: var(--film-shift, 0px) 0 auto; width: 100%; height: calc(100% - var(--film-header-h)); }
.film-opening-poster { z-index: -2; }
.film-opening-poster img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; }
.film-opening-canvas { z-index: -1; object-fit: contain; object-position: 50% 50%; }
/* The light: a feathered circle, white-hot then paper, centred on the curtain's aperture, growing
   until the whole stage (copy included) is flat paper, the colour of #services. Above
   everything in the pin; without the film (no JS, reduced motion) it never paints. */
.film-opening-bloom {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  opacity: var(--bloom-o, 0);
  background:
    radial-gradient(circle at var(--bloom-x, 50%) var(--bloom-y, 50%),
      var(--bloom-core, #fff) calc(var(--bloom-r, 0px) * .45), var(--bloom-edge, rgb(255 255 255 / 0)) var(--bloom-r, 0px)),
    radial-gradient(circle at var(--bloom-x, 50%) var(--bloom-y, 50%),
      rgb(255 226 186 / 0) calc(var(--bloom-r, 0px) * .6), rgb(255 226 186 / .3) calc(var(--bloom-r, 0px) * .9), rgb(255 226 186 / 0) calc(var(--bloom-r, 0px) * 1.3));
}
.film-opening-bloom[data-bloom="full"] { background: #f3f2ee; }
/* Ambient glow: the first frame, blurred and dimmed, fills the stage around the film so the
   room around a contained frame reads as the theatre, not as an empty navy band. */
.film-opening-pin::before {
  content: "";
  position: absolute;
  inset: -48px;
  z-index: -3;
  pointer-events: none;
  background: url("/media/film/curtain/poster-desktop.webp") 50% 50% / 100% 100% no-repeat;
  filter: blur(28px) saturate(1.25) brightness(.62);
}
.film-opening .opening-copy {
  position: relative;
  width: min(30%, 420px);
  margin-inline: 20.5vw auto;
  padding: 0;
  /* Clear the shared flow.css text plate without changing other scenes. */
  background: none;
  color: #f3f2ee;
  opacity: var(--film-overlay-opacity, 1);
}
.film-opening h1, .film-opening .opening-offer {
  text-shadow: 0 1px 2px rgb(10 12 40 / 95%), 0 3px 12px rgb(10 12 40 / 80%), 0 0 32px rgb(10 12 40 / 65%);
}
.film-opening h1 {
  max-width: 11ch;
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(48px, 5.2vw, 80px);
  line-height: 1.06;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.film-opening .opening-offer { max-width: 36ch; margin: 24px 0 28px; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.7; }
.film-opening .opening-actions { display: flex; flex-wrap: nowrap; gap: 8px; direction: rtl; }
/* Ticket faces are masked separately so the keyboard outline stays uncut. */
.film-opening .opening-ticket {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1e2150;
  box-shadow: none;
  font: 600 15px/1 var(--display);
  text-decoration: none;
  text-shadow: none;
  white-space: nowrap;
  transition: transform 160ms ease;
}
.film-opening .opening-ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  mask: radial-gradient(circle at left, transparent 4px, #000 4.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at right, transparent 4px, #000 4.5px) right / 51% 100% no-repeat;
}
.film-opening .opening-ticket-primary::before { background: #f3f2ee; border-block-start: 1px solid #c9803a; }
.film-opening .opening-ticket::after {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 10px;
  border-inline-start: 1px dashed currentColor;
  opacity: .45;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.film-opening .opening-ticket svg { flex: none; width: 16px; height: 16px; }
.film-opening .opening-ticket-secondary { color: #f3f2ee; }
.film-opening .opening-ticket-secondary::before { border: 1px solid #f3f2ee; }
/* Trace the curved edges of the outline ticket's two open notches. */
.film-opening .ticket-notches { position: absolute; inset: 0; pointer-events: none; }
.film-opening .ticket-notches::before, .film-opening .ticket-notches::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid #f3f2ee;
  border-radius: 50%;
  transform: translateY(-50%);
}
.film-opening .ticket-notches::before { left: -5px; clip-path: inset(0 0 0 50%); }
.film-opening .ticket-notches::after { right: -5px; clip-path: inset(0 50% 0 0); }
.film-opening .ticket-arrow { display: inline-block; transition: transform 160ms ease; }
.film-opening .opening-ticket:is(:hover, :focus-visible) { transform: translateY(-1px); }
.film-opening .opening-ticket:is(:hover, :focus-visible)::after { opacity: 1; }
.film-opening .opening-ticket:is(:hover, :focus-visible) .ticket-arrow { transform: translateY(3px); }
.film-opening .opening-ticket:focus-visible { outline: 2px solid #f3f2ee; outline-offset: 3px; box-shadow: none; }
/* Exact paper at the hand-off, independent of the document's sky gradient. */
#top.film-opening + #services { background: #f3f2ee; }
.film-contact {
  position: fixed;
  z-index: 100;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(12px * var(--film-cta-emphasis, 1));
  min-width: 52px;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--paper);
  border-radius: 4px;
  color: var(--paper);
  background: var(--deep);
  text-decoration: none;
}
.film-contact svg { flex-shrink: 0; }
.film-contact-label {
  max-inline-size: calc(9rem * var(--film-cta-emphasis, 1));
  overflow: hidden;
  white-space: nowrap;
  opacity: var(--film-cta-emphasis, 1);
}
@media (max-width: 720px) {
  /* 44px menu control + 28px header padding + 1px border (layout.css). */
  .film-opening { --film-header-h: 73px; }
  /* Same file as the phone poster <source>: the glow costs no extra request. */
  .film-opening-pin::before { background-image: url("/media/film/curtain/poster-mobile.webp"); }
  .film-opening .opening-ticket { padding-inline: 12px; gap: 6px; }
  .film-opening .opening-ticket::after { inset-inline-start: 6px; }
}
/* Portrait screens: the stage is the film's own 16:9 box at full width, and the copy sits
   directly under it in the same pinned screen. Nothing overlaps the frame, so the copy
   stays readable for the whole scrub (opening.mjs: copyBesideFilm). Free height is shared
   evenly between the rows so no single navy band opens up. */
@media (max-aspect-ratio: 1/1) {
  .film-opening-pin {
    grid-template-rows: auto auto; align-content: space-evenly; align-items: start;
    padding-block: 8px calc(8px + var(--film-header-h));
  }
  .is-sequenced .film-opening-pin { padding-block: 8px calc(8px + var(--film-header-h)); }
  .film-opening-poster, .film-opening-canvas {
    position: relative; inset: auto; grid-area: 1 / 1;
    width: 100%; height: auto; aspect-ratio: 16 / 9;
  }
  .film-opening-poster img { display: block; }
  .film-opening .opening-copy {
    grid-area: 2 / 1; width: auto; max-width: 560px; margin-inline: 16px;
    display: grid; align-content: start; row-gap: clamp(14px, 3svh, 28px);
  }
  .film-opening h1 { max-width: none; font-size: clamp(40px, min(14.6vw, 7.4svh), 76px); line-height: 1.04; }
  .film-opening .opening-offer { max-width: 30ch; margin: 0; font-size: clamp(17px, min(5vw, 2.5svh), 22px); line-height: 1.55; }
  /* Two full-width tickets: the primary leads, both are large touch targets. */
  .film-opening .opening-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .film-opening .opening-ticket { height: clamp(48px, 6.2svh, 58px); font-size: 16px; }
}
/* Upright phones: the 16:9 box at full width left the film small (owner, 23.11.2026). The box
   is --film-zoom taller and the frame fills it, so the full height shows and an equal sliver
   leaves from each side (js/film/draw-rect.mjs: zoomRect, never more than FILM_ZOOM_MAX).
   The figure stands 9.9% or more in from the edge once he has walked in: he is never cut. */
@media (max-width: 720px) and (max-aspect-ratio: 1/1) {
  .film-opening { --film-zoom: 1.15; }
  .film-opening-poster, .film-opening-canvas { aspect-ratio: 16 / calc(9 * var(--film-zoom)); }
  .film-opening-poster img { object-fit: cover; }
}
/* Short landscape screens (phones on their side): film and copy side by side, the copy on
   the reading side, the film whole at the height the screen allows. */
@media (max-height: 540px) and (min-aspect-ratio: 1/1) {
  .film-opening-pin, .is-sequenced .film-opening-pin {
    grid-template-columns: minmax(0, 1fr) min(56vw, calc((100svh - 32px) * 16 / 9));
    align-items: center; column-gap: 20px; padding: 16px 20px calc(16px + var(--film-header-h));
  }
  .film-opening-poster, .film-opening-canvas {
    position: relative; inset: auto; grid-area: 1 / 2; width: 100%; height: auto; aspect-ratio: 16 / 9;
  }
  .film-opening-poster img { display: block; }
  .film-opening .opening-copy { grid-area: 1 / 1; width: auto; margin: 0; }
  .film-opening h1 { max-width: none; font-size: clamp(26px, 7.4svh, 36px); line-height: 1.08; }
  .film-opening .opening-offer { margin: 10px 0 14px; font-size: 14px; line-height: 1.5; }
  .film-opening .opening-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-height: 650px) and (min-width: 721px) and (min-aspect-ratio: 1/1) and (min-height: 541px) {
  .film-opening h1 { font-size: 44px; }
  .film-opening .opening-offer { margin-block: 16px; font-size: 16px; }
}
.motion-off .film-opening.is-sequenced { height: 100svh; }
.motion-off .film-opening-pin { position: relative; }
.motion-off .film-opening-canvas, .motion-off .film-opening-bloom { display: none; }
.motion-off .film-opening .opening-copy { opacity: 1; }
.motion-off .film-opening .opening-ticket, .motion-off .film-opening .ticket-arrow { transform: none !important; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .film-opening.is-sequenced { height: 100svh; }
  .film-opening-pin { position: relative; }
  .film-opening-canvas, .film-opening-bloom { display: none; }
  .film-opening .opening-copy { opacity: 1; }
  .film-opening .opening-ticket, .film-opening .ticket-arrow { transform: none !important; transition: none; }
}

/* Fully faded text leaves the render tree: no invisible-but-measured or focusable copy. */
.film-opening .opening-copy[inert] { visibility: hidden; }
