/* ========================================
   Clean Metrics – Custom Styles & Animations
   ======================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --navy:       #0F172A;
  --navy-light: #1E293B;
  --cobalt:     #3B82F6;
  --cobalt-dark:#2563EB;
  --emerald:    #10B981;
  --teal:       #14B8A6;
  --cyan:       #06B6D4;
  --gray-50:    #F8FAFC;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --gray-300:   #CBD5E1;
  --gray-400:   #94A3B8;
  --gray-500:   #64748B;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1E293B;
  --white:      #FFFFFF;
}

/* ---------- Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--cobalt);
  border-radius: 4px;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--cobalt);
  color: var(--white);
}

/* ---------- Header / Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.navbar.scrolled .nav-link {
  color: var(--gray-300);
}
.navbar.scrolled .nav-link:hover {
  color: var(--white);
}

/* ---------- Logo animation ---------- */
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--cobalt), var(--emerald));
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.15) 50%,
    transparent 70%
  );
  animation: logo-shine 4s ease-in-out infinite;
}

@keyframes logo-shine {
  0%, 100% { transform: translateX(-100%) rotate(25deg); }
  50%      { transform: translateX(100%) rotate(25deg); }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Hero Section ---------- */
.hero-section {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--navy) 0%, #0c1425 40%, #111c36 100%);
  overflow: hidden;
}

/* Animated grid background */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-drift 25s linear infinite;
}

@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Gradient orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orb-float 8s ease-in-out infinite alternate;
}

.hero-orb-1 {
  width: 500px;
  height: 500px;
  background: var(--cobalt);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.hero-orb-2 {
  width: 350px;
  height: 350px;
  background: var(--emerald);
  bottom: 5%;
  left: -5%;
  animation-delay: 3s;
}

.hero-orb-3 {
  width: 250px;
  height: 250px;
  background: var(--teal);
  top: 40%;
  left: 35%;
  animation-delay: 5s;
  opacity: 0.15;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -30px) scale(1.08); }
}

/* Metric cards (floating) */
.metric-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 16px;
  padding: 20px 24px;
  color: var(--white);
  animation: float-card 6s ease-in-out infinite alternate;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

@keyframes float-card {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-14px); }
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-dark));
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cobalt-dark), #1d4ed8);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary span,
.btn-primary i {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-cta-nav {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-dark));
  color: var(--white) !important;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  text-decoration: none;
}

.btn-cta-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

/* ---------- Section Styling ---------- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 100px;
  color: var(--cobalt);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 600px;
  line-height: 1.7;
}

/* ---------- Service Cards ---------- */
.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 36px 30px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cobalt), var(--emerald));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
  border-color: transparent;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 1.4rem;
  color: var(--white);
}

.service-icon.automation {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
}
.service-icon.dashboards {
  background: linear-gradient(135deg, var(--cobalt), var(--cyan));
}
.service-icon.analytics {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: all 0.25s ease;
}

.tech-badge:hover {
  background: var(--cobalt);
  color: var(--white);
  border-color: var(--cobalt);
  transform: translateY(-2px);
}

/* ---------- Tech Stack Section ---------- */
.tech-stack-section {
  background: linear-gradient(180deg, var(--gray-50), var(--white));
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  transition: all 0.35s ease;
  cursor: default;
}

.tech-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  border-color: var(--cobalt);
}

.tech-item i,
.tech-item svg {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}

.tech-item:hover i,
.tech-item:hover svg {
  transform: scale(1.15);
}

/* ---------- Value Props ---------- */
.value-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  transition: all 0.35s ease;
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  margin-bottom: 20px;
  font-size: 1.6rem;
}

.value-icon.precision {
  background: rgba(59, 130, 246, 0.1);
  color: var(--cobalt);
}

.value-icon.time {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald);
}

.value-icon.custom {
  background: rgba(99, 102, 241, 0.1);
  color: #6366F1;
}

/* ---------- Contact Section ---------- */
.contact-section {
  background: linear-gradient(160deg, var(--navy), #0c1425);
  position: relative;
  overflow: hidden;
}

.contact-section .hero-grid {
  opacity: 0.4;
}

.contact-form {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 24px;
  padding: 40px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: 8px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

.form-select option {
  background: var(--navy);
  color: var(--white);
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-dark));
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.6s; }

/* ---------- Counter Animation ---------- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 16px 24px;
  border-radius: 14px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
}

.toast.error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}

/* ---------- Scroll-to-top Button ---------- */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-dark));
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.35s ease;
  z-index: 900;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}

/* ---------- Particle Dot in Hero ---------- */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--cobalt);
  border-radius: 50%;
  opacity: 0;
  animation: particle-rise 6s ease-in-out infinite;
}

@keyframes particle-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  20%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-200px) scale(1.2); }
}

/* Utility to hide Tailwind loading flicker */
[x-cloak] { display: none !important; }

/* ---------- Responsive adjustments ---------- */
@media (max-width: 768px) {
  .hero-orb-1 {
    width: 300px;
    height: 300px;
  }
  .hero-orb-2 {
    width: 200px;
    height: 200px;
  }
  .hero-orb-3 {
    display: none;
  }

  .metric-card {
    padding: 14px 18px;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .contact-form {
    padding: 24px 20px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .scroll-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}
