/* The television completes the camera push before exposing this viewport host.
   Archive layout then belongs entirely to CSS, independent of the 3D model. */
.film-archive {
  position: absolute; inset: 0; overflow: hidden; isolation: isolate;
  container-type: size; color: #8a9eff; color-scheme: dark;
  /* The same quiet CRT surface as PRESS START, beneath the untouched film frames. */
  background:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0,0,0,.055) 3px 4px),
    radial-gradient(ellipse at center, rgba(61,80,148,.11), transparent 72%), #0a0d13;
  font-family: 'FTK Tiny5', ui-monospace, monospace;
  --archive-gutter: clamp(24px, 6vw, 100px);
  --archive-header: clamp(96px, 14vh, 150px);
}
.film-archive, .film-archive * { box-sizing: border-box; }
.film-archive:focus { outline: none; }
.film-archive [hidden], .film-archive[hidden] { display: none !important; }
.film-archive button { color: inherit; font: inherit; touch-action: manipulation; cursor: pointer; }
.film-archive :focus-visible { outline: 1px solid currentColor; outline-offset: 5px; }
.film-archive-header {
  height: var(--archive-header); max-width: 1640px; margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) var(--archive-gutter) 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.film-archive-heading { margin: 0; font-size: clamp(23px, 2.1vw, 34px); font-weight: 400; line-height: 1; letter-spacing: .035em; }
.film-archive-label { display: block; margin-top: 7px; font-size: 12px; opacity: .66; letter-spacing: .12em; }
.film-archive-close { border: 0; padding: 12px 0 12px 12px; background: none; min-height: 44px; font-size: 15px !important; letter-spacing: .04em; white-space: nowrap; }
.film-library {
  height: calc(100% - var(--archive-header)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: #485479 #0a0d13;
  padding: 12px var(--archive-gutter) max(80px, env(safe-area-inset-bottom));
}
.film-collection {
  max-width: 1440px; margin: 0 auto; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; gap: clamp(52px, 7vw, 100px) clamp(28px, 4vw, 64px);
}
.film-entry { min-width: 0; }
.film-entry.is-featured { grid-column: 1 / -1; width: min(100%, 1120px, calc((100svh - 200px) * 1.7778)); margin: 0 auto; }
.film-tile { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.film-thumbnail { position: relative; width: 100%; aspect-ratio: var(--frame-ratio, 16/9); background: #090c12; overflow: hidden; }
.film-still { display: block; width: 100%; height: 100%; object-fit: contain; position: relative; }
.film-placeholder { position: absolute; inset: 0; padding: 24px; display: grid; place-items: center; font-size: clamp(22px, 3vw, 42px); text-align: center; opacity: .65; }
.film-caption { display: flex; align-items: baseline; gap: 14px; margin-top: 16px; font-size: clamp(21px, 2vw, 29px); line-height: 1.15; }
.film-index { flex: none; font-size: 12px; opacity: .6; }
.film-name { transition: opacity 160ms ease; }
.film-tile:hover .film-name { opacity: .72; }
.film-archive.is-viewing { background: #090909; color: #eeeae2; }
.film-viewer { position: absolute; inset: 0; overflow: hidden; }
.film-viewer-header {
  position: absolute; inset: 0 0 auto; min-height: 66px;
  padding: max(10px, env(safe-area-inset-top)) clamp(14px, 3vw, 48px) 10px;
  display: flex; align-items: center; gap: clamp(12px, 2vw, 32px); z-index: 4;
  background: rgba(9,9,9,.76);
}
.film-viewer-close { margin-left: auto; }
.film-text-control { border: 0; background: none; min-height: 44px; padding: 8px 3px; font-size: 16px !important; letter-spacing: .04em; white-space: nowrap; }
.film-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.film-player { width: min(100%, calc(100cqh * var(--film-aspect, 1.7778))); max-height: 100%; position: relative; background: #090909; }
.film-embed { position: absolute; inset: 0; height: 100%; width: 100%; border: 0; display: block; }
.film-wake { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; background: transparent; }
.film-lower-third {
  position: absolute; left: clamp(20px, 4vw, 64px); right: clamp(20px, 4vw, 64px);
  bottom: max(28px, env(safe-area-inset-bottom)); z-index: 2;
  padding: 20px 24px; max-height: calc(100% - 128px); overflow-y: auto;
  overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin;
  background: rgba(9,9,9,.87); transition: opacity 250ms ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
.film-lower-third.is-quiet:not(:hover):not(:focus-within) { opacity: 0; pointer-events: none; }
.film-viewer-title { font-size: clamp(19px, 2.3vw, 31px); line-height: 1.2; font-weight: 400; margin: 0 0 7px; }
.film-client { font-size: 13px; line-height: 1.45; opacity: .65; margin: 0; }
.film-details { max-width: 760px; margin-top: 22px; font-size: 14px; line-height: 1.6; }
.film-details p { margin: 0 0 18px; }
.film-details p:last-child { margin-bottom: 0; }
.film-subtitle { opacity: .7; }
.film-credits { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px 24px; margin: 18px 0 0; overflow-wrap: anywhere; }
.film-credits dt { color: #aaa; }
.film-credits dd { margin: 0; }
.film-status { position: absolute; z-index: 3; left: 20px; right: 20px; top: 78px; margin: 0; padding: 12px; background: #151515; font: 13px/1.4 -apple-system, sans-serif; }
.film-ended { position: absolute; inset: 66px 0 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.film-ended-return { pointer-events: auto; background: #0a0d13; color: #8a9eff; border: 0; padding: 16px 24px; min-height: 44px; font-size: 19px !important; }
.film-flight-frame { position: absolute; z-index: 5; transform-origin: 0 0; pointer-events: none; }
.film-archive.is-opening-film .film-viewer-header,
.film-archive.is-opening-film .film-lower-third { visibility: hidden; }
@media (max-width: 680px) {
  .film-archive { --archive-gutter: 22px; --archive-header: 100px; }
  .film-archive-header { gap: 12px; }
  .film-archive-heading { font-size: 23px; }
  .film-archive-close { font-size: 13px !important; }
  .film-collection { grid-template-columns: minmax(0, 1fr); gap: 42px; }
  .film-entry.is-featured { width: 100%; }
  .film-caption { margin-top: 12px; font-size: 23px; gap: 10px; }
  .film-viewer-header { gap: 12px; padding-left: 14px; padding-right: 14px; }
  .film-text-control { font-size: 13px !important; letter-spacing: 0; }
  .film-lower-third { left: 16px; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); padding: 16px; }
  .film-viewer-title { font-size: 21px; }
  .film-details { font-size: 13px; }
  .film-credits { gap: 10px 16px; }
}
@media (max-height: 480px) {
  .film-archive { --archive-header: 80px; }
  .film-viewer-header { min-height: 54px; padding-top: 4px; padding-bottom: 4px; }
  .film-lower-third { bottom: 12px; max-height: calc(100% - 88px); padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-archive *, .film-archive *::after { transition: none !important; animation: none !important; }
}
