/* Motion + depth layer. Everything here is progressive: content is visible without JS,
   and the whole file is neutralised by prefers-reduced-motion and the .lite (low-end) class. */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease-in both; }
::view-transition-new(root) { animation: vt-in .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* Reveal: only elements JS marked as below the fold start hidden, and a timeout releases them. */
.rv-wait > * { opacity: 0; transform: translateY(22px) scale(.985); }
.rv-in > * { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .7s cubic-bezier(.2,.8,.2,1); }
.rv-in > *:nth-child(2) { transition-delay: .07s; } .rv-in > *:nth-child(3) { transition-delay: .14s; }
.rv-in > *:nth-child(4) { transition-delay: .21s; } .rv-in > *:nth-child(n+5) { transition-delay: .26s; }
@media print { .rv-wait > * { opacity: 1 !important; transform: none !important; } }

/* Hero 3D stage */
.hero { overflow: hidden; }
.hero-visual { perspective: 1200px; }
.stage3d { position: relative; transform-style: preserve-3d; transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -12deg)); transition: transform .5s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.stage3d > * { transform: translateZ(var(--z, 0)); }
.stage3d .chip { transform: translateZ(var(--z, 0)); }
.cert { position: absolute; left: -9%; bottom: -16%; width: 47%; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 30px 50px -24px rgba(11,42,91,.45); }
.cert::before { content: ''; position: absolute; inset: 6px; border: 1.5px solid #dfe6f3; border-radius: 11px; pointer-events: none; }
.cert-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.cert-no { color: var(--blue); }
.cert-std { font: 800 1.5rem/1.1 var(--display); color: var(--navy); margin-top: 10px; }
.cert-sub { font-size: 13px; color: var(--ink-2); }
.cert-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.cert-line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #c9d4e8 0 6px, transparent 6px 10px); }
.coin { width: 56px; height: 56px; position: relative; transform-style: preserve-3d; animation: coin 7s linear infinite; }
.coin > div { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; backface-visibility: hidden; font: 800 14px/1 var(--display); }
.coin-f { background: var(--yellow); color: var(--navy); box-shadow: inset 0 0 0 4px #e3b20c; }
.coin-b { background: var(--navy); color: var(--yellow); transform: rotateY(180deg); box-shadow: inset 0 0 0 4px #1d4a8f; }
@keyframes coin { to { transform: rotateY(360deg); } }
.hv-card { z-index: 2; }

/* Counters + standards marquee */
.counters ul { list-style: none; margin: 0 auto; padding: 28px var(--m); max-width: var(--max); display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.counters li { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; }
.counters b { display: block; font: 800 2.2rem/1 var(--display); color: var(--blue); font-variant-numeric: tabular-nums; }
.counters span { color: var(--ink-2); font-size: 14px; }
.std-marquee { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.std-marquee .logo { background: var(--soft); border: 1px solid var(--line); min-width: 120px; height: 44px; color: var(--navy); font: 800 15px/1 var(--display); }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Pinned "How it works" (desktop only) */
.pin-bar { height: 4px; background: var(--soft-2); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.pin-bar span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--blue); border-radius: 4px; transition: width .1s linear; }
.step-grid li { transition: border-color .3s, background-color .3s, transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.step-grid li.on { border-color: var(--blue); background: var(--blue-tint); transform: translateY(-6px); box-shadow: 0 18px 30px -22px rgba(31,95,224,.6); }
.step-grid li.done::before { color: var(--blue); }
@media (min-width: 901px) {
  .js .pin { height: calc(var(--n) * 28vh + 45vh); }
  .js .pin-sticky { position: sticky; top: calc(50vh - 120px); }
}

/* Tilt cards */
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.tilt.tilting { transition: transform .08s linear; }

/* Mega menu + tabs */
.js .mega { display: block; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s .25s; }
.js .mega.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
.js .mega[hidden] { display: block; }
.mega-col { transition: transform .3s ease; }
.mega.open .mega-col { animation: mega-col .35s cubic-bezier(.2,.8,.2,1) both; }
.mega.open .mega-col:nth-child(2) { animation-delay: .03s; } .mega.open .mega-col:nth-child(3) { animation-delay: .06s; } .mega.open .mega-col:nth-child(n+4) { animation-delay: .09s; }
@keyframes mega-col { from { opacity: 0; transform: translateY(8px); } }
.tabs button { transition: background-color .2s, color .2s, border-color .2s, transform .15s; }
.tabs button:active { transform: scale(.96); }
.exp { transition: opacity .3s, transform .3s; }
.exp.pop { animation: pop .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.tabbar a { transition: color .2s, border-color .25s; }

/* Buttons + forms */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s ease; z-index: -1; }
.btn:hover::after { transform: translateX(120%); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(11,42,91,.6); }
.enq input, .enq select, .enq textarea { transition: border-color .15s, box-shadow .2s, transform .15s; }
.enq input:focus, .enq textarea:focus { transform: translateY(-1px); }
.enq .fld label { transition: color .15s; }
.enq .fld:focus-within label { color: var(--blue); }
.enq.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.enq.sending button[type=submit] { opacity: .8; }

/* Parallax depth */
[data-depth] { will-change: transform; }

/* Floating contact cluster (desktop: left side; chat + live call stay on the right) */
.floats { position: fixed; left: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column-reverse; gap: 10px; align-items: flex-start; }
.fl { display: inline-flex; align-items: center; gap: 0; height: 52px; min-width: 52px; padding: 0 15px; border-radius: 999px; border: 0; color: #fff; text-decoration: none; cursor: pointer;
  font: 700 14px/1 var(--text); box-shadow: 0 12px 24px -12px rgba(0,0,0,.5); transition: transform .2s, gap .25s, padding .25s; }
.fl span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease; }
.fl:hover, .fl:focus-visible { transform: translateY(-2px); gap: 8px; }
.fl:hover span, .fl:focus-visible span { max-width: 180px; }
.fl-wa { background: #1f8f4e; }
.fl-call { background: var(--navy); }
.fl-top { background: #fff; color: var(--navy); border: 1px solid var(--line); padding: 0; width: 44px; min-width: 44px; height: 44px; justify-content: center; }
.fl-top[hidden] { display: none; }
.fl-call::before { content: ''; position: absolute; width: 52px; height: 52px; border-radius: 50%; left: 0; border: 2px solid var(--navy); opacity: 0; animation: ring 2.6s ease-out infinite; }
.fl-call { position: relative; }
@keyframes ring { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }

/* Mobile bottom bar (like the D&D site); floats move out of its way */
.mbar { display: none; }
@media (max-width: 760px) {
  .mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(11,42,91,.5); }
  .mbar a { display: grid; place-items: center; min-height: 44px; border-radius: 10px; font: 700 14.5px/1 var(--text); text-decoration: none; background: var(--soft-2); color: var(--navy); }
  .mbar .mbar-wa { background: #1f8f4e; color: #fff; } .mbar .mbar-q { background: var(--yellow); color: var(--navy); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .floats .fl-call, .floats .fl-wa { display: none; }
  .floats { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .counters ul { grid-template-columns: 1fr 1fr; }
  .cert { left: 0; width: 70%; bottom: -10%; }
}

/* Low-end devices and reduced motion: no 3D, no loops */
.lite .stage3d { transform: none !important; }
.lite .coin, .lite .chip, .lite .marquee-track, .lite .fl-call::before { animation: none !important; }
.lite .tilt { transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .stage3d { transform: none !important; }
  .rv-wait > * { opacity: 1 !important; transform: none !important; }
  .coin, .chip, .marquee-track, .fl-call::before, .mega-col, .exp.pop { animation: none !important; }
  .btn::after { display: none; }
}
.hero-visual .hv-card { width: min(250px, 46%); right: 0; bottom: -6px; padding: 14px; }
@media (max-width: 760px) { .hero-visual .hv-card { display: none; } .cert { width: 64%; } }
/* VegaDesk chat (loaded by the D&D chat-widget bridge) has no offset option: lift it above the mobile bar. */
@media (max-width: 760px) { #vegadesk-root { bottom: calc(68px + env(safe-area-inset-bottom)) !important; } }
/* Hero vertical video (replaces the photo when on). Chips and cards sit around it. */
.stage3d:has(.hv-vid) { display: flex; justify-content: flex-end; padding: 10px 6% 10px 0; min-height: 0; }
.hv-vid { position: relative; width: min(330px, 56%); aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; background: var(--navy);
  box-shadow: 0 40px 70px -36px rgba(11,42,91,.75); border: 4px solid #fff; }
.hv-vid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hv-ctrl { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.hv-ctrl button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(11,42,91,.78); color: #fff; font: 700 13.5px/1 var(--text); backdrop-filter: blur(6px); }
.hv-ctrl .hv-sound { background: var(--yellow); color: var(--navy); }
.hv-ctrl .hv-pause { width: 40px; padding: 0; justify-content: center; }
.hv-ctrl button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hv-pause .i-play, .hv-pause[aria-pressed="true"] .i-pause { display: none; } .hv-pause[aria-pressed="true"] .i-play { display: inline; }
.hv-vid.sound .hv-sound span { display: none; } .hv-vid.sound .hv-sound { width: 40px; padding: 0; justify-content: center; }
.stage3d:has(.hv-vid) .cert { left: 0; bottom: 12%; width: 44%; min-width: 200px; }
.stage3d:has(.hv-vid) .chip-1 { top: 4%; left: 6%; } .stage3d:has(.hv-vid) .chip-2 { top: 40%; right: -2%; } .stage3d:has(.hv-vid) .chip-3 { bottom: auto; top: 22%; left: 0; }
.hero-visual:has(.hv-vid) .hv-card { left: 0; right: auto; bottom: auto; top: 44%; width: min(230px, 40%); }
@media (max-width: 900px) {
  .stage3d:has(.hv-vid) { justify-content: center; padding: 8px 0; }
  .hv-vid { width: min(300px, 74vw); }
  .stage3d:has(.hv-vid) .cert { display: none; }
  .stage3d:has(.hv-vid) .cert-std { font-size: 1.1rem; } .stage3d:has(.hv-vid) .coin { width: 40px; height: 40px; }
  .stage3d:has(.hv-vid) .chip-2 { right: 0; } .stage3d:has(.hv-vid) .chip-3 { display: none; }
}
