/* =============================================================
   Cloudyfy Pvt Ltd — Custom Styles
   Tailwind (via CDN + inline config in index.html) handles the
   bulk of layout/utility styling. This file holds only what
   Tailwind utilities cannot express cleanly: keyframes, custom
   scrollbars, gradient meshes, and third-party plugin overrides.
   ============================================================= */

:root {
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f4f9;
}
::-webkit-scrollbar-thumb {
  background: #c3cde0;
  border-radius: 999px;
  border: 2px solid #f1f4f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #9aa8c4;
}

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}
.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}
.reveal-scale.reveal-visible {
  opacity: 1;
  transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}

/* stagger children helper */
.reveal-group > * {
  transition-delay: calc(var(--stagger, 0) * 80ms);
}

/* ---------- Hero background mesh / glow ---------- */
.hero-glow {
  background: radial-gradient(60% 60% at 30% 20%, rgba(46, 94, 255, 0.16), transparent 70%),
    radial-gradient(50% 50% at 85% 15%, rgba(255, 107, 74, 0.12), transparent 70%),
    radial-gradient(40% 40% at 75% 80%, rgba(46, 94, 255, 0.1), transparent 70%);
}

.grid-overlay {
  background-image: linear-gradient(to right, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 90%);
}

/* ---------- Floating cards ---------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.float-slow { animation: float-y 6s ease-in-out infinite; }
.float-slower { animation: float-y 8s ease-in-out infinite; animation-delay: -2s; }
.float-fast { animation: float-y 4.5s ease-in-out infinite; animation-delay: -1s; }
@media (prefers-reduced-motion: reduce) {
  .float-slow, .float-slower, .float-fast { animation: none; }
}

/* ---------- Orbiting connection dots (hero) ---------- */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow { animation: spin-slow 22s linear infinite; }
.animate-spin-slower { animation: spin-slow 34s linear infinite reverse; }

/* ---------- Pulse dot ---------- */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(46, 94, 255, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(46, 94, 255, 0); }
}
.pulse-dot { animation: pulse-ring 2.2s var(--ease-premium) infinite; }

/* ---------- Marquee (tech / logo strip) ---------- */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 28s linear infinite;
}
.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- Underline link hover ---------- */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease-premium);
}
.link-underline:hover,
.link-underline:focus-visible {
  background-size: 100% 1.5px;
}

/* ---------- Nav active indicator ---------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s var(--ease-premium);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2e5eff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-premium);
}
#mobile-menu.open {
  max-height: 640px;
}

/* ---------- FAQ accordion ---------- */
.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-premium), opacity 0.3s ease;
  opacity: 0;
}
.faq-item.open .faq-panel {
  opacity: 1;
}
.faq-item .faq-chevron {
  transition: transform 0.35s var(--ease-premium);
}
.faq-item.open .faq-chevron {
  transform: rotate(45deg);
}

/* ---------- Service tabs (interactive experience) ---------- */
.service-tab {
  transition: background-color 0.3s var(--ease-premium), border-color 0.3s var(--ease-premium);
}
.service-tab[aria-selected="true"] {
  background-color: rgba(46, 94, 255, 0.06);
  border-color: #2e5eff;
}
.service-panel {
  transition: opacity 0.35s var(--ease-premium), transform 0.35s var(--ease-premium);
}
.service-panel[hidden] {
  display: none;
}

/* ---------- Industry cards hover reveal ---------- */
.industry-card .industry-reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-premium), opacity 0.35s ease, margin-top 0.4s var(--ease-premium);
}
.industry-card:hover .industry-reveal,
.industry-card:focus-within .industry-reveal {
  max-height: 220px;
  opacity: 1;
  margin-top: 0.75rem;
}
.industry-card:hover .industry-icon-wrap,
.industry-card:focus-within .industry-icon-wrap {
  transform: translateY(-4px);
}

/* ---------- Card hover lift ---------- */
.card-lift {
  transition: transform 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium);
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px -18px rgba(15, 23, 42, 0.25);
}

/* ---------- Portfolio image zoom ---------- */
.zoom-wrap { overflow: hidden; }
.zoom-img { transition: transform 0.6s var(--ease-premium); }
.zoom-wrap:hover .zoom-img { transform: scale(1.06); }

/* ---------- Testimonial carousel ---------- */
#testimonial-track {
  transition: transform 0.5s var(--ease-premium);
}
.testimonial-dot {
  transition: width 0.35s var(--ease-premium), background-color 0.35s var(--ease-premium);
}

/* ---------- Timeline (process) ---------- */
.timeline-line-fill {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s var(--ease-premium);
}
.timeline-line-fill.filled { transform: scaleX(1); }
.timeline-line-fill-v {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.2s var(--ease-premium);
}
.timeline-line-fill-v.filled { transform: scaleY(1); }

/* ---------- Counter number tabular alignment ---------- */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ---------- Toast ---------- */
#toast {
  transform: translateY(140%);
  transition: transform 0.45s var(--ease-premium);
}
#toast.show {
  transform: translateY(0);
}

/* ---------- Form states ---------- */
.form-field.field-error input,
.form-field.field-error textarea,
.form-field.field-error select {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.form-error-msg {
  display: none;
}
.form-field.field-error .form-error-msg {
  display: block;
}

/* ---------- Back to top ---------- */
#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease-premium), transform 0.35s var(--ease-premium), visibility 0.35s;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Loading spinner ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 0.7s linear infinite;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Gradient text ---------- */
.text-gradient {
  background: linear-gradient(100deg, #2e5eff 10%, #6d8bff 45%, #ff6b4a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header blur state ---------- */
#site-header {
  transition: background-color 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium), padding 0.4s var(--ease-premium);
}

/* lazy image fade-in */
img.lazy-fade {
  opacity: 0;
  transition: opacity 0.5s ease;
}
img.lazy-fade.loaded {
  opacity: 1;
}
