/* "Laboratorio" on the agency landing (2026-10-02): between Trabajos and the blog, an edge-to-edge
   glide of pieces that don't fit the client reels: AI clips, animated menus, AI edits.
   Hierarchy: featured pieces run full height; small ones stack two to a column at half height
   (cropped to the shape in --small). The strip is built in the page script; tapping a piece opens
   it big in .lab-viewer. Flat navy so the clips glow; the blog below goes ivory to alternate. */
.lab-strip {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 5vw, 64px) 0;
  background: var(--navy, #0b0b1c);
  color: #ffffff;
}

.lab-strip__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
}

.lab-strip__head .eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

/* Speed buttons, pushed to the right end of the header row. */
.lab-speed {
  display: inline-flex;
  align-self: center;
  margin-left: auto;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.lab-speed button {
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font: 600 12px/1 var(--font-body, "Roboto", sans-serif);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lab-speed button:hover { color: #ffffff; }

.lab-speed button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--navy, #0b0b1c);
}

.lab-speed button:focus-visible { outline: 3px solid var(--yellow, #f8d648); outline-offset: 2px; }

/* Smaller than the other section headers: this band is a side note, not a chapter. */
.lab-strip__head h3 {
  margin: 0;
  font-family: var(--font-display, "Poppins", sans-serif);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.lab-strip__viewport {
  --lab-h: clamp(320px, 34vw, 480px);
  --lab-gap: 16px;
  margin-top: clamp(20px, 2.4vw, 32px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.lab-strip__viewport::-webkit-scrollbar { display: none; }

.lab-strip__viewport.is-dragging { cursor: grabbing; user-select: none; }

.lab-strip__viewport.is-dragging .lab-card__open { pointer-events: none; }

.lab-strip__track {
  display: flex;
  align-items: flex-start;
  gap: var(--lab-gap);
  width: max-content;
  padding: 10px 0 14px;
}

.lab-card {
  position: relative;
  flex: 0 0 auto;
  height: var(--lab-h);
  aspect-ratio: var(--ratio, 9 / 16);
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius, 18px);
  background: #15152b;
}

.lab-col {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: var(--lab-gap);
  height: var(--lab-h);
}

.lab-col .lab-card {
  height: calc((var(--lab-h) - var(--lab-gap)) / 2);
  aspect-ratio: var(--small, var(--ratio));
}

.lab-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* The whole card opens the viewer. */
.lab-card__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
  appearance: none;
}

.lab-card__open:focus-visible {
  outline: 3px solid var(--yellow, #f8d648);
  outline-offset: -3px;
}

/* What it is and what it was made with: hidden at rest so the video reads clean, shown on hover. */
.lab-card figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lab-card figcaption span {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(10, 9, 14, 0.6);
  color: #ffffff;
  font: 600 12px/1.3 var(--font-body, "Roboto", sans-serif);
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lab-card figcaption .lab-card__type {
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy, #0b0b1c);
}

@media (hover: hover) {
  .lab-card:hover video { transform: scale(1.03); }
  .lab-card:hover figcaption,
  .lab-card:focus-within figcaption { opacity: 1; transform: none; }
}

/* Touch: no hover, so one short tag stays on. */
@media (hover: none) {
  .lab-card figcaption { opacity: 1; transform: none; }
  .lab-card figcaption .lab-card__tool { display: none; }
}

@media (max-width: 560px) {
  .lab-strip__viewport { --lab-h: min(50vh, 380px); --lab-gap: 12px; }
  /* Wide pieces would run past the screen at this height: cap them and let the video crop. */
  .lab-card { max-width: 86vw; }
}

/* Viewer: the reels viewer shell, sized to each piece's own shape. */
.lab-viewer__panel {
  width: min(100%, 1100px);
  gap: 14px;
}

.lab-viewer__video {
  display: block;
  max-width: 100%;
  max-height: calc(100svh - 140px);
  width: auto;
  height: auto;
  border-radius: 18px;
  background: var(--navy, #0b0b1c);
  box-shadow: var(--shadow);
}

.lab-viewer__panel .reel-viewer__close {
  top: -8px;
  right: 0;
}

.lab-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lab-viewer__caption {
  margin: 0;
  min-width: 0;
  font: 500 0.9rem/1.3 var(--font-body, "Roboto", sans-serif);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.lab-viewer__nav {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: var(--navy, #0b0b1c);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lab-viewer__nav:hover,
.lab-viewer__nav:focus-visible { background: #1d1d3a; }

.lab-viewer__nav:focus-visible { outline: 3px solid var(--yellow, #f8d648); outline-offset: 3px; }

.lab-viewer__nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
