/*
 * LumeClient trailer: a 50-second sequence cut to an original score (assets/js/trailer.js).
 * The stage is 16:9 and everything inside it is sized in container units, so it reads the
 * same at any width. Scenes animate while .active; .paused freezes every animation.
 */

:root {
  color-scheme: dark;
  --void: #07080f; --abyss: #0d0f1d; --raised: #14172e; --line: #1e2142; --line2: #2f3463;
  --text: #f1ebdd; --muted: #a5a8c6; --dim: #6d7198;
  --lumen: #f6c25b; --lumen-hi: #ffe08a; --arcane: #a68dff; --good: #6fd39a; --teal: #4fd1c5;
  /* the logo's theme colours (site.css "Nova") */
  --accent: #8b5cff; --accent2: #3dd6ff; --halo1: #ffd36a; --halo2: #ff8ac8;
  --display: Outfit, "Segoe UI", system-ui, sans-serif; --pixel: Silkscreen, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--void); color: var(--text); font-family: var(--display); }
body { min-height: 100svh; }
button, a { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { text-decoration: none; }

.trailer { width: min(1400px, 100% - 32px); margin: 0 auto; padding: 18px 0 28px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mark { display: inline-flex; align-items: center; gap: 8px; font: 800 17px/1 var(--display); }
.mark svg { width: 28px; height: 28px; }
.mark span { color: var(--muted); font-weight: 600; }
.label { font: 400 11px/1 var(--pixel); text-transform: uppercase; color: var(--dim); }

/* ---------- stage ---------- */
.stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; container-type: size; background: #04050a; border: 1px solid var(--line); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s; }
.scene.active { opacity: 1; visibility: visible; }
.paused * , .paused *::before, .paused *::after { animation-play-state: paused !important; }

.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene.active .kb { animation: kb 7.2s linear both; }
.scene.active .kb-slow { animation: kb 8s ease-out both; }
@keyframes kb { from { transform: scale(1.14) translate(1.5%, 1%); } to { transform: scale(1.02) translate(0, 0); } }
.shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 8, 15, .94) 0%, rgba(7, 8, 15, .75) 34%, rgba(7, 8, 15, .1) 70%); }
.shade.low { background: linear-gradient(0deg, rgba(7, 8, 15, .85), transparent 55%); }
.shade.end { background: linear-gradient(0deg, rgba(7, 8, 15, .92) 8%, rgba(7, 8, 15, .25) 60%, rgba(7, 8, 15, .45)); }

.copy { position: absolute; z-index: 2; left: 6.5cqw; top: 50%; width: 38cqw; transform: translateY(-50%); }
.copy.bottom { top: auto; bottom: 7cqh; left: 50%; width: 80cqw; text-align: center; transform: translateX(-50%); }
.eyebrow { display: inline-flex; align-items: center; gap: 1cqw; font: 400 1.25cqw/1 var(--pixel); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.eyebrow::before { content: ""; width: .6cqw; height: .6cqw; background: var(--lumen); }
.eyebrow.new::before { display: none; }
.eyebrow.new i { font-style: normal; padding: .45cqw .7cqw; color: #1a1004; background: var(--lumen); }
.scene h2 { margin-top: 1.8cqw; font: 800 5.2cqw/1.02 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.scene em { font-style: normal; color: var(--lumen); }
.copy p { margin-top: 1.6cqw; font-size: 1.55cqw; line-height: 1.5; color: var(--muted); max-width: 32cqw; }
.copy.bottom h2 { font-size: 4.4cqw; }
.scene.active .copy > * { animation: rise .7s var(--ease) both; }
.scene.active .copy > :nth-child(2) { animation-delay: .12s; }
.scene.active .copy > :nth-child(3) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(2.2cqw); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- 0 · cold open ---------- */
.s-open { display: grid; place-items: center; }
.open-line { grid-area: 1 / 1; font: 800 7.6cqw/1 var(--display); letter-spacing: -.04em; opacity: 0; }
.s-open.active .l1 { animation: word 1.5s .05s var(--ease) both; }
.s-open.active .l2 { animation: word 1.5s 1.55s var(--ease) both; }
.s-open.active .l3 { animation: word-stay 1.7s 3.05s var(--ease) both; color: var(--lumen); }
@keyframes word { 0% { opacity: 0; transform: scale(1.12); filter: blur(.6cqw); } 22%, 72% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; transform: scale(.96); } }
@keyframes word-stay { 0% { opacity: 0; transform: scale(1.12); filter: blur(.6cqw); } 25%, 85% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; transform: scale(1.4); filter: blur(.4cqw); } }

/* ---------- 1 · logo ---------- */
.s-logo { display: grid; place-content: center; justify-items: center; text-align: center; }
.burst { position: absolute; left: 50%; top: 40%; width: 60cqw; height: 60cqw; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 211, 106, .22), rgba(139, 92, 255, .1) 35%, transparent 65%); }
.s-logo.active .burst { animation: burst 4.8s ease-out both; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.15); opacity: .7; } }
.logo { width: 17cqw; height: 17cqw; filter: drop-shadow(0 0 3cqw rgba(255, 211, 106, .35)); }
.s-logo.active .logo { animation: logo-in 1.1s var(--ease) both; }
@keyframes logo-in { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; filter: blur(1cqw) brightness(3); } 60% { opacity: 1; } 100% { transform: none; filter: drop-shadow(0 0 3cqw rgba(255, 211, 106, .35)); } }
.wordmark { margin-top: 1.4cqw; font: 800 8cqw/1 var(--display); letter-spacing: -.045em; }
.wordmark span { color: var(--muted); font-weight: 600; }
.s-logo.active .wordmark { animation: track 1.6s .35s var(--ease) both; }
@keyframes track { from { opacity: 0; letter-spacing: .25em; } }
.tag { margin-top: 1.6cqw; font: 400 1.5cqw/1 var(--pixel); text-transform: uppercase; color: var(--lumen); }
.s-logo.active .tag { animation: rise .8s 1.1s var(--ease) both; }

/* ---------- 2 · performance ---------- */
.bench { position: absolute; z-index: 2; right: 6cqw; bottom: 8cqh; width: 34cqw; padding: 2cqw; background: rgba(7, 8, 15, .82); border: 1px solid var(--line2); }
.s-perf.active .bench { animation: rise .8s .5s var(--ease) both; }
.fps { display: flex; align-items: baseline; gap: 1cqw; font: 400 7.5cqw/1 var(--pixel); color: var(--lumen); }
.fps small { font-size: 2cqw; color: var(--muted); }
.bars { display: grid; gap: 1cqw; margin-top: 1.6cqw; }
.bar { display: grid; grid-template-columns: 9cqw 1fr auto; align-items: center; gap: 1cqw; font-size: 1.15cqw; color: var(--muted); }
.bar i { height: 1.1cqw; width: 0; background: var(--line2); transition: width 2.4s var(--ease); }
.bar.ours i { background: var(--lumen); }
.bar.ours span { color: var(--text); font-weight: 700; }
.bar b { font: 400 1cqw/1 var(--pixel); min-width: 7cqw; text-align: right; }
.fine { margin-top: 1.2cqw; font-size: .85cqw; color: var(--dim); }

/* ---------- 3 · mod menu ---------- */
.s-menu { background: radial-gradient(ellipse at 70% 50%, rgba(166, 141, 255, .12), transparent 60%); }
.s-menu .copy { width: 33cqw; }
.s-menu .copy p { max-width: 28cqw; }
.menu { position: absolute; right: 4.5cqw; top: 50%; width: 55cqw; height: 32cqw; display: grid; grid-template-columns: 10cqw 1fr; transform: translateY(-50%);
  background: rgba(13, 15, 29, .96); border: 1px solid var(--line2); box-shadow: 0 3cqw 6cqw rgba(0, 0, 0, .55); }
.s-menu.active .menu { animation: menu-in .9s .1s var(--ease) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-50%) perspective(80cqw) rotateY(-14deg) translateX(4cqw); } }
.menu aside { display: flex; flex-direction: column; gap: .35cqw; padding: 1.3cqw .9cqw; border-right: 1px solid var(--line); }
.menu-brand { margin-bottom: .9cqw; font: 800 1.15cqw/1 var(--display); color: var(--lumen); }
.side { padding: .55cqw .7cqw; font-size: .95cqw; font-weight: 600; color: var(--dim); }
.side.on { color: var(--text); background: rgba(246, 194, 91, .12); box-shadow: inset .2cqw 0 0 var(--lumen); }
.menu-main { display: flex; flex-direction: column; min-width: 0; padding: 1.2cqw; }
.menu-head { display: flex; gap: .7cqw; align-items: center; margin-bottom: 1.1cqw; font-size: .95cqw; color: var(--muted); }
.menu-head .profile { margin-right: auto; }
.menu-head b { color: var(--text); }
.pill { padding: .45cqw .8cqw; border: 1px solid var(--line2); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8cqw; }
.mcard { position: relative; overflow: hidden; height: 8.4cqw; display: flex; flex-direction: column; justify-content: space-between; padding: .8cqw;
  background: var(--raised); border: 1px solid var(--line); transition: border-color .3s, background-color .3s; }
.s-menu.active .mcard { animation: rise .5s var(--ease) both; }
.mcard .ic { font-size: 1.9cqw; line-height: 1; filter: grayscale(1); opacity: .6; transition: filter .3s, opacity .3s; }
.mcard b { font-size: .95cqw; }
.mcard .st { font: 400 .7cqw/1 var(--pixel); color: var(--dim); }
.mcard::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .25cqw; background: var(--line2); transition: background-color .3s; }
.mcard.on { border-color: rgba(246, 194, 91, .55); background: #1a1a2e; }
.mcard.on .ic { filter: none; opacity: 1; }
.mcard.on .st { color: var(--good); }
.mcard.on::after { background: var(--lumen); }
.mcard.on::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 224, 138, .28) 50%, transparent 65%); animation: glint .7s ease-out both; }
@keyframes glint { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.cursor { position: absolute; z-index: 3; left: 0; top: 0; width: 1.6cqw; height: 1.6cqw; transition: transform .45s var(--ease);
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 1l11 7-5 1-2 5z' fill='%23f1ebdd' stroke='%2307080f' stroke-width='1'/%3E%3C/svg%3E"); }

/* ---------- 4 · cosmetics montage ---------- */
.s-cos .cut { opacity: 0; }
.s-cos .cut.on { opacity: 1; animation: punch .6s var(--ease) both; }
@keyframes punch { from { transform: scale(1.12); filter: brightness(1.6); } to { transform: scale(1.03); } }
.cos-word { position: absolute; z-index: 2; left: 6cqw; bottom: 9cqh; font: 800 10cqw/1 var(--display); letter-spacing: -.05em; text-shadow: 0 1cqw 4cqw rgba(0, 0, 0, .6); }
.cos-word.hit { animation: word-hit .45s var(--ease) both; }
@keyframes word-hit { from { opacity: 0; transform: translateY(2cqw) scale(1.08); } }
.cos-eyebrow { position: absolute; z-index: 2; left: 6.4cqw; bottom: 5cqh; }

/* ---------- 5 · community capes ---------- */
.s-community { background: radial-gradient(ellipse at 72% 50%, rgba(79, 209, 197, .1), transparent 60%); }
.s-community .copy { width: 32cqw; }
.capes { position: absolute; right: 5cqw; top: 50%; width: 54cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; transform: translateY(-50%); }
.cape { position: relative; padding: 1cqw; background: var(--abyss); border: 1px solid var(--line); border-top: .2cqw solid var(--teal); }
.s-community.active .cape { animation: rise .6s var(--ease) both; }
.cape .pic { display: grid; place-items: center; height: 11cqw; background: var(--raised); }
.cape canvas { height: 9cqw; width: auto; aspect-ratio: 10 / 16; image-rendering: pixelated; filter: drop-shadow(0 .8cqw 1cqw rgba(0, 0, 0, .5)); }
.cape b { display: block; margin-top: .8cqw; font-size: 1.1cqw; }
.cape small { display: block; margin-top: .2cqw; font-size: .9cqw; color: var(--dim); }
.cape .row { display: flex; align-items: center; justify-content: space-between; margin-top: .8cqw; }
.cape .likes { font: 400 .85cqw/1 var(--pixel); color: #ff6fae; }
.cape .get { padding: .45cqw .8cqw; font-size: .85cqw; font-weight: 700; color: #1a1004; background: var(--lumen); transition: background-color .3s, color .3s; }
.cape .get.owned { color: var(--good); background: transparent; box-shadow: inset 0 0 0 1px rgba(111, 211, 154, .5); }
.cape .get.press { animation: press .3s ease-out; }
@keyframes press { 50% { transform: scale(.88); } }

/* ---------- 6 · together ---------- */
.s-sky { background: radial-gradient(ellipse at 50% 46%, rgba(139, 92, 255, .14), transparent 55%); }
.sky-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky-lines path { fill: none; stroke: rgba(246, 194, 91, .55); stroke-width: 2; stroke-dasharray: 900; stroke-dashoffset: 900; vector-effect: non-scaling-stroke; }
.s-sky.active .sky-lines path { animation: draw 1.4s var(--ease) both; }
.s-sky.active .sky-lines path:nth-child(2) { animation-delay: .2s; }
.s-sky.active .sky-lines path:nth-child(3) { animation-delay: .4s; }
.s-sky.active .sky-lines path:nth-child(4) { animation-delay: .6s; }
.s-sky.active .sky-lines path:nth-child(5) { animation-delay: .8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.me { position: absolute; left: 50%; top: 50%; width: 13cqw; height: 13cqw; border-radius: 50%; overflow: hidden; transform: translate(-50%, -50%);
  border: .25cqw solid var(--lumen); box-shadow: 0 0 4cqw rgba(246, 194, 91, .35); }
.me img { width: 100%; height: 100%; object-fit: cover; }
.s-sky.active .me { animation: pop .8s var(--ease) both; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }
.node { position: absolute; display: grid; grid-template-columns: auto 1fr; column-gap: .8cqw; align-items: center; padding: .8cqw 1.1cqw;
  background: rgba(13, 15, 29, .92); border: 1px solid var(--line2); transform: translate(-50%, -50%); }
.node i { grid-row: span 2; width: 1cqw; height: 1cqw; background: var(--lumen); box-shadow: 0 0 1.2cqw var(--lumen); }
.node.fr i { border-radius: 50%; background: var(--good); box-shadow: 0 0 1.2cqw var(--good); }
.node b { font-size: 1.1cqw; }
.node small { font-size: .85cqw; color: var(--muted); }
.s-sky.active .node { animation: node-in .6s var(--ease) both; }
@keyframes node-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
.n1 { left: 23.5%; top: 27%; } .n2 { left: 22%; top: 50%; } .n3 { left: 25%; top: 73%; }
.n4 { left: 77%; top: 30%; } .n5 { left: 78%; top: 62%; }
.s-sky.active .n1 { animation-delay: .9s; } .s-sky.active .n2 { animation-delay: 1.05s; } .s-sky.active .n3 { animation-delay: 1.2s; }
.s-sky.active .n4 { animation-delay: 1.35s; } .s-sky.active .n5 { animation-delay: 1.5s; }

/* ---------- 7 · end ---------- */
.end-copy { position: absolute; z-index: 2; left: 50%; bottom: 10cqh; display: grid; justify-items: center; text-align: center; transform: translateX(-50%); width: 80cqw; }
.end-logo { width: 9cqw; height: 9cqw; }
.end-copy .wordmark { margin-top: .6cqw; font-size: 7cqw; }
.s-end.active .end-logo { animation: logo-in 1s .1s var(--ease) both; }
.s-end.active .wordmark { animation: track 1.4s .3s var(--ease) both; }
.s-end.active .tag { animation: rise .8s .9s var(--ease) both; }
.end-actions { display: grid; justify-items: center; gap: 1.2cqw; margin-top: 2.4cqw; }
.s-end.active .end-actions { animation: rise .8s 1.4s var(--ease) both; }
.btn.gold { padding: 1.1cqw 2.4cqw 1.3cqw; font: 800 1.5cqw/1 var(--display); color: #1a1004; background: var(--lumen);
  clip-path: polygon(.7cqw 0, 100% 0, 100% calc(100% - .7cqw), calc(100% - .7cqw) 100%, 0 100%, 0 .7cqw);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .7), inset 0 -.25cqw 0 rgba(120, 66, 10, .55); }
.btn.gold:hover { background: var(--lumen-hi); }
.free { font: 400 1cqw/1 var(--pixel); text-transform: uppercase; color: var(--muted); }

/* ---------- overlays ---------- */
.flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: #fff6dc; opacity: 0; }
.flash.go { animation: flash .55s ease-out; }
@keyframes flash { from { opacity: .75; } }
.grain { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.stage.shake { animation: shake .35s steps(4); }
@keyframes shake { 25% { transform: translate(.3cqw, -.2cqw); } 50% { transform: translate(-.3cqw, .2cqw); } 75% { transform: translate(.2cqw, .2cqw); } }

.poster { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 2cqw;
  background: linear-gradient(0deg, rgba(4, 5, 10, .55), rgba(4, 5, 10, .55)), center / cover url("/assets/img/media/hero_back.jpg"); }
.poster[hidden] { display: none; }
.poster-play { display: grid; place-items: center; width: 8cqw; height: 8cqw; color: #1a1004; background: var(--lumen);
  clip-path: polygon(1cqw 0, 100% 0, 100% calc(100% - 1cqw), calc(100% - 1cqw) 100%, 0 100%, 0 1cqw); transition: transform .2s; }
.poster-play svg { width: 3.4cqw; height: 3.4cqw; fill: currentColor; margin-left: .4cqw; }
.poster:hover .poster-play { transform: scale(1.06); }
.poster-text { display: grid; gap: .8cqw; text-align: left; }
.poster-text b { font: 800 3.2cqw/1 var(--display); letter-spacing: -.02em; }
.poster-text small { font: 400 1.2cqw/1 var(--pixel); text-transform: uppercase; color: var(--muted); }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.controls button { padding: 7px 12px; font-weight: 700; border: 1px solid var(--line2); transition: border-color .15s, color .15s; }
.controls button:hover { color: var(--text); border-color: var(--muted); }
#toggle { width: 44px; }
.timeline { flex: 1; height: 4px; background: var(--line); }
.timeline span { display: block; height: 100%; width: 0; background: var(--lumen); }
#clock { font: 400 12px/1 var(--pixel); min-width: 92px; text-align: right; }
.credits { margin-top: 12px; font-size: 12.5px; color: var(--dim); }

@media (max-width: 640px) {
  .trailer { width: calc(100% - 24px); }
  .controls { flex-wrap: wrap; gap: 8px; }
  .timeline { flex-basis: 100%; order: -1; }
  #clock { margin-right: auto; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .stage.shake { animation: none; }
  .scene.active .kb, .scene.active .kb-slow { animation: none; }
}
