/* ─── WORK ───────────────────────────────────────────────── */
.work {
  padding: 124px 56px;
  border-bottom: 1px solid var(--b0);
}
.work-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--b0);
}
.work-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
  opacity: .7;
}
.work-title {
  font-family: var(--f-disp);
  font-size: clamp(28px, 3.8vw, 52px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .95;
  color: var(--fg);
  text-wrap: balance;
}
.work-count {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .2em;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 4px;
}

.reel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
a.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.vid-card {
  cursor: pointer;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.vid-thumb {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}
.vid-bg {
  position: absolute;
  inset: 0;
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.vid-card:hover .vid-bg { transform: scale(1.05); }
.vid-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.vid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12,12,10,.3);
  transition: background .3s;
}
.vid-card:hover .vid-overlay { background: rgba(12,12,10,.05); }
.play-sm {
  width: 50px;
  height: 50px;
  border: 1.5px solid var(--b2);
  display: grid;
  place-items: center;
  color: var(--fg);
  font-size: 16px;
  transition: opacity .3s, transform .3s;
}
.vid-card:hover .play-sm { opacity: 0; transform: scale(.9); }

/* Project number badge */
.vid-num {
  position: absolute;
  top: 16px;
  left: 18px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 2;
}

.vid-info {
  padding: 18px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--b0);
}
.vid-title {
  font-family: var(--f-disp);
  font-style: italic;
  font-size: 19px;
  color: var(--fg);
}
.vid-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Thumbnail palettes */
.vb-1 { background: linear-gradient(155deg, #1e1a14 0%, #100c08 55%, #191510 100%); }
.vb-2 { background: linear-gradient(220deg, #141820 0%, #0c1016 55%, #181e28 100%); }
.vb-3 { background: linear-gradient(45deg, #181614 0%, #0e0c0c 55%, #1c1918 100%); }
.vb-4 { background: linear-gradient(295deg, #141a16 0%, #0c1210 55%, #182018 100%); }

/* Textures */
.tx-scan {
  background-image: repeating-linear-gradient(
    0deg, transparent 0, transparent 3px,
    rgba(237,233,220,.03) 3px, rgba(237,233,220,.03) 4px
  );
}
.tx-diag {
  background-image: repeating-linear-gradient(
    -45deg, transparent 0, transparent 8px,
    rgba(237,233,220,.02) 8px, rgba(237,233,220,.02) 9px
  );
}
.tx-grid {
  background-image:
    repeating-linear-gradient(0deg, rgba(237,233,220,.018) 0, rgba(237,233,220,.018) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(237,233,220,.018) 0, rgba(237,233,220,.018) 1px, transparent 1px, transparent 40px);
}
.tx-noise {
  background-image: repeating-linear-gradient(
    72deg, transparent 0, transparent 14px,
    rgba(237,233,220,.015) 14px, rgba(237,233,220,.015) 15px
  );
}

/* ─── WORK CAROUSEL ─── */
.work-carousel {
  padding: 80px 56px;
  position: relative;
  overflow: hidden;   /* clip para cards 3D que sobresalen del borde */
  z-index: 1; /* stacking context propio; nav fixed z-index:200 queda siempre encima */
  min-height: 100vh;  /* para centrar wc-viewport en viewports muy altos */
}
.wc-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 0;
  position: relative; /* queda encima del wc-viewport absoluto */
  z-index: 2;
}
.wc-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}
.wc-title {
  font-family: var(--f-disp);
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  color: var(--fg);
}
.wc-count {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.wc-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  align-self: flex-end;
}
.wc-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--b2);
  border-radius: 4px;
  transition: background .2s, border-color .2s;
}
.wc-all-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wc-viewport {
    position: absolute;
    top: 50%;
    left: 56px;
    right: 56px;
    transform: translate(17%, -48%);
    height: 540px;
    overflow: visible;
    perspective: 900px;
    perspective-origin: 47% 44%;
}
.wc-planes {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* ── Planos ── */
.project-plane {
  position: absolute;
  width: 260px;
  height: 370px;
  top: 50%;
  left: 50%;
  margin-top: -185px;
  margin-left: -130px;
  cursor: pointer;
  will-change: transform, filter;
  transition: translate 0.35s ease, scale 0.4s ease;
}
.project-plane:hover {
  translate: 0 -12px;
}
.project-plane.is-active {
  cursor: pointer;
  scale: 1.2;
}
/* Fondo apagado: desaturado y ligeramente oscurecido — sin color concreto, pura sombra */
.project-plane[data-phantom="true"] .pp-bg {
  filter: saturate(0.1) brightness(0.75);
}
.project-plane[data-phantom="true"] .pp-texture {
  opacity: 0.35;
}

/* Phantom cards: solo fondo visual, sin interacción */
.project-plane[data-phantom="true"] {
  cursor: default;
}
.project-plane[data-phantom="true"]:hover {
  translate: 0 0;
}
.project-plane[data-phantom="true"].is-active {
  scale: 1;
}

/* Número: fuera del frame, encima del borde superior */
.pp-num-badge {
  position: absolute;
  top: -22px;
  left: 0;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .22em;
  z-index: 2;
  pointer-events: none;
  line-height: 1;
}

/* Frame interno: recorta la imagen */
.pp-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.pp-thumb {
  position: absolute;
  inset: 0;
}
.pp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pp-bg {
  position: absolute;
  inset: 0;
}
.pp-texture {
  position: absolute;
  inset: 0;
  opacity: 0.3;
}

/* Label lateral: sale del centro derecho del plano en hover */
.pp-info {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}
.project-plane:hover .pp-info { opacity: 1; }

/* Card activa (centro): label siempre visible como cue para abrir modal */
.project-plane.is-active .pp-info { opacity: 1; }
.project-plane.is-active .pp-line {
  background: var(--accent);
  width: 56px;
}

.pp-line {
  display: block;
  width: 44px;
  height: 1px;
  background: rgba(232, 228, 220, 0.45);
  flex-shrink: 0;
  margin-right: 10px;
  margin-top: 6px;
}
.pp-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pp-title {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--fg);
  letter-spacing: .26em;
  text-transform: uppercase;
  font-weight: 400;
}
.pp-tag {
  font-family: var(--f-mono);
  font-size: 8px;
  color: var(--accent);
  letter-spacing: .2em;
  text-transform: uppercase;
}


/* ── VideoPlayer ─────────────────────────────────────────────────────────── */
.video-player { position: relative; }
.video-player.vp-ready { background: var(--bg); }

.vp-inner {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

.vp-media {
  position: absolute;
  inset: 0;
}
.vp-media iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.vp-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vp-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .35s ease;
}

.vp-play-hint {
  width: 64px;
  height: 64px;
  border: 2px solid var(--b2);
  display: grid;
  place-items: center;
  color: var(--fg);
  font-size: 22px;
  transition: background .25s, color .25s, border-color .25s;
}
.vp-inner:hover .vp-play-hint {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.vp-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}
.vp-controls-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,12,10,.85) 0%, transparent 50%);
  pointer-events: none;
}
.vp-progress {
  position: relative;
  height: 24px;
  margin-bottom: 4px;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
}
.vp-progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(237,233,220,.15);
  border-radius: 2px;
}
.vp-progress-bar {
  position: relative;
  height: 3px;
  background: var(--accent);
  width: 0%;
  border-radius: 2px;
  transition: width .1s linear;
  pointer-events: none;
}
.vp-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.vp-btn-play,
.vp-btn-mute {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color .2s;
  line-height: 1;
}
.vp-btn-play:hover,
.vp-btn-mute:hover { color: var(--accent); }
.vp-mute-off { display: none; }
.vp-muted .vp-mute-on  { display: none; }
.vp-muted .vp-mute-off { display: inline; }

/* inline variant */
.video-inline { max-width: 400px; }

/* ── Contenido descriptivo (usado en .wd-modal-content) ── */
.pd-content {
  margin-top: 40px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(237,233,220,.85);
}
.pd-content h2 {
  font-family: var(--f-disp);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--fg);
  margin: 40px 0 14px;
}
.pd-content h3 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 10px;
}
.pd-content p { margin-bottom: 18px; }
.pd-content ul, .pd-content ol {
  margin: 0 0 18px 20px;
}
.pd-content li { margin-bottom: 6px; }
.pd-content a { color: var(--fg); text-underline-offset: 3px; }
.pd-content strong { color: var(--fg); font-weight: 600; }
.pd-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  margin: 24px 0;
}


/* ── Responsive ── */
@media (max-width: 960px) {
  .work-carousel {
    padding: 60px 24px;
    min-height: unset; /* revertir el min-height desktop */
    /* overflow: hidden heredado del rule base */
  }
  .wc-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    position: static; /* revertir posicionamiento desktop */
    z-index: auto;
  }
  .wc-viewport {
    position: relative; /* revertir absolute desktop */
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    height: 460px;
    z-index: -999;
    /* overflow: hidden; /* en mobile no se usa label lateral → clipar cards 3D */
  }
  .project-plane {
    width: 220px;
    height: 314px;
    margin-top: -157px;
    margin-left: -110px;
    /* Sin hover lift en mobile; solo anima el scale de is-active */
    transition: scale 0.4s ease;
  }
  .project-plane:hover { translate: 0 0; }

  /* En mobile: pp-info como overlay en la card activa */
  .pp-info {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 28px 12px 12px;
    background: linear-gradient(to top, rgba(12,12,10,.9) 0%, rgba(12,12,10,.3) 70%, transparent 100%);
    white-space: normal;
    pointer-events: none;
  }
  .pp-line { display: none; }
  .pp-text { gap: 3px; }
  .pp-title { font-size: 11px; letter-spacing: .14em; }
  .pp-tag   { font-size: 8px; }
  .project-plane:hover:not(.is-active) .pp-info { opacity: 0; }
  .project-plane.is-active .pp-info { opacity: 1; }
}


