*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Anchor targets (e.g. #products) land below the fixed navbar instead of
   being hidden behind it. */
[id] { scroll-margin-top: 6rem; }

/* A softer, more premium deceleration curve than Tailwind's default eases —
   used for hover/reveal transitions throughout this file. */
:root { --ease-elegant: cubic-bezier(0.16, 1, 0.3, 1); }

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: #1A1A2E;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dark body,
html.dark {
  background: #0A0A14;
  color: #F1F5F9;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #F8F9FC; }
::-webkit-scrollbar-thumb { background: #0B3D91; border-radius: 3px; }
html.dark ::-webkit-scrollbar-track { background: #12122A; }

/* Focus visible — WCAG 2.4.11 requires >=3:1 contrast between the focus
   indicator and the color(s) right next to it. #F7B500 (accent) only has
   ~1.8:1 against white, so light mode uses the navy brand color instead
   (~10:1 on white); dark mode keeps accent yellow, which has ~11:1 against
   the near-black dark background. outline-offset keeps the ring on the page
   background rather than overlapping a control's own colored fill. */
:focus-visible { outline: 2px solid #0B3D91; outline-offset: 2px; }
html.dark :focus-visible { outline-color: #F7B500; }

/* Skip to content */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: #0B3D91;
  color: white;
  padding: 8px 16px;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ── Keyframe Animations ── */
@keyframes kenBurns {
  from { transform: scale(1) translateX(0); }
  to { transform: scale(1.08) translateX(-1%); }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes scrollIndicator {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(6px); }
}

/* ── Utility Classes ── */
.animate-ken-burns { animation: kenBurns 22s ease-out forwards; }
.animate-marquee { animation: marquee 38s linear infinite; }
.animate-marquee-slow { animation: marquee 55s linear infinite; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.5s ease-out forwards; }
.animate-scroll-dot { animation: scrollIndicator 1.5s ease-in-out infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

.opacity-0-start { opacity: 0; }

/* Glass morphism */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-light {
  background: rgba(11, 61, 145, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 61, 145, 0.1);
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, #0B3D91 0%, #1251B5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #F7B500 0%, #FF8C00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shimmer loading skeleton */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Progress bar loading */
@keyframes progressBar {
  0% { width: 0%; }
  30% { width: 35%; }
  60% { width: 65%; }
  85% { width: 88%; }
  100% { width: 100%; }
}
.animate-progress { animation: progressBar 1.8s ease-in-out forwards; }

/* Light ring that travels around the quote button after a product is added. */
@property --quote-ring-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.quote-attention {
  position: relative;
  isolation: isolate;
  --quote-ring-angle: 0deg;
}

.quote-attention::before {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: -3px;
  border-radius: 9999px;
  padding: 2px;
  background: conic-gradient(
    from var(--quote-ring-angle),
    transparent 0deg 245deg,
    #00e5ff 265deg,
    #7c3aed 290deg,
    #f7b500 315deg,
    #ffffff 340deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 0 4px rgba(247, 181, 0, 0.95));
  animation: quoteRing 1.1s linear infinite;
}

@keyframes quoteRing {
  to { --quote-ring-angle: 360deg; }
}

/* Hover lift */
.hover-lift {
  transition: transform 0.35s var(--ease-elegant), box-shadow 0.35s var(--ease-elegant);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -8px rgba(11, 61, 145, 0.15);
}

/* Gradient borders */
.border-gradient {
  border: 1px solid;
  border-image: linear-gradient(135deg, #0B3D91, #F7B500) 1;
}

/* Hide scrollbar (utility) */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Reveal-on-scroll (replaces the React useInView pattern) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-elegant), transform 0.7s var(--ease-elegant);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Microinteractions ── */

/* Tactile press feedback as a zero-specificity fallback (:where()) so any
   component that already sets its own active:scale-* Tailwind utility (e.g.
   the WhatsApp button) keeps winning — this only fills in the gap for plain
   buttons that had no press feedback at all (navbar icon buttons, etc.).
   Transform only: compositor-only, no layout/paint cost. */
:where(button:not(:disabled)) {
  transition: transform 0.15s var(--ease-elegant), background-color 0.2s ease, color 0.2s ease;
}
:where(button:not(:disabled)):active {
  transform: scale(0.96);
}

/* Animated underline for plain text links (footer, mega menu, inline CTAs) —
   a background-size trick so it's a single compositable layer instead of a
   width/border transition. Opt-in via class so existing pill/button-style
   links are untouched. */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.35s var(--ease-elegant);
}
.link-underline:hover {
  background-size: 100% 1px;
}

/* Scroll progress bar + back-to-top button */
#scroll-progress-bar {
  transition: transform 0.1s linear;
}
#back-to-top-btn {
  transition: opacity 0.3s var(--ease-elegant), transform 0.3s var(--ease-elegant), box-shadow 0.3s ease;
}

/* Respect the OS-level reduced-motion preference: keep the UI fully usable
   (no permanently-hidden content) but drop the motion, per WCAG 2.3.3. */
@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;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  /* The quote indicator is intentionally kept animated: it communicates
     that the user has products waiting in the quote request. */
  .quote-attention::before {
    animation-name: quoteRing !important;
    animation-duration: 1.1s !important;
    animation-iteration-count: infinite !important;
    animation-timing-function: linear !important;
  }

  /* The brands ticker is intentionally kept animated too — it's a passive,
     low-intensity scroll (no flashing/zooming) whose only purpose is to
     display the full logo list; freezing it would just permanently hide
     whichever half of the (duplicated) list didn't happen to be on-screen. */
  .animate-marquee {
    animation-name: marquee !important;
    animation-duration: 38s !important;
    animation-iteration-count: infinite !important;
    animation-timing-function: linear !important;
  }
}
