/* ============================================================
   VN Cloud App — motion & aero effects (1.9.0)
   Everything here is decorative: layout and content never depend on it.
   Honours prefers-reduced-motion (style.css already disables animations).
   ============================================================ */

/* ---------- Floating aero blobs behind every page ---------- */
.aero-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aero-bg i {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform;
  animation: blobDrift 26s ease-in-out infinite alternate;
}
.aero-bg i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(59,130,246,.55), rgba(59,130,246,0) 70%); animation-duration: 28s; }
.aero-bg i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 18vh; background: radial-gradient(circle, rgba(255,106,0,.28), rgba(255,106,0,0) 70%); animation-duration: 34s; animation-delay: -8s; }
.aero-bg i:nth-child(3) { width: 42vw; height: 42vw; left: 28vw; bottom: -22vw; background: radial-gradient(circle, rgba(31,79,216,.4), rgba(31,79,216,0) 70%); animation-duration: 31s; animation-delay: -15s; }
.aero-bg i:nth-child(4) { width: 22vw; height: 22vw; right: 22vw; bottom: 10vh; background: radial-gradient(circle, rgba(22,163,74,.22), rgba(22,163,74,0) 70%); animation-duration: 24s; animation-delay: -4s; }
@keyframes blobDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vw, -4vh, 0) scale(1.08); }
  100% { transform: translate3d(-4vw, 6vh, 0) scale(.96); }
}
/* soft moving light sweep over the whole page */
.aero-bg::after {
  content: ''; position: absolute; inset: -50%; z-index: 1;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  animation: sweep 18s linear infinite; mix-blend-mode: overlay;
}
@keyframes sweep { from { transform: translateX(-30%); } to { transform: translateX(30%); } }

/* ---------- Scroll progress bar ---------- */
.scroll-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 100; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--cobalt), var(--flare)); box-shadow: 0 0 12px rgba(31,79,216,.5); }

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translate3d(0, 26px, 0) scale(.985); filter: blur(4px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1), filter .7s ease; transition-delay: var(--d, 0ms); will-change: opacity, transform; }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }
[data-reveal="left"]  { transform: translate3d(-36px, 0, 0); }
[data-reveal="right"] { transform: translate3d(36px, 0, 0); }
[data-reveal="pop"]   { transform: scale(.9); }
html.no-reveal [data-reveal] { opacity: 1; transform: none; filter: none; }

/* ---------- Header: glass that tightens on scroll (rules in 1.9.1 block below) ---------- */
.brand .logo-mark { transition: transform .4s cubic-bezier(.2,.8,.2,1), filter .4s ease; }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 6px 14px rgba(31,79,216,.45)); }

/* ---------- Hero ---------- */
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; animation: riseIn .9s cubic-bezier(.2,.8,.2,1) both; }
.hero h1 .line-media > span { animation-delay: .12s; }
.hero .lead { animation: fadeUp .8s .25s cubic-bezier(.2,.8,.2,1) both; }
.hero-actions { animation: fadeUp .8s .35s cubic-bezier(.2,.8,.2,1) both; }
.hero-stats { animation: fadeUp .8s .45s cubic-bezier(.2,.8,.2,1) both; }
.hero-kicker::before { animation: pulseDot 2s ease-in-out infinite; }
@keyframes riseIn { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 4px rgba(22,163,74,.18); } 50% { box-shadow: 0 0 0 9px rgba(22,163,74,.06); } }
.hero h1 .line-media > span { background: linear-gradient(90deg, var(--ink-soft) 0%, var(--cobalt) 40%, var(--flare) 70%, var(--ink-soft) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: riseIn .9s .12s cubic-bezier(.2,.8,.2,1) both, shimmerText 8s linear infinite; }
@keyframes shimmerText { 0% { background-position: 0 0; } 100% { background-position: 200% 0; } }

/* app window floats and gets a glowing aura */
.app-window { animation: floatY 7s ease-in-out infinite; transition: transform .25s ease; position: relative; }
.hero-grid > .app-window { opacity: 0; animation: floatY 7s ease-in-out infinite, fadeIn .9s .2s ease both; }
@keyframes fadeIn { to { opacity: 1; } }
.app-window::before { content: ''; position: absolute; inset: -18px; z-index: -1; border-radius: 30px; background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--tool-color, #1F4FD8) 35%, transparent), transparent 75%); filter: blur(18px); opacity: .9; animation: glowPulse 5s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes glowPulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.app-tabs button { transition: background .25s ease, transform .25s ease; }
.app-tabs button:hover { transform: translateY(-1px); }
.app-panel { animation: panelIn .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.app-progress i { transition: none; }

/* ---------- Page hero (tools / media / contact) ---------- */
.page-hero .orb { animation: orbFloat 9s ease-in-out infinite; }
.page-hero .orb-2 { animation-duration: 12s; animation-delay: -3s; }
.page-hero .orb-3 { animation-duration: 7s; animation-delay: -5s; }
@keyframes orbFloat { 0%, 100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-18px, 14px, 0); } }
.page-hero .glass { animation: glassTilt 10s ease-in-out infinite; }
@keyframes glassTilt { 0%, 100% { transform: translateY(-50%) rotate(-8deg); } 50% { transform: translateY(-56%) rotate(-4deg); } }
.page-hero .hero-icon { animation: floatY 6s ease-in-out infinite; }
.page-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); background-size: 250% 100%; animation: heroSheen 7s ease-in-out infinite; }
@keyframes heroSheen { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* ---------- Cards: 3D tilt (JS sets --rx/--ry/--mx/--my), spotlight, shine ---------- */
.tilt { transform-style: preserve-3d; transition: transform .18s ease, box-shadow .3s ease, border-color .3s ease; }
.tilt.is-tilting { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px) scale(1.01); box-shadow: 0 24px 50px -22px rgba(11,31,58,.45); }
.tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.55), transparent 45%); mix-blend-mode: soft-light; }
.tilt.is-tilting::after { opacity: 1; }
.tool-card, .service-card, .process article, .work-item, .detail-aside, .contact-card { position: relative; }
.tool-chip { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease; }
.tool-card:hover .tool-chip, .app-panel:hover .tool-chip { transform: translateY(-3px) rotate(-6deg) scale(1.08); box-shadow: 0 12px 24px -10px var(--tool-color, var(--cobalt)); }
.tool-card .tool-cover img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.tool-card:hover .tool-cover img { transform: scale(1.06); }
.tool-card-foot .link { transition: transform .25s ease; display: inline-block; }
.tool-card:hover .tool-card-foot .link { transform: translateX(4px); }
.process article { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.process article:hover { transform: translateY(-4px); border-color: var(--cobalt); box-shadow: 0 20px 40px -24px rgba(31,79,216,.5); }
.process article::before { transition: transform .3s ease, color .3s ease; display: inline-block; }
.process article:hover::before { transform: scale(1.15) rotate(-6deg); color: var(--flare); }

/* ---------- Portfolio ---------- */
.work-filter button { transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.work-filter button:active { transform: scale(.95); }

/* ---------- Buttons: shine sweep + ripple ---------- */
.btn { position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, background .2s ease, color .2s ease; }
.btn::before { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transition: left .55s ease; pointer-events: none; }
.btn:hover::before { left: 120%; }
.btn-primary:hover, .btn-flare:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(31,79,216,.7); }
.btn-flare:hover { box-shadow: 0 14px 28px -12px rgba(255,106,0,.7); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.5); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.btn svg { transition: transform .25s ease; }
.btn:hover svg { transform: translateX(3px); }

/* ---------- Inputs ---------- */
.field input, .field textarea, .field select { transition: border-color .2s ease, box-shadow .25s ease, transform .2s ease; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 0 0 0 4px rgba(31,79,216,.14), 0 10px 24px -16px rgba(31,79,216,.6); transform: translateY(-1px); }

/* ---------- Stats count-up ---------- */
.hero-stats b { font-variant-numeric: tabular-nums; }

/* ---------- Status flags & pills ---------- */
.sflag { transition: transform .2s ease; }
.tool-card:hover .sflag { transform: translateY(-1px); }

/* ---------- Chat launcher attention ---------- */
.chat-launch { animation: launcherIn .6s 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes launcherIn { from { transform: translateY(20px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; }
.site-footer::before { content: ''; position: absolute; left: 50%; top: -120px; width: 700px; height: 300px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(31,79,216,.45), transparent 65%); filter: blur(30px); pointer-events: none; animation: glowPulse 6s ease-in-out infinite; }
.site-footer a { transition: color .2s ease, transform .2s ease; display: inline-block; }
.site-footer a:hover { transform: translateX(3px); color: #fff; }

/* ---------- Page enter ---------- */
main { animation: pageIn .5s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .aero-bg i, .aero-bg::after { animation: none; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .tilt.is-tilting { transform: none; }
}
@media (max-width: 700px) { .aero-bg i { filter: blur(40px); opacity: .45; } }

/* ---------- 1.9.1 Header: full-bleed aero bar effects ---------- */
.header-aurora i:nth-child(1) { animation: auroraA 14s ease-in-out infinite alternate; }
.header-aurora i:nth-child(2) { animation: auroraB 17s ease-in-out infinite alternate; }
.header-aurora i:nth-child(3) { animation: auroraA 21s ease-in-out infinite alternate-reverse; }
@keyframes auroraA { from { transform: translateX(0) scale(1); opacity: .45; } to { transform: translateX(14vw) scale(1.15); opacity: .7; } }
@keyframes auroraB { from { transform: translateX(0) scale(1.1); opacity: .5; } to { transform: translateX(-16vw) scale(.9); opacity: .75; } }
.header-line { animation: lineFlow 6s linear infinite; }
@keyframes lineFlow { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.header-inner::after { content: ''; position: absolute; top: 0; bottom: 0; width: 28%; left: -40%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent); animation: headerSheen 9s ease-in-out infinite; }
@keyframes headerSheen { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }
.brand::before { animation: glowPulse 3.2s ease-in-out infinite; }
.nav-pill { transition: left .32s cubic-bezier(.2,.8,.2,1), width .32s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
.nav.has-pill .nav-pill { opacity: 1; }
.nav > a.is-active::before { animation: heroSheen 4.5s ease-in-out infinite; }
.nav > a { transition: color .2s ease, transform .25s cubic-bezier(.2,.8,.2,1); }
.nav > a:hover { transform: translateY(-1px); }
.site-header.is-scrolled .header-inner { height: 58px; background: linear-gradient(90deg, rgba(227,234,251,.97), rgba(255,255,255,.95) 40%, rgba(255,255,255,.95) 60%, rgba(234,240,252,.97)); box-shadow: 0 14px 34px -16px rgba(11,31,58,.45); }
.header-inner { transition: height .3s ease, box-shadow .3s ease, background .3s ease; }
/* featured tool card extras */
.tool-facts div { transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; }
.tool-card:hover .tool-facts div { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(11,31,58,.45); }
.tool-card:hover .tool-facts div:nth-child(2) { transition-delay: .05s; } .tool-card:hover .tool-facts div:nth-child(3) { transition-delay: .1s; }
@media (prefers-reduced-motion: reduce) { .header-aurora i, .header-line, .header-inner::after, .brand::before, .nav > a.is-active::before { animation: none; } }
.header-deco i { animation: decoFloat 7s ease-in-out infinite; }
.header-deco i:nth-child(2n) { animation-duration: 9s; animation-delay: -3s; } .header-deco i:nth-child(3n) { animation-duration: 11s; animation-delay: -5s; }
.header-deco i:nth-child(3) { animation-name: decoSpin; animation-duration: 14s; } .header-deco i:nth-child(7) { animation-name: decoSpin; animation-duration: 18s; }
@keyframes decoFloat { 0%, 100% { translate: 0 0; } 50% { translate: 6px -7px; } }
@keyframes decoSpin { 0% { rotate: 0deg; translate: 0 0; } 50% { translate: 4px -6px; } 100% { rotate: 360deg; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .header-deco i { animation: none; } }

/* reveal offsets must never cause horizontal scroll (clip keeps sticky working) */
body { overflow-x: clip; }

.page-hero .hero-bg { animation: heroZoom 22s ease-in-out infinite alternate; transform-origin: 60% 50%; }
@keyframes heroZoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .page-hero .hero-bg { animation: none; } }
