/* ============================================================
   animations.css — UI/UX enhancement layer for Jonix Software
   Effects: scroll reveal, counters, marquee, hover lift,
            gradient motion, text reveal, accordion, mobile menu
            slide, button press, micro-interactions, parallax,
            scroll progress bar, page transitions, logo pulse.
   All animations respect prefers-reduced-motion.
   ============================================================ */

/* ----------------------------------------------------------
   #18 Soft gradient motion — hero & CTA background blobs
   ---------------------------------------------------------- */
@keyframes blob-drift-a {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(32px,-22px) scale(1.06); }
  66%      { transform: translate(-22px,16px) scale(0.96); }
}
@keyframes blob-drift-b {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(-28px,22px) scale(0.94); }
  66%      { transform: translate(24px,-16px) scale(1.05); }
}

.hero-sec::before { animation: blob-drift-a 18s ease-in-out infinite; }
.hero-sec::after  { animation: blob-drift-b 22s ease-in-out infinite; }
.ph::before       { animation: blob-drift-a 20s ease-in-out infinite; }
.cta-sec::before  { animation: blob-drift-b 16s ease-in-out infinite; }

/* ----------------------------------------------------------
   #21 Logo dot pulse
   ---------------------------------------------------------- */
@keyframes logo-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: 0.75; }
}
.logo-dot {
  animation: logo-pulse 4s ease-in-out infinite;
  transform-origin: center;
}

/* ----------------------------------------------------------
   #6 Button press animation
   ---------------------------------------------------------- */
.btn:active,
.nav-btn:active,
.mob-cta:active {
  transform: scale(0.97);
  transition: transform 0.08s ease !important;
}

/* ----------------------------------------------------------
   #5 Hover lift on cards
   ---------------------------------------------------------- */
.card,
.card-d,
.card-l,
.card-d2 {
  transition: transform 0.28s ease, box-shadow 0.28s ease !important;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 44px rgba(0,0,0,.13);
}
.card-d:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 44px rgba(0,0,0,.28);
}
.card-l:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,.09);
}
.card-d2:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,.22);
}

/* ----------------------------------------------------------
   #4 Micro-interactions
   ---------------------------------------------------------- */

/* Nav link slide-underline */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--cyan);
  border-radius: 1px;
  transition: width 0.22s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Checklist arrow shift */
.cl li::before {
  transition: transform 0.15s ease;
  display: inline-block;
}
.cl li:hover::before {
  transform: translateX(4px);
}

/* Form focus glow */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(24,95,165,.18);
}

/* ----------------------------------------------------------
   #16 Mobile menu smooth slide-in
   Override the display:none / display:flex toggle with
   a max-height / opacity transition.
   ---------------------------------------------------------- */
.mob-menu {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition:
    max-height 0.38s cubic-bezier(0.4,0,0.2,1),
    opacity    0.28s ease,
    padding    0.32s ease;
}
.mob-menu.open {
  max-height: 520px;
  opacity: 1;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* ----------------------------------------------------------
   #24 Marquee / trust bar ticker
   ---------------------------------------------------------- */
.trust-marquee {
  overflow: hidden;
  display: flex;
}
.trust-track {
  display: flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
  animation: marquee-scroll 32s linear infinite;
  will-change: transform;
}
.trust-track:hover {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----------------------------------------------------------
   #1 Scroll reveal — fade + slide-up entrance
   ---------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity    0.58s ease,
    transform  0.58s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="left"] {
  opacity: 0;
  transform: translateX(-24px);
}
[data-reveal="left"].revealed {
  opacity: 1;
  transform: translateX(0);
}
[data-reveal="scale"] {
  opacity: 0;
  transform: scale(0.94);
}
[data-reveal="scale"].revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger helpers — add data-delay="1" through "6" */
[data-delay="1"] { transition-delay: 0.09s; }
[data-delay="2"] { transition-delay: 0.17s; }
[data-delay="3"] { transition-delay: 0.25s; }
[data-delay="4"] { transition-delay: 0.34s; }
[data-delay="5"] { transition-delay: 0.42s; }
[data-delay="6"] { transition-delay: 0.50s; }

/* ----------------------------------------------------------
   #23 Hero text reveal — two-line stagger
   ---------------------------------------------------------- */
.hero-line {
  display: block;
}

/* ----------------------------------------------------------
   #29 Scroll progress bar
   ---------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 72px; /* flush below nav */
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple), var(--amber));
  z-index: 300;
  border-radius: 0 1px 1px 0;
  pointer-events: none;
  transition: width 0.06s linear;
}

/* ----------------------------------------------------------
   #15 FAQ Accordion
   ---------------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--bdt);
}
.faq-item {
  border-bottom: 1px solid var(--bdt);
}
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s ease;
}
.faq-q:hover { color: var(--blue); }
.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--gray4);
  transition: transform 0.32s ease, color 0.15s ease;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--blue);
}
.faq-item.open .faq-q { color: var(--blue-lt); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.42s cubic-bezier(0.4,0,0.2,1);
}
.faq-item.open .faq-a {
  max-height: 600px;
}
.faq-a-inner {
  padding-bottom: 20px;
  font-size: 15px;
  color: var(--text2);
  line-height: 1.7;
}

/* ----------------------------------------------------------
   #7 Smooth page-load entrance (View Transitions API fallback)
   ---------------------------------------------------------- */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-wrap {
  animation: page-enter 0.38s ease both;
}

/* View Transitions API cross-page fade */
@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
}
::view-transition-old(root) {
  animation: vt-fade-out 0.22s ease forwards;
}
::view-transition-new(root) {
  animation: vt-fade-in 0.22s ease forwards;
}

/* ----------------------------------------------------------
   #3 Parallax — hero content drifts slightly slower than scroll.
   JS sets translateY directly on .hero-in via element.style.
   ---------------------------------------------------------- */
.hero-in {
  will-change: transform;
  transition: none;
}

/* ----------------------------------------------------------
   #30 Reduced-motion — disable everything for accessibility
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-progress { display: none; }
  .trust-track { animation: none; }
  .hero-line { opacity: 1 !important; transform: none !important; }
}
