/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
  /* Colores — extraídos del logo */
  --navy: #0B1F3F;
  --navy-deep: #071429;
  --navy-soft: #17335E;
  --crimson: #B5182B;
  --crimson-dark: #8C1220;
  --crimson-soft: #D94A57;
  --ink: #171A1F;
  --paper: #FAF9F6;
  --paper-warm: #F3F0EA;
  --white: #FFFFFF;
  --line: #E4E1D9;

  /* Tipografía */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  /* Espaciado */
  --space-section: clamp(4rem, 8vw, 7rem);
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;

  --shadow-sm: 0 2px 8px rgba(11, 31, 63, 0.06);
  --shadow-md: 0 8px 30px rgba(11, 31, 63, 0.10);
  --shadow-lg: 0 20px 60px rgba(11, 31, 63, 0.16);
}

/* ==========================================================================
   2. RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

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

:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
}

/* ==========================================================================
   3. UTILIDADES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 1.5rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 0.9rem;
  display: block;
}
.eyebrow-center { text-align: center; }
.eyebrow-invert { color: var(--crimson-soft); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  max-width: 34ch;
}
.text-center { text-align: center; margin-inline: auto; }

.section-lead {
  font-size: 1.08rem;
  color: #4A5163;
  max-width: 46ch;
  margin-top: 1rem;
}
.section-lead.text-center { margin-inline: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--crimson);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--crimson-dark); box-shadow: var(--shadow-md); }
.btn-lg { padding: 1.05rem 2.1rem; font-size: 1.05rem; }
.btn-ghost {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: var(--white); }
.icon-wa { width: 20px; height: 20px; fill: currentColor; stroke: none; flex-shrink: 0; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   4. HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.15;
  color: var(--navy);
}
.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-block: 0.3rem;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--crimson);
  transition: width 0.25s ease;
}
.main-nav a:hover::after { width: 100%; }
.header-cta { font-size: 0.9rem; padding: 0.65rem 1.3rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.4rem;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); transition: transform 0.25s ease, opacity 0.25s ease; }

/* ==========================================================================
   5. HERO
   ========================================================================== */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3rem); overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.08;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: italic;
  color: var(--crimson);
}
.hero-lead {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: #4A5163;
  max-width: 48ch;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.2rem; }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-number {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--navy);
  display: inline;
}
.stat-suffix {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--crimson);
}
.stat-label {
  display: block;
  font-size: 0.82rem;
  color: #6B7280;
  margin-top: 0.2rem;
}
.stat-divider { width: 1px; height: 40px; background: var(--line); }

/* Hero visual: blob + seal */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-blob {
  position: absolute;
  inset: 4%;
  border-radius: 44% 56% 62% 38% / 45% 40% 60% 55%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 45%, var(--crimson) 100%);
  opacity: 0.94;
  animation: blob-morph 14s ease-in-out infinite alternate;
}
@keyframes blob-morph {
  0%   { border-radius: 44% 56% 62% 38% / 45% 40% 60% 55%; }
  50%  { border-radius: 56% 44% 40% 60% / 55% 62% 38% 45%; }
  100% { border-radius: 48% 52% 55% 45% / 50% 48% 52% 50%; }
}
.seal {
  position: relative;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}
.seal-ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--navy); }
.seal-arc-text {
  font-family: var(--font-mono);
  font-size: 8.6px;
  font-weight: 600;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  fill: var(--navy);
}
.seal-arc-text-accent { fill: var(--crimson); letter-spacing: 2px; }
.seal-logo {
  width: 42%;
  aspect-ratio: 305 / 223;
  background-image: url('../assets/logo.png');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 139%;
  filter: drop-shadow(0 2px 6px rgba(11, 31, 63, 0.12));
}

/* ==========================================================================
   6. TRUST BAR
   ========================================================================== */
.trust-bar { background: var(--navy); padding-block: 1.1rem; }
.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.trust-bar-inner p { color: var(--paper); font-size: 0.92rem; }
.trust-bar-inner strong { color: var(--white); }
.trust-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.trust-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  border: 1px solid rgba(250, 249, 246, 0.28);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* ==========================================================================
   7. PROBLEMA
   ========================================================================== */
.problem { padding-block: var(--space-section); }
.problem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  margin-top: 3rem;
}
.problem-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.problem-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.problem-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--crimson);
  color: var(--crimson);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}
.problem-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.problem-card p { font-size: 0.92rem; color: #5B6270; }

/* ==========================================================================
   8. SERVICIOS
   ========================================================================== */
.services { padding-block: var(--space-section); background: var(--paper-warm); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  margin-top: 3rem;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.service-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem;
}
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.service-card p { font-size: 0.9rem; color: #5B6270; }

.service-card-cta {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.service-card-cta h3 { color: var(--white); }
.service-card-cta p { color: rgba(250, 249, 246, 0.75); margin-bottom: 1.3rem; }
.service-card-cta .btn { align-self: flex-start; }

/* ==========================================================================
   9. PROCESO
   ========================================================================== */
.process { padding-block: var(--space-section); }
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3.5rem;
  position: relative;
}
.process-step { position: relative; padding-left: 0.2rem; }
.process-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--line);
  display: block;
  line-height: 1;
  margin-bottom: 1rem;
}
.process-step h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.process-step p { color: #5B6270; font-size: 0.95rem; max-width: 32ch; }

/* ==========================================================================
   10. TESTIMONIOS
   ========================================================================== */
.testimonials {
  position: relative;
  padding-block: var(--space-section);
  background:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(181,24,43,0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(181,24,43,0.10), transparent 60%),
    var(--navy);
  overflow: hidden;
}
.testimonials .eyebrow { color: var(--crimson-soft); }
.testimonials .section-title { color: var(--white); }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
  align-items: start;
}
/* Desfase orgánico: la card del medio "flota" un poco más arriba */
.testimonials-grid .testimonial-card:nth-child(2) { margin-top: -1.1rem; }

.testimonial-card {
  position: relative;
  background: linear-gradient(165deg, rgba(250,249,246,0.07), rgba(250,249,246,0.03));
  border: 1px solid rgba(250, 249, 246, 0.13);
  border-radius: 18px;
  padding: 2.1rem 1.9rem 1.8rem;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.testimonial-card:hover {
  transform: translateY(-5px);
  border-color: rgba(181, 24, 43, 0.4);
  background: linear-gradient(165deg, rgba(250,249,246,0.1), rgba(250,249,246,0.04));
}

.t-quote {
  width: 34px;
  height: 26px;
  color: var(--crimson);
  opacity: 0.85;
  margin-bottom: 0.9rem;
}

.t-stars {
  color: #E8A93B;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.testimonial-card p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.03rem;
  line-height: 1.6;
  color: rgba(250, 249, 246, 0.92);
  margin-bottom: 1.7rem;
}

.testimonial-card footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(250, 249, 246, 0.12);
}
.t-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.t-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.t-name { font-size: 0.9rem; font-weight: 600; color: var(--white); }
.t-role { font-size: 0.76rem; color: rgba(250, 249, 246, 0.5); line-height: 1.3; }

.testimonials-note {
  text-align: center;
  font-size: 0.74rem;
  color: rgba(250, 249, 246, 0.4);
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

@media (max-width: 980px) {
  .testimonials-grid .testimonial-card:nth-child(2) { margin-top: 0; }
}

/* ==========================================================================
   11. CTA FINAL
   ========================================================================== */
.final-cta { padding-block: var(--space-section); background: var(--crimson); text-align: center; }
.final-cta-inner { display: flex; flex-direction: column; align-items: center; }
.final-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
}
.final-cta p { color: rgba(255,255,255,0.88); max-width: 42ch; margin-bottom: 2.2rem; font-size: 1.05rem; }
.final-cta .btn-primary { background: var(--navy); }
.final-cta .btn-primary:hover { background: var(--navy-deep); }

/* ==========================================================================
   12. FOOTER
   ========================================================================== */
.site-footer { background: var(--navy-deep); padding-block: 2.2rem; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-logo { width: 30px; filter: brightness(0) invert(1); opacity: 0.85; }
.footer-brand p { font-family: var(--font-mono); font-size: 0.8rem; color: var(--paper); }
.footer-copy { font-size: 0.78rem; color: rgba(250, 249, 246, 0.4); }
.footer-wa { font-size: 0.82rem; color: var(--paper); border-bottom: 1px solid rgba(250,249,246,0.3); }
.footer-wa:hover { color: var(--crimson-soft); border-color: var(--crimson-soft); }

/* ==========================================================================
   13. BOTÓN FLOTANTE WHATSAPP
   ========================================================================== */
.wa-float {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  z-index: 90;
  animation: wa-pulse 2.6s ease-in-out infinite;
}
.wa-float svg { width: 30px; height: 30px; fill: var(--white); stroke: none; }
.wa-float:hover { transform: scale(1.08); }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 6px 28px rgba(37, 211, 102, 0.65); }
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

/* ---- Tablet y móvil: ≤980px ---- */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 300px; margin-inline: auto; }
  .hero { text-align: left; }

  .problem-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .testimonials-grid { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
  .testimonials-grid .testimonial-card:nth-child(2) { margin-top: 0; }

  /* Menú móvil desplegable — funcional en TODO el rango ≤980px, incluye tablets */
  .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 1rem clamp(1.1rem, 4vw, 1.5rem) 1.5rem;
    gap: 0.3rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .main-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a {
    padding: 0.7rem 0.2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .main-nav a:last-child { border-bottom: none; }
  .main-nav a::after { display: none; }

  .nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---- Móvil: ≤640px ---- */
@media (max-width: 640px) {
  .problem-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; white-space: normal; text-align: center; }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    text-align: left;
  }
  .stat-divider { display: none; }
  .stat-number, .stat-suffix { font-size: 1.6rem; }

  .trust-bar-inner { flex-direction: column; align-items: flex-start; }

  .final-cta .btn-lg { white-space: normal; text-align: center; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-inner > * { margin-inline: auto; }

  .wa-float { width: 52px; height: 52px; bottom: 1.2rem; right: 1.2rem; }
  .wa-float svg { width: 26px; height: 26px; }
}

/* ---- Móvil pequeño: ≤400px (iPhone SE y similares) ---- */
@media (max-width: 400px) {
  .hero h1 { font-size: 2rem; }
  .hero-lead { font-size: 1rem; }
  .section-title { font-size: 1.6rem; }
  .section-lead { font-size: 0.98rem; }

  .brand-name { font-size: 0.85rem; }
  .brand-logo { width: 36px; height: 36px; }

  .btn-lg { padding: 0.9rem 1.5rem; font-size: 0.98rem; }

  .final-cta h2 { font-size: 1.7rem; }

  .hero-visual { max-width: 240px; }

  .stat-label { font-size: 0.72rem; }
}

/* ---- Altura reducida en móvil horizontal: evita que el botón flotante tape el CTA ---- */
@media (max-height: 480px) and (max-width: 900px) {
  .wa-float { width: 46px; height: 46px; }
  .wa-float svg { width: 22px; height: 22px; }
}