/* FAQ illustrations (templates/site/faq_art.html), replacing ftbk_faq_new.png and bg_join_1.png.
   Same kit as the Identity Protect art (identity-art.css, not loaded here): every piece is laid out in px at its
   original 1x size inside .ipa__s and scaled to the column by identity-art.js (--s). Motion: the entrance runs once
   when a piece scrolls in (.is-in), loops run only while it is on screen (.is-on). Only transform / opacity animate.
   Reduced motion = the static art. */

/* ---------- kit (same rules as identity-art.css) ---------- */
.ipa {
    --s: initial; /* unset until identity-art.js sets it: .ipa__s falls back to the CSS scale */
    position: relative;
    display: inline-block;
    vertical-align: top;
    width: calc(var(--w) * 1px);
    max-width: 100%;
    aspect-ratio: var(--w) / var(--h);
    font-size: 0;
    text-align: left;
    line-height: 1.2;
    color: #fff;
    container-type: inline-size;
}
.ipa__s {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--w) * 1px);
    height: calc(var(--h) * 1px);
    /* box width over the 1x width (tan(atan2(a, b)) = a / b); --s from identity-art.js wins once set */
    transform: scale(var(--s, min(1, tan(atan2(100cqw, var(--w) * 1px)))));
    transform-origin: 0 0;
}
.ipa__s > *, .ipa__s * { box-sizing: border-box; }
.ipa svg { display: block; overflow: visible; }
.ipa i { display: block; }
/* the hero column is a shrink-to-fit flex item: let it shrink like the <img> it replaced */
.ftbk_col_right { min-width: 0; }

@keyframes ipa-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes ipa-fade { from { opacity: 0; } }
@keyframes ipa-pop { from { opacity: 0; scale: .86; } }
@keyframes ipa-grow { from { scale: 0 1; } }
@keyframes fqa-growv { from { scale: 1 0; } }

.ipa.is-armed:not(.is-in) .a-rise,
.ipa.is-armed:not(.is-in) .a-fade,
.ipa.is-armed:not(.is-in) .a-pop { opacity: 0; }
.ipa.is-armed:not(.is-in) .a-grow { scale: 0 1; }
.ipa.is-armed:not(.is-in) .fqa-gv { scale: 1 0; }
.ipa.is-in .a-rise { animation: ipa-rise .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
.ipa.is-in .a-fade { animation: ipa-fade .9s ease var(--d, 0s) backwards; }
.ipa.is-in .a-pop { animation: ipa-pop .8s cubic-bezier(.2, .8, .2, 1.1) var(--d, 0s) backwards; }
.ipa.is-in .a-grow { animation: ipa-grow .9s cubic-bezier(.3, .7, .2, 1) var(--d, 0s) backwards; }
.ipa.is-in .fqa-gv { animation: fqa-growv .8s cubic-bezier(.3, .7, .2, 1) var(--d, 0s) backwards; }
/* identity resting scale (looks the same as none): each part keeps its transform when its entrance ends, so the end
   of the entrance does not relayout the page once per part (join entrance: 13 layouts -> 2) */
.ipa .a-rise, .ipa .a-fade, .ipa .a-pop, .ipa .a-grow, .ipa .fqa-gv { scale: 1; }
.ipa .a-grow { transform-origin: 0 50%; }
.ipa .fqa-gv { transform-origin: 50% 0; }

/* off screen: drop the loops entirely (not just pause) so their layers are released */
.ipa:not(.is-on) *, .ipa:not(.is-on) *::before, .ipa:not(.is-on) *::after { animation-name: none !important; }
@media (prefers-reduced-motion: reduce) {
    .ipa *, .ipa *::before, .ipa *::after { animation: none !important; }
}

/* Hero (at or near the fold at every width): its entrance starts with the first frame instead of when the deferred
   identity-art.js adds .is-armed / .is-in, so the art is never painted, hidden and drawn again. Same keyframes and timing.
   On phones, where it sits just below the fold, the entrance therefore plays at load rather than on scroll. */
@media (prefers-reduced-motion: no-preference) {
    .fqa-hero .a-rise { animation: ipa-rise .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards !important; }
    .fqa-hero .a-fade { animation: ipa-fade .9s ease var(--d, 0s) backwards !important; }
    .fqa-hero .a-pop { animation: ipa-pop .8s cubic-bezier(.2, .8, .2, 1.1) var(--d, 0s) backwards !important; }
    .fqa-hero .a-grow { animation: ipa-grow .9s cubic-bezier(.3, .7, .2, 1) var(--d, 0s) backwards !important; }
    .fqa-hero .fqa-gv { animation: fqa-growv .8s cubic-bezier(.3, .7, .2, 1) var(--d, 0s) backwards !important; }
    .fqa-hero.is-armed:not(.is-in) .a-rise, .fqa-hero.is-armed:not(.is-in) .a-fade, .fqa-hero.is-armed:not(.is-in) .a-pop { opacity: 1; }
    .fqa-hero.is-armed:not(.is-in) .a-grow, .fqa-hero.is-armed:not(.is-in) .fqa-gv { scale: 1; }
}

/* ---------- loops ---------- */
@keyframes fqa-float { 50% { transform: translateY(-3px); } }
@keyframes fqa-breathe { 50% { transform: scale(1.05); opacity: .8; } }
@keyframes fqa-ping { 0% { transform: scale(1); opacity: .5; } 55%, 100% { transform: scale(1.42); opacity: 0; } }
@keyframes fqa-bob-0 { 50% { transform: translateY(-4px); } }
@keyframes fqa-bob-1 { 50% { transform: translateY(3px); } }
@keyframes fqa-bob-2 { 50% { transform: translate(2px, -3px); } }
.fqa-float { animation: fqa-float 6s ease-in-out 1.4s infinite; }
.fqa-float--b { animation-delay: 4.4s; }
.fqa-ring {
    position: absolute; inset: -1px; border-radius: 50%;
    border: 1px solid rgba(225, 230, 255, .7);
    opacity: 0;
    animation: fqa-ping 4.2s cubic-bezier(.2, .6, .3, 1) 1.8s infinite;
}

/* ---------- 1. hero: chat card, Banrox disc, question card ---------- */
.fqa-hero__glow { position: absolute; left: 16px; top: 200px; width: 241px; height: 241px; }
.fqa-hero__glow > i {
    width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(77, 103, 223, .4) 53%, rgba(77, 103, 223, .38) 56%, rgba(77, 103, 223, .31) 61%, rgba(77, 103, 223, .24) 66%, rgba(77, 103, 223, .18) 71%, rgba(77, 103, 223, .14) 76%, rgba(77, 103, 223, .105) 81%, rgba(77, 103, 223, .075) 86%, rgba(77, 103, 223, .04) 91%, rgba(77, 103, 223, .022) 96%, rgba(77, 103, 223, 0) 100%);
    animation: fqa-breathe 5.5s ease-in-out 1.4s infinite;
}

/* dashed wires: card -> disc -> card */
.fqa-hero__wv { position: absolute; left: 135px; top: 150px; width: 3px; height: 108px; }
.fqa-hero__wh { position: absolute; left: 197px; top: 319px; width: 139px; height: 3px; }
.fqa-hero__wv path, .fqa-hero__wh path { fill: none; stroke: rgba(253, 253, 255, .5); stroke-width: 1.25; stroke-dasharray: 3 5.2; }
.fqa-hero__wh path { stroke-dasharray: 3 5.17; }
/* a light runs down the wire into the disc, then out to the question card */
.fqa-hero__pv, .fqa-hero__ph {
    position: absolute; width: 8px; height: 8px; border-radius: 50%;
    background: radial-gradient(closest-side, #fff, rgba(200, 210, 255, .6) 45%, rgba(200, 210, 255, 0));
    opacity: 0;
}
.fqa-hero__pv { left: -2.4px; top: 6px; animation: fqa-pv 5.6s ease-in-out 1.6s infinite; }
.fqa-hero__ph { left: 6px; top: -2.3px; animation: fqa-ph 5.6s ease-in-out 1.6s infinite; }
@keyframes fqa-pv { 0% { transform: translateY(0); opacity: 0; } 6% { opacity: .9; } 30% { opacity: .9; } 36%, 100% { transform: translateY(96px); opacity: 0; } }
@keyframes fqa-ph { 0%, 40% { transform: translateX(0); opacity: 0; } 46% { opacity: .9; } 70% { opacity: .9; } 76%, 100% { transform: translateX(122px); opacity: 0; } }

.fqa-hero__chat, .fqa-hero__ask { position: absolute; width: 160px; height: 160px; }
.fqa-hero__chat { left: 56px; top: 0; }
.fqa-hero__ask { left: 329px; top: 240px; }
.fqa-hero__card {
    position: absolute; inset: 0; border-radius: 20px;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .15);
}
.fqa-hero__chat .fqa-hero__card { background: linear-gradient(168deg, #2d3a88, #3349b6); }
.fqa-hero__ask .fqa-hero__card { background: linear-gradient(100deg, #2f42a0 0%, #2f3f95 25%, #2e3d8d 40%, #2c3982 50%, #293574 63%, #28336c 80%, #283166 92%); }

/* chat bubbles: the back one is cut around the front one (mask), so both stay put inside the floating card */
.fqa-hero__back, .fqa-hero__front { position: absolute; left: 44px; top: 45px; width: 76px; height: 70px; }
.fqa-hero__back path { fill: rgba(255, 255, 255, .1); }
.fqa-hero__ln { position: absolute; left: 60px; width: 30px; height: 4px; }
.fqa-hero__ln rect { fill: #fafafb; }
/* the two text lines in the bubble re-type now and then */
@keyframes fqa-type { 0%, 100% { transform: none; } 12% { transform: scaleX(.55); } 26% { transform: none; } }
.fqa-hero__ln > svg { transform-origin: 0 50%; animation: fqa-type 5.6s ease-in-out 2.4s infinite; }
.fqa-hero__ln:nth-of-type(2) > svg { animation-delay: 2.7s; }

/* question: soft offset shadow + white disc with a gradient "?" */
.fqa-hero__qs, .fqa-hero__qd { position: absolute; width: 59px; height: 59px; }
.fqa-hero__qs { left: 55px; top: 55px; }
.fqa-hero__qs circle { fill: rgba(255, 255, 255, .1); }
.fqa-hero__qd { left: 48px; top: 48px; }
.fqa-hero__qd circle { fill: #fff; }
.fqa-hero__qm { position: absolute; left: 17px; top: 12px; width: 24px; height: 34px; transform-origin: 50% 85%; animation: fqa-wobble 5.6s ease-in-out 3.6s infinite; }
.fqa-hero__qm path, .fqa-hero__qm circle { fill: url(#fqaBrand); }
@keyframes fqa-wobble { 0%, 24%, 100% { transform: none; } 6% { transform: rotate(-9deg); } 13% { transform: rotate(6deg); } 19% { transform: rotate(-2deg); } }

/* Banrox disc */
.fqa-hero__disc {
    position: absolute; left: 72px; top: 255px; width: 129px; height: 129px; border-radius: 50%;
    border: 1px solid transparent;
    /* fill: brand gradient + soft top light; 1px rim: white fading from the top-left to the bottom-right */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .076), rgba(255, 255, 255, 0) 20%) padding-box,
        linear-gradient(265.04deg, #8585e9, #264bff) padding-box,
        linear-gradient(160deg, rgba(255, 255, 255, .55) 11%, rgba(255, 255, 255, 0) 89%) border-box,
        linear-gradient(265.04deg, #8585e9, #264bff) border-box;
}
.fqa-mark { position: absolute; fill: #fff; }
.fqa-hero__disc .fqa-mark { left: 35px; top: 32px; translate: .5px .5px; }

/* ---------- 2. join: Banrox disc under dashed orbit arcs ---------- */
.fqa-join__defs { position: absolute; }
.fqa-join__arc { position: absolute; }
.fqa-join__arc path { fill: none; stroke: url(#fqaArcG); stroke-width: 1.5; stroke-dasharray: 4 8; stroke-dashoffset: 2; }
/* a slow ripple outwards from the disc */
@keyframes fqa-wave { 0%, 100% { opacity: 1; } 18% { opacity: .35; } 40% { opacity: 1; } }
.fqa-join__arc > svg { animation: fqa-wave 5s ease-in-out calc(1.2s + var(--i) * .35s) infinite; }

.fqa-join__dot { position: absolute; width: 48px; height: 48px; }
.fqa-join__disc { width: 100%; height: 100%; border-radius: 50%; background: #fff; animation: var(--bob) 6s ease-in-out calc(1.2s + var(--d) * 2) infinite; }
.fqa-join__disc.is-blue { background: linear-gradient(265.04deg, #8585e9, #264bff); }
.fqa-join__disc path, .fqa-join__disc circle { fill: none; stroke: #264bff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fqa-join__disc.is-blue path { stroke: #fff; }

.fqa-join__logo {
    position: absolute; left: 207px; top: 207px; width: 128px; height: 128px; border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(255, 255, 255, 0) 78%, rgba(255, 255, 255, .04)),
        linear-gradient(180deg, #373f88, #4652b6);
}
.fqa-join__logo .fqa-mark { left: 36px; top: 32px; }
.fqa-join__logo .fqa-ring { animation-duration: 4.8s; animation-delay: 2s; }
