/* ── LAYOUT UTILITY ─── */
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-mobile-divider { display: none; }

/* ── SERVICES (mismo fondo que #porque) ─── */
#servicios {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
  padding: 64px 64px;
  position: relative;
  overflow: hidden;
}
#servicios::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(26,158,143,0.15) 0%, transparent 70%);
  pointer-events: none;
}
#servicios .section-inner {
  position: relative;
  z-index: 1;
}
#servicios .section-title-dark { color: var(--white); }
#servicios .section-sub-dark { color: rgba(255,255,255,0.45); }
#servicios .section-overline { color: var(--teal); }
.section-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(36px, 4vw, 54px);
  letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 12px;
}
.section-sub {
  font-size: 17px; line-height: 1.6;
  margin-bottom: 64px;
}
.section-title-dark { color: var(--blue-dark); }
.section-title-light { color: var(--white); }
.section-sub-dark { color: rgba(27,79,138,0.6); }
.section-sub-light { color: rgba(255,255,255,0.45); }

.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; max-width: 1100px; margin: 0 auto;
}
.service-card {
  background: var(--white); border-radius: 14px;
  padding: 28px 22px;
  box-shadow: 0 2px 20px rgba(27,79,138,0.06);
  position: relative; overflow: hidden;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.3s;
  border-bottom: 3px solid transparent;
  display: flex; flex-direction: column;
}
.service-card::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1);
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 16px 48px rgba(27,79,138,0.13); }
.service-card:hover::after { transform: scaleX(1); }
.service-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, rgba(42,127,193,0.1), rgba(26,158,143,0.1));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.service-icon svg { width: 22px; height: 22px; }
.service-name {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 16px; color: var(--blue-dark); margin-bottom: 8px;
}
.service-tagline {
  font-size: 13px; color: rgba(27,79,138,0.6);
  line-height: 1.55; margin-bottom: 16px;
}
.service-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.service-card-link .service-tagline { margin-bottom: 12px; }
.service-cta {
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal);
  transition: color 0.2s;
}
.service-card-link:hover .service-cta { color: var(--blue-mid); }
.service-price {
  display: none;
}

/* ── PROCESS ─── */
#proceso {
  background: var(--bg-dark);
  padding: 64px 64px;
}
.process-wrapper {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  --process-gap: 12px;
  --col-w: calc((100% - 3 * var(--process-gap)) / 4);
  /* Ancho útil de la imagen (columna menos padding horizontal de la tarjeta 8+8px) */
  --process-img-inner-w: min(280px, calc(var(--col-w) - 16px));
  --process-img-h: calc(var(--process-img-inner-w) * 365 / 512);
  --process-card-pad-top: 12px;
  --process-line-offset: 50px;
}
.process-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--process-gap);
  align-items: stretch;
  width: 100%;
}
.process-connector {
  position: absolute;
  z-index: 1;
  left: calc(var(--col-w) / 2);
  width: calc(3 * var(--col-w) + 3 * var(--process-gap));
  /* Centro vertical del área de la imagen (padding superior + mitad de alto renderizado) */
  top: calc(var(--process-card-pad-top) + var(--process-img-h) / 2 + var(--process-line-offset));
  transform: translateY(-50%);
  height: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  pointer-events: none;
}
.process-connector-fill {
  height: 100%;
  width: 0%;
  background: var(--grad);
  transform-origin: left center;
}
.process-connector-fill.animated {
  animation: processLineSequential 4.2s cubic-bezier(0.33, 1, 0.65, 1) infinite;
}
@keyframes processLineSequential {
  0% { width: 0%; }
  5% { width: 0%; }
  18% { width: 25%; }
  23% { width: 25%; }
  36% { width: 50%; }
  41% { width: 50%; }
  54% { width: 75%; }
  59% { width: 75%; }
  74% { width: 100%; }
  88% { width: 100%; }
  100% { width: 100%; }
}
.process-step-wrap {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 12px 8px 16px;
  border-radius: 20px;
  outline: none;
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
  transition: transform 0.42s cubic-bezier(0.34, 1.45, 0.64, 1), filter 0.38s ease;
}
.process-step-wrap .step-diorama,
.process-step-wrap .proceso-desc {
  transition: transform 0.42s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.process-wrapper:has(.process-step-wrap:hover) .process-step-wrap:not(:hover) {
  filter: brightness(0.68);
}
.process-step-wrap:hover {
  z-index: 6;
  filter: brightness(1);
}
.process-step-wrap:hover .step-diorama {
  transform: scale(1.2) translateY(-8px);
}
.process-step-wrap:hover .proceso-desc {
  transform: scale(1.16);
}
#proceso .proceso-desc {
  max-width: 200px;
  margin: 0;
  width: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .process-connector-fill.animated {
    animation: none;
    width: 100%;
  }
  .process-step-wrap {
    transition: none;
  }
  .process-wrapper:has(.process-step-wrap:hover) .process-step-wrap:not(:hover) {
    filter: none;
  }
  .process-step-wrap:hover .step-diorama,
  .process-step-wrap:hover .proceso-desc {
    transform: none;
  }
}
.step-desc { font-size: 14px; color: rgba(255,255,255,0.45); line-height: 1.6; }

/* ── TEAM ─── */
#equipo {
  background: var(--bg-light);
  padding: 64px 64px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: stretch;
}
.team-card {
  background: var(--white); border-radius: 20px;
  padding: 44px 28px;
  text-align: center;
  box-shadow: 0 2px 24px rgba(27,79,138,0.07);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  box-sizing: border-box;
}
.team-card:hover { transform: translateY(-6px); box-shadow: 0 16px 48px rgba(27,79,138,0.13); }
.team-avatar {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0 auto 24px;
  background: var(--bg-light);
  border: 2px solid rgba(27, 79, 138, 0.08);
  box-sizing: border-box;
}
.team-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 15%;
  /* Aclara sombras/fondos oscuros típicos en JPG (no sustituye a PNG con transparencia) */
  filter: brightness(1.12) contrast(1.04);
}
/* Fabián: un poco más de zoom y recorte para ocultar bordes irregulares del JPG en el círculo */
.team-grid .team-card:nth-child(1) .team-avatar img {
  object-position: center 18%;
  transform: scale(1.075);
  transform-origin: center center;
  filter: brightness(1.1) contrast(1.06);
}
/* Juan y Diego: zoom ligero dentro del círculo */
.team-grid .team-card:nth-child(2) .team-avatar img,
.team-grid .team-card:nth-child(3) .team-avatar img {
  object-position: center 14%;
  transform: scale(1.065);
  transform-origin: center center;
}
.team-name {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 20px; color: var(--blue-dark); margin-bottom: 4px;
  width: 100%;
}
.team-role { font-size: 14px; font-weight: 600; color: var(--teal); margin-bottom: 4px; width: 100%; }
.team-prev { font-size: 12px; color: var(--gray); margin-bottom: 16px; letter-spacing: 0.02em; width: 100%; }
.team-bio {
  font-size: 14px; color: rgba(27,79,138,0.7); line-height: 1.6;
  width: 100%;
  max-width: 280px;
  margin: 0;
  flex: 1;
}

/* ── WHY NEXO ─── */
#porque {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
  padding: 120px 64px;
  position: relative;
  overflow: hidden;
}
#porque::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(26,158,143,0.15) 0%, transparent 70%);
}
.porque-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
  max-width: 1100px; margin: 0 auto;
  position: relative; z-index: 1;
}
.porque-big {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.28em;
}
.porque-big-line {
  display: block;
}
.porque-reasons { display: flex; flex-direction: column; gap: 36px; }
.reason { display: flex; gap: 20px; align-items: flex-start; }
.reason-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(42,127,193,0.15), rgba(26,158,143,0.15));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.reason-icon svg { width: 22px; height: 22px; }
.reason-text h3 {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 16px; color: var(--white); margin-bottom: 6px;
}
.reason-text p { font-size: 14px; color: rgba(255,255,255,0.5); line-height: 1.6; }

/* ── CTA SECTION ─── */
#cta {
  background: var(--bg-dark);
  padding: 144px 64px;
  text-align: center;
  position: relative;
}
#cta .section-title { color: var(--white); position: relative; z-index: 1; margin-bottom: 20px; }
#cta .cta-sub {
  font-size: 18px; color: rgba(255,255,255,0.6);
  max-width: 560px; margin: 0 auto 48px;
  line-height: 1.6; position: relative; z-index: 1;
}
#cta .hero-ctas { position: relative; z-index: 1; }

/* ── FOOTER ─── */
footer {
  background: var(--bg-darkest);
  padding: 64px 64px 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  display: grid;
  /* Marca | espacio flexible | Servicios · Empresa · Contacto (misma separación entre las 3) */
  grid-template-columns: auto 1fr auto auto;
  gap: 40px 28px;
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 48px;
}
.footer-brand {
  justify-self: start;
  width: max-content;
  max-width: 220px;
}
/* Servicios pegado al grupo Empresa/Contacto; Contacto no se mueve */
.footer-col-services {
  justify-self: end;
  width: max-content;
}
/* Servicios: una columna, un enlace por fila (como Empresa / Contacto) */
.footer-col-services .footer-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(26,158,143,0.25));
}
.footer-logo-text {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 20px; color: var(--white); margin-bottom: 0;
}
.footer-tagline { font-size: 14px; color: rgba(255,255,255,0.4); line-height: 1.6; max-width: 240px; }
.footer-col h4 {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 20px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a {
  font-size: 14px; color: rgba(255,255,255,0.5);
  text-decoration: none; transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--white); }
.footer-bottom {
  display: flex; align-items: center; justify-content: flex-start;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 32px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.35); }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.footer-socials a:hover { border-color: var(--teal); color: var(--teal); }
.footer-socials a svg { width: 16px; height: 16px; }

/* ── SECTION OVERRIDES (formerly inline styles) ─── */

/* Logo accent color (span "Labs" in nav & footer) */
.nav-logo-text span,
.footer-logo-text span { color: var(--teal); }

/* Nav */
nav .nav-links { padding-left: 80px; gap: 38px; width: 580.823px; }
nav .nav-links a[href="#servicios"] { padding-left: 2px; }
nav .nav-links a[href="#porque"]    { width: 90px; }
nav .nav-links a[href="#equipo"],
footer .footer-col a[href="#equipo"] { display: none; }

/* Numbers */
#numeros .section-overline { font-size: 13px; font-family: sans-serif; }
#numeros .number-value { font-family: sans-serif; font-size: 50px; }

/* Services */
#servicios { font-family: sans-serif; }
#servicios .section-overline { font-family: sans-serif; font-size: 12px; }
#servicios .section-title { font-family: "DM Sans", sans-serif; font-size: 40px; }

/* Proceso */
#proceso { font-family: sans-serif; }
#proceso .section-overline { padding-top: 0; font-size: 12px; font-family: 'DM Sans', sans-serif; }
#proceso .section-title { font-family: "DM Sans", sans-serif; font-size: 40px; }

/* Equipo */
#equipo { font-family: "DM Sans", sans-serif; }
#equipo .section-overline { color: #1B4F8A; font-size: 12px; }
#equipo .section-title { font-family: 'DM Sans', sans-serif; font-size: 38px; }

/* Por qué */
#porque .section-overline { font-size: 16px; font-family: sans-serif; }
.porque-big { font-family: "DM Sans", sans-serif; }

/* CTA */
#cta .section-title { font-family: sans-serif; }

/* Footer — Empresa: ancho fijo en desktop */
.footer-inner > .footer-col:nth-child(3) { width: 144px; padding-left: 10px; }

/* ── PROCESS DIORAMA ─── */
.step-diorama {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45))
          drop-shadow(0 6px 16px rgba(26, 158, 143, 0.22));
}
.step-diorama img {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
}

/* ══════════════════════════════════════════
   DESKTOP ≥ 768px — sin sección Equipo
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  #equipo { display: none; }
}

/* ══════════════════════════════════════════
   TABLET ≤ 980px
   ══════════════════════════════════════════ */
@media (max-width: 980px) {
  #servicios, #proceso, #equipo { padding: 64px 32px; }
  #servicios {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
  }
  #porque {
    padding: 80px 32px;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
  }
  #cta {
    padding: 100px 32px;
    background: var(--bg-dark);
  }
  footer    { padding: 64px 32px 40px; }

  /* Servicios → 2 columnas */
  .services-grid { grid-template-columns: repeat(2, 1fr); }

  /* Proceso → 2×2, sin línea conectora */
  .process-cards    { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .process-connector { display: none; }

  /* Footer → brand arriba; Servicios · Empresa · Contacto en línea */
  .footer-inner {
    width: auto !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px 20px;
    margin-bottom: 40px;
  }
  .footer-col-services {
    justify-self: start;
  }
  .footer-inner .footer-brand {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
  }
}

/* ══════════════════════════════════════════
   MOBILE ≤ 767px
   ══════════════════════════════════════════ */
@media (max-width: 767px) {
  .section-inner { padding: 0; }

  /* ── SERVICIOS (fondo gradiente, igual que #porque) ── */
  #servicios {
    padding: 52px 20px;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
    position: relative;
    overflow: hidden;
  }
  #servicios::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(26,158,143,0.15) 0%, transparent 70%);
    pointer-events: none;
  }
  #servicios .section-title { font-size: 28px !important; }
  #servicios .section-sub { font-size: 15px; margin-bottom: 32px; }
  .services-grid { grid-template-columns: 1fr; gap: 14px; }

  /* ── PROCESO ── */
  #proceso { padding: 52px 20px; }
  #proceso .section-title { font-size: 28px !important; }
  #proceso .section-sub { font-size: 15px; margin-bottom: 32px; }
  .process-connector { display: none !important; }
  /* Cada paso: diorama izquierda + texto derecha */
  .process-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .process-step-wrap {
    flex-direction: row !important;
    text-align: left !important;
    align-items: center !important;
    gap: 16px !important;
  }
  .step-diorama {
    width: 175px;
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .step-diorama img {
    max-width: 175px !important;
    width: 175px;
  }
  #proceso .proceso-desc {
    max-width: 100% !important;
    text-align: left !important;
    flex: 1;
  }
  /* Efectos hover desactivados en táctil */
  .process-step-wrap:hover .step-diorama  { transform: none !important; }
  .process-step-wrap:hover .proceso-desc  { transform: none !important; }
  .process-wrapper:has(.process-step-wrap:hover) .process-step-wrap:not(:hover) { filter: none !important; }

  /* ── EQUIPO — oculto en móvil ── */
  #equipo { display: none; }

  /* ── DIVISOR entre Proceso y Por Qué ── */
  .section-mobile-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    background: var(--blue-dark);
  }
  .section-mobile-divider::after {
    content: '';
    width: 80px;
    height: 1px;
    background: rgba(255,255,255,0.28);
  }

  /* ── POR QUÉ (fondo gradiente, igual que desktop) ── */
  #porque {
    padding: 52px 20px 60px;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--bg-dark) 100%);
    position: relative;
    overflow: hidden;
  }
  #porque::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(26,158,143,0.15) 0%, transparent 70%);
    pointer-events: none;
  }
  .porque-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    position: relative;
    z-index: 1;
  }
  .porque-big { font-size: clamp(32px, 10vw, 52px) !important; }

  /* ── CTA (fondo plano, igual que desktop) ── */
  #cta {
    padding: 80px 20px;
    background: var(--bg-dark);
  }
  #cta .section-title { font-size: 28px !important; }
  #cta .cta-sub { font-size: 16px; margin-bottom: 32px; }
  #cta .hero-ctas {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    max-width: 100% !important;
    margin: 0 auto;
  }

  /* ── FOOTER ── */
  footer { padding: 52px 20px 32px; }
  .footer-inner {
    grid-template-columns: 1fr !important;
    width: auto !important;
    gap: 32px;
    margin-bottom: 32px;
  }
  .footer-inner .footer-brand { grid-column: auto; }
  .footer-tagline { max-width: 100%; }
  .footer-col-services { grid-column: 1 / -1; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
  }
}

/* ══════════════════════════════════════════
   EXTRA SMALL ≤ 480px
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  nav.nav-open .nav-links a { font-size: 22px !important; }
  .hero h1 { font-size: clamp(32px, 10vw, 44px); }
  .step-diorama { width: 140px; }
  .step-diorama img { max-width: 140px !important; width: 140px; }
}
