/* ── Keyframe Animations ─────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(0, 51, 204, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 51, 204, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 51, 204, 0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes progressFill {
  from { width: 0; }
  to   { width: var(--fill-width, 99%); }
}

/* ── Hero Entry Animations ───────────────────────────────── */
.hero-badge  { animation: scaleIn  0.45s cubic-bezier(0.34,1.56,0.64,1) both; animation-delay: 0.1s; }
.hero-title  { animation: fadeInUp 0.6s  ease both; animation-delay: 0.2s; }
.hero-body   { animation: fadeInUp 0.6s  ease both; animation-delay: 0.38s; }
.hero-chips  { animation: fadeInUp 0.6s  ease both; animation-delay: 0.5s; }
.hero-ctas   { animation: fadeInUp 0.6s  ease both; animation-delay: 0.5s; }
.hero-form   { animation: scaleIn  0.55s ease both; animation-delay: 0.3s; }

/* ── Scroll Reveal ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger.is-visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0s;    }
.stagger.is-visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.1s;  }
.stagger.is-visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.2s;  }
.stagger.is-visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.3s;  }
.stagger.is-visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.4s;  }
.stagger.is-visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.5s;  }

/* ── Navigation ──────────────────────────────────────────── */
#main-nav {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
#main-nav.nav-scrolled {
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.11);
}

/* Animated underline for desktop nav links */
.nav-link {
  position: relative;
  padding-bottom: 3px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: #002294;
  border-radius: 2px;
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.active::after { width: 100%; }
.nav-link.active {
  color: #002294;
  font-weight: 700;
}

/* Call button pulse */
.btn-call {
  animation: pulseRing 2.4s ease-out infinite;
}

/* Mobile menu */
#mobile-menu {
  display: none;
}
#mobile-menu.open {
  display: block;
  animation: slideDown 0.22s ease;
}
.mobile-nav-link {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #e8e8e8;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #002294;
  padding-left: 8px;
}

/* ── Contact / Hero Form ─────────────────────────────────── */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: #002294;
  box-shadow: 0 0 0 3px rgba(0, 34, 148, 0.12);
}
.form-label {
  transition: color 0.2s ease;
}
.form-input:focus + .form-label,
.form-input:focus ~ .form-label {
  color: #002294;
}

/* Submit button spin state */
.btn-loading .spin-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

/* Submit success feedback */
.form-success-msg {
  animation: fadeInUp 0.4s ease both;
}

/* Progress bar fill animation (diagnostics card) */
.progress-bar {
  animation: progressFill 1.4s ease 0.6s both;
}

/* ── Process Steps connector animation ──────────────────── */
.process-connector {
  position: relative;
  overflow: hidden;
}
.process-connector::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #002294, #0033cc);
  transition: width 1.1s ease;
}
.process-connector.is-visible::before {
  width: 100%;
}

/* ── Gallery Filter Tabs ─────────────────────────────────── */
.filter-tab {
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.filter-tab:hover {
  transform: translateY(-1px);
}
.filter-tab.active {
  background-color: #d9e0ee;
  color: #1a1c1c;
  font-weight: 600;
}

/* gallery item reveal */
.gallery-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item.hidden {
  display: none;
}

/* ── Lightbox ────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 16, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#lightbox.open {
  display: flex;
  animation: fadeIn 0.25s ease;
}
#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  animation: scaleIn 0.3s ease;
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #fff;
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  background: none;
  border: none;
  padding: 0;
}
#lightbox-close:hover { opacity: 1; }

/* ── CTA Section shimmer ─────────────────────────────────── */
.cta-shimmer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,51,204,0.18), transparent 65%);
  pointer-events: none;
}

/* ── Service area town card hover ───────────────────────── */
.town-card {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.town-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 34, 148, 0.10);
}

/* ── Material icons base ─────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}
.icon-fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
