/* AT-MEDIA motion layer for the public website: portal intro, page transitions, living hero, cursor light,
   magnetic buttons, 3D cards, word reveals, scroll progress. Everything is off with "reduce motion". */

/* ---------- page transitions (Chrome, Edge, Safari 18+) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fx-vt-out .32s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: fx-vt-in .5s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes fx-vt-out { to { opacity: 0; transform: scale(.985); filter: blur(6px); } }
@keyframes fx-vt-in { from { opacity: 0; transform: scale(1.015) translateY(10px); filter: blur(8px); } }

/* ---------- portal intro (first page of a visit) ---------- */
#fx-portal { display: none; }
html.fx-intro #fx-portal { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; background: radial-gradient(60% 60% at 50% 50%, #0f1b3d 0%, #050816 70%); color: #fff; cursor: pointer; overflow: hidden; }
html.fx-intro body { overflow: hidden; }
#fx-portal .fx-p-grid { position: absolute; inset: -50%; background-image: linear-gradient(rgba(96,165,250,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(96,165,250,.13) 1px, transparent 1px); background-size: 60px 60px; transform: perspective(600px) rotateX(62deg) translateY(0); transform-origin: 50% 60%; animation: fx-grid 1.6s linear infinite; mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 55%); -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 55%); }
@keyframes fx-grid { to { background-position: 0 60px, 0 0; } }
#fx-portal .fx-p-core { position: relative; display: grid; place-items: center; gap: 18px; text-align: center; }
#fx-portal .fx-p-mark { width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; font-weight: 800; font-size: 34px; letter-spacing: -.04em; background: linear-gradient(135deg, #2b59ff, #7b3bff 60%, #10b981); box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 30px 80px -10px rgba(43,89,255,.7); animation: fx-mark .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes fx-mark { from { transform: scale(.4) rotate(-25deg); opacity: 0; filter: blur(10px); } }
#fx-portal .fx-p-ring { position: absolute; left: 50%; top: 46px; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; border: 1.5px solid rgba(147,197,253,.55); animation: fx-ring 1.4s cubic-bezier(.16, 1, .3, 1) infinite; }
#fx-portal .fx-p-ring:nth-child(2) { animation-delay: .35s; } #fx-portal .fx-p-ring:nth-child(3) { animation-delay: .7s; }
@keyframes fx-ring { from { transform: scale(.8); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
#fx-portal .fx-p-text { font-size: 13px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: #93c5fd; opacity: 0; animation: fx-up .6s .25s cubic-bezier(.16, 1, .3, 1) forwards; }
#fx-portal .fx-p-bar { width: 180px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
#fx-portal .fx-p-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #60a5fa, #a78bfa, #34d399); transform-origin: left; animation: fx-load 1s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes fx-load { from { transform: scaleX(0); } }
@keyframes fx-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#fx-portal.fx-open { animation: fx-open .75s cubic-bezier(.7, 0, .2, 1) forwards; pointer-events: none; }
@keyframes fx-open { from { clip-path: circle(150% at 50% 46%); } to { clip-path: circle(0% at 50% 46%); } }
html.fx-intro main { transform: scale(.96); }
main { transition: transform .9s cubic-bezier(.16, 1, .3, 1); }

/* ---------- scroll progress ---------- */
#fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #2b59ff, #7b3bff, #10b981); box-shadow: 0 0 12px rgba(43,89,255,.6); pointer-events: none; }

/* ---------- living hero (constellation canvas) ---------- */
.fx-has-sky { isolation: isolate; }
.fx-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.fx-sky.on { opacity: 1; }

/* ---------- cursor light (mouse only) ---------- */
#fx-cursor, #fx-glow { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 2147482000; opacity: 0; transition: opacity .3s; }
#fx-cursor { width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 1.5px solid rgba(43,89,255,.55); transition: opacity .3s, width .25s, height .25s, margin .25s, background-color .25s, border-color .25s; mix-blend-mode: multiply; }
#fx-cursor.hot { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: rgba(43,89,255,.10); border-color: rgba(43,89,255,.35); }
#fx-cursor.dark { border-color: rgba(147,197,253,.7); mix-blend-mode: screen; }
#fx-cursor.dark.hot { background: rgba(147,197,253,.14); }
#fx-glow { width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; background: radial-gradient(circle, rgba(96,165,250,.16), rgba(167,139,250,.08) 35%, transparent 65%); mix-blend-mode: screen; }
body.fx-mouse #fx-cursor, body.fx-mouse #fx-glow.dark { opacity: 1; }

/* ---------- magnetic buttons + click burst ---------- */
.fx-mag { transition: transform .35s cubic-bezier(.16, 1, .3, 1) !important; will-change: transform; }
.fx-burst { position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 2147482500; animation: fx-burst .7s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes fx-burst { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* ---------- 3D cards with light ---------- */
.fx-tilt { transform-style: preserve-3d; transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .4s; will-change: transform; }
.fx-tilt.fx-tilting { transition: transform .08s linear, box-shadow .4s; box-shadow: 0 40px 80px -40px rgba(15, 23, 42, .45); }
.fx-tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.28), transparent 45%); z-index: 3; }
.fx-tilt.fx-tilting::after { opacity: 1; }

/* ---------- word reveal on headings ---------- */
.fx-words .fx-w { display: inline-block; opacity: 0; transform: translateY(.55em) rotateX(-40deg); filter: blur(6px); transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1), filter .7s; transition-delay: calc(var(--i) * 45ms); }
.fx-words.fx-in .fx-w { opacity: 1; transform: none; filter: none; }

/* ---------- screenshots: light sweep on hover ---------- */
.fx-shine { position: relative; overflow: hidden; }
.fx-shine::before { content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); z-index: 2; pointer-events: none; transition: left .9s cubic-bezier(.16, 1, .3, 1); }
.fx-shine:hover::before { left: 130%; }

/* ---------- "different world" ambient: floating orbs behind light sections ---------- */
.fx-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-orbs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22; animation: fx-float 22s ease-in-out infinite alternate; }
.fx-orbs i:nth-child(1) { width: 520px; height: 520px; background: #2b59ff; left: -160px; top: 20%; }
.fx-orbs i:nth-child(2) { width: 440px; height: 440px; background: #a855f7; right: -140px; top: 55%; animation-duration: 26s; animation-delay: -6s; }
.fx-orbs i:nth-child(3) { width: 380px; height: 380px; background: #10b981; left: 35%; bottom: -200px; animation-duration: 30s; animation-delay: -12s; }
@keyframes fx-float { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(80px, -60px) scale(1.15); } 100% { transform: translate(-40px, 50px) scale(.95); } }

/* calm mode (device set to "reduce motion"): same world, no big movement — fades instead of zooms, still sky */
html.fx-calm::view-transition-old(root) { animation: fx-fade-out .25s ease both; }
html.fx-calm::view-transition-new(root) { animation: fx-fade-in .35s ease both; }
@keyframes fx-fade-out { to { opacity: 0; } }
@keyframes fx-fade-in { from { opacity: 0; } }
html.fx-calm #fx-portal .fx-p-grid, html.fx-calm #fx-portal .fx-p-ring { animation: none; opacity: .5; }
html.fx-calm #fx-portal .fx-p-ring { display: none; }
html.fx-calm #fx-portal .fx-p-mark { animation: fx-fade-in .5s ease both; }
html.fx-calm #fx-portal.fx-open { animation: fx-fade-out .5s ease forwards; }
html.fx-calm.fx-intro main, html.fx-calm main { transform: none; transition: none; }
html.fx-calm .fx-words .fx-w { transform: none; filter: none; transition: opacity .6s ease; transition-delay: calc(var(--i) * 30ms); }
html.fx-calm .fx-orbs i { animation: none; }
html.fx-calm .fx-tilt, html.fx-calm .fx-mag { transform: none !important; }
@media (hover: none), (pointer: coarse) { #fx-cursor, #fx-glow { display: none; } }
@media print { #fx-portal, #fx-progress, #fx-cursor, #fx-glow, .fx-orbs, .fx-sky { display: none !important; } }

/* ---------- Website assistant ---------- */
.as { position: fixed; left: 18px; bottom: 18px; z-index: 900; font-family: inherit; }
.as-fab { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; font: inherit; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, #2b59ff, #7b3bff); box-shadow: 0 16px 40px -12px rgba(43,89,255,.7), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .25s cubic-bezier(.16,1,.3,1); }
.as-fab:hover { transform: translateY(-2px); }
.as-fab-i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); animation: as-pulse 2.6s ease-in-out infinite; }
@keyframes as-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
.as.on .as-fab { display: none; }
.as-box { position: fixed; left: 18px; bottom: 18px; width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100vh - 36px)); display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #0b1324; border-radius: 22px; box-shadow: 0 40px 90px -24px rgba(15,23,42,.45), 0 0 0 1px rgba(15,23,42,.06); animation: as-in .35s cubic-bezier(.16,1,.3,1); }
.as-box[hidden] { display: none; }
@keyframes as-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.as-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px; color: #fff; background: radial-gradient(80% 140% at 100% 0%, rgba(123,59,255,.9), transparent 60%), linear-gradient(135deg, #0f1b3d, #2b59ff); }
.as-h b { display: block; font-size: 15px; } .as-h small { opacity: .8; font-size: 12px; }
.as-av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.18); }
.as-x { margin-left: auto; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 32px; height: 32px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.as-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f6f7fb; scroll-behavior: smooth; }
.as-m { max-width: 88%; padding: 10px 12px; border-radius: 16px; font-size: 14px; line-height: 1.5; animation: as-in .3s ease both; }
.as-bot { align-self: flex-start; background: #fff; border: 1px solid #e6e9f2; border-bottom-left-radius: 6px; }
.as-me { align-self: flex-end; background: #2b59ff; color: #fff; border-bottom-right-radius: 6px; }
.as-m a { color: #2b59ff; font-weight: 700; } .as-me a { color: #fff; }
.as-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa4ba; animation: as-dot 1s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: .15s; } .as-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes as-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.as-chips button { border: 1px solid #d9def0; background: #fff; color: #1e293b; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.8px; font-weight: 600; cursor: pointer; transition: all .15s; }
.as-chips button:hover { border-color: #2b59ff; color: #2b59ff; background: #f0f4ff; }
.as-card { display: flex; gap: 10px; margin-top: 8px; padding: 10px; border-radius: 14px; background: #f8f9fd; border: 1px solid #e6e9f2; }
.as-card .as-dot { flex: none; width: 10px; border-radius: 6px; background: var(--c); }
.as-card b { display: block; } .as-card small { display: block; color: #64748b; font-size: 12.5px; }
.as-price { margin-top: 6px; font-weight: 800; font-size: 18px; } .as-price small { display: inline; font-size: 12px; font-weight: 600; }
.as-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.as-btn { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 11px; border: 1px solid #d9def0; background: #fff; color: #1e293b !important; font-weight: 700; font-size: 13px; text-decoration: none !important; }
.as-pri { background: #2b59ff; border-color: #2b59ff; color: #fff !important; }
.as-wa { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.as-note { display: block; margin-top: 6px; color: #64748b; font-size: 12px; }
.as-ul { margin: 6px 0; padding-left: 18px; }
.as-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e6e9f2; background: #fff; }
.as-f input { flex: 1; border: 1px solid #d9def0; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; outline: none; }
.as-f input:focus { border-color: #2b59ff; box-shadow: 0 0 0 3px rgba(43,89,255,.12); }
.as-f button { width: 42px; border: 0; border-radius: 12px; background: #2b59ff; color: #fff; cursor: pointer; display: grid; place-items: center; }
.as-nudge { position: absolute; left: 0; bottom: 64px; white-space: nowrap; padding: 10px 14px; border-radius: 14px; background: #fff; color: #0b1324; font-size: 13.5px; box-shadow: 0 18px 40px -14px rgba(15,23,42,.4); cursor: pointer; animation: as-in .4s ease both; }
.as-nudge.out { opacity: 0; transform: translateY(6px); transition: all .35s; }
@media (max-width: 640px) { .as { left: 12px; bottom: 12px; } .as-fab-t { display: none; } .as-fab { padding: 6px; } .as-box { left: 6px; right: 6px; bottom: 6px; width: auto; height: calc(100vh - 12px); border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .as-fab-i, .as-typing i { animation: none; } .as-box, .as-m { animation: none; } }
@media print { .as { display: none; } }

/* the chat sits above the page's floating bars while it is open */
body.as-open .am-dock, body.as-open .wa-float, body.as-open .am-stack-bar { display: none !important; }
.as { z-index: 9950; }
