/* Hexaintel animations — recreates the original framer-motion behaviour with CSS + light JS. */

/* 1) Scroll-reveal: elements rise + fade when they enter the viewport.
   The original used .scroll-fade-up (JS-driven). We give it a real definition. */
.scroll-fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.scroll-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger helpers (original used stagger-1..4) */
.scroll-fade-up.stagger-1 { transition-delay: .05s; }
.scroll-fade-up.stagger-2 { transition-delay: .15s; }
.scroll-fade-up.stagger-3 { transition-delay: .25s; }
.scroll-fade-up.stagger-4 { transition-delay: .35s; }

/* Generic reveal used by my own templates */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* 2) Letter-by-letter title animation.
   JS splits headings into per-letter spans with incremental delay. */
.hx-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em) rotateX(-40deg);
  transform-origin: bottom;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.hx-letter.is-in {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .scroll-fade-up, .reveal, .hx-letter {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------
 * Loading screen (recreated from the original LoadingScreen component)
 * ------------------------------------------------------------------- */
#hx-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--background));
  transition: opacity .5s ease-in-out;
}
#hx-loader.hx-loaded {
  opacity: 0;
  pointer-events: none;
}
.hx-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.hx-loader-hex {
  position: relative;
  width: 5rem;
  height: 6rem;
  animation: hx-loader-pop .5s ease forwards;
}
.hx-loader-hex .hx-hex-spin {
  width: 5rem;
  height: 6rem;
  animation: hx-rotate 3s linear infinite;
}
.hx-loader-hex .hx-hex-pulse {
  position: absolute;
  inset: 0;
  width: 5rem;
  height: 6rem;
  animation: hx-loader-pulse 2s ease-in-out infinite;
}
.hx-loader-text {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.hx-loader-dots { color: hsl(var(--accent)); animation: hx-loader-blink 1.5s infinite; }
.hx-loader-bar {
  height: 2px;
  width: 120px;
  background: hsl(var(--border));
  border-radius: 9999px;
  overflow: hidden;
}
.hx-loader-bar > span {
  display: block;
  height: 100%;
  width: 50%;
  background: hsl(var(--accent));
  border-radius: 9999px;
  animation: hx-loader-slide 1s ease-in-out infinite;
}
@keyframes hx-rotate { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes hx-loader-pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes hx-loader-pulse {
  0%, 100% { transform: scale(.6); opacity: .3; }
  50%      { transform: scale(.8); opacity: .6; }
}
@keyframes hx-loader-blink { 0%,100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes hx-loader-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }

@media (prefers-reduced-motion: reduce) {
  #hx-loader { display: none !important; }
}

/* FAQ layout fix: the original Radix h3 was display:flex, which put the answer
   beside the question and squeezed it into a narrow column. Stack them instead. */
h3[data-orientation="vertical"] { display: block !important; }
[data-hexaintel-faq-answer] { width: 100%; }

/* Services dropdown (header) */
.hx-dropdown { display: none; z-index: 60; }
.hx-nav-item:hover .hx-dropdown,
.hx-nav-item:focus-within .hx-dropdown { display: block; }

/* Testimonials / clients marquee (ported from the original) */
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.marquee-left { animation: marquee-left 20s linear infinite; }
.marquee-right { animation: marquee-right 20s linear infinite; }
.marquee-container:hover .marquee-left,
.marquee-container:hover .marquee-right { animation-play-state: paused; }

/* Services dropdown chevron rotates when the menu is hovered/open */
.hx-nav-item:hover .hx-chevron,
.hx-nav-item:focus-within .hx-chevron { transform: rotate(180deg); }

/* Safety net: gap utilities used by the theme that aren't in the production build */
.gap-7 { gap: 1.75rem; }
@media (min-width:1024px){ .lg\:gap-16{ gap:4rem; } .lg\:gap-20{ gap:5rem; } }

/* Constrain the WordPress Customizer logo (WP outputs it unsized). Matches the
   original logo sizing: h-8 on mobile, h-10 on md+. */
#site-header .custom-logo-link { display: flex; align-items: center; }
#site-header img.custom-logo { height: 2rem; width: auto; max-width: none; }
@media (min-width: 768px) { #site-header img.custom-logo { height: 2.5rem; } }
