/* ══════════════════════════════════════════════════════════════════
   Lumen — cinema layer. Loaded after design.css.
   Ambient light, film grain, an opening title sequence, page transitions,
   a living hero, and cards that respond to the pointer.
   Motion only runs when <html> has .cine-motion (set by js/cinema.js,
   never with prefers-reduced-motion).
   ══════════════════════════════════════════════════════════════════ */
@property --sa { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --ember: #ff6a45;
  --ember-2: #ffb36b;
  --ember-3: #ffe1c4;
  --glow: rgba(255, 106, 69, .32);
  --grad-cine: linear-gradient(100deg, #ffe1c4 0%, #ffb36b 30%, #ff6a45 62%, #e5533d 100%);
  --cine-ease: cubic-bezier(.22, 1, .36, 1);
  --cine-slow: cubic-bezier(.65, 0, .35, 1);
}
::selection { background: rgba(255, 106, 69, .35); color: #fff; }

/* ── ambient light, grain, scroll progress ── */
.cine-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cine-ambient i { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .5; will-change: transform; }
.cine-ambient i:nth-child(1) { width: 52vw; height: 52vw; right: -16vw; top: -22vw; background: radial-gradient(closest-side, rgba(229, 83, 61, .34), transparent); }
.cine-ambient i:nth-child(2) { width: 44vw; height: 44vw; left: -14vw; top: 38vh; background: radial-gradient(closest-side, rgba(255, 179, 107, .14), transparent); }
.cine-ambient i:nth-child(3) { width: 36vw; height: 36vw; right: 12vw; bottom: -18vw; background: radial-gradient(closest-side, rgba(120, 92, 255, .12), transparent); }
.cine-motion .cine-ambient i:nth-child(1) { animation: cineDrift 26s var(--cine-slow) infinite alternate; }
.cine-motion .cine-ambient i:nth-child(2) { animation: cineDrift 32s var(--cine-slow) -9s infinite alternate-reverse; }
.cine-motion .cine-ambient i:nth-child(3) { animation: cineDrift 38s var(--cine-slow) -15s infinite alternate; }
@keyframes cineDrift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-6vw, 5vh, 0) scale(1.12); } 100% { transform: translate3d(4vw, -4vh, 0) scale(.94); } }
:root[data-theme='light'] .cine-ambient i { opacity: .35; }

.cine-grain { position: fixed; inset: -60%; z-index: 9990; pointer-events: none; opacity: .055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.cine-motion .cine-grain { animation: grain 1s steps(6) infinite; }
:root[data-theme='light'] .cine-grain { opacity: .035; mix-blend-mode: multiply; }
body.saver-on .cine-grain { display: none; }

.cine-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 700; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  background: var(--grad-cine); box-shadow: 0 0 12px var(--glow); opacity: 0; transition: opacity .4s; }
.cine-progress.on { opacity: 1; }

/* ── opening titles ── */
#intro { display: grid !important; background: #050506; }
#intro .intro-glow { background: radial-gradient(circle, rgba(229, 83, 61, .34), rgba(255, 179, 107, .1) 32%, transparent 60%); }
#intro .intro-mark { width: 64px; height: 64px; filter: drop-shadow(0 0 36px rgba(229, 83, 61, .7)); }
#intro .intro-word { font-family: var(--display); font-weight: 400; font-size: clamp(72px, 13vw, 168px); letter-spacing: -.01em; padding-left: 0; gap: 0; line-height: 1; }
#intro .intro-word span { background: linear-gradient(180deg, #fff 35%, #ffd2b0); -webkit-background-clip: text; background-clip: text; }
#intro .intro-tag { font-size: 11.5px; letter-spacing: .5em; color: rgba(255, 255, 255, .55); }
#intro .intro-line { width: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: introLine 1.4s 1.2s var(--cine-ease) forwards; }
@keyframes introLine { to { width: min(320px, 60vw); } }

/* ── page transitions ── */
.cine-motion .view.leaving { opacity: 0; transform: scale(.992); filter: blur(4px); transition: opacity .17s ease, transform .17s ease, filter .17s ease; }
.cine-motion .view:not(.entering):not(.leaving) { animation: cineViewIn .7s var(--cine-ease); }
@keyframes cineViewIn { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } 60% { filter: blur(0); } to { opacity: 1; transform: none; filter: none; } }
body.intro-playing .view, body.intro-playing .view * { animation-play-state: paused !important; }

/* ── type ── */
.display em, .hero-title em, .lp-title em, .ev-title em { font-style: italic; background: var(--grad-cine); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.cine-motion :is(.display, .lp-title, .lp-h2) em { animation: cineShimmer 9s ease-in-out infinite alternate; }
@keyframes cineShimmer { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.row-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2vw, 28px); letter-spacing: -.01em; }
body.lang-ethiopic .row-head h2 { font-family: 'Noto Sans Ethiopic', var(--font); font-weight: 700; font-size: 18px; }
.cine-motion .page-head > *, .cine-motion .page-head > div > * { animation: cineRise .9s var(--cine-ease) both; }
.cine-motion .page-head > :nth-child(2), .cine-motion .page-head > div > :nth-child(2) { animation-delay: .08s; }
.cine-motion .page-head > :nth-child(3), .cine-motion .page-head > div > :nth-child(3) { animation-delay: .16s; }
@keyframes cineRise { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
/* soft left-to-right wipe used for big titles */
@keyframes cineWipe { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: .2; filter: blur(10px); transform: translateY(10px); } to { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; filter: none; transform: none; } }
.cine-motion :is(.page-head .display, .watch-title, .ev-title, .det-head h2) {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: 0 0; mask-position: 0 0; animation: cineWipe 1.3s var(--cine-ease) both; }

/* ── buttons ── */
.btn { transition: transform .35s var(--cine-ease), background .25s, box-shadow .35s var(--cine-ease), border-color .25s, opacity .2s, color .2s; }
.btn-primary, .btn-glass { overflow: hidden; isolation: isolate; }
.btn-primary::before, .btn-glass::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); }
.btn-glass::before { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .16) 50%, transparent 70%); }
.btn-primary:hover::before, .btn-glass:hover::before { transform: translateX(120%); transition: transform .9s var(--cine-ease); }
.btn-primary:hover { opacity: 1; box-shadow: 0 10px 34px -12px rgba(255, 255, 255, .28); }
:root[data-theme='light'] .btn-primary:hover { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }
:is(.hero, .x-hero, .ev-hero, .det-hero, .x-cta) .btn-primary:hover { box-shadow: 0 14px 44px -12px rgba(255, 210, 176, .45), 0 0 0 1px rgba(255, 255, 255, .5); }
.btn:active { transform: scale(.97); opacity: 1; }
.btn[data-magnet] { transition: transform .5s var(--cine-ease), background .25s, box-shadow .35s var(--cine-ease), border-color .25s, color .2s; }
.btn-glass { backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }

/* ── navigation chrome ── */
.nav.scrolled, .lp-nav.scrolled { background: color-mix(in srgb, var(--bg) 74%, transparent) !important; backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.brand-mark { transition: transform .6s var(--cine-ease), filter .6s; }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.08); filter: drop-shadow(0 0 14px rgba(229, 83, 61, .6)); }
.sb-nav a { transition: background .25s, color .25s, padding .35s var(--cine-ease); }
.sb-nav a .i { transition: color .25s, transform .45s var(--cine-ease); }
.sb-nav a:hover .i { transform: scale(1.1) rotate(-4deg); }
.sb-nav a.active { background: linear-gradient(90deg, rgba(229, 83, 61, .16), rgba(229, 83, 61, .02) 80%) !important; }
.sb-nav a.active .i { color: var(--ember) !important; filter: drop-shadow(0 0 8px rgba(255, 106, 69, .5)); }
.sb-nav a.active::before { display: block !important; content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-cine); box-shadow: 0 0 14px var(--glow); }
.cine-motion .sb-nav a.active::before { animation: cineBar .5s var(--cine-ease); }
@keyframes cineBar { from { transform: scaleY(0); } }
@media (min-width: 901px) { body.sb-collapsed .sb-nav a.active::before { left: -12px; } }
.sb-count { background: var(--live); box-shadow: 0 0 12px rgba(229, 72, 77, .5); }
.nav-icon { transition: background .2s, color .2s, transform .4s var(--cine-ease); }
.nav-icon:hover { transform: scale(1.06); }
.avatar { transition: transform .4s var(--cine-ease), box-shadow .3s; }
.avatar:hover { transform: scale(1.06); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 3px rgba(255, 106, 69, .25) !important; }

/* ── home hero ── */
.hero { --hp: 0; }
.hero-media { transform: translate3d(calc(var(--hx, 0) * -14px), calc(var(--hp) * 120px + var(--hy, 0) * -10px), 0) scale(1.06); transition: transform .9s var(--cine-ease); will-change: transform; }
.cine-motion .hero-slide.active img { animation: kenburns 26s ease-out forwards; }
.hero-slide::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 220, .16) 50%, transparent 62%); transform: translateX(-100%); }
.cine-motion .hero-slide.active::after { animation: cineSweep 2.4s .5s var(--cine-ease) forwards; }
@keyframes cineSweep { 0% { opacity: 1; transform: translateX(-100%); } 100% { opacity: 1; transform: translateX(100%); } }
.hero::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 60% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    radial-gradient(600px 400px at var(--mx, 70%) var(--my, 30%), rgba(255, 190, 150, .07), transparent 70%); }
.hero-content { z-index: 3; opacity: calc(1 - var(--hp) * 1.6); transform: translateY(calc(var(--hp) * -60px)); }
.hero-content > * { transition: opacity 1s var(--cine-ease), transform 1s var(--cine-ease), filter 1s var(--cine-ease); filter: blur(6px); }
.hero-content.in > * { filter: none; }
.hero-content .hero-title { -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0; transform: translateY(14px);
  transition: -webkit-mask-position 1.5s var(--cine-ease), mask-position 1.5s var(--cine-ease), opacity 1s var(--cine-ease), transform 1.2s var(--cine-ease), filter 1.2s var(--cine-ease); }
.hero-content.in .hero-title { -webkit-mask-position: 0 0; mask-position: 0 0; }
.hero-empty .hero-content > * { filter: none; }
.hero-empty .hero-content .hero-title { -webkit-mask-position: 0 0; mask-position: 0 0; transform: none; }
.hero-kicker { text-transform: uppercase; letter-spacing: .22em; font-size: 11.5px !important; font-weight: 600 !important; color: rgba(255, 255, 255, .72) !important; }
.hero-kicker::before { content: ''; width: 34px; height: 1px; background: var(--grad-cine); box-shadow: 0 0 10px var(--glow); transform-origin: left; }
.cine-motion .hero-content.in .hero-kicker::before { animation: cineLine 1.1s .2s var(--cine-ease) both; }
@keyframes cineLine { from { transform: scaleX(0); } }
.hero-title { text-shadow: 0 18px 60px rgba(0, 0, 0, .45) !important; }
.hero-meta span:first-child { border-color: rgba(255, 255, 255, .45); }
.hero-progress i, .hero-dots button.on i::after { background: var(--grad-cine) !important; }
.hero-dots i { height: 2px !important; }
.hero-dots button:hover i { background: rgba(255, 255, 255, .55); }
.hero-mute { transition: transform .4s var(--cine-ease), background .2s; backdrop-filter: blur(10px); }
.hero-mute:hover { transform: scale(1.08); background: rgba(255, 255, 255, .12); }
.hero-empty .hero-aurora { display: block !important; opacity: .7; background: radial-gradient(40% 50% at 70% 40%, rgba(229, 83, 61, .45), transparent 70%), radial-gradient(35% 45% at 30% 60%, rgba(120, 92, 255, .25), transparent 70%), radial-gradient(30% 40% at 85% 75%, rgba(255, 179, 107, .3), transparent 70%); }

/* ── rows ── */
.cine-motion .row.cine-r { opacity: 0; transform: translateY(26px); filter: blur(6px); }
.cine-motion .row.cine-r.cine-in { opacity: 1; transform: none; filter: none; transition: opacity 1s var(--cine-ease), transform 1s var(--cine-ease), filter 1s var(--cine-ease); }
.row-head h2 { position: relative; }
.row-more .i { transition: transform .35s var(--cine-ease); }
.row-more:hover .i { transform: translateX(3px); }
.row-track { padding-top: 14px; }

/* ── cards: tilt, glare, glow ── */
.cine-motion .card { animation: cineCard 1s var(--cine-ease) both; animation-delay: calc(min(var(--i, 0), 14) * 55ms); }
@keyframes cineCard { from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.card-media { --rx: 0deg; --ry: 0deg; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transition: transform .7s var(--cine-ease), box-shadow .6s var(--cine-ease), outline-color .4s; will-change: transform; }
.card.tilting .card-media { transition: transform .18s ease-out, box-shadow .6s var(--cine-ease), outline-color .4s; }
.card-shine { display: block !important; opacity: 0; transition: opacity .5s var(--cine-ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .2), transparent 45%), linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .55)) !important; }
.card-play { display: grid !important; width: 52px; height: 52px; margin: -26px 0 0 -26px; background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 12px 32px rgba(0, 0, 0, .45); transform: scale(.7); transition: opacity .4s var(--cine-ease), transform .6s var(--cine-ease); }
.card-progress i { background: var(--grad-cine) !important; }
@media (hover: hover) {
  .card:hover .card-media { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.035);
    outline-color: rgba(255, 255, 255, .22) !important; box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .95), 0 22px 60px -24px var(--glow) !important; }
  :root[data-theme='light'] .card:hover .card-media { box-shadow: 0 30px 50px -26px rgba(0, 0, 0, .45), 0 20px 50px -26px var(--glow) !important; }
  .card:hover .card-media img { transform: scale(1.08); filter: brightness(1.06) saturate(1.08); transition: transform 1.4s var(--cine-ease), filter .6s, opacity .6s; }
  .card:hover .card-shine { opacity: 1; }
  .card:hover .card-play { opacity: 1; transform: scale(1); }
  .card:hover .card-text h3 { color: var(--text); }
}
.card-text h3 { transition: color .3s; }
.card-live .live-pill { box-shadow: 0 0 18px rgba(229, 72, 77, .55); }
.card-event.is-live .card-media { box-shadow: 0 0 0 2px var(--live), 0 0 40px -8px rgba(229, 72, 77, .6) !important; }

/* ── surfaces with a pointer spotlight ── */
html.cine :is(.panel, .kpi, .onboard-card, .mode-card, .x-tile, .x-lang, .lp-plan) {
  --sa: 0; transition: --sa .5s var(--cine-ease), border-color .3s, transform .5s var(--cine-ease);
  background-image: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 140, 100, calc(var(--sa) * .085)), transparent 45%) !important; }
html.cine :is(.panel, .kpi, .onboard-card, .mode-card, .x-tile, .x-lang, .lp-plan):hover { --sa: 1; }
html.cine :is(.kpi, .onboard-card, .mode-card):hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi b { background: linear-gradient(180deg, var(--text) 40%, color-mix(in srgb, var(--text) 65%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── modals, menus, toasts ── */
.modal-back { backdrop-filter: blur(14px) saturate(1.2) !important; -webkit-backdrop-filter: blur(14px) saturate(1.2) !important; background: rgba(4, 4, 6, .62) !important; }
:root[data-theme='light'] .modal-back { background: rgba(20, 20, 24, .32) !important; }
.modal { transform: translateY(26px) scale(.96); filter: blur(6px); opacity: 0; transition: transform .6s var(--cine-ease), filter .5s var(--cine-ease), opacity .4s; }
.modal-back.in .modal { filter: none; opacity: 1; }
.modal::before, .auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); border-radius: inherit; }
.acct-menu { transition: opacity .25s, transform .45s var(--cine-ease); transform-origin: top right; }
.acct-menu:not(.in) { transform: translateY(-8px) scale(.96); }
.toast { transition: opacity .35s, transform .6s var(--cine-ease) !important; }

/* ── watch page: ambient light from the film's artwork ── */
.watch-backdrop { display: block !important; opacity: .32; }
:root[data-theme='light'] .watch-backdrop { opacity: .16; }
.cine-motion .watch-backdrop img.ok { animation: cineBreathe 14s ease-in-out infinite alternate; }
@keyframes cineBreathe { from { transform: scale(1.2); } to { transform: scale(1.32) translate(-2%, 1%); } }
.ply-box { box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); }
.ply-played { background: var(--grad-cine) !important; box-shadow: 0 0 12px var(--glow) !important; }
.ply-knob { box-shadow: 0 0 0 4px rgba(255, 106, 69, .25), 0 1px 4px rgba(0, 0, 0, .5) !important; }
.ply-big { backdrop-filter: blur(14px) saturate(1.4) !important; -webkit-backdrop-filter: blur(14px) saturate(1.4) !important; }
.qitem { transition: background .25s, transform .4s var(--cine-ease); }
.qitem:hover { transform: translateX(3px); }

/* ── live, events ── */
.live-pill { box-shadow: 0 0 16px rgba(229, 72, 77, .45); }
.cine-motion .live-dot { animation: livePulse 1.6s infinite; }
.cine-motion .cd b.flip { animation: cdflip .5s var(--cine-ease); }
.cine-motion .ev-hero-bg img.ok { animation: kenburns 26s ease-out forwards; }
.ev-hero.is-live { box-shadow: 0 0 60px -20px rgba(229, 72, 77, .6) !important; }

/* ── auth ── */
.auth-bg i { display: block !important; opacity: .28; }
.auth-bg i:nth-child(1) { background: #e5533d; } .auth-bg i:nth-child(2) { background: #5b46d6; } .auth-bg i:nth-child(3) { background: #ffb36b; } .auth-bg i:nth-child(4) { background: #2b9e86; }
.auth.as-modal { backdrop-filter: blur(16px) saturate(1.2) !important; -webkit-backdrop-filter: blur(16px) saturate(1.2) !important; }
.auth.as-modal .auth-card { animation: cineCardIn .7s var(--cine-ease) both; }
@keyframes cineCardIn { from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.auth-card { position: relative; }
.input, .select { transition: border-color .25s, box-shadow .35s var(--cine-ease), background .25s; }
.input:focus, .select:focus { border-color: rgba(255, 106, 69, .6) !important; box-shadow: 0 0 0 4px rgba(255, 106, 69, .14) !important; }
.input-ico:focus-within > .i { color: var(--ember); }

/* ── reduced motion: everything settles in place ── */
@media (prefers-reduced-motion: reduce) {
  .cine-ambient i, .cine-grain { animation: none !important; }
  .hero-media { transform: none !important; transition: none !important; }
  .hero-content { opacity: 1 !important; transform: none !important; }
}
@media (hover: none) { .card-media { transform: none; } }
