/* =========================================================================
   OptimityFX — FX layer: light flare, neural mesh, AI prompt-to-film, 3D decks
   ========================================================================= */

/* ---------- Light flare ---------- */
.flare { position: fixed; left: 0; right: 0; top: 0; height: 0; z-index: 80; pointer-events: none; mix-blend-mode: screen; opacity: 0; will-change: transform, opacity; }
.flare__core { position: absolute; top: 0; left: 0; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,250,240,.75) 0, rgba(255,226,180,.35) 10%, rgba(243,196,126,.16) 26%, rgba(255,154,114,.06) 45%, transparent 68%); }
.flare__core::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 220px; margin: -110px 0 0 -1px; background: linear-gradient(transparent, rgba(255,246,227,.6), transparent); filter: blur(.5px); }
.flare__streak { position: absolute; left: -10vw; right: -10vw; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent 0, rgba(159,217,255,.15) 18%, rgba(159,217,255,.65) 42%, rgba(255,250,240,1) 50%, rgba(159,217,255,.65) 58%, rgba(159,217,255,.15) 82%, transparent 100%);
  box-shadow: 0 0 16px 2px rgba(159,217,255,.35); }
.flare__streak--wide { height: 46px; top: -23px; opacity: .22; filter: blur(14px); }
.flare__ghost { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(195,168,255,.22); background: radial-gradient(circle, rgba(195,168,255,.14), rgba(159,217,255,.04) 60%, transparent 72%); }
.flare__ghost--warm { border-color: rgba(243,196,126,.25); background: radial-gradient(circle, rgba(255,190,120,.16), transparent 70%); }
@media (max-width: 760px) { .flare__core { width: 240px; height: 240px; margin: -120px 0 0 -120px; } }
@media (prefers-reduced-motion: reduce) { .flare { display: none; } }

/* ---------- Neural mesh ---------- */
.neural { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .75;
  -webkit-mask-image: radial-gradient(90% 80% at 60% 40%, #000 30%, transparent 85%); mask-image: radial-gradient(90% 80% at 60% 40%, #000 30%, transparent 85%); }
[data-neural] { position: relative; isolation: isolate; }

/* ---------- 3D deck (inner page heroes) ---------- */
.deck { position: absolute; right: var(--g); top: 58%; width: min(34vw, 470px); aspect-ratio: 4 / 3; transform: translateY(-46%); perspective: 1300px; z-index: 0; pointer-events: none; }
.deck__in { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.deck__card { position: absolute; width: 74%; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 40px 80px -24px rgba(0,0,0,.85); }
.deck__card img { width: 100%; height: 100%; object-fit: cover; }
.deck__card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 40%); mix-blend-mode: soft-light; }
.deck__card:nth-child(1) { left: 26%; top: 0; }
.deck__card:nth-child(2) { left: 0; top: 22%; }
.deck__card:nth-child(3) { left: 18%; top: 46%; }
.deck__tag { position: absolute; left: 12px; bottom: 10px; z-index: 2; }
@media (max-width: 1000px) { .deck { display: none; } }

/* ---------- AI Prompt → Film ---------- */
.gen { display: grid; grid-template-columns: .9fr 1.3fr; gap: 14px; align-items: stretch; }
.gen__panel { display: flex; flex-direction: column; gap: 22px; justify-content: space-between; }
.gen__prompt { position: relative; padding: 20px; border-radius: 18px; background: rgba(0,0,0,.35); border: 1px solid var(--line-2); min-height: 150px; }
.gen__prompt::before { content: "✦ PROMPT"; display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: var(--gold); margin-bottom: 12px; }
.gen__text { font-size: clamp(19px, 1.7vw, 25px); line-height: 1.3; font-weight: 500; letter-spacing: -.01em; min-height: 3.9em; }
.gen__text::after { content: "▍"; color: var(--gold); animation: blink 1s steps(2) infinite; margin-left: 2px; }
.gen__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gen__chips button { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); transition: all .3s; }
.gen__chips button:hover { color: var(--ink); border-color: rgba(243,196,126,.5); }
.gen__chips button.on { background: var(--ink); color: #000; border-color: var(--ink); }
.gen__steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gen__steps span { position: relative; padding: 10px 0 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); transition: color .4s; }
.gen__steps span::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); }
.gen__steps span::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; border-radius: 3px; width: var(--p, 0%); background: var(--heaven); }
.gen__steps span.on { color: var(--ink); }
.gen__screen { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 10; background: #08080b; box-shadow: 0 0 0 1px var(--line-2), 0 50px 120px -40px rgba(243,196,126,.3); isolation: isolate; }
.gen__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: filter, transform; }
.gen__noise { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; mix-blend-mode: screen; pointer-events: none; }
.gen__scan { position: absolute; left: 0; right: 0; height: 2px; top: var(--scan, 0%); background: linear-gradient(90deg, transparent, var(--gold-2), transparent); box-shadow: 0 0 24px 4px rgba(243,196,126,.55); opacity: var(--scan-o, 0); }
.gen__hud { position: absolute; left: 16px; right: 16px; top: 14px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.85); text-shadow: 0 1px 8px #000; z-index: 2; }
.gen__hud b { color: var(--gold-2); font-weight: 500; }
.gen__grid { 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: 40px 40px; opacity: var(--grid-o, 0); pointer-events: none; }
.gen__corners::before, .gen__corners::after { content: ""; position: absolute; width: 26px; height: 26px; border: 1.5px solid rgba(255,255,255,.7); z-index: 2; }
.gen__corners::before { left: 14px; bottom: 14px; border-right: 0; border-top: 0; }
.gen__corners::after { right: 14px; bottom: 14px; border-left: 0; border-top: 0; }
@media (max-width: 960px) { .gen { grid-template-columns: 1fr; } }
.flag-row { flex-wrap: wrap; }

/* ---------- Local showreel video ---------- */
.reel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Film floor hover loops ---------- */
.wall__tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; pointer-events: none; }
.wall__tile.is-live video { opacity: 1; }

/* ---------- Phone showcase ---------- */
.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 30px); perspective: 1400px; padding: 20px 0 10px; }
.phone { position: relative; display: block; aspect-ratio: 9 / 19; border-radius: 38px; padding: 0; overflow: hidden; background: #000; text-align: left;
  border: 7px solid #17171d; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 50px 90px -30px rgba(0,0,0,.9), 0 0 60px -20px rgba(243,196,126,.35); transition: box-shadow .4s; }
.phone:nth-child(even) { margin-top: 40px; }
.phone:hover { box-shadow: 0 0 0 1.5px var(--gold), 0 50px 90px -30px rgba(0,0,0,.9), 0 0 70px -10px rgba(243,196,126,.55); }
.phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone__notch { position: absolute; z-index: 2; top: 10px; left: 50%; width: 34%; height: 20px; transform: translateX(-50%); border-radius: 20px; background: #000; }
.phone__cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 12px; color: rgba(255,255,255,.75); }
.phone__cap b { display: block; font-family: var(--display); font-weight: 800; font-stretch: 70%; text-transform: uppercase; font-size: 22px; line-height: 1; color: #fff; margin-bottom: 4px; }
@media (max-width: 760px) { .phones { grid-template-columns: 1fr 1fr; } .phone { border-radius: 26px; border-width: 5px; } }
