/* ==========================================================================
   Home page 3D layer (loaded only by home.php; behaviour in assets/js/home-fx3d.js).
   To switch every effect off, remove the two home-fx3d lines from home.php.
   ========================================================================== */

/* ---------- 1. HERO: depth scene, 3D favicon coin, orbit rings, floating chips ---------- */
.tp-hero-right-side-five { --mx: 0; --my: 0; }
.tp-hero-right-side-five .tp-yellow-circle-five { translate: calc(var(--mx) * -16px) calc(var(--my) * -12px); }
.tp-hero-right-side-five .bp-hero-shape-4 { translate: calc(var(--mx) * 22px) calc(var(--my) * 16px); }

/* favicon: a real turning coin with two tilted orbits */
.tp-hero-area .twk-hero-logo { perspective: 700px; transform-style: preserve-3d; translate: calc(var(--mx) * 30px) calc(var(--my) * 22px); animation: fx3dBob 5s ease-in-out infinite; }
.tp-hero-area .twk-hero-logo .twk-coin { animation: fx3dCoin 7s cubic-bezier(.45, .05, .55, .95) infinite; }
.tp-hero-area .twk-hero-logo .twk-coin__face { filter: drop-shadow(0 10px 16px rgba(22, 158, 245, .5)); }
.fx3d-orbit { position: absolute; inset: -16%; border-radius: 50%; pointer-events: none; transform-style: preserve-3d; }
.fx3d-orbit::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(22, 158, 245, .45); }
.fx3d-orbit::after { content: ""; position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: #169ef5; box-shadow: 0 0 12px 3px rgba(22, 158, 245, .65); }
.fx3d-orbit--a { animation: fx3dOrbitA 8s linear infinite; }
.fx3d-orbit--b { inset: -28%; animation: fx3dOrbitB 12s linear infinite; }
.fx3d-orbit--b::before { border-color: rgba(255, 215, 73, .75); }
.fx3d-orbit--b::after { background: #ffd749; box-shadow: 0 0 12px 3px rgba(255, 215, 73, .8); }
@keyframes fx3dBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fx3dCoin { 0%, 100% { transform: rotateY(-38deg) rotateX(10deg); } 50% { transform: rotateY(38deg) rotateX(-8deg); } }
@keyframes fx3dOrbitA { from { transform: rotateX(68deg) rotateY(-14deg) rotateZ(0deg); } to { transform: rotateX(68deg) rotateY(-14deg) rotateZ(360deg); } }
@keyframes fx3dOrbitB { from { transform: rotateX(62deg) rotateY(26deg) rotateZ(360deg); } to { transform: rotateX(62deg) rotateY(26deg) rotateZ(0deg); } }

/* floating glass chips around the hero picture */
.fx3d-chip { position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 9px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(255, 255, 255, .95); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 22px 36px -18px rgba(11, 42, 74, .45), 0 2px 6px rgba(11, 42, 74, .08); color: #0b2a4a; font-size: 15.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; pointer-events: none;
  translate: calc(var(--mx) * var(--depth, 20px)) calc(var(--my) * var(--depth, 20px)); animation: fx3dChip 6s ease-in-out infinite, fx3dChipIn 1s cubic-bezier(.16, 1, .3, 1) var(--in, 1s) backwards; }
.fx3d-chip i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #169ef5; color: #fff; font-size: 18.5px; }
.fx3d-chip--web { top: 44%; left: -4%; --depth: 34px; --in: 1.1s; }
.fx3d-chip--app { top: 27%; right: -2%; --depth: 24px; --in: 1.35s; animation-delay: -2s, 1.35s; }
.fx3d-chip--app i { background: #ffd749; color: #0b2a4a; }
.fx3d-chip--seo { bottom: 12%; left: 4%; --depth: 44px; --in: 1.6s; animation-delay: -4s, 1.6s; }
.fx3d-chip--seo i { background: #0b2a4a; }
@keyframes fx3dChip { 0%, 100% { transform: perspective(600px) rotateY(-9deg) rotateX(4deg) translateY(0); } 50% { transform: perspective(600px) rotateY(9deg) rotateX(-4deg) translateY(-12px); } }
@keyframes fx3dChipIn { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@media (max-width: 767px) { .fx3d-chip { font-size: 14px; padding: 6px 11px 6px 6px; gap: 7px; } .fx3d-chip i { width: 26px; height: 26px; font-size: 15px; } .fx3d-chip--app { right: 0; } .fx3d-chip--web { left: 0; } }

/* ---------- 2. EVERY SECTION: 3D entrance (upgrades the page's existing scroll reveal) ---------- */
html.twk-js.fx3d [data-anim="fade-up"].is-in    { animation-name: fx3dUp; animation-duration: 1.15s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
html.twk-js.fx3d [data-anim="fade-down"].is-in  { animation-name: fx3dDown; animation-duration: 1.15s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
html.twk-js.fx3d [data-anim="fade-left"].is-in  { animation-name: fx3dFromRight; animation-duration: 1.2s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
html.twk-js.fx3d [data-anim="fade-right"].is-in { animation-name: fx3dFromLeft; animation-duration: 1.2s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
html.twk-js.fx3d [data-anim="zoom-in"].is-in    { animation-name: fx3dZoom; animation-duration: 1.2s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
@keyframes fx3dUp        { from { opacity: 0; transform: perspective(1100px) translate3d(0, 56px, -90px) rotateX(22deg); } to { opacity: 1; transform: perspective(1100px) translate3d(0, 0, 0) rotateX(0); } }
@keyframes fx3dDown      { from { opacity: 0; transform: perspective(1100px) translate3d(0, -46px, -90px) rotateX(-20deg); } to { opacity: 1; transform: perspective(1100px) translate3d(0, 0, 0) rotateX(0); } }
@keyframes fx3dFromRight { from { opacity: 0; transform: perspective(1200px) translate3d(60px, 0, -110px) rotateY(-20deg); } to { opacity: 1; transform: perspective(1200px) translate3d(0, 0, 0) rotateY(0); } }
@keyframes fx3dFromLeft  { from { opacity: 0; transform: perspective(1200px) translate3d(-60px, 0, -110px) rotateY(20deg); } to { opacity: 1; transform: perspective(1200px) translate3d(0, 0, 0) rotateY(0); } }
@keyframes fx3dZoom      { from { opacity: 0; transform: perspective(1100px) translate3d(0, 30px, -240px) rotateX(10deg); } to { opacity: 1; transform: perspective(1100px) translate3d(0, 0, 0) rotateX(0); } }

/* ---------- 3. CARDS: 3D tilt that follows the pointer, with a moving light ---------- */
.fx3d-card { position: relative; }
.fx3d-card.is-tilting { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-8px) !important; transition: transform .18s ease-out, box-shadow .3s ease !important; box-shadow: 0 36px 54px -30px rgba(11, 66, 120, .55); z-index: 2; }
.fx3d-card.is-leaving { transition: transform .6s cubic-bezier(.16, 1, .3, 1), box-shadow .5s ease !important; }
.fx3d-glare { position: absolute; inset: 0; z-index: 5; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(108, 196, 250, .22), rgba(255, 255, 255, 0) 55%); }
.fx3d-card.is-tilting > .fx3d-glare { opacity: 1; }

/* icons lift out of the card while it tilts */
.twk-why-card.is-tilting > :not(.fx3d-glare):first-child { translate: 0 -4px; }

/* client logo tiles pop forward */
.twk-trust__tile { transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s ease; }
@media (hover: hover) {
  .twk-trust__tile:hover { transform: perspective(600px) translateZ(36px) rotateX(8deg) rotateY(-8deg); box-shadow: 0 26px 34px -20px rgba(11, 42, 74, .5); position: relative; z-index: 3; }
}

/* ---------- 4. Headline highlights draw themselves in ---------- */
html.fx3d .twk-h2 .twk-hl { background-repeat: no-repeat; }
html.twk-js.fx3d [data-anim].is-in .twk-hl { animation: fx3dMark 1.1s cubic-bezier(.16, 1, .3, 1) .45s backwards; }
@keyframes fx3dMark { from { background-size: 0% 100%; } }

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  .tp-hero-area .twk-hero-logo, .tp-hero-area .twk-hero-logo .twk-coin, .fx3d-orbit, .fx3d-chip { animation: none !important; translate: none !important; }
  .fx3d-card.is-tilting { transform: none !important; }
  html.twk-js.fx3d [data-anim].is-in { animation: none !important; }
}

/* chips sit above the picture, and all three are visible on a normal laptop screen */
.tp-hero-right-side-five .fx3d-chip { z-index: 12; }
.fx3d-chip--seo { top: 66%; bottom: auto; left: auto; right: -3%; }
.fx3d-chip--web { top: 58%; left: -5%; }
@media (max-width: 767px) { .fx3d-chip--seo { top: 70%; right: 2%; } .fx3d-chip--web { top: 48%; left: 0; } }


/* ---------- Section headings: words flip up in 3D ---------- */
/* words of a heading flip up in 3D, one after another */
.fx3d-split { perspective: 900px; }
.fx3d-split .fx3d-word { display: inline-block; transform-origin: 50% 100%; backface-visibility: hidden; }
.fx3d-words-wait .fx3d-word { opacity: 0; transform: translate3d(0, .5em, -60px) rotateX(-75deg); }
.fx3d-words-wait.fx3d-words-in .fx3d-word { animation: fx3dWord 1s cubic-bezier(.16, 1, .3, 1) calc(var(--i, 0) * 75ms + 80ms) both; }
@keyframes fx3dWord { from { opacity: 0; transform: translate3d(0, .5em, -60px) rotateX(-75deg); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }


@media (prefers-reduced-motion: reduce) {
  .fx3d-words-wait .fx3d-word, .fx3d-await { opacity: 1 !important; transform: none !important; animation: none !important; }
  .fx3d-flyer { display: none !important; }
}

/* word wrappers must not pick up the headings' "every span" highlight / gradient styles */
.twk-services__head h2 span.fx3d-word, .twk-trust__title span.fx3d-word, .twk-pf__title span.fx3d-word, main h2 span.fx3d-word {
  padding: 0; background: none; color: inherit; -webkit-text-fill-color: currentColor; -webkit-background-clip: border-box; background-clip: border-box; box-decoration-break: slice; }
.twk-trust__title span.fx3d-word:not(.fx3d-words-in *) { animation: none; }
.fx3d-words-wait.fx3d-words-done .fx3d-word { opacity: 1; transform: none; filter: none; animation: none; }


/* ---------- Phones and tablets: keep the face clear. All three labels sit below the chin. ---------- */
@media (max-width: 991.98px) {
  .tp-hero-right-side-five .fx3d-chip { right: auto; bottom: auto; white-space: nowrap; }
  .tp-hero-right-side-five .fx3d-chip--web { top: 69%; left: 0; }
  .tp-hero-right-side-five .fx3d-chip--app { top: 69%; left: auto; right: 0; }
  .tp-hero-right-side-five .fx3d-chip--seo { top: 85%; left: 0; right: 0; width: max-content; margin-inline: auto; }
}@media (max-width: 339.98px) {   /* very narrow screens: smaller labels so they do not collide */
  .tp-hero-right-side-five .fx3d-chip { gap: 5px; padding: 4px 8px 4px 4px; border-radius: 10px; font-size: 11px; line-height: 1.2; }
  .tp-hero-right-side-five .fx3d-chip i { width: 20px; height: 20px; border-radius: 7px; font-size: 11px; }
  .tp-hero-right-side-five .fx3d-chip--web, .tp-hero-right-side-five .fx3d-chip--app { top: 67%; }
  .tp-hero-right-side-five .fx3d-chip--seo { top: 85%; }
}