/* Studio: the 9-10 tools (ST8; studio DESIGN §2.9, the 9-10 rows of §2.3, §8): the clapper's count, the take frame and its
   words, the hint bubbles, the camera chips, the moment strip and slow motion. Every class root carries the st- prefix;
   colours, motion and layers come from the core tokens. While the set counts or takes, Movie! and the beats dim to 50 % and
   take no pointer through css/studio.css (ST2b, .st-hud[data-mode="count"|"take"]; its rule outranks the core's
   html.stage-on main.view :is(button, …) { pointer-events: auto } since issue ST8-2), so nothing here repeats it. */

/* ── the clapper: the HUD's Plan button ([data-st="plan"], ST8's st-plan picture) with older.js's decoration in it */
.st-hud [data-st="plan"] .st-clap-deco { position: absolute; inset: 0; pointer-events: none; }
.st-hud [data-st="plan"] :is(.st-clap-d0, .st-clap-d1, .st-clap-d2) { transform-box: fill-box; transform-origin: center; transition: fill var(--t-micro); }
/* the count: the three dots fill one by one (0.6 s apart), each with a little pop */
.st-hud [data-st="plan"]:is([data-st-count="1"], [data-st-count="2"], [data-st-count="3"]) .st-clap-d0,
.st-hud [data-st="plan"]:is([data-st-count="2"], [data-st-count="3"]) .st-clap-d1,
.st-hud [data-st="plan"][data-st-count="3"] .st-clap-d2 { fill: var(--coral); animation: st-clap-dot 320ms var(--spring) both; }
@keyframes st-clap-dot { from { transform: scale(.3); } to { transform: scale(1); } }
.st-hud [data-st="plan"][data-st-clap="count"] { border-color: var(--coral-deep); }
/* the count's pill on the clapper's top edge: three 11 px felt dots, filled with the icon's own as the ticks come */
.st-hud [data-st="plan"] .st-clap-dots { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); display: none; gap: 4px; padding: 3px 6px;
  border-radius: 999px; background: var(--card); box-shadow: 0 0 0 2.5px var(--ink), var(--shadow); }
.st-hud [data-st="plan"][data-st-clap="count"] .st-clap-dots { display: flex; }
.st-hud [data-st="plan"] .st-clap-dots > i { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--sand); box-shadow: inset 0 0 0 2px var(--ink); }
.st-hud [data-st="plan"]:is([data-st-count="1"], [data-st-count="2"], [data-st-count="3"]) .st-clap-dots > i:nth-child(1),
.st-hud [data-st="plan"]:is([data-st-count="2"], [data-st-count="3"]) .st-clap-dots > i:nth-child(2),
.st-hud [data-st="plan"][data-st-count="3"] .st-clap-dots > i:nth-child(3) { background: var(--coral); animation: st-clap-dot 320ms var(--spring) both; }
/* the clapper's picture a little larger than a side button's (it carries the count and the cross) */
.st-hud [data-st="plan"] .st-pic { width: 40px; height: 40px; }
/* the take: the board shows st-cut ("Cut!"), the REC dot sits beside it and a ring fills round it over 30 s */
.st-hud [data-st="plan"] .st-clap-cut { position: absolute; inset: 0; display: none; place-items: center; }
.st-hud [data-st="plan"][data-st-clap="take"] > .st-pic { visibility: hidden; }
.st-hud [data-st="plan"][data-st-clap="take"] .st-clap-cut { display: grid; }
.st-hud [data-st="plan"][data-st-clap="take"] { background: var(--coral-field); border-color: var(--coral-deep); }
.st-hud [data-st="plan"] .st-clap-ring { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg);
  pointer-events: none; overflow: visible; opacity: 0; transition: opacity var(--t-micro); }
.st-hud [data-st="plan"] .st-clap-ring circle { fill: none; stroke: var(--coral); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.st-hud [data-st="plan"][data-st-clap="take"] .st-clap-ring { opacity: 1; }
.st-hud [data-st="plan"] .st-clap-rec { position: absolute; top: 2px; right: -24px; width: 16px; height: 16px; border-radius: 50%; background: var(--coral);
  box-shadow: 0 0 0 3px var(--card); display: none; animation: st-clap-rec 1s ease-in-out infinite alternate; }
.st-hud [data-st="plan"][data-st-side="l"] .st-clap-rec { right: auto; left: -24px; }
.st-hud [data-st="plan"][data-st-clap="take"] .st-clap-rec { display: block; }
@keyframes st-clap-rec { from { opacity: .45; } to { opacity: 1; } }
/* Cut!: the board snaps shut */
.st-hud [data-st="plan"][data-st-clap="cut"] > .st-pic { visibility: hidden; }
.st-hud [data-st="plan"][data-st-clap="cut"] .st-clap-cut { display: grid; animation: st-clap-snap 220ms var(--spring) both; }
@keyframes st-clap-snap { from { transform: scale(1.18) rotate(-6deg); } to { transform: none; } }

/* ── the take layer over the set: the coral frame, the big words, the hint bubbles (never takes a pointer) */
.st-older-layer { position: fixed; inset: 0; z-index: calc(var(--z-view) + 2); pointer-events: none; overflow: hidden; }
.st-older-frame { position: absolute; inset: 0; box-shadow: inset 0 0 0 4px var(--coral); opacity: 0; visibility: hidden; }
.st-older-layer[data-st-take] .st-older-frame { visibility: visible; animation: st-older-frame 2.4s ease-in-out infinite alternate; }
@keyframes st-older-frame { from { opacity: .5; } to { opacity: 1; } }
.st-older-word { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; padding: 12px 30px 14px; border-radius: 999px;
  border: 3px solid var(--ink); background: var(--butter); color: var(--ink); box-shadow: var(--shadow-lift), var(--press);
  font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -.01em; white-space: nowrap; animation: st-older-in 280ms var(--spring) both; }
.st-older-word[data-word="cut"] { background: var(--coral); color: var(--card); animation-duration: 200ms; }
@keyframes st-older-in { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 70% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.st-older-hint { position: absolute; left: 0; top: 0; max-width: min(260px, calc(100vw - 32px)); box-sizing: border-box; margin: 0; padding: 10px 14px;
  border-radius: 16px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lift); font-size: var(--label); font-weight: 700; line-height: 1.25;
  animation: st-older-hint 4.2s ease both; }
@keyframes st-older-hint { 0% { opacity: 0; transform: translateY(6px); } 8%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ── the end card's tools slot (9-10): camera chips, the moment strip, Slow motion */
.st-older-tools { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px; box-sizing: border-box; }
.st-older-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.st-older-chips { display: flex; align-items: center; gap: 8px; }
.st-older-tools button { font: inherit; color: var(--ink); -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
.st-older-chip { height: 60px; min-height: 60px; min-width: 76px; padding: 0 16px; border-radius: 30px; border: 3px solid var(--ink); background: var(--card);
  box-shadow: var(--shadow), var(--press); font-size: 19px; font-weight: 800; line-height: 1; white-space: nowrap;
  transition: background-color 120ms ease-out, color 120ms ease-out, transform var(--t-micro) var(--spring); }
.st-older-chip[aria-pressed="true"] { background: var(--ink); color: var(--card); box-shadow: var(--shadow); }
.st-older-slow { flex: none; width: 60px; height: 60px; min-height: 60px; padding: 0; border-radius: 50%; border: 3px solid var(--ink); background: var(--card);
  box-shadow: var(--shadow), var(--press); display: grid; place-items: center; transition: background-color 120ms ease-out, transform var(--t-micro) var(--spring); }
.st-older-slow .ico { width: 40px; height: 40px; }
.st-older-slow.is-on { background: var(--signal); }
.st-older-tools button:active { transform: scale(.92); transition-duration: 80ms; }
.st-older-tools button:focus-visible, .st-older-strip:focus-visible { outline: 4px solid var(--signal); outline-offset: 2px; }
.st-older-tools .is-nope { animation: st-older-nope 260ms ease-in-out; }
@keyframes st-older-nope { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* the moment strip: a felt track the film's length, pictograms at their moments, a 44 px ring knob (the playhead); older.js
   sets --st-f (0..1, the playhead's share of the film) and places each pictogram with the same 22 px inset (STRIP.pad) */
.st-older-strip { position: relative; width: 100%; height: 64px; flex: none; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; outline: none; }
.st-older-strip.is-drag { cursor: grabbing; }
.st-older-track { position: absolute; left: 0; right: 0; top: 11px; bottom: 11px; border-radius: 21px; border: 3px solid var(--ink); background: var(--sand);
  box-shadow: var(--press); overflow: hidden; }
.st-older-track::before { content: ""; position: absolute; inset: 4px; border-radius: 15px; border: 2px dashed rgba(255, 251, 243, .75); pointer-events: none; }
.st-older-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(19px + (100% - 38px) * var(--st-f, 0)); background: color-mix(in srgb, var(--signal) 55%, var(--sand)); }
.st-older-mark { position: absolute; left: 0; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--card);
  box-shadow: 0 0 0 2px var(--ink); display: grid; place-items: center; color: var(--ink); pointer-events: none; }
.st-older-mark[data-lane="1"] { margin-top: -27px; }
.st-older-mark .ico { width: 24px; height: 24px; }
.st-older-knob { position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; box-sizing: border-box; border-radius: 50%;
  border: 4px solid var(--ink); background: color-mix(in srgb, var(--signal) 28%, transparent); box-shadow: 0 0 0 3px var(--card), var(--shadow-lift);
  left: calc(22px + (100% - 44px) * var(--st-f, 0)); pointer-events: none; }
.st-older-strip.is-drag .st-older-knob { background: color-mix(in srgb, var(--signal) 45%, transparent); }

/* While older.js replays a re-cut film the panel is away (as for Again): the grown-ups' button waits too */
.st-end.st-older-playing .st-end-video { visibility: hidden; }

/* phone landscape: the panel is the 340 px right column (css/movie.css); the tools span the bottom left under the frame */
@media (orientation: landscape) and (max-height: 599px) {
  .st-older-tools { position: fixed; left: calc(12px + env(safe-area-inset-left)); right: calc(352px + env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom)); width: auto; padding: 10px 12px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lift); }
  .st-end:not(.is-in) .st-older-tools { opacity: 0; visibility: hidden; }
  .st-end.is-in .st-older-tools { animation: st-older-late 220ms ease-out 300ms both; }
  .st-older-row { justify-content: space-between; }
}
@keyframes st-older-late { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .st-older-layer[data-st-take] .st-older-frame { animation: none; opacity: 1; }
  .st-hud [data-st="plan"] .st-clap-rec, .st-hud [data-st="plan"] :is(.st-clap-d0, .st-clap-d1, .st-clap-d2), .st-hud [data-st="plan"] .st-clap-dots > i,
  .st-hud [data-st="plan"][data-st-clap="cut"] .st-clap-cut { animation: none; }
  .st-older-word { animation: st-older-fade var(--t-calm) ease-out both; }
  .st-older-hint { animation-name: st-older-hint-calm; }
  .st-end.is-in .st-older-tools { animation: st-older-fade var(--t-calm) ease-out 300ms both; }
}
@keyframes st-older-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-older-hint-calm { 0% { opacity: 0; } 8%, 86% { opacity: 1; } 100% { opacity: 0; } }
