/* "Why Choose ALFIDAONE?": the motion layer, loaded after why.css on the home page only. */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------
 * Motion (js/why.js adds the reveal and the pointer effects). The cards come in from their own side one after the other; with a mouse a soft light follows the
 * pointer and the card leans towards it; the pictures pan very slowly (Ken Burns) and zoom on hover; the bar under each picture flows; a number sits on each
 * picture; the heading has a gold-blue accent; two pale glows float behind the section. transform / opacity only. Without the script, on touch screens or under
 * reduced motion everything is simply shown (no tilt, no reveal, no pan).
 * ------------------------------------------------------------------------------------------------------------------------------------------------- */
.why { position: relative; overflow: hidden; isolation: isolate; }
.why::before, .why::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.why::before { inline-size: 440px; block-size: 440px; inset-block-start: -160px; inset-inline-start: -120px; background: rgba(22, 119, 255, .12); animation: why-float 20s ease-in-out infinite alternate; }
.why::after { inline-size: 400px; block-size: 400px; inset-block-end: -170px; inset-inline-end: -100px; background: rgba(201, 163, 73, .13); animation: why-float 24s ease-in-out infinite alternate-reverse; }
@keyframes why-float { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(44px, 28px, 0) scale(1.16); } }
.why .section-head h2 { position: relative; padding-block-end: .5em; }
.why .section-head h2::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; margin-inline: auto; inline-size: 72px; block-size: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--blue), var(--gold)); background-size: 200% 100%; animation: why-shine 4s linear infinite; }
@keyframes why-shine { to { background-position: -200% 0; } }

.why .why-grid { counter-reset: w; }
.why .why-card {
  --tx: 0px; --ty: 0px; --rx: 0deg; --ry: 0deg; --i: 0; counter-increment: w; position: relative;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translate(var(--tx), var(--ty)); will-change: transform;
  transition: transform .28s ease-out, box-shadow .28s ease, border-color .28s ease, opacity .28s ease;
}
.why .why-grid > li:nth-child(2) .why-card { --i: 1; } .why .why-grid > li:nth-child(3) .why-card { --i: 2; } .why .why-grid > li:nth-child(4) .why-card { --i: 3; }
.why .why-card:hover, .why .why-card:focus-within { --ty: -6px; transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translate(var(--tx), var(--ty)); }
/* the light that follows the pointer */
.why .why-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s ease; z-index: 2; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(22, 119, 255, .13), rgba(201, 163, 73, .06) 45%, transparent 70%); }
.why .why-card:hover::after { opacity: 1; }
/* the picture: slow pan, a number badge, a flowing bar */
.why .why-pic img { animation: why-pan 14s ease-in-out infinite alternate; }
.why .why-grid > li:nth-child(2) .why-pic img { animation-delay: -3s; } .why .why-grid > li:nth-child(3) .why-pic img { animation-delay: -6s; } .why .why-grid > li:nth-child(4) .why-pic img { animation-delay: -9s; }
@keyframes why-pan { from { scale: 1; translate: 0 0; } to { scale: 1.08; translate: -6px -4px; } }
.why .why-pic::before { content: counter(w, decimal-leading-zero); position: absolute; z-index: 2; inset-block-start: 12px; inset-inline-start: 12px; padding: .22em .7em; border-radius: 99px; font-size: .8rem; font-weight: 800; letter-spacing: .08em; color: #fff; background: rgba(7, 26, 70, .55); border: 1px solid rgba(255, 255, 255, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .25s ease, transform .3s ease; }
.why .why-card:hover .why-pic::before { background: var(--blue); transform: scale(1.08); }
.why .why-pic::after { background: linear-gradient(90deg, var(--blue), var(--sky), var(--gold), var(--blue)); background-size: 300% 100%; animation: why-shine 6s linear infinite; }
.why .why-body h3 { position: relative; transition: color .25s ease; }
.why .why-body h3::after { content: ""; display: block; inline-size: 0; block-size: 3px; margin-block-start: .35em; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--blue)); transition: inline-size .35s cubic-bezier(.2, .7, .2, 1); }
.why .why-card:hover .why-body h3::after, .why .why-card:focus-within .why-body h3::after { inline-size: 56px; }
/* the reveal: js/why.js adds .why-armed only when the grid is still below the fold, .is-in on each card, and removes .why-armed when done */
@media (prefers-reduced-motion: no-preference) {
  .why-armed .why-card { opacity: 0; --tx: -48px; --ty: 18px; }
  .why-armed .why-grid > li:nth-child(even) .why-card { --tx: 48px; }
  [dir="rtl"] .why-armed .why-card { --tx: 48px; }
  [dir="rtl"] .why-armed .why-grid > li:nth-child(even) .why-card { --tx: -48px; }
  .why-armed .why-card.is-in { opacity: 1; --tx: 0px; --ty: 0px; transition-delay: calc(var(--i) * 140ms), 0s, 0s, calc(var(--i) * 140ms); transition-duration: .8s, .28s, .28s, .8s; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 899px) { /* one column: the cards come up from below only (nothing slides in from beside the screen) */
  .why-armed .why-card, .why-armed .why-grid > li:nth-child(even) .why-card, [dir="rtl"] .why-armed .why-card, [dir="rtl"] .why-armed .why-grid > li:nth-child(even) .why-card { --tx: 0px; }
}
@media (hover: none), (pointer: coarse) { .why .why-card { --rx: 0deg !important; --ry: 0deg !important; } }
@media (prefers-reduced-motion: reduce) {
  .why::before, .why::after, .why .section-head h2::after, .why .why-pic img, .why .why-pic::after { animation: none; }
  .why .why-card, .why .why-card:hover, .why .why-card:focus-within { --rx: 0deg !important; --ry: 0deg !important; transform: none; will-change: auto; }
  .why .why-card, .why .why-card::after, .why .why-body h3::after { transition: none; }
}
