/*
 * AiX homepage 21st.dev component fidelity layer
 * Recreates the source components' motion and interaction states in vanilla CSS.
 */

/* Hover Gradient NavBar: cursor-following glow plus a persistent current section. */
.aix-home-header .hover-gradient-nav-item {
  --nav-pointer-x: 50%;
  --nav-pointer-y: 50%;
  will-change: color;
}

.aix-home-header .hover-gradient-nav-glow {
  background:
    radial-gradient(
      circle at var(--nav-pointer-x) var(--nav-pointer-y),
      rgba(var(--nav-accent-rgb), 0.3) 0%,
      rgba(var(--nav-accent-rgb), 0.13) 34%,
      rgba(var(--nav-accent-rgb), 0) 72%
    );
  will-change: opacity, transform;
}

.aix-home-header .hover-gradient-nav-item.is-nav-current {
  color: #fafafa;
  background: rgba(var(--nav-accent-rgb), 0.11);
}

.aix-home-header .hover-gradient-nav-item.is-nav-current .hover-gradient-nav-glow {
  opacity: 0.72;
  transform: scale(1.34);
}

.aix-home-header .hover-gradient-nav-item.is-nav-current .hover-gradient-nav-front i {
  color: var(--nav-hover-color);
}

.aix-home-header .hover-gradient-nav-item.is-nav-pressed .hover-gradient-nav-glow {
  opacity: 1;
  transform: scale(1.7);
}

.aix-home-header .hover-gradient-nav-item.is-nav-pressed .hover-gradient-nav-front {
  opacity: 0;
  transform: rotateX(-90deg);
}

.aix-home-header .hover-gradient-nav-item.is-nav-pressed .hover-gradient-nav-back {
  opacity: 1;
  transform: rotateX(0);
}

/* Stack Feature Section: keep orbiting product marks upright while their rings move. */
.aix-stack-hero-copy > *,
.aix-stack-orbit-stage {
  animation: aixComponentEnter 720ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.aix-stack-hero-copy > :nth-child(2) {
  animation-delay: 90ms;
}

.aix-stack-hero-copy > :nth-child(3) {
  animation-delay: 170ms;
}

.aix-stack-orbit-stage {
  animation-name: aixOrbitStageEnter;
  animation-delay: 120ms;
  animation-duration: 900ms;
}

.aix-orbit-node {
  animation: aixOrbitCounterSpin var(--orbit-duration, 18s) linear infinite;
  animation-direction: inherit;
  will-change: transform;
}

.aix-stack-orbit-stage:hover .aix-orbit-ring,
.aix-stack-orbit-stage:hover .aix-orbit-node {
  animation-play-state: paused;
}

@keyframes aixOrbitCounterSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes aixOrbitStageEnter {
  from {
    opacity: 0;
    transform: translate(-46%, -50%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes aixComponentEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Meteors: match the source's shorter five-to-seven second beam motion. */
body.aix-top-nav-active .aix-site-meteor-field span {
  animation-name: aixMeteorFidelity;
  animation-duration: 6s;
  animation-delay: calc(var(--meteor-delay, 0s) * -1);
}

body.aix-top-nav-active .aix-site-meteor-field span:nth-child(4n + 1) {
  animation-duration: 5.2s;
}

body.aix-top-nav-active .aix-site-meteor-field span:nth-child(4n + 2) {
  animation-duration: 5.8s;
}

body.aix-top-nav-active .aix-site-meteor-field span:nth-child(4n + 3) {
  animation-duration: 6.6s;
}

body.aix-top-nav-active .aix-site-meteor-field span:nth-child(4n) {
  animation-duration: 7.2s;
}

@keyframes aixMeteorFidelity {
  0% {
    opacity: 1;
    transform: rotate(215deg) translateX(0);
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: rotate(215deg) translateX(var(--meteor-travel, -500px));
  }
}

/* Hero Highlight: run the entrance and marker sweep when the section is reached. */
.aix-hero-highlight.is-component-ready > .container {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 620ms ease,
    transform 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-hero-highlight.is-component-ready .aix-highlight-mark {
  animation: none;
  background-size: 0% 100%;
}

.aix-hero-highlight.is-highlight-in-view > .container {
  opacity: 1;
  transform: translateY(0);
}

.aix-hero-highlight.is-highlight-in-view .aix-highlight-mark {
  animation: aixHighlightSweep 1.15s cubic-bezier(0.16, 1, 0.3, 1) 260ms forwards;
}

/* Animated Hero: stagger the block in and only cycle words while it is visible. */
.aix-animated-hero.is-component-ready :where(
  .aix-animated-kicker,
  .aix-animated-title,
  .aix-animated-lead,
  .aix-animated-actions
) {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 580ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-animated-hero.is-component-ready .aix-animated-title {
  transition-delay: 80ms;
}

.aix-animated-hero.is-component-ready .aix-animated-lead {
  transition-delay: 160ms;
}

.aix-animated-hero.is-component-ready .aix-animated-actions {
  transition-delay: 240ms;
}

.aix-animated-hero.is-entered :where(
  .aix-animated-kicker,
  .aix-animated-title,
  .aix-animated-lead,
  .aix-animated-actions
) {
  opacity: 1;
  transform: translateY(0);
}

/* Bento Grid: viewport stagger and a pointer-localized dot wash. */
.aix-bento-grid.is-component-ready .aix-bento-card {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
}

.aix-bento-grid.is-bento-in-view .aix-bento-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 520ms ease,
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 260ms ease,
    box-shadow 260ms ease,
    background 260ms ease;
}

.aix-bento-grid.is-bento-in-view .aix-bento-card:nth-child(2) {
  transition-delay: 70ms;
}

.aix-bento-grid.is-bento-in-view .aix-bento-card:nth-child(3) {
  transition-delay: 140ms;
}

.aix-bento-grid.is-bento-in-view .aix-bento-card:nth-child(4) {
  transition-delay: 210ms;
}

.aix-bento-card .aix-bento-pattern {
  background-image:
    radial-gradient(
      190px circle at var(--bento-x, 50%) var(--bento-y, 50%),
      rgba(var(--path-accent-rgb), 0.24),
      transparent 72%
    ),
    radial-gradient(circle at center, currentColor 1px, transparent 1px);
  background-size: 100% 100%, 4px 4px;
  transform: scale(1);
  transition: opacity 300ms ease, transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-bento-grid.is-bento-in-view .aix-bento-card:hover,
.aix-bento-grid.is-bento-in-view .aix-bento-card:focus-within,
.aix-bento-grid.is-bento-in-view .aix-bento-card.is-bento-active {
  transform: translateY(-4px) scale(1.005);
}

.aix-bento-card:hover .aix-bento-pattern,
.aix-bento-card:focus-within .aix-bento-pattern,
.aix-bento-card.is-bento-active .aix-bento-pattern {
  opacity: 1;
  transform: scale(1.035);
}

/* Image Comparison: desktop pointer-follow plus touch-safe vertical scrolling. */
.aix-workproof-stage,
.aix-workproof-handle {
  touch-action: pan-y;
}

.aix-workproof-compare.is-component-ready {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition:
    opacity 560ms ease,
    transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-workproof-compare.is-workproof-in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Single Pricing Card: preserve both quotes in one grid row for a true cross-slide. */
.aix-single-pricing-card.is-component-ready {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
}

.aix-single-pricing-card.is-pricing-in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 560ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.aix-pricing-testimonials {
  grid-template-areas:
    "quote"
    "dots";
}

.aix-pricing-quote {
  position: static;
  grid-area: quote;
  display: grid;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.985);
  transition:
    opacity 340ms ease,
    visibility 340ms step-end,
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-pricing-quote.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 340ms ease,
    visibility 0s step-start,
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-pricing-quote.is-exiting {
  visibility: visible;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.99);
}

.aix-pricing-quote-dots {
  grid-area: dots;
}

/* FAQ Accordion: motion-style entrance and a softer spring-like disclosure. */
.aix-faq-list.is-component-ready .aix-faq-item {
  opacity: 0;
  transform: translateY(14px);
}

.aix-faq-list.is-faq-in-view .aix-faq-item {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 480ms ease,
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1),
    background 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.aix-faq-list.is-faq-in-view .aix-faq-item:nth-child(2) {
  transition-delay: 55ms;
}

.aix-faq-list.is-faq-in-view .aix-faq-item:nth-child(3) {
  transition-delay: 110ms;
}

.aix-faq-list.is-faq-in-view .aix-faq-item:nth-child(4) {
  transition-delay: 165ms;
}

.aix-faq-list.is-faq-in-view .aix-faq-item:nth-child(5) {
  transition-delay: 220ms;
}

.aix-faq-answer {
  transition:
    grid-template-rows 360ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease;
}

.aix-faq-trigger:focus-visible {
  border-radius: 9px;
  outline-offset: -4px;
}

.aix-faq-answer > p {
  transition: padding-block-end 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.aix-faq-answer[aria-hidden="true"] > p {
  padding-block-end: 0;
}

@media (prefers-reduced-motion: reduce) {
  .aix-stack-hero-copy > *,
  .aix-stack-orbit-stage,
  .aix-orbit-ring,
  .aix-orbit-node,
  body.aix-top-nav-active .aix-site-meteor-field span,
  .aix-hero-highlight.is-highlight-in-view .aix-highlight-mark {
    animation: none;
  }

  .aix-orbit-node {
    transform: translate(-50%, -50%);
  }

  .aix-hero-highlight.is-component-ready > .container,
  .aix-animated-hero.is-component-ready :where(
    .aix-animated-kicker,
    .aix-animated-title,
    .aix-animated-lead,
    .aix-animated-actions
  ),
  .aix-bento-grid.is-component-ready .aix-bento-card,
  .aix-workproof-compare.is-component-ready,
  .aix-single-pricing-card.is-component-ready,
  .aix-faq-list.is-component-ready .aix-faq-item {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .aix-hero-highlight.is-component-ready .aix-highlight-mark {
    background-size: 100% 100%;
  }

  .aix-pricing-quote {
    transition: none;
  }
}

@media (forced-colors: active) {
  .aix-home-header .hover-gradient-nav-item.is-nav-current,
  .aix-bento-card.is-bento-active {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
