/* ==========================================================================
   Secciones de la página: hero, datos, servicios, clientes, proyectos, nosotros, contacto
   ========================================================================== */

/* --- Hero --------------------------------------------------------------- */

/* Móvil (< 40rem): foto completa arriba y texto debajo sobre fondo azul,
   para que el texto no tape al técnico. Desde 40rem: texto sobre la foto. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--jpc-azul-950);
  color: #e3edf6;
}

.hero__media {
  position: relative;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(180deg, rgb(2 31 58 / 0) 0%, var(--jpc-azul-950) 100%);
}

.hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero__content {
  padding-block: var(--space-m) clamp(4.5rem, 12vw, 5.5rem);
}

@media (min-width: 40rem) {
  .hero {
    display: grid;
    align-items: end;
    min-height: clamp(34rem, calc(100svh - var(--header-h)), 46rem);
  }

  .hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
  }

  .hero__media::after {
    content: none;
  }

  .hero__media img {
    height: 100%;
    aspect-ratio: auto;
    object-position: 50% 35%;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
      180deg,
      rgb(2 31 58 / 0.2) 0%,
      rgb(2 31 58 / 0.62) 30%,
      rgb(2 31 58 / 0.9) 52%,
      rgb(2 31 58 / 0.96) 100%
    );
  }

  .hero__content {
    padding-block: 8rem clamp(5rem, 9vw, 7.5rem);
  }
}

.hero__text {
  max-width: 44rem;
}

.hero .eyebrow {
  color: #a6e0e7;
}

/* Título largo ("Elaboración y ejecución de proyectos…"): algo más pequeño que --step-4. */
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 1.3rem + 2.9vw, 3.4rem);
  line-height: 1.04;
}

.hero h1 em {
  font-style: italic;
  color: var(--jpc-verde);
}

.hero__lead {
  margin-top: var(--space-l);
  font-size: var(--step-1);
  line-height: 1.55;
  color: #dbe7f2;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  margin-top: var(--space-xl);
}

.hero__arc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(2.5rem, 6vw, 5.5rem);
  pointer-events: none;
}

@media (min-width: 48rem) {
  .hero {
    align-items: center;
  }

  .hero__media img {
    object-position: 60% 40%;
  }

  .hero::before {
    background: linear-gradient(
      90deg,
      rgb(2 31 58 / 0.95) 0%,
      rgb(2 31 58 / 0.88) 45%,
      rgb(2 31 58 / 0.5) 70%,
      rgb(2 31 58 / 0.15) 100%
    );
  }

  .hero__content {
    padding-block: 5rem 7rem;
  }
}

/* --- Datos clave -------------------------------------------------------- */

.facts {
  position: relative;
  padding-block: var(--space-l) var(--space-xl);
}

.facts__list {
  list-style: none;
  display: grid;
  gap: var(--space-m);
}

.facts__item {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-m) 0;
  border-bottom: 1px solid var(--c-line);
}

.facts__item:last-child {
  border-bottom: 0;
}

.facts__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 50%;
  background: var(--jpc-azul-50);
  color: var(--jpc-azul-oscuro);
}

.facts__item strong {
  display: block;
  color: var(--jpc-azul-900);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.1;
}

.facts__label {
  display: block;
  font-size: var(--step--1);
}

@media (min-width: 48rem) {
  .facts__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-l);
  }

  .facts__item {
    padding: var(--space-s) var(--space-l) var(--space-s) 0;
    border-bottom: 0;
    border-right: 1px solid var(--c-line);
  }

  .facts__item:last-child {
    border-right: 0;
  }
}

/* --- Servicios ---------------------------------------------------------- */

/* Móvil: 1 columna. Tablet: 2 columnas (las tarjetas anchas ocupan la fila entera).
   Escritorio: 4 columnas; "Instalación" y "Chillers, compresores y sistemas VRF"
   ocupan 2 cada una en la primera fila y las otras cuatro van debajo. */
.services-grid {
  list-style: none;
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 40rem) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid__wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .services-grid__wide {
    grid-column: span 2;
  }

  .services-grid > li:not(.services-grid__wide) .service-card h3 {
    font-size: clamp(1.25rem, 0.85rem + 0.8vw, 1.5rem);
  }
}

/* --- Clientes (portafolio) ---------------------------------------------- */

.clients {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(50rem 28rem at 100% 0%, rgb(78 183 196 / 0.28), transparent 60%),
    linear-gradient(160deg, var(--jpc-azul-oscuro) 0%, var(--jpc-azul-800) 55%, var(--jpc-azul-900) 100%);
  color: #d6e4f0;
}

/* Arcos del logo (verde y azul claro) como fondo decorativo, en la mitad inferior,
   por detrás de las tarjetas para no cruzar el texto del encabezado. */
.clients__arcs {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  width: 100%;
  height: 58%;
  opacity: 0.35;
  pointer-events: none;
}

.clients .eyebrow {
  color: #cfe8a0;
}

.clients h2 {
  color: #fff;
}

.clients__head {
  max-width: 46rem;
}

.clients__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-m);
}

@media (min-width: 56rem) {
  .clients__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-l);
  }
}

.client-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(6.5rem, 5rem + 5vw, 9rem);
  padding: var(--space-l) var(--space-m);
  border-radius: var(--radius-l);
  background: #fff;
  box-shadow: 0 18px 40px -20px rgb(2 31 58 / 0.7);
  text-align: center;
  overflow: hidden;
}

.client-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--jpc-verde), var(--jpc-azul-claro));
}

.client-card:nth-child(even)::before {
  background: linear-gradient(90deg, var(--jpc-azul-claro), var(--jpc-verde));
}

.client-card__name {
  color: var(--jpc-azul-oscuro);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 0.9rem + 1.4vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

.clients__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m) var(--space-l);
  margin-top: var(--space-xl);
}

.clients__more {
  font-size: var(--step-1);
  color: #e3edf6;
}

/* --- Proyectos: galería ------------------------------------------------- */

.gallery {
  list-style: none;
  display: grid;
  gap: var(--space-l);
}

.gallery__figure {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.gallery__trigger {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--jpc-azul-100);
  box-shadow: var(--shadow-s);
}

.gallery__trigger picture,
.gallery__trigger img {
  width: 100%;
  height: 100%;
}

.gallery__trigger img {
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  transition: transform 600ms var(--ease);
}

.gallery__trigger:hover img {
  transform: scale(1.04);
}

.gallery__zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgb(2 31 58 / 0.78);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color var(--dur) var(--ease);
}

.gallery__trigger:hover .gallery__zoom,
.gallery__trigger:focus-visible .gallery__zoom {
  background: var(--jpc-azul-oscuro);
}

.gallery__caption {
  display: flex;
  gap: 0.5rem;
  font-size: var(--step--1);
  line-height: 1.45;
}

.gallery__caption strong {
  color: var(--jpc-azul-900);
}

.gallery__item--tall .gallery__trigger {
  aspect-ratio: 4 / 5;
}

@media (min-width: 40rem) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery__trigger,
  .gallery__item--tall .gallery__trigger {
    aspect-ratio: 1;
  }
}

@media (min-width: 64rem) {
  .gallery {
    grid-template-columns: repeat(12, 1fr);
  }

  .gallery__item:nth-child(1) {
    grid-column: span 7;
  }

  .gallery__item:nth-child(2) {
    grid-column: span 5;
  }

  .gallery__item:nth-child(3),
  .gallery__item:nth-child(4) {
    grid-column: span 6;
  }

  .gallery__trigger,
  .gallery__item--tall .gallery__trigger {
    aspect-ratio: auto;
    height: clamp(20rem, 30vw, 27rem);
  }
}

/* --- Sobre nosotros ----------------------------------------------------- */

.about {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.about__media {
  position: relative;
  isolation: isolate;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.about__media::before {
  content: "";
  position: absolute;
  inset: 1rem -1rem -1rem 1rem;
  z-index: -1;
  border-radius: var(--radius-l);
  background: linear-gradient(135deg, var(--jpc-verde) 0%, var(--jpc-azul-claro) 55%, var(--jpc-azul-oscuro) 100%);
}

.about__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 72%;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
}

.about__body > p:not(.eyebrow) {
  margin-top: var(--space-m);
}

.about__body h2 {
  max-width: 30rem;
}

.about__body h2 + p {
  margin-top: var(--space-l) !important;
  font-size: var(--step-1);
}

.checklist {
  list-style: none;
  display: grid;
  gap: var(--space-s);
  margin-block: var(--space-xl);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  color: var(--jpc-azul-900);
  font-weight: 500;
}

.checklist .icon {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.2rem;
  border-radius: 50%;
  background: var(--jpc-verde);
  color: var(--jpc-azul-950);
  stroke-width: 2.5;
}

@media (min-width: 40rem) and (max-width: 63.99rem) {
  .about__media {
    max-width: 34rem;
  }
}

@media (min-width: 64rem) {
  .about {
    grid-template-columns: 5fr 6fr;
    gap: clamp(3rem, 6vw, 5.5rem);
  }

  .about__media img {
    aspect-ratio: 3 / 4;
    object-position: 50% 50%;
  }
}

/* --- Contacto ----------------------------------------------------------- */

.section--dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 110% -10%, rgb(0 73 141 / 0.9), transparent 60%),
    radial-gradient(40rem 26rem at -20% 110%, rgb(78 183 196 / 0.18), transparent 60%),
    var(--jpc-azul-950);
  color: #c9d8e6;
}

.section--dark h2 {
  color: #fff;
}

.section--dark .eyebrow {
  color: var(--jpc-verde);
}

.section--dark a:not(.btn) {
  color: #8fd6df;
}

.contact {
  display: grid;
  gap: var(--space-2xl);
  align-items: start;
}

.contact > * {
  min-width: 0;
  overflow-wrap: break-word;
}

.contact__intro > p:not(.eyebrow) {
  margin-top: var(--space-m);
  font-size: var(--step-1);
}

.contact-list {
  list-style: none;
  display: grid;
  gap: var(--space-m);
  margin: var(--space-xl) 0 0;
}

.contact-list__item {
  display: flex;
  gap: var(--space-m);
  align-items: flex-start;
}

.contact-list__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.14);
  color: var(--jpc-azul-claro);
}

.contact-list__item p {
  overflow-wrap: break-word;
}

.contact-list__item p + p {
  margin-top: 0;
}

.contact-list__label {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.contact-card {
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  border-radius: var(--radius-l);
  background: #fff;
  color: var(--c-text);
  box-shadow: var(--shadow-l);
}

.contact-card .notice {
  margin-bottom: var(--space-xl);
}

.contact-card a:not(.btn) {
  color: var(--jpc-azul-oscuro);
}

.noscript-msg {
  margin-bottom: var(--space-l);
  padding: var(--space-m);
  border-radius: var(--radius-m);
  background: #fff4e5;
  color: #6a3b00;
}

@media (min-width: 64rem) {
  .contact {
    grid-template-columns: 5fr 7fr;
    gap: clamp(3rem, 6vw, 5rem);
  }

  .contact__intro {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

/* --- Página 404 --------------------------------------------------------- */

.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h));
  padding-block: var(--space-3xl);
  text-align: center;
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 3rem + 8vw, 8rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(90deg, var(--jpc-verde), var(--jpc-azul-claro), var(--jpc-azul-oscuro));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h1 {
  margin-top: var(--space-s);
  font-size: var(--step-3);
}

.error-page p {
  max-width: 32rem;
  margin: var(--space-m) auto var(--space-xl);
}
