/* The film's frame inside the Home r4 page (card 282, round 3).
   The player, captions, controls and chapters of build/page.css, scoped to .film.
   The film's own tokens are pinned to their light values, which are the same as the
   page's light tokens (site.css): page = paper #f3efe9, surface #fff, surface-2 = warm
   surface #faf8f4, ink #1d1b19, ink-2 = muted #5e5a55, red = brand red #ff3b30,
   red-ink = word red #c0261e. In dark mode the film stays a lit paper screen, like a video. */

.film {
  --paper: #f3efe9;
  --surface: #ffffff;
  --surface-warm: #faf8f4;
  --ink: #1d1b19;
  --muted: #5e5a55;
  --brand-red: #ff3b30;
  --red: #c0261e;
  --red-dark: #a51f18;
  --red-soft: #fce9e5;
  --line: #ddd6cd;
  --line-soft: #e6dfd6;
  /* Colours motion.css writes as literals, as tokens with the same light values (light mode is unchanged). */
  --card-line: #e6ddd3;
  --row-line: #ece4da;
  --eyebrow: #766b61;
  --folder: #ded9c9;
  --folder-line: #d5cfbb;
  --folder-ink: #5e5a55;          /* was #6f6956: 3.9:1 on the folder; the page's muted ink gives 4.9:1 */
  --warm-line: #dfcbbc;
  --warm-divider: #ead9cc;
  --question-ink: #5e3a2e;
  --glyph: #f4eee6;
  --glyph-ink: #7d6a58;
  --field: #f6f2ec;
  --press-rgb: 252 233 229;
  --ring-track: #e6dfd5;
  --halo: #efe1d6;
  --sheet-back: #e8e3d6;
  --sheet-mid: #f3f0e5;
  --sheet-line: #d9d5c7;
  --paper-line: #e4dacf;
  --reader-icon: #b38f73;
  --reader-badge: #7f6e5c;
  --reader-section: #7d7265;
  --text-line: #e6e3d8;
  --cue-line: #dfc9bb;
  --cue-chip: #fbe5de;
  --sub-line: #bdb2a6;
  --button-line: #e3d7cb;
  --strip-line: #e2d9cf;
  --tab-track: #efe9e1;
  --tab-selected: #ffffff;
  --bubble: #f1ebe3;
  --send-idle: #d9cfc4;
  --track: #e4ded6;
  --chapter-line: #d7cfc5;
  --chapter-hover: #a69b8e;
  --sound-hover-line: #cbbeb2;
  /* The app icon (icono/icon.json): white tile; every piece #FF383C. */
  --icon-tile: #ffffff;
  --icon-tile-line: #e6ddd3;
  --icon-sweep: 1;                        /* the light sweep across the finished icon */
  --sound-on-line: #edc1ba;
  --sound-on: #fff1ed;
  color-scheme: light;
  /* The base text of build/page.css. site.css sets body to 17 px, line-height 1.5 and its own stack;
     the film was laid out and checked on these. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  color: var(--ink);
}
@media (max-width: 767px) {
  /* The page gutter is 20 px; the film was made and checked on a 16 px gutter (358 px at 390). */
  .film { margin-inline: -4px; }
}

/* site.css styles .stage (widget backdrop) and strong (ink colour); the film's stage and words keep their own. */
.film .stage { display: block; padding: 0; border: 0; border-radius: 0; background-image: none; }
:where(.film) strong { color: inherit; }   /* lowest specificity: the film's own strong colours win */

.film .icon { width: 18px; height: 18px; flex-shrink: 0; }
.film .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.film button, .film input { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.film button { cursor: pointer; }
.film button:disabled { cursor: default; opacity: .5; }

.film .demo-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 8px; font-size: 11px; line-height: 1.5; letter-spacing: 1.2px; font-weight: 600; color: var(--muted); }
.film .demo-topline > :last-child { font-size: 12px; font-weight: 400; letter-spacing: 0; }
.film .player { position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg, 24px); overflow: hidden; isolation: isolate; background: var(--surface-warm); box-shadow: var(--shadow-card); }
.film .player-bottom { position: relative; z-index: 20; background: var(--surface); border-top: 1px solid var(--line-soft); }
.film .caption-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px 8px; }
.film #scene-caption { margin: 0; font-size: 14px; line-height: 1.5; letter-spacing: -.1px; color: var(--muted); }
.film #scene-counter { flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .5px; color: var(--muted); }
.film .transport { display: flex; align-items: center; gap: 8px; min-height: 72px; padding: 0 16px 16px; }
.film .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 8px; border-radius: 16px; background: transparent; border: 1px solid transparent; flex-shrink: 0; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.film .icon-button:hover { background: var(--surface-warm); }
.film .icon-button .control-label { font-size: 12px; font-weight: 550; line-height: 1.25; }
.film .icon-button svg { width: 18px; height: 18px; flex-shrink: 0; }
.film #toggle-play { min-width: 108px; justify-content: flex-start; }
.film #restart { color: var(--muted); }
.film #sound-toggle { min-width: 136px; padding-inline: 12px; background: var(--surface-warm); border-color: var(--line-soft); color: var(--muted); }
.film #sound-toggle:hover { border-color: var(--sound-hover-line); color: var(--ink); }
.film #sound-toggle[aria-pressed="true"] { color: var(--red); border-color: var(--sound-on-line); background: var(--sound-on); }
.film #timeline { --progress: 0%; width: 100%; min-width: 80px; height: 44px; margin: 0 8px; padding: 0; border-radius: 8px; background: transparent; accent-color: var(--brand-red); cursor: pointer; -webkit-appearance: none; appearance: none; }
.film #timeline::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--brand-red) 0%, var(--brand-red) var(--progress), var(--track) var(--progress), var(--track) 100%); }
.film #timeline::-moz-range-track { height: 4px; border-radius: 4px; background: var(--track); }
.film #timeline::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--brand-red); }
.film #timeline::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--brand-red); box-shadow: 0 0 0 4px var(--surface); }
.film #timeline::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--brand-red); box-shadow: 0 0 0 4px var(--surface); }
.film #timecode { min-width: 80px; font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; text-align: center; }
/* «Sound» and «Reduce motion»: one control style (round 8). */
.film .text-button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-soft); background: var(--surface-warm); border-radius: 16px; font-size: 12px; font-weight: 550; line-height: 1.25; white-space: nowrap; color: var(--muted); }
.film .text-button:hover { color: var(--ink); border-color: var(--sound-hover-line); }
.film .text-button[aria-pressed="true"] { color: var(--red); border-color: var(--sound-on-line); background: var(--sound-on); }
.film .chapters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; padding: 24px 0 0; }
.film .chapter { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 0; border: 0; border-top: 1px solid var(--chapter-line); background: transparent; color: var(--muted); text-align: left; font-size: 12px; line-height: 1.4; transition: color 160ms ease, border-color 160ms ease; }
.film .chapter-num { font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.film .chapter::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--brand-red); transform: scaleX(var(--chapter-progress, 0)); transform-origin: left; pointer-events: none; }
.film .chapter:hover { border-color: var(--chapter-hover); color: var(--ink); }
.film .chapter[aria-current="step"] { color: var(--red); border-top-color: var(--line); }
.film .illustrated-note { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Desktop (round 8): the stage is sized to the window so the stage and its controls fit under the sticky nav
   (1280 × 800: 652 px; 1440 × 900: 752 px; never more than 760 px). The controls are compact: 88 px in all. */
@media (min-width: 901px) {
  .film .caption-row { min-height: 36px; padding: 8px 20px 0; }
  .film .transport { min-height: 51px; padding: 0 12px 4px; }
}
@media (max-width: 900px) {
  .film .transport { display: grid; grid-template-columns: auto 44px minmax(0,1fr) auto; gap: 0 8px; padding: 0 16px 16px; }
  .film #timeline { grid-column: 1 / 4; grid-row: 1; min-width: 0; margin: 0 8px; width: calc(100% - 16px); }
  .film #timecode { grid-column: 4; grid-row: 1; justify-self: end; }
  .film #toggle-play { grid-column: 1; grid-row: 2; }
  .film #restart { grid-column: 2; grid-row: 2; }
  .film #sound-toggle { grid-column: 3; grid-row: 2; justify-self: end; }
  .film #motion-toggle { grid-column: 4; grid-row: 2; }
  .film .chapters { gap: 16px; }
  .film .chapter { font-size: 11px; }
}
@media (max-width: 600px) {
  .film .demo-topline { align-items: flex-start; padding-bottom: 16px; gap: 16px; font-size: 10px; letter-spacing: .6px; }
  .film .demo-topline > :last-child { font-size: 11px; line-height: 1.4; text-align: right; max-width: 150px; }
  .film .demo-topline .nw { white-space: nowrap; }
  .film .caption-row { padding: 16px 16px 8px; min-height: 80px; gap: 16px; }
  .film #scene-caption { font-size: 13px; letter-spacing: 0; }
  .film #scene-counter { font-size: 10px; letter-spacing: .3px; }
  .film .transport { grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 4px 8px; padding: 0 12px 12px; }
  .film #timeline { grid-column: 1 / 3; grid-row: 1; margin: 0 4px; width: calc(100% - 8px); }
  .film #timecode { grid-column: 3; grid-row: 1; min-width: 0; padding-right: 4px; }
  .film #toggle-play { grid-column: 1; grid-row: 2; min-width: 0; width: 100%; padding: 8px 4px; gap: 6px; }
  .film #restart { grid-column: 2; grid-row: 2; }
  .film #sound-toggle { grid-column: 3; grid-row: 2; justify-self: stretch; min-width: 0; width: 100%; gap: 6px; padding: 8px; }
  .film #sound-toggle svg { width: 16px; height: 16px; }
  .film #sound-label { white-space: normal; }
  .film #motion-toggle { grid-column: 1 / 4; grid-row: 3; justify-self: center; padding: 8px 12px; }
  .film .icon-button .control-label { font-size: 11px; }
  .film .chapters { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 16px; padding-top: 24px; }
  .film .chapter-num { font-size: 10px; }
}
@media (max-width: 350px) {
  .film .chapters { column-gap: 8px; }
  .film .chapter { gap: 6px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .film .icon-button, .film .chapter { transition: none; }
}

/* The film's colour layer: every colour motion.css writes as a literal, through the tokens above. */
.film .scene-eyebrow { color: var(--eyebrow); }
.film .card { border-color: var(--card-line); }
.film .item-row { border-color: var(--row-line); }
.film .files-folder, .film .folder-tab { background: var(--folder); border-color: var(--folder-line); }
.film .files-folder { color: var(--folder-ink); }
.film .question-strip { border-color: var(--warm-line); color: var(--question-ink); }
.film .question-note { border-color: var(--warm-line); }
.film .question-note p { color: var(--question-ink); }
.film .qn-promise { border-color: var(--warm-divider); }
.film .qn-promise::before, .film .qn-promise::after { box-shadow: 0 0 0 5px var(--halo); }
.film .qn-answer { border-top-color: var(--warm-divider); }
.film .nb-glyph { background: var(--glyph); color: var(--glyph-ink); }
.film .nb-search { background: var(--field); }
.film .progress-ring circle { stroke: var(--ring-track); }
.film .progress-ring .ring-fill { stroke: var(--brand-red); }
.film .source-chip svg { color: var(--glyph-ink); }
.film .reader-sheets { background: var(--sheet-back); border-color: var(--sheet-line); }
.film .reader-sheets::after { background: var(--sheet-mid); border-color: var(--sheet-line); }
.film .reader-paper { border-color: var(--paper-line); }
.film .reader-label svg { color: var(--reader-icon); }
.film .reader-badge { color: var(--reader-badge); }
.film .reader-section { color: var(--reader-section); }
.film .reader-lines i, .film .web-lines i { background: var(--text-line); }
.film .action-cue { border-color: var(--cue-line); }
.film .cue-indicator { background: var(--cue-chip); }
.film .sub-circle { border-color: var(--sub-line); }
.film .todo-done, .film .share-button, .film .asst-composer { border-color: var(--button-line); }
.film .todo-strip { border-color: var(--strip-line); }
.film .picker-tabs { background: var(--tab-track); }
.film .picker-tabs span.selected { background: var(--tab-selected); }
.film .asst-bubble { background: var(--bubble); }
.film .asst-send { background: var(--send-idle); }

/* Dark mode: the page's own dark tokens (site.css): page #252525, surface #2e2d2c, surface-2 #363534,
   ink #f5f5f5, ink-2 #b6b2ad, red-ink #ff5c56. Same cards, same sizes; cover tones stay (they are the documents' art). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .film {
    color-scheme: dark;
    --paper: #252525;
    --paper-warm: #2c2926;
    --surface: #2e2d2c;
    --surface-warm: #363534;
    --ink: #f5f5f5;
    --muted: #b6b2ad;
    --red: #ff857b;          /* site.css dark red-ink #ff5c56, lighter: 4.0:1 on the film's warm cards; this is ≥ 4.8:1 on every dark surface */
    --red-soft: #4b3433;
    --line: rgba(255, 255, 255, .14);
    --line-soft: rgba(255, 255, 255, .08);
    --card-line: rgba(255, 255, 255, .08);
    --row-line: rgba(255, 255, 255, .08);
    --eyebrow: #b6b2ad;
    --folder: #3a3836;
    --folder-line: rgba(255, 255, 255, .1);
    --folder-ink: #b6b2ad;
    --warm-line: rgba(255, 255, 255, .12);
    --warm-divider: rgba(255, 255, 255, .1);
    --question-ink: #ecd6cb;
    --glyph: #363534;
    --glyph-ink: #b6b2ad;
    --field: #363534;
    --press-rgb: 75 52 51;
    --ring-track: rgba(255, 255, 255, .14);
    --halo: #4a4442;
    --sheet-back: #3a3836;
    --sheet-mid: #333130;
    --sheet-line: rgba(255, 255, 255, .08);
    --paper-line: rgba(255, 255, 255, .08);
    --reader-icon: #c9a88f;
    --reader-badge: #b6b2ad;
    --reader-section: #b6b2ad;
    --text-line: rgba(255, 255, 255, .12);
    --cue-line: rgba(255, 255, 255, .12);
    --cue-chip: #4b3433;
    --sub-line: #6f6a65;
    --button-line: rgba(255, 255, 255, .12);
    --strip-line: rgba(255, 255, 255, .08);
    --tab-track: #3a3836;
    --tab-selected: #4a4846;
    --bubble: #3a3836;
    --send-idle: #4a4846;
    --track: rgba(255, 255, 255, .14);
    --chapter-line: rgba(255, 255, 255, .14);
    --chapter-hover: rgba(255, 255, 255, .4);
    --sound-hover-line: rgba(255, 255, 255, .3);
    --icon-tile: #212121;                 /* icon.json dark: 0.1298 grey */
    --icon-tile-line: rgba(255, 255, 255, .14);
    --icon-sweep: .4;                     /* softer on the dark tile */
    --sound-on-line: rgba(255, 92, 86, .4);
    --sound-on: #4b3433;
  }
  /* motion.js warms the light paper under the end card inline; dark mode warms the dark paper the same way. */
  :root:not([data-theme="light"]) .film .stage { background-color: color-mix(in srgb, var(--paper), var(--paper-warm) calc(var(--warmth, 0) * 100%)) !important; }
}

/* One Play on the film's opening frame, in the masthead row; shown only while the film waits at 0:00.
   It is the player's «Watch» hook (#watch-story in motion.js): start from 0:00 and bring the player into view. */
.film .film-start { position: absolute; z-index: 25; top: 13px; left: 50%; transform: translateX(-50%); min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: #c0261e; color: #ffffff; font-size: 15px; font-weight: 600; box-shadow: 0 6px 16px -8px rgb(120 28 22 / .5); }
.film .film-start svg { width: 16px; height: 16px; }
.film .film-start span { font-weight: 400; opacity: .9; }
.film .film-start:hover { background: #a51f18; }
.film #stage:not([data-time="0.000"]) ~ .film-start { display: none; }
@media (max-width: 600px) {
  .film .film-start { top: 12px; }
  .film .film-start span { display: none; }
}
