/**
 * TechnAre — additional motion (100% local CSS, no CDN)
 * Loaded after main.css. Respects prefers-reduced-motion.
 */

/* ---------- Global: tone down for accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero .img-fluid.animated,
  .header .btn-getstarted,
  .section-title h2,
  .scroll-top.active,
  .chatbot-btn {
    animation: none !important;
  }
}

/* ---------- Hero: soft moving gradient ---------- */
body .hero {
  background: linear-gradient(135deg, #e8f6fc 0%, #ffffff 40%, #f0f9ff 70%, #e0f2fe 100%);
  background-size: 200% 200%;
  animation: technare-hero-mesh 20s ease-in-out infinite;
}

@keyframes technare-hero-mesh {
  0%, 100% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .hero {
    animation: none;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  }
}

/* ---------- Hero art: slightly richer float (overrides .animated) ---------- */
.hero .img-fluid.animated,
.hero .hero-img .animated {
  animation: technare-hero-bob 3.2s ease-in-out infinite alternate;
}

@keyframes technare-hero-bob {
  0% {
    transform: translateY(12px) scale(1);
  }
  100% {
    transform: translateY(-14px) scale(1.01);
  }
}

/* ---------- Nav (desktop): accent underline on hover / active ---------- */
@media (min-width: 1200px) {
  .header .navmenu > ul > li {
    position: relative;
  }

  .header .navmenu > ul > li > a {
    position: relative;
    transition: color 0.25s ease;
  }

  .header .navmenu > ul > li > a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.9;
  }

  .header .navmenu > ul > li > a:hover::after,
  .header .navmenu > ul > li > a.active::after {
    transform: scaleX(1);
  }
}

/* ---------- Service cards: icon nudge on hover ---------- */
.services .service-item {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.3s ease;
}

.services .service-item:hover .icon {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.services .service-item .icon {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background 0.3s ease;
}

/* ---------- Section title badge: light breathe ---------- */
.section-title h2 {
  animation: technare-badge-breathe 5s ease-in-out infinite;
}

@keyframes technare-badge-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 185, 210, 0.12);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 185, 210, 0.08);
  }
}

/* ---------- Header CTA: soft glow pulse ---------- */
.header .btn-getstarted {
  animation: technare-cta-pulse 3.5s ease-in-out infinite;
}

@keyframes technare-cta-pulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(0, 185, 210, 0.35);
  }
  50% {
    box-shadow: 0 6px 28px rgba(0, 185, 210, 0.5);
  }
}

/* ---------- Page title (inner pages): enter ---------- */
.page-title .heading {
  animation: technare-fade-in 0.7s ease-out both;
}

@keyframes technare-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Scroll to top: attention when visible ---------- */
.scroll-top.active {
  animation: technare-scroll-nudge 2.5s ease-in-out infinite;
}

@keyframes technare-scroll-nudge {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* ---------- Testimonials: lift on hover ---------- */
.testimonials .testimonial-item,
.testimonials .swiper-slide {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.testimonials .testimonial-item:hover,
.testimonials .swiper-slide:hover {
  transform: translateY(-4px);
}

/* ---------- Blog cards: polish ---------- */
.blog-posts article {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.3s ease;
}

.blog-posts article:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08) !important;
}

/* ---------- Logo hover ---------- */
.header .logo {
  transition: transform 0.3s ease;
}

.header .logo:hover {
  transform: scale(1.03);
}

/* ---------- Contact form card feel ---------- */
.contact .php-email-form,
.service-details-page .php-email-form {
  transition: box-shadow 0.35s ease;
}

.contact .php-email-form:focus-within,
.service-details-page .php-email-form:focus-within {
  box-shadow: 0 8px 32px rgba(0, 185, 210, 0.12);
}

/* ---------- Chatbot launcher: gentle float (local only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .chatbot-btn {
    animation: technare-chatbot-float 3s ease-in-out infinite;
  }
}

@keyframes technare-chatbot-float {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 185, 210, 0.35);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 8px 22px rgba(0, 185, 210, 0.45);
  }
}

/* ============================================================
   Mobile & touch — lighter paint, less main-thread work
   (no new assets; works with same local CSS/JS)
   ============================================================ */
@media (max-width: 767.98px) {
  /* Shorter first paint: drop infinite background animation */
  body .hero {
    animation: none;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  }

  .hero .img-fluid.animated,
  .hero .hero-img .animated {
    animation: technare-hero-bob-mobile 4s ease-in-out infinite alternate;
  }

  @keyframes technare-hero-bob-mobile {
    0% {
      transform: translateY(4px) scale(1);
    }
    100% {
      transform: translateY(-6px) scale(1);
    }
  }

  .header .btn-getstarted {
    animation: none;
  }

  .section-title h2 {
    animation: none;
  }

  @media (prefers-reduced-motion: no-preference) {
    .chatbot-btn {
      animation: none;
    }
  }

  /* Less vertical scroll jank: hero does not need full viewport height */
  .hero {
    min-height: auto;
    min-height: min(100dvh, 920px);
    padding-top: 88px;
    padding-bottom: 40px;
  }

  .page-title {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  /* Faster tap: no 300ms delay on primary controls */
  a.btn-get-started,
  .header .btn-getstarted,
  .php-email-form [type="submit"],
  .btn,
  .btn-get-started,
  button,
  .navmenu a,
  .scroll-top,
  .chatbot-btn {
    touch-action: manipulation;
  }
}
