/* ---------- CH 05: THE DAILIES ----------
   A night screening room in tent indigo. Reel A is a 35 mm strip crossing a pinned stage; colour
   exists only in the projector gate, everything else on the strip is graded into the wash and
   dimmed. The clapperboard slate beside it snaps shut when the film changes. The board and the
   contact sheet live in css/dailies-sheet.css.
   Only transform, opacity and filter animate. Without GSAP or with reduced motion the stage
   un-pins and the three films read as plain cards (html.no-motion, at the end of this file). */
.dly {
  --on-hot: var(--land-near);
  padding: calc(var(--section) * .8) 0 calc(var(--section) + 12vh); overflow-x: clip;
  background: linear-gradient(180deg, var(--sky-2) 0, var(--land-near) 26rem, var(--land-near) calc(100% - 46rem), var(--sky-2) calc(100% - 15vh));
}
.dly__head { padding: 0 var(--gutter); }
.dly__head .h-display { max-width: 15ch; }
.dly__head .lede { color: var(--fg); }

/* the tally: a slate's data row, numerals in tabular figures */
.tally {
  display: flex; flex-wrap: wrap; max-width: 46rem; margin: 2.4rem 0 0; padding-top: 10px; border-radius: var(--radius);
  border: 2px solid var(--paper); background: var(--land-near) linear-gradient(115deg, var(--paper) 0 50%, transparent 50% 100%) 0 0 / 22px 10px repeat-x;
}
.tally__cell { flex: 1 1 8rem; display: flex; flex-direction: column-reverse; gap: .35rem; padding: 1rem 1.1rem 1.1rem; border-right: 1px solid var(--rule); }
.tally__cell:last-child { border-right: 0; }
.tally dt { font-size: .66rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-dim); }
.tally dd { margin: 0; font: 900 clamp(2.2rem, 1.5rem + 2.2vw, 3.4rem)/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--hot); }

/* ---------- Reel A: the stage ---------- */
.gate-scene { margin-top: clamp(3rem, 6vw, 5rem); }
.gate-stage {
  --fh: clamp(210px, 52svh, 430px); --fw: calc(var(--fh) * 9 / 16); --gh: calc(var(--fh) * 1.12);
  --slate-w: min(430px, 33vw); --gx: calc((100% + var(--gutter) + var(--slate-w)) / 2); --gy: 55%;
  position: relative; height: 100svh; overflow: hidden;
}
.gate__reel { position: absolute; z-index: 5; left: var(--gutter); top: 5.2rem; margin: 0; display: flex; align-items: center; gap: .5rem; font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-dim); }
.gate__reel::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); }
/* the strip fades into the dark at both edges of the screen */
.gate-stage::before, .gate-stage::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 2; width: 16%; pointer-events: none; }
.gate-stage::before { left: 0; background: linear-gradient(90deg, var(--land-near), transparent); }
.gate-stage::after { right: 0; background: linear-gradient(270deg, var(--land-near), transparent); }

/* the film: a dark base, sprocket holes top and bottom, a printed frame number under every still */
.strip {
  position: absolute; z-index: 1; left: 0; top: var(--gy); translate: 0 -50%; display: flex; align-items: center; gap: 14px; width: max-content;
  padding: 32px 18px; background: #14102d; border-block: 1px solid rgb(254 254 203 / .12); will-change: transform;
}
.strip::before, .strip::after {
  content: ''; position: absolute; left: 0; right: 0; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='12'%3E%3Crect x='3' y='1' width='15' height='10' rx='2.5' fill='%23070120'/%3E%3C/svg%3E") repeat-x;
}
.strip::before { top: 9px; }
.strip::after { bottom: 9px; }
.cell { position: relative; flex: none; width: var(--fw); margin: 0; }
.cell img { width: 100%; height: var(--fh); object-fit: cover; opacity: .55; filter: var(--dt); }
/* an indigo tint over every still: the strip sits in the room's blue light */
.cell::before { content: ''; position: absolute; inset: 0 0 auto; z-index: 1; height: var(--fh); background: rgb(46 46 123 / .5); }
.cell figcaption { position: absolute; left: 0; right: 0; top: 100%; padding-top: 5px; font: 600 .5rem/1 var(--font-body); letter-spacing: .16em; white-space: nowrap; color: var(--hot); opacity: .8; }
/* a black leader between films, with the take written on it in china marker */
.lead { flex: none; display: grid; place-items: center; width: calc(var(--fw) * .7); height: var(--fh); background: #000; border-inline: 1px dashed rgb(254 254 203 / .22); }
.lead__id { writing-mode: vertical-rl; rotate: 180deg; font: italic 700 1.1rem var(--font-display); letter-spacing: .04em; color: var(--hot); opacity: .85; white-space: nowrap; }

/* ---------- the projector gate: the only colour on the stage ---------- */
.gate { position: absolute; z-index: 3; left: var(--gx); top: var(--gy); width: calc(var(--fw) * 1.12); height: var(--gh); translate: -50% -50%; }
.gate__glow {
  position: absolute; inset: -5px; border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 4px #2a2442, 0 0 0 6px rgb(253 186 44 / .65), 0 0 44px 8px rgb(253 186 44 / .3), 0 0 140px 40px rgb(253 186 44 / .13);
  animation: projector 1.1s steps(2, end) infinite;
}
@keyframes projector { 50% { opacity: .72; } }
.gate__window { position: absolute; inset: 0; overflow: hidden; border-radius: 3px; background: #000; }
.gate__video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the light leak that burns over the gate on a film change (js/dailies-gate.js) */
.gate__leak { position: absolute; inset: 0; opacity: 0; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(circle at 28% 34%, #fff3b0 0, rgb(253 186 44 / .9) 28%, rgb(233 81 197 / .55) 62%, transparent 82%); }
.gate__mark { position: absolute; width: 16px; height: 16px; border: 2px solid var(--hot); pointer-events: none; }
.gate__mark--tl { left: -16px; top: -16px; border-right: 0; border-bottom: 0; }
.gate__mark--tr { right: -16px; top: -16px; border-left: 0; border-bottom: 0; }
.gate__mark--bl { left: -16px; bottom: -16px; border-right: 0; border-top: 0; }
.gate__mark--br { right: -16px; bottom: -16px; border-left: 0; border-top: 0; }
.gate__watch { position: absolute; left: 50%; top: 100%; margin-top: 1.5rem; translate: -50% 0; white-space: nowrap; }
.gate__watch svg { width: 15px; height: 15px; }

/* ---------- the slate: a clapperboard data card ---------- */
.slate-card { position: absolute; z-index: 4; left: var(--gutter); top: var(--gy); translate: 0 -50%; width: var(--slate-w); max-height: calc(100svh - 10.5rem); }
.clap { position: relative; height: 32px; }
.clap__stick, .clap__base {
  position: absolute; left: 0; right: 0; height: 16px; border: 3px solid var(--paper);
  background: repeating-linear-gradient(115deg, var(--paper) 0 15px, var(--land-near) 15px 30px);
}
.clap__stick { top: 0; border-radius: 3px 3px 0 0; transform-origin: 0 100%; }
.clap__base { bottom: 0; }
.slate-body { display: grid; padding: 1rem 1.15rem 1.15rem; background: #0b0820; border: 3px solid var(--paper); border-top: 0; box-shadow: 10px 12px 0 rgb(0 0 0 / .5); overflow: hidden; }
.sl { grid-area: 1 / 1; display: grid; gap: .7rem; align-content: start; min-width: 0; visibility: hidden; opacity: 0; color: var(--paper); font-size: .8rem; line-height: 1.45; }
.sl.is-current { visibility: visible; opacity: 1; }
.sl > * { margin: 0; }
.sl__scene { font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--hot); }
.sl__take { font-variant-numeric: tabular-nums; color: var(--paper); opacity: .8; }
.sl__title { font: 800 1.2rem/1.4 var(--font-body); text-wrap: balance; }
.sl__gloss { color: var(--fg-dim); font-size: .78rem; }
.sl__meta { display: grid; grid-template-columns: auto auto 1fr; gap: .8rem 1.4rem; padding: .7rem 0; border-block: 1px solid var(--rule); }
.sl__meta dt, .sl__k { font-size: .6rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-dim); }
.sl__meta dd { margin: .15rem 0 0; font: 800 1.15rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.sl__meta .stamp { display: block; margin: .35rem 0 0; width: max-content; }
.sl__row { display: grid; gap: .25rem; }
.sl__k { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: .1rem; }
.sl__ar { font: 600 1.02rem/1.55 var(--font-body); }
.sl__en, .sl__txt { color: var(--fg-dim); font-size: .76rem; }
.sl__row--music .sl__txt { font-size: .7rem; }
/* a rubber stamp naming the pipeline step this row is proof of */
.stamp { display: inline-block; padding: .18rem .4rem; border: 1.5px solid var(--hot); border-radius: 3px; rotate: -2.5deg; font: 700 .52rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--hot); white-space: nowrap; }
.sl__watch { display: none; justify-self: start; }
.sl__watch svg { width: 14px; height: 14px; }

/* ---------- the Watch dialog: the first seconds of a film, with sound ---------- */
.watch { width: min(460px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: clamp(1rem, 2.4vw, 1.6rem); border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--ink-2); color: var(--bone); --fg: var(--bone); --bg: var(--ink-2); --kicker: var(--ink-2); --hot: var(--film-amber); }
.watch::backdrop { background: rgb(9 4 32 / .92); backdrop-filter: blur(4px); }
.watch[open] { animation: lb var(--t-base) var(--ease); }
.watch .lightbox__head { margin-bottom: 1rem; }
.watch .lightbox__head h3 { margin-top: .2rem; font: 800 1.15rem/1.5 var(--font-body); }
.watch .slate { margin-bottom: .6rem; }
.watch__video { display: block; width: 100%; max-height: calc(100dvh - 11rem); aspect-ratio: 9 / 16; margin: 0 auto; background: #000; border-radius: 3px; object-fit: contain; }

/* ---------- close ---------- */
.dly__close { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; max-width: var(--max); margin: clamp(5rem, 9vw, 8rem) auto 0; padding: 2rem var(--gutter) 0; border-top: 1px solid var(--rule); }
.dly__close p { margin: 0; max-width: 30ch; font: italic 800 clamp(1.6rem, 1rem + 1.8vw, 2.6rem)/1.1 var(--font-display); }

/* ---------- phones: gate on top, slate card under it ---------- */
@media (max-width: 760px) {
  .gate-stage { --fh: clamp(130px, 25svh, 220px); --gx: 50%; --gy: calc(5rem + var(--gh) / 2); }
  .gate__reel { display: none; }
  .gate-stage::before, .gate-stage::after { width: 10%; }
  .slate-card { left: 16px; right: 16px; top: auto; bottom: 5.6rem; translate: none; width: auto; max-height: calc(100svh - var(--gy) - var(--gh) / 2 - 9.6rem); }
  .clap { height: 26px; }
  .clap__stick, .clap__base { height: 13px; }
  .slate-body { padding: .7rem .85rem .85rem; box-shadow: 6px 7px 0 rgb(0 0 0 / .4); }
  .sl { gap: .45rem; font-size: .72rem; }
  .sl__title { font-size: 1rem; line-height: 1.3; }
  .sl__gloss, .sl__en, .sl__row--music { display: none; }
  .sl__meta { padding: .45rem 0; gap: .5rem 1rem; }
  .sl__meta dd { font-size: 1rem; }
  .sl__ar { font-size: .9rem; line-height: 1.45; }
  .gate__watch { margin-top: 1rem; }
  .dly__close { padding-inline: 16px; }
}
@media (max-height: 860px) and (min-width: 761px) {
  .slate-card { top: 49%; }
  .gate__reel { display: none; }
  .slate-body { padding: .8rem 1rem 1rem; }
  .sl { gap: .4rem; font-size: .72rem; }
  .sl__title { font-size: 1rem; line-height: 1.3; }
  .sl__gloss, .sl__en, .sl__txt { font-size: .7rem; }
  .sl__meta { padding: .45rem 0; }
  .sl__meta dd { font-size: 1.02rem; }
  .sl__ar { font-size: .94rem; line-height: 1.45; }
  .sl__row--music .sl__txt { font-size: .64rem; }
}

/* ---------- no GSAP or reduced motion: three readable film cards, no pin, no gate ---------- */
html.no-motion .gate-stage { height: auto; overflow: visible; padding: 0 var(--gutter); display: grid; gap: 2.4rem; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
html.no-motion .gate-stage::before, html.no-motion .gate-stage::after, html.no-motion .gate, html.no-motion .gate__reel, html.no-motion .lead { display: none; }
html.no-motion .strip { position: static; translate: none; display: flex; flex-wrap: wrap; justify-content: center; width: auto; padding: 32px 14px; gap: 14px; }
html.no-motion .cell { width: clamp(70px, 9vw, 110px); }
html.no-motion .cell img { height: auto; aspect-ratio: 9 / 16; opacity: 1; filter: none; }
html.no-motion .cell::before { display: none; }
html.no-motion .slate-card { position: static; translate: none; width: auto; max-height: none; }
html.no-motion .slate-body { gap: 2.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
html.no-motion .sl { grid-area: auto; visibility: visible; opacity: 1; }
html.no-motion .sl__watch { display: inline-flex; }
html.no-motion .sl__gloss, html.no-motion .sl__en, html.no-motion .sl__row--music { display: block; }
html.no-motion .gate__watch { display: none; }
@media (prefers-reduced-motion: reduce) {
  .gate__glow { animation: none; }
}
