/* ============================================================
   QUANTUM, case-study film (Apple-style minimal motion)
   Scoped entirely under #qfilm. Plays inside .wm-media.

   Design principle: every element's RESTING state is its final,
   fully-visible state. Entrance motion is driven by JS (Web
   Animations API), so the film degrades gracefully, a static
   frame (or reduced-motion) always shows complete, legible
   content. Sizing uses container query units (cqw) to scale
   with the modal media at any width.
   ============================================================ */
#qfilm {
  --g: #34d399;          /* emerald accent */
  --g-deep: #10b981;
  --ink: #f4f6f5;
  --faint: rgba(244,246,245,.55);
  --hair: rgba(244,246,245,.16);
  position: relative;
  background: #0a0b0d;
}
#qfilm * { box-sizing: border-box; }

#qfilm .qf-stage {
  position: absolute; inset: 0; overflow: hidden;
  container-type: inline-size;
  background:
    radial-gradient(120% 130% at 50% -20%, #15201c 0%, #0d1311 42%, #08090b 100%);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#qfilm .qf-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 88% 108%, color-mix(in srgb, var(--g) 18%, transparent), transparent 60%);
}

/* persistent chrome ---------------------------------------- */
#qfilm .qf-kicker {
  position: absolute; top: 5.2cqw; left: 5.4cqw; z-index: 6;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.45cqw; letter-spacing: .42em; text-transform: uppercase;
  color: var(--faint);
  display: flex; align-items: center; gap: 1.3cqw;
}
#qfilm .qf-kicker b { width: 1.5cqw; height: 1.5cqw; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 .55cqw color-mix(in srgb, var(--g) 28%, transparent); }
#qfilm .qf-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; background: rgba(255,255,255,.07); z-index: 6; }
#qfilm .qf-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g-deep), var(--g)); }

/* scene base, only the active scene is shown (instant, no transition).
   Top padding reserves room for the fixed kicker so headings never collide. */
#qfilm .qf-scene {
  position: absolute; inset: 0; z-index: 2;
  display: grid; align-content: center; justify-items: start;
  padding: 9.5cqw 7cqw 6cqw;
  opacity: 0; visibility: hidden;
}
#qfilm .qf-scene.active { opacity: 1; visibility: visible; }
#qfilm .qf-brand, #qfilm .qf-close { padding: 6cqw; }

/* shared type ---------------------------------------------- */
#qfilm .qf-h {
  font-size: 6.2cqw; line-height: .98; font-weight: 600; letter-spacing: -.04em;
  max-width: 18ch; text-wrap: balance;
}
#qfilm .qf-h .dim { color: var(--faint); }
#qfilm .qf-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.45cqw; letter-spacing: .12em; text-transform: uppercase;
  color: var(--g); margin-bottom: 2.4cqw;
}

/* ===== Scene 1, brand open ===== */
#qfilm .qf-brand { justify-items: center; text-align: center; padding: 0 6cqw; }
#qfilm .qf-mark { position: relative; width: 13cqw; height: 13cqw; margin-bottom: 3.4cqw; }
#qfilm .qf-mark .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--hair); }
#qfilm .qf-mark .ring.two { inset: 23%; border-color: rgba(244,246,245,.28); }
#qfilm .qf-mark .core { position: absolute; inset: 44%; border-radius: 50%; background: var(--g); box-shadow: 0 0 5cqw color-mix(in srgb, var(--g) 60%, transparent); }
#qfilm .qf-mark .orbit { position: absolute; inset: 0; }
#qfilm .qf-mark .orbit i { position: absolute; top: -.7cqw; left: 50%; width: 1.5cqw; height: 1.5cqw; margin-left: -.75cqw; border-radius: 50%; background: var(--ink); }
#qfilm .qf-brand .word { font-size: 9.2cqw; font-weight: 600; letter-spacing: -.05em; }
#qfilm .qf-brand .sub { margin-top: 1.6cqw; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.7cqw; letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }

/* ===== Scene 2, discovery / sources ===== */
#qfilm .qf-sources { display: flex; flex-wrap: wrap; gap: 1.3cqw; margin-top: 3.4cqw; max-width: 62cqw; }
#qfilm .qf-chip {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.6cqw;
  color: var(--ink); border: 1px solid var(--hair); border-radius: 2.4cqw;
  padding: 1.1cqw 1.9cqw; background: rgba(255,255,255,.02);
  display: inline-flex; align-items: center; gap: 1cqw;
}
#qfilm .qf-chip::before { content: ""; width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--g); flex: none; }
#qfilm .qf-scan { position: absolute; top: 0; bottom: 0; width: 30cqw; pointer-events: none; z-index: 4; opacity: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--g) 16%, transparent), transparent); }

/* ===== Scene 3, AI scoring ===== */
#qfilm .qf-score-wrap { display: flex; align-items: center; gap: 4.2cqw; margin-top: 3cqw; }
#qfilm .qf-dial { position: relative; width: 20cqw; height: 20cqw; flex: none; }
#qfilm .qf-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#qfilm .qf-dial circle { fill: none; stroke-width: 6; }
#qfilm .qf-dial .trk { stroke: rgba(255,255,255,.09); }
/* resting state = filled to ~8.5 (dashoffset 40); JS animates from 264 */
#qfilm .qf-dial .arc { stroke: var(--g); stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 40; }
#qfilm .qf-dial .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6cqw; }
#qfilm .qf-dial .num b { font-size: 6.2cqw; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
#qfilm .qf-dial .num span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.25cqw; color: var(--faint); letter-spacing: .06em; white-space: nowrap; }
#qfilm .qf-leadcard { border: 1px solid var(--hair); border-radius: 2.6cqw; padding: 2.6cqw 3cqw; min-width: 26cqw; background: rgba(255,255,255,.02); }
#qfilm .qf-leadcard .row { display: flex; justify-content: space-between; gap: 2cqw; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.5cqw; padding: .9cqw 0; border-bottom: 1px solid rgba(255,255,255,.05); }
#qfilm .qf-leadcard .row:last-child { border: 0; }
#qfilm .qf-leadcard .row .k { color: var(--faint); }
#qfilm .qf-leadcard .row .v { color: var(--ink); }
#qfilm .qf-qual { margin-top: 1.8cqw; display: inline-flex; align-items: center; gap: 1cqw; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.5cqw; color: var(--g); }
#qfilm .qf-qual::before { content: "✓"; display: grid; place-items: center; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: var(--g); color: #06281d; font-size: 1.5cqw; font-weight: 700; }

/* ===== Scene 4, SMS booking ===== */
#qfilm .qf-thread { display: flex; flex-direction: column; gap: 1.1cqw; margin-top: 2.6cqw; width: 52cqw; max-width: 92%; }
#qfilm .qf-bub { max-width: 78%; padding: 1.3cqw 1.9cqw; border-radius: 2.4cqw; font-size: 1.62cqw; line-height: 1.3; }
#qfilm .qf-bub.in { align-self: flex-start; background: rgba(255,255,255,.07); border-bottom-left-radius: .7cqw; }
#qfilm .qf-bub.out { align-self: flex-end; background: var(--g-deep); color: #06281d; border-bottom-right-radius: .7cqw; font-weight: 500; }
#qfilm .qf-booked { align-self: flex-start; margin-top: .4cqw; display: inline-flex; align-items: center; gap: 1.2cqw; border: 1px solid color-mix(in srgb, var(--g) 40%, transparent); border-radius: 2cqw; padding: 1.2cqw 1.9cqw; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.5cqw; color: var(--g); }
#qfilm .qf-booked::before { content: ""; width: 1.3cqw; height: 1.3cqw; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 .5cqw color-mix(in srgb, var(--g) 30%, transparent); }

/* ===== Scene 5, morning brief ===== */
#qfilm .qf-brief { margin-top: 2.8cqw; width: 52cqw; max-width: 92%; border: 1px solid var(--hair); border-radius: 2.6cqw; padding: 3cqw 3.4cqw; background: rgba(255,255,255,.02); }
#qfilm .qf-brief .bh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.2cqw; }
#qfilm .qf-brief .bh b { font-size: 2.4cqw; font-weight: 600; letter-spacing: -.02em; }
#qfilm .qf-brief .bh span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.35cqw; color: var(--faint); letter-spacing: .12em; text-transform: uppercase; }
#qfilm .qf-brief ul { list-style: none; display: grid; gap: 1.5cqw; }
#qfilm .qf-brief li { display: grid; grid-template-columns: auto 1fr; gap: 1.6cqw; align-items: baseline; font-size: 1.75cqw; color: var(--ink); }
#qfilm .qf-brief li i { width: .9cqw; height: .9cqw; border-radius: 50%; background: var(--g); transform: translateY(-.3cqw); }
#qfilm .qf-brief li .m { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--faint); }

/* ===== Scene 6, close ===== */
#qfilm .qf-close { justify-items: center; text-align: center; padding: 0 8cqw; }
#qfilm .qf-close .word { font-size: 8.5cqw; font-weight: 600; letter-spacing: -.05em; }
#qfilm .qf-close .ln { margin-top: 2.2cqw; font-size: 2.1cqw; color: var(--faint); letter-spacing: -.01em; max-width: 28ch; }

/* replay button (shows when film ends) --------------------- */
#qfilm .qf-replay {
  position: absolute; z-index: 7; right: 4.5cqw; bottom: 4.5cqw;
  display: none; align-items: center; gap: 1cqw;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.5cqw;
  color: var(--ink); background: rgba(255,255,255,.08); border: 1px solid var(--hair);
  padding: 1.2cqw 2cqw; border-radius: 3cqw; backdrop-filter: blur(6px);
}
#qfilm.qf-ended .qf-replay { display: inline-flex; }
#qfilm .qf-replay:hover { background: rgba(255,255,255,.16); }
