/* ============================================================
   FILM.CSS: the scroll-scrubbed film and the portfolio built on it
   A fixed layer above the page plays four clips as you scroll
   through an empty runway section. On top of it sits #film-ui:
   scenes of cards that the helper cursors build while the film
   plays or holds. Without JS, or with reduced motion, none of
   this exists and the full sections below tell the same story.
   ============================================================ */

#film {
  position: fixed; inset: 0;
  z-index: 4;                       /* above the page (3), below the helpers (90), nav (100) and HUD (200) */
  pointer-events: none;
  background: var(--deep);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s linear;
}
#film.on { visibility: visible; }

#film video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.16s linear;  /* short crossfade at the cuts */
}
#film video.show { opacity: 1; }
#film video[data-clip="c"] { object-position: 50% 60%; }

/* the opening movie: the next clip fades in ON TOP of the last frame of the one before (0.9 s), and the old one is
   only removed once the new one is fully in, so the picture never dips to the background between clips. The film
   layer itself fades in slowly after the glitch. Scrubbing keeps the quick 0.16 s fade above. */
#film.movie { transition: opacity 1.1s ease-in-out; }
#film.movie video { transition: opacity 0s linear 0.95s; z-index: 1; }
#film.movie video.show { transition: opacity 0.9s ease-in-out; z-index: 2; }

#film-runway { width: 100%; pointer-events: none; }

/* ---------- the overlay: scenes of cards on top of the film ---------- */
#film-ui {
  position: fixed; inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s linear;
}
.fs {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  pointer-events: none;
}
.fs.on { opacity: 1; visibility: visible; }
.fs:not(.on) .b-ov { visibility: hidden !important; }   /* the build overlay must not show through a hidden scene */

/* LAYOUT SYSTEM
   Every scene is a chip at the top and one row. The left and right columns sit in the
   same row, so they always share a top edge and a height (the shorter column's cards
   stretch to match). The middle third is left clear for the character. */
.fs-chip {
  position: absolute; left: 0; bottom: calc(100% + 12px);
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  padding: 6px 16px; border-radius: 999px;
  white-space: nowrap;
}
.fs .row {
  position: absolute; left: 4vw; right: 4vw; top: 53%;
  transform: translateY(-48%);
  display: flex; justify-content: space-between; align-items: stretch;
}
.fs .col {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  width: clamp(250px, 27vw, 420px);
}
.fs .col > .fc { flex: 1 1 auto; display: flex; flex-direction: column; }
.fs .col.mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 86vw); align-items: center; text-align: center; }
.fs .col.top { position: absolute; top: 14vh; left: 4vw; width: min(520px, 90vw); }

/* the progress rail: one dot per part of the story */
#film-rail {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 6;
  display: flex; flex-direction: column; gap: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s linear;
}
#film-rail span { display: block; }
#film-rail i {
  display: block; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--cream) 45%, transparent);
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
#film-rail .on i { background: var(--accent); border-color: var(--accent); transform: scale(1.5); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }
#film-rail b { display: none; }
@media (max-width: 999px) { #film-rail { display: none; } }

/* a card: dark glass, so the writing reads over any frame */
.fc {
  position: relative;
  padding: 16px 18px;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 12px;
  pointer-events: none;
}
.fc .k {
  display: block;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.fc h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--cream); }
.fc p  { margin-top: 7px; font-size: 0.82rem; line-height: 1.55; color: color-mix(in srgb, var(--cream) 82%, transparent); }
.fc .n {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em;
  color: var(--accent);
}
.fc .hint {
  display: block; margin-top: 8px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 50%, transparent);
}
.fc .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fc .chip {
  font-family: var(--mono); font-size: 0.64rem;
  padding: 3px 8px; border-radius: 999px;
  color: var(--cream);
  border: 1px solid color-mix(in srgb, var(--cream) 28%, transparent);
  background: transparent;
}
.fc .pts { margin-top: 10px; }
.fc .pts li { font-size: 0.8rem; color: color-mix(in srgb, var(--cream) 82%, transparent); }
.fc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.fc-stats div { padding: 8px 6px; text-align: center; border: 1px solid color-mix(in srgb, var(--cream) 18%, transparent); border-radius: 8px; }
.fc-stats b { display: block; font-family: var(--mono); font-size: 1.1rem; color: var(--accent); font-weight: 700; }
.fc-stats span { display: block; margin-top: 3px; font-size: 0.62rem; line-height: 1.3; color: color-mix(in srgb, var(--cream) 70%, transparent); }

.fc-tag b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--cream); }
.fc-tag span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--accent); }

.fc[data-proj] { pointer-events: auto; cursor: none; transition: border-color 0.25s, transform 0.3s var(--ease-out); }
.fc[data-proj]:hover { border-color: var(--accent); transform: translateY(-3px); }
.fc-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; pointer-events: auto; }
.fc-cta a {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-decoration: none; padding: 9px 16px; border-radius: 6px;
  color: var(--cream); border: 1px solid color-mix(in srgb, var(--cream) 35%, transparent);
  transition: border-color 0.2s, color 0.2s;
}
.fc-cta a:hover { border-color: var(--accent); color: var(--accent); }
.fc-cta a.solid { background: var(--cream); color: var(--deep); font-weight: 700; border-color: var(--cream); }
.fc-cta a.solid:hover { background: var(--accent); border-color: var(--accent); color: var(--deep); }
.fc-big h3 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.fc-big p { font-size: 0.95rem; }

/* ---------- a project opened over the film ---------- */
#fm {
  position: fixed; inset: 0;
  z-index: 130;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(26, 18, 11, 0.8);
}
#fm.open { display: flex; }
.fm-card {
  position: relative;
  width: min(640px, 92vw); max-height: 86vh; overflow: auto;
  padding: 28px 30px;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 14px;
  overscroll-behavior: contain;
}
.fm-card .k { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.fm-card h3 { margin-top: 8px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.fm-card p { margin-top: 10px; line-height: 1.6; color: color-mix(in srgb, var(--cream) 82%, transparent); }
.fm-card .pts li { color: color-mix(in srgb, var(--cream) 85%, transparent); font-size: 0.92rem; }
.fm-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.fm-card .tags span { font-family: var(--mono); font-size: 0.68rem; padding: 3px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--cream) 28%, transparent); }
.fm-card .links { display: flex; gap: 12px; margin-top: 18px; }
.fm-card .links a { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.fm-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 1px solid color-mix(in srgb, var(--cream) 30%, transparent);
  color: var(--cream); width: 30px; height: 30px; border-radius: 50%;
  font-family: var(--mono); cursor: none;
}
.fm-close:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- highlights: key results ---------- */
.hl { display: flex; flex-direction: column; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--cream) 14%, transparent); }
.hl b { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em; color: var(--accent); font-weight: 700; }
.hl span { margin-top: 3px; font-size: 0.9rem; color: var(--cream); }
.fc .k + .hl { margin-top: 2px; }

/* ---------- the album showcase: a cover-flow on the empty floor ---------- */
.fs-album .fs-chip.center { position: absolute; left: 50%; top: 11vh; bottom: auto; transform: translateX(-50%); }
.album-stage { --S: 320px; position: absolute; inset: 0; perspective: 1500px; perspective-origin: 50% 45%; }
.rec {
  position: absolute; left: 50%; top: 44%;
  width: var(--S); height: var(--S);
  opacity: 0;
  pointer-events: auto; cursor: none;
  transition: opacity 0.4s;
  will-change: transform, opacity;
  filter: drop-shadow(0 26px 34px rgba(26, 18, 11, 0.55));
}
.rec:not(.in) { opacity: 0 !important; }

/* a 3.5 inch floppy disk */
.cover.floppy {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--shell) 100%, #fff 8%), var(--shell));
  clip-path: polygon(0 0, 86% 0, 100% 14%, 100% 100%, 0 100%);
  border-radius: 3% 0 3% 3%;
  color: var(--deep);
  font-family: var(--mono);
}
/* the dark opening and the magnetic disk under the shutter */
.cover .mag {
  position: absolute; top: 0; left: 22%; width: 46%; height: 26%;
  background: #15100A;
  border-radius: 0 0 4% 4%;
}
.cover .mag span {
  position: absolute; left: 26%; top: -8%; width: 56%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #15100A 0 14%, #3a3128 15% 100%);
}
/* the metal shutter slides open as the disk comes to the centre */
.cover .shutter {
  position: absolute; top: 0; left: 22%; width: 46%; height: 26%;
  background: linear-gradient(90deg, #A9AEB2, #E4E7E9 40%, #B9BEC2);
  border-radius: 0 0 4% 4%;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  transform: translateX(calc(var(--peek, 0) * -62%));
  transition: transform 0.25s ease-out;
}
.cover .shutter i { position: absolute; right: 12%; top: 18%; width: 18%; height: 64%; background: #2a2f33; border-radius: 6%; opacity: 0.8; }
/* the paper label carries the content */
.cover .label {
  position: absolute; left: 8%; right: 8%; top: 31%; bottom: 10%;
  background: #F1E7D4;
  border-radius: 2.5%;
  padding: calc(var(--S) * 0.035) calc(var(--S) * 0.045);
  box-shadow: inset 0 0 0 1px rgba(26, 18, 11, 0.12);
}
.cover .label .no { display: block; font-size: calc(var(--S) * 0.03); letter-spacing: 0.16em; color: #7A6A55; }
.cover .stat { margin-top: calc(var(--S) * 0.02); }
.cover .big { font-family: var(--sans); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: #1A120B; font-size: calc(var(--S) * var(--bs, 0.15)); }
.cover .unit { margin-top: calc(var(--S) * 0.015); font-size: calc(var(--S) * 0.033); line-height: 1.35; color: #5A4A38; }
.cover .ttl { position: absolute; left: 4.5%; right: 4.5%; bottom: 17%; font-family: var(--sans); font-weight: 800; font-size: calc(var(--S) * var(--ts, 0.06)); line-height: 1.1; letter-spacing: -0.02em; color: #1A120B; }
.cover .by { position: absolute; left: 4.5%; bottom: 5%; font-size: calc(var(--S) * 0.027); letter-spacing: 0.28em; color: #8A4F12; }
/* the write-protect notch */
.cover .notch { position: absolute; left: 5%; bottom: 3.5%; width: 6%; height: 4.2%; background: #15100A; border-radius: 10%; opacity: 0.85; }

.album-info {
  position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%);
  width: min(580px, 88vw); text-align: center;
  padding: 14px 20px;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 12px;
}
.album-info .k { display: block; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.album-info h3 { font-size: 1.02rem; font-weight: 700; }
.album-info p { margin-top: 5px; font-size: 0.82rem; line-height: 1.5; color: color-mix(in srgb, var(--cream) 82%, transparent); }
.album-info .hint { display: block; margin-top: 8px; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--cream) 50%, transparent); }

/* ---------- the sleeve (a project opened over the film) ---------- */
.fm-card.sleeve { display: grid; grid-template-columns: 260px 1fr; gap: 26px; width: min(860px, 94vw); }
.sl-art { --S: 260px; position: relative; width: 260px; height: 260px; }
.sl-art { filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5)); }
.sl-body .trk { counter-reset: t; list-style: none; margin-top: 14px; padding: 0; }
.sl-body .trk li { counter-increment: t; position: relative; padding-left: 36px; margin-top: 9px; font-size: 0.9rem; line-height: 1.55; color: color-mix(in srgb, var(--cream) 85%, transparent); }
.sl-body .trk li::before { content: counter(t, decimal-leading-zero); position: absolute; left: 0; top: 0.2em; font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
@media (max-width: 700px) {
  .fm-card.sleeve { grid-template-columns: 1fr; gap: 16px; }
  .sl-art { margin: 0 auto; width: 200px; height: 200px; --S: 200px; }
}

/* ---------- phones: columns stack, cards shrink ---------- */
@media (max-width: 999px) {
  .fs-chip { font-size: 0.56rem; letter-spacing: 0.16em; padding: 5px 12px; bottom: calc(100% + 8px); }
  .fs .row { position: absolute; inset: 0; transform: none; display: block; }
  .fs .col { position: absolute; left: 4vw; right: 4vw; width: auto; gap: 8px; }
  .fs .col.left  { top: 12vh; }
  .fs .col.right { bottom: 4vh; justify-content: flex-end; }
  .fs .col.top   { top: 12vh; }
  .fs .col.mid   { top: auto; bottom: 6vh; left: 50%; right: auto; width: min(560px, 90vw); transform: translateX(-50%); }
  .fs .col > .fc { flex: 0 0 auto; }
  .fc { padding: 10px 12px; }
  .fc h3 { font-size: 0.9rem; }
  .fc p, .fc .pts li { font-size: 0.72rem; }
  .fc .hint { display: none; }
  .fc[data-proj] p { display: none; }       /* title and key number only, so more of the character shows */
  .fs-album .fs-chip.center { top: 8vh; }
  .album-info { bottom: 4vh; padding: 10px 14px; }
  .album-info p { display: none; }
  .album-info .hint { font-size: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  #film, #film-ui, #fm { display: none !important; }
}

/* the film's floor is light stone: the menu and HUD text go dark while it shows */
body.film-light .logo, body.film-light .nav-links a, body.film-light .hud-label { color: #2C2016; }
body.film-light .logo b { color: #8A4F12; }
body.film-light .nav-links a::after { background: #8A4F12; }

/* ---------- the frame counter and the scroll hint ---------- */
#film-count {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 160;
  display: flex; align-items: baseline; gap: 2px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 6px 14px; border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s linear;
}
#film-count b { color: var(--accent); font-weight: 700; }
#film-count span { opacity: 0.6; }
#film-count .hint {
  display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap;
  font-style: normal; opacity: 0;
  transition: max-width 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}
#film-count.hint-on .hint { max-width: 140px; opacity: 0.85; margin-left: 12px; animation: hintNudge 1.4s ease-in-out infinite; }
#film-count .hint::after { content: ' ↓'; }
@keyframes hintNudge { 50% { transform: translateY(2px); } }
@media (max-width: 999px) { #film-count { bottom: 12px; font-size: 0.58rem; } }


/* ---------- low-power mode: film.js switches it on when frames run slow ---------- */
.lite body::before { display: none; }
.lite .rec { filter: none; }
.lite .helper svg { filter: none; }
.lite .b-trace rect { filter: none; }
.lite .fc, .lite .fs-chip, .lite #film-count { box-shadow: none; }


/* ---------- the locked intro ---------- */
.scroll-locked, .scroll-locked body { overscroll-behavior: none; }
#intro-skip {
  position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%);
  z-index: 161;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cream);
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 7px 16px; border-radius: 999px;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s, border-color 0.2s, color 0.2s;
}
#intro-skip.on { opacity: 0.9; visibility: visible; }
#intro-skip:hover, #intro-skip:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
@media (max-width: 999px) { #intro-skip { bottom: 50px; } }


/* ---------- the intro's boxes: a rise-and-fade, then the lines drop in one by one ----------
   Pure CSS animation (transform and opacity only): no per-frame script, no layout work. */
/* A box waits at opacity 0 (not visibility hidden) with its own layer, so the browser has already painted it
   and put it on the graphics card before its cue; the cue only changes opacity and position, which costs
   nothing. Painting it at the cue was the hitch. */
.fs .fc.css-reveal { will-change: opacity, transform; }
.fs .fc.css-reveal:not(.in) { opacity: 0; }
.fs .fc.css-reveal.in { animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fs .fc.css-reveal.in.now { animation: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- boxes that belong to the picture ----------
   Inside the film a box has no panel, no border and no blur: just writing that sits on the scene, with a
   soft dark pool of shade behind it (one static radial gradient) and two thin corner marks, like a
   caption drawn into the shot. Nothing here is translucent-blended or animated except opacity and
   transform on the whole box, so the video keeps its frame rate. */
.fs .fc {
  background: radial-gradient(ellipse 85% 85% at 50% 50%, rgba(26, 18, 11, 0.72), rgba(26, 18, 11, 0.38) 62%, transparent 100%);
  border: 0; border-radius: 0;
  padding: 20px 24px;
}
.fs .fc::after {
  content: ''; position: absolute; inset: 6px; pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 14px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 1px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 1px 14px no-repeat;
  opacity: 0.8;
}
.fs-album .fc::after { display: none; }

/* ---------- the pre-paint: everything drawn once, almost invisibly, before the movie ---------- */
.prewarm #film { visibility: visible; opacity: 0.01; transition: none; }
.prewarm #film video { opacity: 0.01 !important; transition: none; }
.prewarm #film-ui { opacity: 0.01; transition: none; }
.prewarm .fs { visibility: visible; opacity: 1; transition: none; }
.prewarm .fs .fc.css-reveal:not(.in) { opacity: 1; }

/* ---------- the film covers the screen: draw nothing under it ----------
   visibility keeps the layout (the scroll length does not change) but takes the page, the two canvases and
   the grain out of the browser's drawing and compositing while the video plays. */
.film-on #smooth-wrapper, .film-on #net-canvas, .film-on #brain-canvas, .film-on body::before { visibility: hidden; }

/* ---------- phones and small tablets: smaller boxes, so the character stays in view ----------
   Each box keeps its heading and a short text; the bullet points and extra chips are left to the full
   sections below. Boxes sit in the top and bottom bands and leave the middle of the screen clear. */
@media (max-width: 999px) {
  .fs .col.left, .fs .col.top { top: 9vh; }
  .fs .col.right { bottom: 56px; }
  .fs .fc { padding: 9px 12px; }
  .fs .fc .k { margin-bottom: 4px; font-size: 0.54rem; letter-spacing: 0.12em; }
  .fs .fc h3 { font-size: 0.86rem; line-height: 1.22; }
  .fs .fc p {
    margin-top: 4px; font-size: 0.7rem; line-height: 1.4;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  .fs .fc .pts, .fs .fc .hl { display: none; }
  .fs .fc .chips { margin-top: 6px; gap: 4px; }
  .fs .fc .chip { font-size: 0.58rem; padding: 2px 7px; }
  .fs .fc .chips .chip:nth-child(n+5) { display: none; }
  .fs .fc .n { margin-top: 5px; font-size: 0.66rem; }
  .fs .fc-stats { margin-top: 6px; gap: 5px; }
  .fs .fc-stats div { padding: 5px 3px; }
  .fs .fc-stats b { font-size: 0.9rem; }
  .fs .fc-stats span { font-size: 0.54rem; line-height: 1.2; }
  .fs .col { gap: 6px; }
}
@media (max-width: 999px) and (max-height: 640px) {      /* short phones, or landscape: smaller still */
  .fs .fc p { -webkit-line-clamp: 1; }
  .fs .fc .chips .chip:nth-child(n+4) { display: none; }
}

/* ---------- portrait phones: the whole frame fits, centred ----------
   The video is shown uncropped at full width in the middle of the screen (16:9, so it is a band), and its
   top and bottom edges fade into the page. The boxes use the clear space above and below it. */
@media (max-width: 999px) and (orientation: portrait) {
  #film video {
    inset: auto; left: 0; top: 50%; transform: translateY(-50%);
    width: 100%; height: auto; aspect-ratio: 16 / 9;
    object-fit: contain; object-position: 50% 50%;
    -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
            mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
  }
  #film video[data-clip] { object-position: 50% 50%; }
  /* smaller boxes: top band and bottom band only, never over the picture */
  .fs .col { left: 5vw; right: 5vw; }
  .fs .col.left, .fs .col.top { top: 10vh; top: 10dvh; }
  .fs .col.right { bottom: 88px; }
  .fs .col.mid { bottom: 88px; width: 90vw; }
  .fs .fc { padding: 7px 10px; }
  .fs .fc .k { font-size: 0.5rem; margin-bottom: 2px; }
  .fs .fc h3 { font-size: 0.78rem; line-height: 1.2; }
  .fs .fc p { font-size: 0.64rem; line-height: 1.35; -webkit-line-clamp: 2; margin-top: 3px; }
  .fs .fc .chip { font-size: 0.52rem; padding: 1px 6px; }
  .fs .fc-stats b { font-size: 0.8rem; }
  .fs .fc-stats span { font-size: 0.5rem; }
  .fs .fc .chips .chip:nth-child(n+4) { display: none; }
}

/* the floppy disks (the empty floor): the picture fills the phone screen as their background, no band */
@media (max-width: 999px) and (orientation: portrait) {
  html.film-floor #film video[data-clip="c"] {
    inset: 0; top: 0; transform: none; width: 100%; height: 100%; aspect-ratio: auto;
    object-fit: cover; object-position: 50% 50%;   /* the last frame of the intro: the plain cream floor */
    -webkit-mask-image: none; mask-image: none;
  }
}
