/* ================================
   Techify — Custom Styles
   ================================ */

/* --- Smooth scroll offset for fixed navbar --- */
html {
  scroll-padding-top: 80px;
}

/* --- Typing cursor animation --- */
.typing-cursor {
  display: inline-block;
  animation: blink 0.8s step-end infinite;
  color: #F97316;
  font-weight: 700;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Hero blob pulse --- */
@keyframes blob-pulse {
  0%, 100% { transform: scale(1) translate(0, 0); }
  33% { transform: scale(1.05) translate(10px, -10px); }
  66% { transform: scale(0.95) translate(-10px, 10px); }
}
#hero .absolute {
  animation: blob-pulse 8s ease-in-out infinite;
}
#hero .absolute:nth-child(2) {
  animation-delay: -4s;
}

/* --- Marquee --- */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  gap: 4rem;
  animation: marquee 30s linear infinite;
}
.marquee-item {
  display: inline-block;
  flex-shrink: 0;
  user-select: none;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Navbar glassmorphism state --- */
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

/* --- Active nav link --- */
.nav-link.active {
  color: #F97316;
}

/* --- Mobile menu open state --- */
#mobile-menu.open {
  transform: translateX(0);
}

/* --- Hamburger to X --- */
#menu-toggle.open .menu-bar:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
#menu-toggle.open .menu-bar:nth-child(2) {
  opacity: 0;
}
#menu-toggle.open .menu-bar:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* --- CTA gradient background --- */
.cta-gradient {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 50%, #C2410C 100%);
}

/* --- Pricing toggle --- */
#pricing-toggle.active {
  background-color: #F97316;
}
#pricing-toggle.active .pricing-toggle-dot {
  transform: translateX(28px);
}

/* --- FAQ accordion --- */
.faq-item.active {
  border-color: #F97316;
  box-shadow: 0 4px 12px 0 rgb(249 115 22 / 0.08);
}
.faq-item.active .faq-icon {
  transform: rotate(45deg);
}
.faq-content.open {
  max-height: 300px !important;
}

/* --- Portfolio filter animation --- */
.portfolio-item {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.portfolio-item.hidden {
  opacity: 0;
  transform: scale(0.95);
  position: absolute;
  pointer-events: none;
}

/* --- Service card hover icon bg --- */
.service-card:hover .bg-primary-50 {
  background-color: #F97316;
}
.service-card:hover .bg-primary-50 i,
.service-card:hover .bg-primary-50 svg {
  color: white;
}

/* --- Form validation error state --- */
.input-error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

/* --- Back to top visible --- */
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Preloader (optional) --- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.preloader.hidden {
  opacity: 0;
  pointer-events: none;
}
.preloader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #E2E8F0;
  border-top-color: #F97316;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Mobile: prevent horizontal overflow from AOS fade-left/right --- */
@media (max-width: 1023px) {
  [data-aos="fade-left"],
  [data-aos="fade-right"] {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* --- Reduced motion --- */
@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;
  }
  .marquee-track {
    animation: none;
  }
}

/* --- Swiper customization --- */
.testimonial-swiper .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: #CBD5E1;
  opacity: 1;
}
.testimonial-swiper .swiper-pagination-bullet-active {
  background: #F97316;
  transform: scale(1.2);
}

/* --- Focus visible ring for accessibility --- */
:focus-visible {
  outline: 2px solid #F97316;
  outline-offset: 2px;
}

/* --- Hero Carousel --- */
.hero-swiper {
  width: 100%;
  position: relative;
}
.hero-swiper .swiper-slide {
  height: auto;
}
.hero-swiper-pagination {
  position: absolute !important;
  bottom: 1.5rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 20 !important;
  width: auto !important;
}
.hero-swiper-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: #CBD5E1;
  opacity: 1;
  transition: all 0.3s ease;
}
.hero-swiper-pagination .swiper-pagination-bullet-active {
  background: #F97316;
  width: 28px;
  border-radius: 5px;
}
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  margin-top: 0;
  background: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
  border: 1px solid #E2E8F0;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}
.hero-nav:hover {
  background: #F97316;
  border-color: #F97316;
  color: white;
}
.hero-nav-prev {
  left: 16px;
}
.hero-nav-next {
  right: 16px;
}
@media (max-width: 640px) {
  .hero-nav {
    display: none;
  }
}