/* =========================================================
   Nexia — estilos
   ========================================================= */

:root {
  --cream: #f7f4f2;
  --beige: #ece8e3;
  --white: #ffffff;

  --green-950: #062b23;
  --green-900: #083a2e;
  --green-800: #0b4d3d;
  --green-700: #0e6b52;
  --green-600: #128a63;
  --green-500: #16b87a;
  --green-400: #19e08c;
  --green-300: #57f0b0;
  --mint: #b8f5d4;

  --ink: #1f2a26;
  --muted: #4f5b57;

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --container: 1200px;
  --gutter: 36px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Tipografía ---------- */

.h2 {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--green-800);
}

.lead {
  margin-top: 20px;
  max-width: 520px;
  font-size: 14.5px;
  color: var(--muted);
}

.lead--narrow {
  max-width: 500px;
}

.tag {
  display: inline-block;
  margin-bottom: 22px;
  padding: 4px 12px;
  border: 1px solid rgba(22, 184, 122, 0.45);
  border-radius: 999px;
  background: rgba(184, 245, 212, 0.35);
  font-size: 11px;
  font-weight: 500;
  color: var(--green-700);
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(6, 43, 35, 0.18);
}

.btn:active {
  transform: translateY(0);
}

.btn--sm {
  padding: 10px 20px;
  font-size: 12.5px;
}

.btn--white {
  background: var(--white);
  color: var(--green-800);
}

.btn--mint {
  background: var(--mint);
  color: var(--green-900);
}

.btn--mint:hover {
  background: #c9f8df;
}

.btn--primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(90deg, #00664e 0%, #05db7f 100%);
  color: var(--white);
}

/* Hover: el verde oscuro crece de izquierda a derecha por encima del gradiente. */
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #004d3b 0%, #00664e 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--primary:hover::before,
.btn--primary:focus-visible::before {
  transform: scaleX(1);
}

.btn--primary:hover {
  box-shadow: 0 8px 20px rgba(0, 102, 78, 0.35);
}

/* Hover: aparece una flecha verde al lado del texto. */
.btn--arrow {
  gap: 0;
}

.btn__arrow {
  display: inline-grid;
  place-items: center;
  width: 0;
  height: 14px;
  overflow: hidden;
  color: #05db7f;
  opacity: 0;
  transform: translateX(-6px);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn__arrow svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.btn--arrow:hover .btn__arrow,
.btn--arrow:focus-visible .btn__arrow {
  width: 14px;
  margin-left: 10px;
  opacity: 1;
  transform: translateX(0);
}

.btn--icon {
  padding-right: 8px;
}

.btn__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--green-500);
  color: var(--white);
}

/* Hover: la flecha sale por la derecha y vuelve a entrar desde la izquierda. */
.btn--icon:hover .btn__icon svg,
.btn--icon:focus-visible .btn__icon svg {
  animation: arrow-swipe 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes arrow-swipe {
  0% {
    transform: translateX(0);
  }
  49% {
    transform: translateX(140%);
    opacity: 0;
  }
  50% {
    transform: translateX(-140%);
    opacity: 0;
  }
  51% {
    opacity: 1;
  }
  100% {
    transform: translateX(0);
  }
}

/* ---------- Logo ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  line-height: 0;
}

.logo__svg {
  width: 112px;
  height: auto;
}

.logo--lg {
  color: var(--white);
}

.logo--lg .logo__svg {
  width: 144px;
}

/* ---------- Decoraciones ---------- */

.deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.deco--ring {
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.deco--disc {
  border-radius: 50%;
  background: var(--green-400);
}

.deco--arc {
  border-radius: 50%;
  border: 44px solid var(--green-400);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding: var(--gutter) var(--gutter) 0;
}

.hero__card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Entra completo en la primera pantalla, con el mismo margen arriba y abajo. */
  height: calc(100svh - var(--gutter) * 2);
  min-height: 560px;
  max-height: 860px;
  padding: 26px 40px 40px;
  border-radius: var(--radius-xl);
  color: var(--white);
  background: #000 url("assets/img/hero.svg") center / cover no-repeat;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--cream);
}

/* El punto del isotipo sobresale arriba del wordmark: se sube el logo para que las
   letras (no la caja del SVG) queden centradas verticalmente. */
.nav .logo {
  transform: translateY(-4px);
}

.nav .btn {
  height: 44px;
  padding: 0 24px;
  font-size: 13px;
}

.hero__content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0 100px;
  text-align: center;
}

.hero__title {
  font-size: clamp(40px, min(6.2vw, 8.5vh), 68px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  max-width: 600px;
  margin: 28px auto 0;
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.86);
}

.hero__content .btn {
  margin-top: 30px;
}

.hero__badge {
  position: absolute;
  z-index: 2;
  right: 40px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px;
}

.hero__badge-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--white);
}

.hero__badge-icon img {
  width: 15px;
  height: 21px;
}

.hero__badge-card {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  margin-top: -28px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    grid-template-rows 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.45s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero__badge-inner {
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  color: var(--green-800);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.hero__badge-inner p {
  padding: 42px 22px 22px;
}

.hero__badge.is-open .hero__badge-card {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
}

/* =========================================================
   SECCIONES
   ========================================================= */

.section {
  padding-block: 90px;
}

/* ---------- Problema ---------- */

.problem {
  padding-top: 110px;
  overflow-x: clip;
}

.problem__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}

.problem__text {
  padding-top: 40px;
}

.problem__media {
  position: relative;
  padding-bottom: 130px;
}

.problem__photo {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.problem__back {
  width: 400px;
  height: auto;
  right: -110px;
  top: -40px;
}

.problem__line {
  z-index: 2;
  width: 140px;
  height: auto;
  left: 250px;
  bottom: 30px;
}

.problem__quote {
  position: absolute;
  z-index: 2;
  left: -110px;
  bottom: 86px;
  width: 340px;
  margin: 0;
  padding: 22px 26px;
  border-radius: var(--radius-sm);
  background: #f2e9e2;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--green-800);
}

/* ---------- Qué hacemos ---------- */

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 34px 32px;
  border-radius: var(--radius-md);
  background: var(--white);
}

.card h3 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--green-800);
}

.card p {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

.card h3 {
  position: relative;
  z-index: 1;
}

.services__grid .card {
  min-height: 290px;
}

/* Los vectores de cada card vienen dibujados a tamaño de card (368x289): se usan como fondo. */
.card--light {
  background: var(--white) url("assets/img/1.svg") center / cover no-repeat;
}

.card--dark {
  background: #00664e url("assets/img/2.svg") center / cover no-repeat;
}

.card--dark h3 {
  color: #05db7f;
}

.card--dark p {
  color: rgba(255, 255, 255, 0.86);
}

.card--bright {
  background: #05db7f url("assets/img/3.svg") center / cover no-repeat;
}

.card--bright h3 {
  color: var(--green-900);
}

.card--bright p {
  color: var(--green-950);
}

/* ---------- Gestión humana ---------- */

.h2--wide {
  max-width: 640px;
}

.human__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 60px;
  align-items: center;
  margin-top: 40px;
}

.human__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* Una foto por instancia: se apilan y la activa se funde sobre la anterior. */
.human__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.human__photo.is-active {
  opacity: 1;
}

.accordion__trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: rgba(11, 77, 61, 0.55);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.accordion__trigger:hover {
  color: var(--green-800);
}

.accordion__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(11, 77, 61, 0.45);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.accordion__item.is-open .accordion__trigger {
  color: var(--green-800);
}

.accordion__item.is-open .accordion__dot {
  background: #05db7f;
  border-color: #05db7f;
}

.accordion__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  overflow: hidden;
  background: rgba(11, 77, 61, 0.14);
}

.accordion__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #00664e 0%, #05db7f 100%);
}

.accordion__item.is-open .accordion__bar {
  height: 2px;
  background: #00664e;
}

.accordion__item.is-open .accordion__bar-fill {
  animation: accordion-progress var(--autoplay, 5000ms) linear forwards;
}

@keyframes accordion-progress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.accordion__panel {
  overflow: hidden;
}

.accordion__panel-inner {
  padding: 18px 0 24px;
}

.accordion__panel h3 {
  font-size: 22px;
  font-weight: 500;
  color: var(--green-800);
}

.accordion__panel p {
  font-size: 14px;
  color: var(--muted);
}

.accordion__panel h3 + p {
  margin-top: 12px;
}

/* ---------- Cobertura ---------- */

.coverage__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card--plain {
  grid-column: span 2;
  padding: 32px 30px;
}

.card__border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.card__border rect {
  x: 0.5px;
  y: 0.5px;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  rx: calc(var(--radius-md) - 0.5px);
  fill: none;
  stroke: url(#card-stroke);
  stroke-width: 1;
  stroke-linecap: butt;
  /* Dos trazos que nacen en la esquina superior izquierda y se encuentran abajo a la derecha. */
  stroke-dasharray: 0 1 0;
  transition: stroke-dasharray 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card--plain:hover .card__border rect,
.card--plain:focus-within .card__border rect {
  stroke-dasharray: 0.5 0 0.5;
}

.card--plain h3 {
  font-size: 21px;
}

.card--wide {
  grid-column: span 3;
}

/* ---------- CTA ---------- */

.cta__card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  min-height: 400px;
  border-radius: var(--radius-xl);
  color: var(--white);
  background: #0b4d3d url("assets/img/bg-card.webp") center / cover no-repeat;
}

.cta__text {
  position: relative;
  z-index: 1;
  padding: 64px 56px;
  align-self: center;
}

.cta__text h2 {
  font-size: clamp(30px, 2.9vw, 40px);
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.cta__text p {
  margin-top: 22px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.9);
}

.cta__text p + p {
  margin-top: 8px;
}

.cta__text .btn {
  margin-top: 26px;
}

.cta__media {
  position: relative;
  min-height: 320px;
  container-type: size;
}

/* Máscara: un círculo (radio relativo a la altura) unido a un rectángulo hacia la derecha,
   así solo el lado izquierdo de la foto queda curvo y el resto llega a las esquinas. */
.cta__media img {
  --r: 64cqh;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask:
    radial-gradient(circle var(--r) at var(--r) 50%, #000 calc(100% - 1.5px), transparent 100%),
    linear-gradient(#000 0 0) right / calc(100% - var(--r)) 100% no-repeat;
  mask:
    radial-gradient(circle var(--r) at var(--r) 50%, #000 calc(100% - 1.5px), transparent 100%),
    linear-gradient(#000 0 0) right / calc(100% - var(--r)) 100% no-repeat;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  padding: 40px var(--gutter) var(--gutter);
}

.footer__card {
  position: relative;
  overflow: hidden;
  padding: 90px 40px 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--white);
  background: #000 url("assets/img/footer.svg") center / cover no-repeat;
}

.footer__card > * {
  position: relative;
  z-index: 1;
}

.footer__lead {
  margin-top: 64px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
}

.footer__form {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 40px auto 0;
}

.footer__form input {
  flex: 1;
  min-width: 0;
  padding: 13px 20px;
  border: 1px solid rgba(184, 245, 212, 0.55);
  border-radius: 999px;
  background: rgba(6, 43, 35, 0.35);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--white);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.footer__form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.footer__form input:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(25, 224, 140, 0.2);
}

.footer__form input[aria-invalid="true"] {
  border-color: #ff8a8a;
}

.footer__status {
  min-height: 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--mint);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 110px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

.footer__links a:hover {
  color: var(--mint);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1080px) {
  .problem__quote {
    left: 16px;
  }
}

@media (max-width: 900px) {
  :root {
    --gutter: 20px;
  }

  .section {
    padding-block: 64px;
  }

  .hero__card {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 14px 16px 40px;
  }

  .nav {
    padding: 0 16px;
  }



  .logo__svg {
    width: 96px;
  }

  .hero__content {
    padding: 90px 0 0;
  }

  .hero__badge {
    position: static;
    width: 100%;
    max-width: 360px;
    margin: 60px auto 0;
  }

  .problem {
    padding-top: 70px;
  }

  .problem__grid,
  .human__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .problem__text {
    padding-top: 0;
  }

  .problem__media {
    padding-bottom: 80px;
  }

  .problem__back {
    width: 240px;
    right: -100px;
    top: -50px;
  }

  .problem__line {
    width: 90px;
    left: 24px;
    bottom: 30px;
  }

  .problem__quote {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 30px;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .services__grid .card {
    min-height: 0;
  }

  .human__grid {
    gap: 30px;
  }

  .human__media {
    order: -1;
  }

  .coverage__grid {
    grid-template-columns: 1fr;
  }

  .card--plain,
  .card--wide {
    grid-column: auto;
  }

  .cta__card {
    grid-template-columns: 1fr;
  }

  .cta__text {
    padding: 44px 28px;
  }

  .cta__text h2 {
    white-space: normal;
  }

  .cta__media img {
    -webkit-mask: none;
    mask: none;
  }

  .footer__card {
    padding: 64px 24px 32px;
  }

  .footer__lead {
    margin-top: 40px;
  }

  .footer__form {
    flex-direction: column;
    align-items: stretch;
  }

  .footer__form .btn {
    justify-content: center;
  }

  .footer__links {
    flex-direction: column;
    gap: 16px;
    margin-top: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .btn--primary::before,
  .btn__arrow,
  .accordion__trigger,
  .accordion__dot {
    transition: none;
  }

  .btn--icon:hover .btn__icon svg {
    animation: none;
  }

  .human__photo {
    transition: none;
  }

  .accordion__item.is-open .accordion__bar-fill {
    animation: none;
    width: 100%;
  }

}
