/* Home refinements: Empresa slider, service descriptions, project details and service clipping. */

/* --- Empresa / company intro --- */
.intro-grid {
  grid-template-columns: 120px minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(42px, 5vw, 72px);
  align-items: center;
}

.intro-heading {
  align-self: center;
}

.intro-heading h2 {
  max-width: 760px;
  font-size: clamp(2.6rem, 4.5vw, 5rem);
}

.intro-description {
  max-width: 690px;
  margin-top: 30px;
}

.intro-description p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.82;
  color: var(--text-soft);
}

.intro-description .text-link {
  margin-top: 28px;
}

.company-slider {
  min-height: 520px;
  background: #d7d8d2;
  isolation: isolate;
  cursor: pointer;
}

.company-slider-track {
  position: absolute;
  inset: 0;
}

.company-slide {
  overflow: hidden;
}

.company-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.82) contrast(1.03) brightness(.9);
}

.company-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, rgba(1, 45, 34, .48) 100%);
}

/* --- Services: only the active scroll portion is visible --- */
.services-stage {
  overflow: hidden;
}

.service-card-description {
  position: absolute;
  z-index: 2;
  left: clamp(22px, 3vw, 36px);
  bottom: clamp(22px, 3vw, 34px);
  width: min(620px, 58%);
  padding-top: 16px;
  border-top: 1px solid rgba(251, 251, 247, .32);
}

.service-card-description span {
  display: block;
  margin-bottom: 8px;
  color: var(--vg-earth);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.service-card-description p {
  margin: 0;
  color: rgba(251, 251, 247, .82);
  font-size: clamp(.78rem, .92vw, .94rem);
  line-height: 1.68;
}

/* --- Projects: keep the 3D track from stealing hit-testing from cards behind its Z=0 plane. --- */
.projects-track {
  pointer-events: none;
}

.project-card {
  position: relative;
  cursor: pointer;
  isolation: isolate;
  transform-style: flat !important;
  backface-visibility: hidden;
  pointer-events: auto;
}

.project-card > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
}

.project-card::after {
  display: none !important;
}

.project-overlay {
  position: absolute !important;
  z-index: 10 !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(1, 30, 23, .08) 0%, rgba(1, 38, 29, .24) 40%, rgba(1, 43, 33, .92) 100%);
  opacity: 0 !important;
  visibility: hidden;
  transform: none !important;
  pointer-events: none;
  backface-visibility: hidden;
  transition: opacity .28s ease, visibility 0s linear .28s;
}

.project-card:hover > img,
.project-card:focus > img,
.project-card:focus-visible > img,
.project-card.is-hovered > img,
.project-card.is-active > img {
  filter: blur(4px) brightness(.68) saturate(.72);
  transform: scale(1.075);
}

.project-card:hover .project-overlay,
.project-card:focus .project-overlay,
.project-card:focus-visible .project-overlay,
.project-card.is-hovered .project-overlay,
.project-card.is-active .project-overlay {
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity .28s ease, visibility 0s;
}

@media (max-width: 1040px) {
  .intro-grid {
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: start;
  }

  .company-slider {
    grid-column: 2;
    min-height: 470px;
  }
}

@media (max-width: 760px) {
  .company-slider {
    min-height: 420px;
  }

  .service-card-description {
    width: min(520px, 66%);
  }
}

@media (max-width: 640px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .section-marker,
  .intro-heading,
  .company-slider {
    grid-column: auto;
  }

  .intro-heading h2 {
    font-size: clamp(2.4rem, 11.8vw, 3.9rem);
  }

  .intro-description {
    margin-top: 24px;
  }

  .company-slider {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .service-card-description {
    left: 18px;
    right: 18px;
    bottom: 16px;
    width: auto;
    padding-top: 10px;
  }

  .service-card-description span {
    margin-bottom: 5px;
    font-size: .54rem;
  }

  .service-card-description p {
    font-size: .72rem;
    line-height: 1.48;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-height: 640px) {
  html,
  body {
    overflow: hidden !important;
  }

  body::after {
    content: "Gira tu teléfono\A para continuar";
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 142px 24px 24px;
    box-sizing: border-box;
    background-color: #012F24;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20120%20120'%20fill='none'%3E%3Crect%20x='44'%20y='25'%20width='32'%20height='70'%20rx='6'%20stroke='%23FBFBF7'%20stroke-width='3'/%3E%3Ccircle%20cx='60'%20cy='30'%20r='1.6'%20fill='%23FBFBF7'/%3E%3Cpath%20d='M31%2030C18%2042%2017%2060%2028%2073'%20stroke='%23FBFBF7'%20stroke-width='4'%20stroke-linecap='round'/%3E%3Cpath%20d='M20%2067L29%2078L35%2064'%20fill='%23FBFBF7'/%3E%3Cpath%20d='M89%2090C102%2078%20103%2060%2092%2047'%20stroke='%23FBFBF7'%20stroke-width='4'%20stroke-linecap='round'/%3E%3Cpath%20d='M100%2053L91%2042L85%2056'%20fill='%23FBFBF7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center calc(50% - 42px);
    background-size: 128px 128px;
    color: #FBFBF7;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: .02em;
    text-align: center;
    white-space: pre-line;
    pointer-events: all;
  }
}
