/* Valores: cada columna con su fotografía en movimiento lento bajo un tono azul petróleo */
.values {
  position: relative;
  background: var(--teal-950);
}

.values__heading {
  position: absolute;
  z-index: 2;
  top: 2.5rem;
  left: var(--pad);
  color: var(--orange);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.values__list {
  display: grid;
}

.value {
  --tint: 47 110 126;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 22rem;
  padding: 2.5rem var(--pad);
  overflow: hidden;
  outline-offset: -4px;
}

.value:nth-of-type(1) { --tint: 47 110 126; }
.value:nth-of-type(2) { --tint: 41 97 112; }
.value:nth-of-type(3) { --tint: 35 84 98; }
.value:nth-of-type(4) { --tint: 29 71 84; }
.value:nth-of-type(5) { --tint: 23 58 69; }

.value__media {
  position: absolute;
  inset: -16px;
  z-index: -2;
}

.value__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  animation: value-drift 18s ease-in-out infinite alternate;
  transition: opacity 0.6s var(--ease);
}

.value:nth-of-type(even) .value__media img {
  animation-direction: alternate-reverse;
  animation-duration: 22s;
}

/* Velo de color de la columna: denso arriba (donde está el texto) y más abierto abajo para ver la foto */
.value::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(var(--tint) / 0.97) 0%, rgb(var(--tint) / 0.9) 50%, rgb(var(--tint) / 0.45) 100%);
  transition: opacity 0.6s var(--ease);
}

@keyframes value-drift {
  from { transform: scale(1.08) translate(-2%, -1%); }
  to { transform: scale(1.22) translate(2%, 2%); }
}

.value.is-active .value__media img {
  opacity: 0.9;
}

.value.is-active::before {
  opacity: 0.85;
}

/* Elevación: el recuadro bajo el cursor sube por encima de los demás */
.value {
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.value:hover,
.value:focus-visible {
  z-index: 3;
  transform: translateY(-1rem);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(232 136 43 / 0.35);
}

/* Telón de entrada: GSAP lo recoge hacia arriba (scaleY 1 → 0) columna por columna */
.value__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--ink-950);
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
}

/* Barra de avance del foco automático */
.value__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
}

.value.is-active .value__bar {
  animation: value-progress var(--cycle, 2800ms) linear forwards;
}

.values.is-paused .value.is-active .value__bar {
  animation: none;
  transform: scaleX(1);
}

@keyframes value-progress {
  to { transform: scaleX(1); }
}

.value__icon,
.value__title,
.value__text {
  transition: transform 0.6s var(--ease);
}

/* El ícono destacado gira y se tiñe al activarse */
.value__icon {
  transition: transform 0.6s var(--ease), background-color 0.5s var(--ease);
}

.value.is-active .value__icon {
  background: var(--orange);
}

.value.is-active .value__icon svg {
  stroke: var(--ink-950);
}

.value.is-active .value__icon,
.value.is-active .value__title,
.value.is-active .value__text {
  transform: translateY(-0.5rem);
}

.value__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgb(18 19 21 / 0.35);
  backdrop-filter: blur(6px);
}

.value__icon svg {
  width: 1.5rem;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.value__title {
  font-family: var(--font-sans);
  font-size: 1.375rem;
  font-weight: 600;
}

.value__text {
  color: var(--white);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.35);
}

@media (min-width: 48em) {
  .values__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .value {
    min-height: 26rem;
    padding: 5rem 2rem 2.5rem;
  }
}

@media (min-width: 80em) {
  .values__list {
    grid-template-columns: repeat(5, 1fr);
  }

  .value {
    min-height: 32rem;
    padding: 5.5rem 2rem 2.75rem;
  }

  .values__heading {
    left: 2rem;
  }
}

/* Cinco columnas en pantallas de 2 columnas: la última ocupa el ancho completo */
@media (min-width: 48em) and (max-width: 79.99em) {
  .value:last-of-type {
    grid-column: 1 / -1;
  }
}

@media (max-width: 47.99em) {
  .value:first-of-type {
    padding-top: 5rem;
  }
}