/* Nuestro trabajo — galería de fichas en movimiento lento */

.is-trabajo .scroll-indicator {
  opacity: 1;
}

.is-trabajo .sys-hero__video {
  transform: none;
}

.work-stage {
  position: relative;
  background: var(--surface);
  color: var(--blue-deep);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-margin-top: var(--header-h);
}

.work-stage__copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.6rem) var(--gutter) 1.15rem;
  background: var(--surface);
}

.work-stage__kicker {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

.work-stage__copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0;
}

.work-stage__canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: min(32rem, 58vh);
  overflow: hidden;
}

.work-flow {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 28rem));
  justify-content: center;
  align-items: start;
  gap: clamp(0.85rem, 1.5vw, 1.2rem);
  padding: 0.35rem clamp(1.25rem, 4vw, 2.75rem) 1rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.work-flow__col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  height: max-content;
  align-self: start;
  will-change: transform;
  animation: work-flow-y var(--work-dur, 150s) linear infinite;
}

.work-flow__col[data-dir="down"] {
  animation-direction: reverse;
}

.work-flow__col:nth-child(2) {
  margin-top: 5.5rem;
  animation-delay: -18s;
}

.work-flow__col:nth-child(3) {
  margin-top: 2.4rem;
  animation-delay: -36s;
}

.work-flow.is-paused .work-flow__col {
  animation-play-state: paused;
}

.work-card {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
  height: 19rem;
  border-radius: 14px;
  overflow: hidden;
  background: #dfe5ea;
  box-shadow:
    0 4px 12px rgba(11, 58, 91, 0.1),
    0 16px 32px rgba(11, 58, 91, 0.12);
  cursor: pointer;
  transition: box-shadow 0.4s var(--ease-out);
}

.work-card--short {
  height: 15.25rem;
}

.work-card--tall {
  height: 23rem;
}

.work-card:hover {
  box-shadow:
    0 10px 24px rgba(11, 58, 91, 0.14),
    0 22px 40px rgba(11, 58, 91, 0.18);
}

.work-card img,
.work-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  animation: work-ken 26s ease-in-out infinite alternate;
}

.work-card--video::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0.55rem;
  bottom: 0.55rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  pointer-events: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%231578a8' d='M4.1 2.15v7.7l6.15-3.85z'/%3E%3C/svg%3E") center / 0.72rem no-repeat;
  box-shadow: 0 6px 16px rgba(11, 58, 91, 0.16);
}

@keyframes work-flow-y {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes work-ken {
  from {
    transform: scale(1.03);
  }
  to {
    transform: scale(1.1);
  }
}

.work-stage.is-static .work-flow__col,
.work-stage.is-static .work-card img,
.work-stage.is-static .work-card video {
  animation: none;
  margin-top: 0;
  will-change: auto;
}

.work-stage.is-static {
  display: block;
  min-height: 0;
  overflow: visible;
}

.work-stage.is-static .work-stage__canvas {
  min-height: 0;
  height: auto;
  overflow: visible;
}

.work-stage.is-static .work-flow {
  position: relative;
  inset: auto;
  height: auto;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 46rem;
  margin-inline: auto;
  padding-bottom: 3.5rem;
}

.work-stage.is-static .work-flow__col {
  display: contents;
}

.work-lightbox {
  width: min(92vw, 68rem);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.work-lightbox::backdrop {
  background: rgba(11, 31, 51, 0.88);
}

.work-lightbox__stage {
  display: grid;
  place-items: center;
}

.work-lightbox__stage img,
.work-lightbox__stage video {
  width: auto;
  max-width: min(92vw, 68rem);
  max-height: min(86vh, 52rem);
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  background: #0b2438;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.work-lightbox__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(11, 58, 91, 0.2);
}

.work-lightbox__close svg {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
}

.work-lightbox__close:hover,
.work-lightbox__close:focus-visible {
  background: var(--orange);
  color: #fff;
}

@media (max-width: 900px) {
  .work-stage__copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .work-stage__copy h2 {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .work-card,
  .work-card--short,
  .work-card--tall {
    height: 12.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-flow__col,
  .work-card img,
  .work-card video {
    animation: none;
  }
}
