/* Video player + animated stage (kept from v1) */
/* ---------- Modal + player ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; visibility: hidden; }
.modal.open { visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,4,12,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity .4s; }
.modal.open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative; width: min(1040px, 100%, (100svh - 60px) * 16 / 9);
  opacity: 0; transform: translateY(40px) scale(.94); transition: transform .6s var(--ease), opacity .4s;
}
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-close {
  position: absolute; top: -52px; right: 0; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255,255,255,.08); font-size: 1.5rem; line-height: 1; transition: transform .4s var(--ease), background .3s;
}
.modal-close:hover { transform: rotate(90deg); background: rgba(255,255,255,.18); }

.player { position: relative; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 40px 100px -30px rgba(139,92,246,.6); border: 1px solid var(--border); }
.player:fullscreen { border-radius: 0; display: grid; place-items: center; border: 0; }
.player:fullscreen .stage { width: min(100vw, 177.78vh); }
.big-play, .end-screen { position: absolute; inset: 0; z-index: 4; }
.big-play {
  width: 96px; height: 96px; inset: auto; left: 50%; top: 50%; translate: -50% -50%; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.95); color: #111; font-size: 1.8rem; padding-left: 6px; display: none;
}
.player.paused:not(.ended) .big-play { display: grid; place-items: center; animation: popIn .4s var(--spring); }
.end-screen { display: flex; gap: 12px; align-items: flex-end; justify-content: center; padding-bottom: 70px; flex-wrap: wrap; opacity: 0; visibility: hidden; transition: opacity .5s; background: linear-gradient(transparent 50%, rgba(0,0,0,.6)); }
.player.ended .end-screen { opacity: 1; visibility: visible; }
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); transition: opacity .4s, transform .4s var(--ease);
}
.player.idle:not(.paused) .controls { opacity: 0; transform: translateY(10px); }
.player.idle:not(.paused) { cursor: none; }
.ctl { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); font-size: .85rem; display: grid; place-items: center; transition: background .3s; }
.ctl:hover { background: rgba(255,255,255,.28); }
.timeline { position: relative; flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.2); cursor: pointer; }
.timeline::before { content: ""; position: absolute; inset: -10px 0; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: var(--grad); }
.tl-fill::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translateY(-50%) scale(0); transition: transform .25s var(--spring); }
.timeline:hover .tl-fill::after { transform: translateY(-50%) scale(1); }
.tl-marks i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.5); }
.time { font-size: .82rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.85); white-space: nowrap; }

/* =========================================================
   STAGE — the animated "video"
   Everything inside scales with the stage width (cqw units).
   ========================================================= */
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0c0a1d;
  container-type: inline-size; font-family: var(--font-head); color: #fff; user-select: none;
}
.stage.paused *, .stage.paused *::before, .stage.paused *::after { animation-play-state: paused !important; }
.scene {
  --c1: #8b5cf6; --c2: #ec4899; --c3: #fbbf24;
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; overflow: hidden;
  animation: sceneOut .55s calc(var(--dur) - .55s + var(--seek, 0s)) var(--ease) forwards;
}
.scene::after { /* wipe transition */
  content: ""; position: absolute; inset: -5% -60%; z-index: 20; pointer-events: none;
  background: linear-gradient(100deg, transparent 0 30%, var(--c1) 30% 45%, var(--c2) 45% 60%, transparent 60%);
  transform: translateX(-100%); animation: wipe .9s var(--seek, 0s) cubic-bezier(.7,0,.3,1) both;
}
.stage.no-wipe .scene:first-child::after { display: none; }
@keyframes wipe { from { transform: translateX(-70%); } to { transform: translateX(80%); } }
@keyframes sceneOut { to { opacity: 0; transform: scale(1.06); filter: blur(6px); } }

.s-bg { position: absolute; inset: 0; z-index: 0; }
.s-content { position: relative; z-index: 2; display: grid; justify-items: center; gap: 1.4cqw; padding: 0 6cqw; }

/* animation primitives — delay with style="--d:.4s" */
.a { animation-duration: .9s; animation-timing-function: var(--ease); animation-fill-mode: both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
.a-up { animation-name: aUp; }
.a-down { animation-name: aDown; }
.a-pop { animation-name: aPop; animation-timing-function: var(--spring); animation-duration: .8s; }
.a-left { animation-name: aLeft; }
.a-right { animation-name: aRight; }
.a-zoom { animation-name: aZoom; animation-duration: 1.2s; }
.a-fade { animation-name: aFade; }
.a-grow { animation-name: aGrow; transform-origin: left center; animation-duration: 1s; }
.a-type { animation-name: aType; animation-timing-function: steps(var(--steps, 18)); animation-duration: var(--td, 1.2s); }
.a-blur { animation-name: aBlur; animation-duration: 1.1s; }
@keyframes aUp { from { opacity: 0; transform: translateY(60%); filter: blur(8px); } }
@keyframes aDown { from { opacity: 0; transform: translateY(-60%); filter: blur(8px); } }
@keyframes aPop { from { opacity: 0; transform: scale(0) rotate(-12deg); } }
@keyframes aLeft { from { opacity: 0; transform: translateX(-40cqw); } }
@keyframes aRight { from { opacity: 0; transform: translateX(40cqw); } }
@keyframes aZoom { from { opacity: 0; transform: scale(2.2); filter: blur(14px); } }
@keyframes aFade { from { opacity: 0; } }
@keyframes aGrow { from { transform: scaleX(0); } }
@keyframes aType { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes aBlur { from { opacity: 0; letter-spacing: .6em; filter: blur(12px); } }

.mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .06em .08em; }
.mask > span { display: inline-block; animation: aRise .9s var(--ease) both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
@keyframes aRise { from { transform: translateY(110%) rotate(6deg); } }
.w { display: inline-block; white-space: pre; }

/* text styles */
.t-xl { font-size: 7.2cqw; font-weight: 800; line-height: 1.02; letter-spacing: -.03em; }
.t-lg { font-size: 5.2cqw; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.t-md { font-size: 3cqw; font-weight: 700; line-height: 1.15; }
.t-sm { font-size: 1.9cqw; font-weight: 600; opacity: .85; font-family: var(--font-body); }
.t-kick { font-size: 1.5cqw; font-weight: 700; letter-spacing: .35em; text-transform: uppercase; color: var(--c3); }
.t-grad { background: linear-gradient(100deg, var(--c3), var(--c2) 50%, var(--c1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hl { position: relative; display: inline-block; }
.hl::after { content: ""; position: absolute; left: 0; right: 0; bottom: .05em; height: .14em; border-radius: .1em; background: var(--c3); z-index: -1; transform-origin: left; animation: aGrow .7s var(--ease) both; animation-delay: calc(var(--hd, .8s) + var(--seek, 0s)); }

/* shapes */
.ring { position: absolute; left: 50%; top: 50%; width: 30cqw; height: 30cqw; margin: -15cqw 0 0 -15cqw; border-radius: 50%; border: .35cqw solid rgba(255,255,255,.35); animation: ringOut 2.4s var(--ease) infinite both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
@keyframes ringOut { from { transform: scale(.2); opacity: 1; } to { transform: scale(3); opacity: 0; } }
.orb { position: absolute; border-radius: 50%; filter: blur(4cqw); opacity: .8; animation: orbFloat 6s ease-in-out infinite alternate both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
@keyframes orbFloat { from { transform: translate(-6%, -4%) scale(1); } to { transform: translate(8%, 6%) scale(1.2); } }
.spark { position: absolute; width: 1.6cqw; height: 1.6cqw; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: sparkle 2s ease-in-out infinite both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
@keyframes sparkle { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(180deg); opacity: 1; } }
.stripe { position: absolute; height: 1cqw; border-radius: 1cqw; background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 5cqw 5cqw; animation: gridMove 8s linear infinite both; animation-delay: var(--seek, 0s); }
@keyframes gridMove { to { background-position: 5cqw 5cqw; } }
.chip-s { display: inline-flex; align-items: center; gap: .8cqw; padding: 1cqw 2.2cqw; border-radius: 10cqw; font-size: 2cqw; font-weight: 700; background: rgba(255,255,255,.12); border: .15cqw solid rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.chips { display: flex; gap: 1.4cqw; flex-wrap: wrap; justify-content: center; margin-top: 1cqw; }

/* phone mock (showreel scene 3) */
.phone {
  position: relative; width: 22cqw; aspect-ratio: 9 / 18; border-radius: 3.4cqw; padding: .9cqw; background: #16142b;
  box-shadow: 0 0 0 .35cqw rgba(255,255,255,.18), 0 4cqw 8cqw -2cqw rgba(0,0,0,.7);
}
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 2.6cqw; overflow: hidden; background: #000; }
.phone-notch { position: absolute; top: 1.4cqw; left: 50%; width: 6cqw; height: 1.6cqw; margin-left: -3cqw; border-radius: 2cqw; background: #000; z-index: 5; }
.slide { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .6cqw; animation: slideCycle var(--sd, 1.1s) var(--ease) both; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)); }
.slide.last { animation-name: slideIn; animation-duration: .6s; }
.slide .em { font-size: 6cqw; }
.slide b { font-size: 2.1cqw; }
.slide small { font-size: 1.3cqw; opacity: .85; font-family: var(--font-body); font-weight: 600; }
@keyframes slideCycle { 0% { transform: translateX(100%); } 18%, 82% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes slideIn { from { transform: translateX(100%); } }
.side-l, .side-r { position: absolute; top: 50%; display: grid; gap: 1.4cqw; }
.side-l { left: 8cqw; transform: translateY(-50%); justify-items: end; }
.side-r { right: 8cqw; transform: translateY(-50%); justify-items: start; }

/* price scene */
.price-row { display: flex; align-items: center; gap: 3cqw; }
.p-dur { font-size: 10cqw; font-weight: 800; letter-spacing: -.04em; }
.p-arrow { font-size: 6cqw; color: var(--c3); }
.p-big { font-size: 14cqw; font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.p-big sup { font-size: .45em; vertical-align: top; margin-left: .3cqw; }

/* envelope */
.env { position: relative; width: 14cqw; height: 9.5cqw; border-radius: 1.2cqw; background: #fff; box-shadow: 0 2cqw 5cqw -1cqw rgba(0,0,0,.5); }
.env::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 58%); background: linear-gradient(180deg, var(--c2), var(--c1)); border-radius: 1.2cqw 1.2cqw 0 0; }
.env::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 100%, 50% 45%, 100% 100%); background: #ece9ff; border-radius: 0 0 1.2cqw 1.2cqw; }
.fly { animation: flyIn 1.1s var(--spring) both, envBob 2.4s 1.1s ease-in-out infinite; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)), calc(var(--d, 0s) + 1.1s + var(--seek, 0s)); }
@keyframes flyIn { from { opacity: 0; transform: translate(-40cqw, 10cqw) rotate(-30deg) scale(.4); } }
@keyframes envBob { 50% { transform: translateY(-1cqw) rotate(2deg); } }
.mail-pill { display: inline-flex; align-items: center; gap: 1cqw; padding: 1.2cqw 2.6cqw; border-radius: 10cqw; background: #fff; color: #17142e; font-size: 2.6cqw; font-weight: 800; box-shadow: 0 0 0 0 rgba(255,255,255,.5); }
.mail-pill.pulse { animation: aPop .8s var(--spring) both, pillPulse 1.6s ease-out infinite; animation-delay: calc(var(--d, 0s) + var(--seek, 0s)), calc(var(--d, 0s) + .8s + var(--seek, 0s)); }
@keyframes pillPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); } 100% { box-shadow: 0 0 0 2.4cqw rgba(255,255,255,0); } }
.caret { display: inline-block; width: .25cqw; height: 1em; background: currentColor; margin-left: .3cqw; vertical-align: -.1em; animation: blink 1s steps(2) infinite; }

/* ad demo scenes */
.badge-c { position: relative; width: 20cqw; height: 20cqw; border-radius: 50%; display: grid; place-items: center; font-size: 10cqw; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 60%), linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 2cqw 6cqw -1cqw rgba(0,0,0,.5); }
.offer { font-size: 17cqw; font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.feat { display: flex; align-items: center; gap: 1.6cqw; font-size: 3.2cqw; font-weight: 700; padding: 1.2cqw 3cqw 1.2cqw 1.4cqw; border-radius: 10cqw; background: rgba(255,255,255,.1); border: .15cqw solid rgba(255,255,255,.2); }
.feat i { width: 4.2cqw; height: 4.2cqw; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 2cqw; background: var(--c3); color: #111; }
.feats { display: grid; gap: 1.6cqw; justify-items: start; }
.demo-label { position: absolute; top: 2.4cqw; left: 2.6cqw; z-index: 6; font-family: var(--font-body); font-size: 1.3cqw; font-weight: 600; padding: .5cqw 1.3cqw; border-radius: 3cqw; background: rgba(0,0,0,.35); letter-spacing: .05em; }

/* ---------- Photos inside the video ---------- */
.photo-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.kb { animation: kenBurns var(--dur, 4s) linear both; animation-delay: var(--seek, 0s); }
.kb-in { animation-name: kenBurnsIn; }
@keyframes kenBurns { from { transform: scale(1.18); } to { transform: scale(1.02); } }
@keyframes kenBurnsIn { from { transform: scale(1.02) translateX(-2%); } to { transform: scale(1.15) translateX(2%); } }
.badge-c { background-size: cover; background-position: center; border: .5cqw solid rgba(255,255,255,.9); font-size: 0; width: 16cqw; height: 16cqw; }
.photo-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 44cqw; overflow: hidden; z-index: 1; }
.photo-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--c1, #000) 0%, transparent 30%); opacity: .55; }
.a-reveal { animation-name: aReveal; animation-duration: 1.1s; }
@keyframes aReveal { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.split-left { justify-items: start; text-align: left; width: 100%; padding-left: 7cqw; padding-right: 48cqw; }
.chip-photo { width: 3.6cqw; height: 3.6cqw; border-radius: 50%; background-size: cover; background-position: center; border: .2cqw solid #fff; }
.slide.photo { background-size: cover; background-position: center; place-content: end center; padding-bottom: 3.4cqw; text-shadow: 0 .3cqw 1cqw rgba(0,0,0,.5); }

/* ---------- Sound ---------- */
.sound-badge {
  position: absolute; top: 14px; left: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px; background: rgba(0,0,0,.5); font-size: .78rem; font-weight: 600;
}
.reel-main .sound-badge { left: auto; right: 68px; }
.ctl svg { display: block; }
.ctl.off { color: #fca5a5; }

.brand-tag { position: absolute; top: 3cqw; left: 50%; translate: -50% 0; z-index: 6; display: inline-flex; align-items: center; gap: 1cqw; font-size: 2cqw; font-weight: 800; letter-spacing: .02em; }
.brand-tag i { width: 3.2cqw; height: 3.2cqw; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 1.1cqw; padding-left: .3cqw; background: linear-gradient(120deg, #8b5cf6, #ec4899, #fbbf24); }

/* 4 sample ads in one row on wide screens */
@media (min-width: 1001px) { .reels { grid-template-columns: repeat(4, 1fr); gap: 18px; } .reel:not(.reel-main) .reel-overlay h3 { font-size: 1.15rem; } .reel:not(.reel-main) .reel-overlay p { font-size: .85rem; } }

.brand-tag { position: absolute; top: 3cqw; left: 50%; translate: -50% 0; z-index: 6; display: inline-flex; align-items: center; gap: 1cqw; font-size: 2cqw; font-weight: 800; letter-spacing: .02em; }
.brand-tag i { width: 3.2cqw; height: 3.2cqw; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 1.1cqw; padding-left: .3cqw; background: linear-gradient(120deg, #8b5cf6, #ec4899, #fbbf24); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes popIn { from { transform: scale(0) rotate(-60deg); } to { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
