/* AIA Contadores — estilos base
   Tipografía: Lexend (títulos) + Source Sans 3 (cuerpo)
   Paleta: Navy #0F172A / Azul #1E3A8A / Oro #CA8A04 / Fondo #F8FAFC */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --navy: #0F172A;
  --navy-2: #1E3A8A;
  --gold: #CA8A04;
  --gold-light: #EAB308;
  --bg: #F8FAFC;
  --ink: #020617;
  --muted: #475569;
  --line: #E2E8F0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
}

.font-display {
  font-family: 'Lexend', system-ui, sans-serif;
}

/* Logo wordmark */
.logo-mark {
  font-family: 'Lexend', serif;
  letter-spacing: -0.02em;
}

/* Subtle grid backdrop used behind the hero and section dividers */
.grid-backdrop {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

.dot-backdrop {
  background-image: radial-gradient(rgba(248, 250, 252, 0.35) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

/* Hero background image reveal.
   -webkit- prefixes + will-change force GPU-layer promotion, which iOS
   Safari needs to reliably run transform/filter animations on load. */
.hero-bg-reveal {
  opacity: 0;
  -webkit-transform: scale(1.08) translate3d(0, 0, 0);
  transform: scale(1.08) translate3d(0, 0, 0);
  -webkit-filter: blur(10px);
  filter: blur(10px);
  will-change: opacity, transform, filter;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-animation: heroBgReveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation: heroBgReveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@-webkit-keyframes heroBgReveal {
  to {
    opacity: 1;
    -webkit-transform: scale(1) translate3d(0, 0, 0);
    -webkit-filter: blur(0);
  }
}

@keyframes heroBgReveal {
  to {
    opacity: 1;
    -webkit-transform: scale(1) translate3d(0, 0, 0);
    transform: scale(1) translate3d(0, 0, 0);
    -webkit-filter: blur(0);
    filter: blur(0);
  }
}

/* Scroll reveal.
   Same GPU-layer promotion as above — without it, iOS Safari can leave
   elements stuck at opacity:0 instead of transitioning them into view. */
.reveal {
  opacity: 0;
  -webkit-transform: translate3d(0, 16px, 0);
  transform: translate3d(0, 16px, 0);
  -webkit-transition: opacity 0.6s ease-out, -webkit-transform 0.6s ease-out;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.reveal.is-visible {
  opacity: 1;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
    -webkit-transition: none;
    transition: none;
  }
}

/* Sticky header state */
#site-header {
  transition: box-shadow 200ms ease, background-color 200ms ease, padding 200ms ease;
}

#site-header.is-scrolled {
  box-shadow: 0 1px 0 0 var(--line);
}

/* Nav underline hover */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background-color: var(--gold);
  transition: width 200ms ease-out;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

/* Service card accent bar */
.service-card {
  transition: border-color 200ms ease, transform 200ms ease;
}

.service-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

/* Photo-tile service cards */
.service-tile {
  transition: transform 250ms ease, box-shadow 250ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.service-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.35);
}

/* Number badges for the process steps */
.step-number {
  font-family: 'Lexend', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* FAQ accordion */
.faq-item[open] summary .faq-icon {
  transform: rotate(45deg);
}

.faq-icon {
  transition: transform 200ms ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary {
  cursor: pointer;
}

/* Floating WhatsApp button */
.wa-float {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.wa-float:hover {
  transform: translateY(-3px);
}

/* Back to top */
#back-to-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Focus visibility (accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

::selection {
  background-color: var(--gold);
  color: var(--navy);
}

/* Mobile menu */
#mobile-menu {
  transition: max-height 250ms ease, opacity 200ms ease;
}

/* Marquee for the trust strip and client logos.
   Safari (especially iOS) can fail to run this animation unless the layer
   is explicitly promoted to the GPU and the transform uses a 3D value. */
.marquee-track {
  -webkit-animation: marquee 16s linear infinite;
  animation: marquee 16s linear infinite;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    -webkit-animation: none;
    animation: none;
  }
}

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

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

/* Fade the marquee edges — needs the -webkit- prefix for Safari < 15.4 */
.marquee-fade {
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

/* Vertical top-to-bottom fade (hero grid backdrop) */
.fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
}
