/* ============================================
   EmergyFix — Custom Styles & Animations
   ============================================ */

/* ---- Self-Hosted Fonts ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Kalam';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/kalam-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Base body font */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Emergency Banner Pulse Dot ---- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.8); }
}
.pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ---- Sticky CTA Glow ---- */
@keyframes cta-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(255, 107, 44, 0); }
}
.cta-glow {
  animation: cta-glow 2s ease-in-out infinite;
}

/* ---- Phone Icon Ring Pulse ---- */
@keyframes phone-ring {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
.phone-ring {
  animation: phone-ring 2.5s ease-in-out infinite;
  transform-origin: center center;
}

/* ---- Hero Background Orbs ---- */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}
.hero-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(30, 58, 95, 0.7) 0%, transparent 70%);
  top: -120px;
  right: -80px;
  animation: float-orb 18s ease-in-out infinite;
}
.hero-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.12) 0%, transparent 70%);
  bottom: -60px;
  left: -100px;
  animation: float-orb 22s ease-in-out infinite reverse;
}
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -20px); }
  66% { transform: translate(-20px, 15px); }
}

/* ---- Fade-In-Up Animation ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Header Scroll State ---- */
#site-header {
  transition: transform 0.3s ease;
}

.header-hidden {
  transform: translateY(-100%);
}

.header-scrolled {
  background-color: rgba(10, 22, 40, 0.97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ---- Mobile Menu ---- */
.mobile-menu {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.35s;
  visibility: hidden;
}
.mobile-menu.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
}

/* ---- Service Card Hover ---- */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.15);
}

/* ---- Step Connector Line ---- */
.step-connector {
  position: absolute;
  top: 32px;
  left: calc(50% + 40px);
  width: calc(100% - 80px);
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #FF6B2C 0px,
    #FF6B2C 8px,
    transparent 8px,
    transparent 16px
  );
}

/* ---- Testimonial Card ---- */
.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(10, 22, 40, 0.12);
}

/* ---- Dot Grid Pattern ---- */
.dot-grid {
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---- Custom Scrollbar (Desktop) ---- */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: #0A1628; }
  ::-webkit-scrollbar-thumb { background: #1E3A5F; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #FF6B2C; }
}

/* ---- Sticky CTA safe area (iPhone notch) ---- */
.sticky-cta {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* ---- Logo Emergy Digital Glitch ---- */
.logo-emergy {
  color: #ffffff;
  animation: digital-glitch 4s ease-in-out infinite;
}

@keyframes digital-glitch {
  0%, 90%, 100% {
    text-shadow: none;
    transform: translate(0);
  }
  91% {
    text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
    transform: translate(-2px, 1px);
  }
  92% {
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
    transform: translate(2px, -1px);
  }
  93% {
    text-shadow: -1px 0 #ff0000, 1px 0 #00ffff;
    transform: translate(-1px, 0);
  }
  94% {
    text-shadow: none;
    transform: translate(0);
  }
  95% {
    text-shadow: 1px 0 #ff0000, -1px 0 #00ffff;
    transform: translate(1px, 1px);
  }
  96% {
    text-shadow: none;
    transform: translate(0);
  }
}

/* ---- Logo Fix Matte Red ---- */
.logo-fix {
  font-family: 'Kalam', cursive;
  font-size: 1.15em;
  letter-spacing: 0.02em;
  color: #B22222;
}

/* ---- Logo Static (no animation) ---- */
.logo-static {
  color: #ffffff;
  animation: none !important;
}

/* ---- Service Card Image Hover ---- */
.service-card img {
  transition: transform 0.4s ease;
}
.service-card:hover img {
  transform: scale(1.05);
}
