/* Small overrides on top of Tailwind. Keep this file thin —
   most styling should live in utility classes. */

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

/* Selection color */
::selection { background: #dae6ff; color: #1c3088; }

/* Reduce CLS — reserve nav height even before Tailwind loads from CDN */
header { min-height: 4rem; }

/* Form focus ring polish */
.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #d8d9df;
  font-size: 0.95rem;
  color: #22253a;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: #5b85fb;
  box-shadow: 0 0 0 3px rgba(91, 133, 251, .2);
}

/* =========================================================
   MOTION LAYER
   Tasteful, performant. Everything below is GPU-accelerated
   (opacity + transform only) and respects prefers-reduced-motion.
   ========================================================= */

/* --- Scroll-reveal (toggled by assets/js/animate.js) --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Hero arrow pulse (home page, between suspended → active states) --- */
@keyframes pulseArrow {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 4px 14px rgba(41, 98, 255, 0.30);
  }
  50% {
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 8px 26px rgba(41, 98, 255, 0.55);
  }
}
.pulse-arrow {
  animation: pulseArrow 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform, box-shadow;
}

/* --- "REINSTATED" stamp pulse (service-page hero visuals) ---
   A subtle "press" every ~5s. Looks like a real rubber stamp being
   reapplied. Lifted shadow swells with the press. */
@keyframes stampPress {
  0%, 92%, 100% {
    transform: rotate(6deg) scale(1);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.30);
  }
  94% {
    transform: rotate(6deg) scale(0.94);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.50);
  }
  96% {
    transform: rotate(7deg) scale(1.06);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.55);
  }
  98% {
    transform: rotate(6deg) scale(1);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.30);
  }
}
.stamp-press {
  animation: stampPress 5s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, box-shadow;
}

/* --- Hover lift on linked cards (policy grid, related-policies, flagged grid) ---
   Tailwind gives us hover:shadow-md and hover:border-brand-300 already.
   This just adds the upward translation. */
.lift-on-hover {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  will-change: transform;
}
.lift-on-hover:hover {
  transform: translateY(-3px);
}

/* --- Mobile sticky CTA bar ---
   Hidden by default. Slides up after scroll past hero on small screens.
   JS toggles .visible. */
.mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom)) 1rem;
  background: #ffffff;
  border-top: 1px solid #E5E7EB;
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
  z-index: 30;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-cta.visible {
  transform: translateY(0);
}
@media (min-width: 1024px) {
  .mobile-cta { display: none; }
}

/* --- Respect user motion preference (vestibular / OS-level setting) --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pulse-arrow, .stamp-press { animation: none; }
  .lift-on-hover { transition: none; }
  .lift-on-hover:hover { transform: none; }
  .mobile-cta { transition: none; }
}
