/* =========================
   Reset básico
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* =========================
   Medios y enlaces
========================= */
img { max-width: 100%; display: block; }
a { color: inherit; }

/* =========================
   Variables (root)
========================= */
:root {
  --bg: #fbfdff;
  --surface: #ffffff;
  --muted: #f4f8ff;
  --border: #e3eaf6;
  --text: #0e1a2f;
  --text-muted: #52627a;
  --primary: #2b5fc0;
  --primary-600: #1d4ca3;
  --accent: #b7cff8;
  --font-sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-sm: .925rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3.2rem;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(43, 95, 192, .10);
  --container: 1120px;
  --space-1: .5rem;
  --space-2: .75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
}

/* =========================
   Body (sticky footer layout)
========================= */
body {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(59, 130, 246, .08), transparent 55%),
    radial-gradient(800px 600px at 110% 10%, rgba(147, 197, 253, .12), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: var(--fs-md);

  min-height: 100vh;          
  display: flex;             
  flex-direction: column;     
}

main { flex: 1 0 auto; }     

/* =========================
   Contenedor
========================= */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* =========================
   Header
========================= */
header.site {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand { font-weight: 800; letter-spacing: .3px; color: var(--primary); }
.brand a { text-decoration: none; color: inherit; }

.nav ul {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: .4rem .2rem;
  border-radius: 8px;
  transition: color .2s ease, background .2s ease;
  white-space: nowrap; /* evita saltos raros en items largos */
}

.nav a:hover { color: var(--primary); background: var(--muted); }

/* =========================
   Hero
========================= */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; text-align: center; }
.hero h1 {
  font-size: clamp(var(--fs-2xl), 5vw, var(--fs-3xl));
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  letter-spacing: .2px;
  color: var(--primary-600);
}
.title-blue { color: var(--primary-600); }
.hero p {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  margin: 0 auto var(--space-5);
  max-width: 65ch;
}
.hero-grid {
  text-align: left;                 
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;  
  align-items: center;
  gap: var(--space-5);
}

.hero-col { min-width: 0; }        
.hero-text p { max-width: 60ch; }   

.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-art {
  max-width: 560px;                 
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(43,95,192,.16));
}

/* =========================
   Botones
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: .9rem 1.15rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, filter .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* =========================
   Secciones
========================= */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section h1 { font-size: var(--fs-2xl); margin: 0 0 var(--space-4); color: var(--primary-600); }
.section h2 { font-size: var(--fs-xl); margin: 0 0 var(--space-4); color: var(--primary-600); }

/* =========================
   Grid
========================= */
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, 1fr); }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

/* =========================
   Card
========================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease, border-color .28s ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 28px rgba(59, 130, 246, .12);
  border-color: #cfd9ef;
}
.card h3 { margin-top: 0; color: var(--primary-600); }
.card p { color: var(--text-muted); }

/* =========================
   KPIs
========================= */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.kpi {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.kpi .num { font-size: var(--fs-2xl); font-weight: 800; color: var(--primary); }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(59, 130, 246, .12); border-color: #cfd9ef; }

/* =========================
   Footer (antiguo neutralizado)
========================= */
footer.site {
  border-top: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  margin-top: var(--space-4);
  padding: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* =========================
   Visuales
========================= */
.visuals {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
}
.logo-polaris-img {
  width: clamp(240px, 30vw, 600px);
  height: auto;
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 4px 8px rgba(43, 95, 192, 0.15));
  transition: transform 0.3s ease;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}
.logo-polaris-img:hover { transform: scale(1.05); }
.equipo-img {
  width: 100%;
  max-width: 580px;
  height: auto;
  transition: transform 0.4s ease;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}
.equipo-img:hover { transform: scale(1.02); }

/* =========================
   Animaciones
========================= */
.fade-in { opacity: 0; transform: translateY(15px); animation: fadeInUp 0.9s ease-out forwards; }
.fade-up { opacity: 0; transform: translateY(25px); animation: fadeInUp 1.2s ease-out 0.2s forwards; }
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(25px); }
  100% { opacity: 1; transform: translateY(0); }
}
.quienes-somos { align-items: center; }

/* =========================
   Servicios (animado)
========================= */
.grid.servicios-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, 1fr); }
.grid.servicios-grid .card {
  grid-column: span 6;
  opacity: 0;
  transform: translateY(18px);
  animation: cardInSoft 1.25s cubic-bezier(.22, 1, .36, 1) forwards;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, border-color .3s ease;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}
.grid.servicios-grid .card:nth-child(1) { animation-delay: .20s; }
.grid.servicios-grid .card:nth-child(2) { animation-delay: .40s; }
.grid.servicios-grid .card:nth-child(3) { animation-delay: .60s; }
.grid.servicios-grid .card:nth-child(4) { animation-delay: .80s; }
.grid.servicios-grid .card:hover {
  transform: translateY(-4px) scale(1.015) !important;
  box-shadow: 0 16px 32px rgba(43, 95, 192, .14) !important;
  border-color: #cfd9ef !important;
  z-index: 2;
}
@keyframes cardInSoft {
  from { opacity: 0; transform: translateY(24px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .servicios-grid .card { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* =========================
   Blog (animado)
========================= */
.grid.blog-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, 1fr); }
.grid.blog-grid .card {
  grid-column: span 4;
  opacity: 0;
  transform: translateY(18px);
  animation: cardInSoft 1.35s cubic-bezier(.22, 1, .36, 1) forwards;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, border-color .3s ease;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}
.grid.blog-grid .card:nth-child(1) { animation-delay: .20s; }
.grid.blog-grid .card:nth-child(2) { animation-delay: .40s; }
.grid.blog-grid .card:nth-child(3) { animation-delay: .60s; }
.grid.blog-grid .card:nth-child(4) { animation-delay: .80s; }
.grid.blog-grid .card:hover {
  transform: translateY(-4px) scale(1.015) !important;
  box-shadow: 0 16px 32px rgba(43, 95, 192, .14) !important;
  border-color: #cfd9ef !important;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .blog-grid .card { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* =========================
   Contacto (links) — unificado
========================= */
.contact-link {
  color: var(--primary-600);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.25s ease;
}
.contact-link:hover { color: var(--primary); text-decoration: underline; }

/* =========================
   Listas en servicios
========================= */
.servicios-grid ul {
  list-style: disc outside;
  padding-left: 1.2rem;
  margin: 0.5em 0 0 0;
  color: inherit;
}
.servicios-grid li {
  font-size: 1rem;
  line-height: 1.6;
  color: inherit;
  margin-bottom: 0.4em;
  font-weight: 400;
}

/* =========================
   Footer (nuevo + sticky)
========================= */
.footer {
  background: var(--surface, #fff);
  border-top: 1px solid var(--border, #e3eaf6);
  color: var(--text, #0e1a2f);
  padding: 1.25rem 1rem 0.75rem;
  margin-top: auto; /* sticky footer */
}
.footer__container {
  display: grid;
  gap: 1rem;
  text-align: center;
  justify-items: center;
  max-width: 1000px;
  margin: 0 auto;
}
.footer__contact { display: grid; gap: 0.5rem; justify-items: center; }
.footer__address { font-style: normal; color: var(--text-muted, #52627a); line-height: 1.4; }
.footer__address a { color: var(--text, #0e1a2f); text-decoration: none; }
.footer__address a:hover { color: var(--primary, #2b5fc0); text-decoration: underline; }
.footer__social { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.15rem; }
.social {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.35rem; border-radius: 0.5rem; border: 1px solid var(--border, #e3eaf6);
  transition: 0.2s ease;
}
.social svg { fill: currentColor; color: var(--text, #0e1a2f); width: 20px; height: 20px; transition: color 0.2s; }
.social:hover { border-color: var(--primary, #2b5fc0); color: var(--primary, #2b5fc0); transform: translateY(-1px); }
.footer__legal { width: 100%; }
.footer__list { list-style: none; display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; padding: 0; margin: 0; }
.footer__list a, .linklike { text-decoration: none; color: var(--text, #0e1a2f); font-size: 0.95rem; }
.footer__list a:hover, .linklike:hover { color: var(--primary, #2b5fc0); text-decoration: underline; }
.linklike { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.footer__bottom {
  border-top: 1px dashed var(--border, #e3eaf6);
  margin-top: 0.5rem; padding-top: 0.5rem;
  text-align: center; color: var(--text-muted, #52627a);
  display: grid; gap: 0.2rem; font-size: 0.9rem;
}

/* ========================
   Footer: responsive
========================= */
@media (min-width: 900px) {
  .footer__container { grid-template-columns: 1fr; row-gap: 1rem; }
}

/* =========================
   listas 
========================= */
/* Listas dentro del contenido principal */
.section ul,
.section ol {
  color: var(--primary-600);   
}

.section li::marker {
  color: var(--primary-600);
}

/* =========================
   Contacto 
========================= */
.contacto-grid {
  gap: 1.5rem;
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ========================
   Responsive 
==========================*/

@media (max-width: 1200px) {
  .container { max-width: 960px; }
}

@media (max-width: 900px) {

  .grid { grid-template-columns: repeat(6, 1fr); }
  .col-6 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .kpis { grid-template-columns: repeat(2, 1fr); }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual { order: -1; } 
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-art { max-width: 440px; }

  .visuals { margin-top: var(--space-4); }
  .equipo-img { max-width: 480px; }

  /* NAV: permitir salto a nueva línea cuando no quepa */
  .nav { flex-wrap: wrap; height: auto; padding: .5rem 0; row-gap: .5rem; }
  .brand { margin-right: auto; }
  .nav ul { flex-wrap: wrap; justify-content: flex-end; }

  /* BLOG GRID: 2 tarjetas por fila para evitar huecos */
  .grid.blog-grid .card { grid-column: span 3; }
}

/* ====== Móvil grande (≤600px) ====== */
@media (max-width: 600px) {
  .hero p { font-size: var(--fs-md); }
  .btn { padding: .8rem 1rem; font-size: .95rem; }
}

/* ====== Móvil mediano (≤520px) ====== */
@media (max-width: 520px) {
  .hero p { font-size: var(--fs-md); }

  /* KPIs a 1 columna */
  .kpis { grid-template-columns: 1fr; }

  /* BLOG GRID: 1 tarjeta por fila */
  .grid.blog-grid .card { grid-column: span 6; }
}

/* ====== Móvil pequeño (≤480px) ====== */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .section { padding: 2rem 0; }
}

/* ====== Pantallas ultra-wide (≥1600px) ====== */
@media (min-width: 1600px) {
  .container { max-width: 1400px; }
  .hero h1 { font-size: clamp(2.5rem, 3vw, 4rem); }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .hero-text p {
    max-width: 70ch;
  }
}