/* =========================================================
 * css/anims.css — styles for animated visuals (js/anims/*).
 * Each block is scoped by the .anim-<name> class the kit adds.
 * ========================================================= */
.anim-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* SVG scenes are laid out in LTR coordinates; Arabic runs still render RTL inside each text */
.anim-svg, .rv-svg, .ms-viz, .lab-svg, svg.orbit { direction: ltr; }
:where(.anim-svg) text { font-family: var(--font); fill: var(--text); }
.svg-ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.anim-toolbar { position: absolute; z-index: 5; inset-inline: 10px; bottom: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: none; }
.anim-toolbar .btn { pointer-events: auto; background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(8px); }
.anim-toolbar .btn.is-active { background: var(--lesson); color: var(--accent-ink); border-color: transparent; }
:root[data-theme="light"] .anim-toolbar .btn.is-active { color: #fff; }
.stage-label { position: absolute; z-index: 3; padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: var(--fs-0); background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.dual { display: inline-grid; line-height: 1.25; }
.dual-sub { font-family: var(--font-en); font-size: .72em; color: var(--muted); font-weight: 600; }

/* ---------- living photo (hero / photo) ---------- */
.lp-frame { position: absolute; inset: 0; overflow: hidden; perspective: 1000px; background: #050a18; }
.lp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) saturate(1.3) brightness(.55); opacity: .9; user-select: none; will-change: transform; }
.lp-box { position: absolute; transform-style: preserve-3d; will-change: transform; }
.lp-pic { position: absolute; inset: 0; overflow: hidden; border-radius: 14px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.12); background: #0b1224; }
.lp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform; user-select: none; }
.lp-sweep { position: absolute; inset: -10% -30%; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%); mix-blend-mode: screen; pointer-events: none; }
.lp-spot { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), transparent 0 13%, rgba(2,6,23,.62) 34%); }
.lp-particles { position: absolute; inset: 0; pointer-events: none; }
.lp-particles i { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(160, 230, 255, .95), rgba(56, 189, 248, 0) 70%); filter: blur(.5px); }
.lp-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(3, 8, 22, .6) 100%); }
:root[data-theme="light"] .lp-frame { background: #1e293b; }
.lp-caption { position: absolute; z-index: 2; inset-inline: 14px; bottom: 12px; text-align: center; color: #fff; font-weight: 700; font-size: var(--fs-0); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hotspot { position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px; direction: ltr; translate: -17px -50%; }
.hotspot.hs-left { flex-direction: row-reverse; translate: calc(-100% + 17px) -50%; }
.hotspot-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--lesson); color: var(--accent-ink); box-shadow: 0 0 0 0 rgba(56,189,248,.7); font-size: 18px; flex: none; }
.hotspot-label { padding: 5px 11px; border-radius: 10px; background: rgba(6, 11, 28, .86); color: #fff; font-weight: 800; font-size: var(--fs-0); line-height: 1.45; width: max-content; max-width: min(300px, 46cqw); direction: rtl; box-shadow: 0 10px 24px -10px #000; backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.15); }
html[lang="en"] .hotspot-label { direction: ltr; }

/* ---------- cinema (real footage) ---------- */
.cn-frame { position: absolute; inset: 0; overflow: hidden; background: #000; }
.cn-move { position: absolute; inset: -5%; }
.cn-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cn-grade { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55; }
.cn-blue { background: linear-gradient(160deg, rgba(56,189,248,.55), rgba(6,11,28,.2) 60%); }
.cn-violet { background: linear-gradient(160deg, rgba(167,139,250,.6), rgba(6,11,28,.2) 60%); }
.cn-green { background: linear-gradient(160deg, rgba(52,211,153,.55), rgba(6,11,28,.2) 60%); }
.cn-amber { background: linear-gradient(160deg, rgba(251,191,36,.55), rgba(6,11,28,.2) 60%); }
.cn-corners i { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.75); pointer-events: none; }
.cn-corners i:nth-child(1) { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.cn-corners i:nth-child(2) { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.cn-corners i:nth-child(3) { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.cn-corners i:nth-child(4) { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.cn-rec { position: absolute; top: 20px; inset-inline-start: 58px; display: flex; gap: 6px; align-items: center; color: #fff; font: 700 .75rem var(--mono); letter-spacing: .1em; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.cn-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.cn-lower { position: absolute; z-index: 3; inset-inline-start: 18px; bottom: 26px; max-width: calc(100% - 36px); display: flex; gap: 12px; align-items: center; padding: 10px 18px 10px 12px; border-radius: 16px; background: rgba(6,11,28,.78); border: 1px solid rgba(255,255,255,.15); border-inline-start: 5px solid var(--lesson); backdrop-filter: blur(10px); color: #fff; box-shadow: 0 20px 40px -20px #000; }
.cn-lower-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--lesson); color: var(--accent-ink); flex: none; }
.cn-lower-txt { display: grid; }
.cn-lower-txt b { font-size: var(--fs-2); font-weight: 900; line-height: 1.3; }
.cn-lower-txt small { font-size: var(--fs-0); opacity: .8; }
.cn-progress { position: absolute; z-index: 3; top: 22px; inset-inline-end: 58px; display: flex; gap: 4px; }
.cn-progress i { width: 22px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); transition: background .4s; }
.cn-progress i.on { background: #fff; }
.lp-credit { position: absolute; z-index: 2; inset-inline-end: 10px; bottom: 8px; font: 600 .62rem var(--font-en); color: rgba(255,255,255,.75); background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 6px; direction: ltr; }

/* ---------- living backdrop behind every animation ---------- */
.stage-ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.amb-grid { position: absolute; inset: -48px 0 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; opacity: .35; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.amb-glow { position: absolute; width: 60%; height: 60%; left: 10%; top: 25%; border-radius: 50%; background: radial-gradient(circle, var(--lesson-soft), transparent 70%); filter: blur(20px); }
.stage-ambient i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--lesson); box-shadow: 0 0 8px var(--lesson); opacity: .7; }
:where(.stage) > :where(:not(.stage-ambient)) { z-index: 1; } /* zero specificity: anim layers keep their own z-index */
.fit-inner { flex: none; } /* see kit.fitBox */
/* cinema: tap-to-play (only when the device blocks autoplay, e.g. iPad Low Power Mode) */
.cn-tap { position: absolute; z-index: 6; left: 50%; top: 50%; translate: -50% -50%; display: grid; justify-items: center; gap: 8px; padding: 16px 22px; border-radius: 20px; border: 1px solid rgba(255,255,255,.25); background: rgba(6,11,28,.72); color: #fff; font: inherit; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); }
.cn-tap-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--lesson); color: var(--accent-ink); box-shadow: 0 0 0 10px color-mix(in srgb, var(--lesson) 30%, transparent); }
