body[data-page="lab"] {
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% 22%, rgba(94, 176, 232, 0.08), transparent 30rem),
    var(--bg);
}

body[data-page="lab"] > .stars-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.lab-page {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
}

.lab-hero {
  min-height: min(920px, calc(100vh - var(--nav-h)));
  display: grid;
  align-items: center;
  padding: clamp(72px, 10vw, 132px) var(--pad-x) clamp(64px, 9vw, 112px);
}

.lab-hero__inner,
.lab-details__inner {
  width: min(100%, var(--max-w));
  margin: 0 auto;
}

.lab-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: clamp(44px, 7vw, 104px);
  align-items: center;
}

.lab-kicker,
.lab-project-index,
.lab-platform {
  margin: 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--highlight);
}

.lab-title {
  max-width: 8ch;
  margin: 18px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 136px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.83;
  color: #f4f7fb;
}

.lab-lede {
  max-width: 590px;
  margin: 0;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 300;
  line-height: 1.45;
  color: #b8c2d2;
}

.lab-note {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--muted);
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

@media (min-width: 961px) {
  .lab-actions {
    flex-wrap: nowrap;
    width: max-content;
  }

  body.dossier[data-page="lab"] .lab-actions .btn-ghost,
  body.dossier[data-page="lab"] .lab-actions .btn-ghost:hover,
  body.dossier[data-page="lab"] .lab-actions .btn-ghost:focus-visible {
    padding: 13px 10px;
  }
}

@media (min-width: 1050px) {
  body.dossier[data-page="lab"] .lab-actions .btn-ghost,
  body.dossier[data-page="lab"] .lab-actions .btn-ghost:hover,
  body.dossier[data-page="lab"] .lab-actions .btn-ghost:focus-visible {
    padding: 13px 18px;
  }
}

.lab-action--secondary {
  background: transparent !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(216, 221, 232, 0.32) !important;
}

.lab-action--secondary .pill__text {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.lab-action--secondary:hover,
.lab-action--secondary:focus-visible {
  box-shadow: inset 0 0 0 1px var(--highlight) !important;
}

.lab-platform {
  margin-top: 25px;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.lab-preview {
  position: relative;
  margin: 0;
  isolation: isolate;
}

.lab-preview::before {
  content: "";
  position: absolute;
  inset: 6% -4% 22% 10%;
  z-index: -1;
  background: rgba(94, 176, 232, 0.16);
  filter: blur(52px);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}

.lab-preview__frame {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(142, 180, 212, 0.23);
  border-radius: 14px;
  background: #020408;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.58);
  transform: perspective(1400px) rotateY(-4deg) rotateX(1deg);
}

.lab-preview__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.lab-preview figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.lab-preview figcaption::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--highlight);
  box-shadow: 0 0 12px rgba(94, 176, 232, 0.7);
}

.lab-carousel__viewport {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  outline: none;
}

.lab-carousel__viewport:focus-visible {
  box-shadow: 0 0 0 2px var(--highlight);
  border-radius: 14px;
}

.lab-carousel__track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.24, 1);
  will-change: transform;
}

.lab-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.lab-carousel .lab-preview__frame {
  height: 100%;
  aspect-ratio: auto;
  transform: perspective(1400px) rotateY(-4deg) rotateX(1deg);
}

/* Carousel arrows reuse .btn-ghost: only the circular shape lives here,
   every color/hover/press behavior comes from the pill itself. */
.lab-carousel__nav {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

body.dossier .lab-carousel__nav,
body.dossier .lab-carousel__nav:hover,
body.dossier .lab-carousel__nav:focus-visible,
body.dossier .lab-carousel__nav:active {
  padding: 0 !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  font-size: 28px;
  line-height: 1;
}

/* Arrow glyphs are symmetric SVG chevrons (not font characters, not border
   boxes): centered by construction, identical on both buttons. Hover only
   ever changes their color, never their transform, so rotation is impossible. */
.lab-carousel__nav .pill__text {
  width: 12px;
  height: 12px;
  padding: 0;
  padding-bottom: 0;
  border: none;
  font-size: 0;
  line-height: 0;
  color: #000000;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: none;
}

.lab-carousel__nav--prev .pill__text {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='10.5,3.25 5.5,8 10.5,12.75'/%3E%3C/svg%3E");
}

.lab-carousel__nav--next .pill__text {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5.5,3.25 10.5,8 5.5,12.75'/%3E%3C/svg%3E");
}

body.dossier .lab-carousel__nav--prev:hover .pill__text,
body.dossier .lab-carousel__nav--prev:focus-visible .pill__text,
body.dossier .lab-carousel__nav--next:hover .pill__text,
body.dossier .lab-carousel__nav--next:focus-visible .pill__text {
  transform: none;
}

.lab-carousel__nav--prev,
.lab-carousel__nav--next {
  margin: 0;
}

.lab-carousel figcaption::before {
  display: none;
}

.lab-carousel__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.lab-carousel__dots {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lab-carousel__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(142, 180, 212, 0.35);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.lab-carousel__dot.is-active {
  width: 22px;
  background: var(--highlight);
  box-shadow: 0 0 12px rgba(94, 176, 232, 0.7);
}

.lab-carousel[data-lab-single] .lab-carousel__nav,
.lab-carousel[data-lab-single] .lab-carousel__dots {
  display: none;
}

/* 3D depth cascade — desktop / wide screens only. Narrow screens keep the
   standard sliding track defined above. */
@media (min-width: 961px) {
  .lab-carousel__viewport {
    overflow: visible;
  }

  .lab-carousel__track {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    perspective: 1400px;
  }

  .lab-carousel__slide {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    overflow: hidden;
    pointer-events: none;
    transition:
      transform 0.65s cubic-bezier(0.22, 0.8, 0.24, 1),
      opacity 0.65s ease,
      filter 0.65s ease;
    will-change: transform, opacity;
    transform: translateZ(-320px);
    opacity: 0;
    z-index: 1;
  }

  .lab-carousel__slide[data-offset="0"] {
    transform: none;
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
  }

  .lab-carousel__slide[data-offset="1"] {
    transform: translateX(7%) translateZ(-120px);
    opacity: 1;
    z-index: 9;
  }

  .lab-carousel__slide[data-offset="2"] {
    transform: translateX(14%) translateZ(-240px);
    opacity: 1;
    z-index: 8;
  }

  .lab-carousel__slide[data-offset="3"] {
    transform: translateX(21%) translateZ(-360px);
    opacity: 1;
    z-index: 7;
  }

  /* Theoretical position 0: one slot-width left of the front slot —
     the same distance a card travels stepping forward. The outgoing
     card glides here while fading out, then rejoins at the back. */
  .lab-carousel__slide[data-offset="leave"] {
    transform: translateX(-7%);
    opacity: 1;
    z-index: 20;
    pointer-events: none;
  }

  /* Fade the depth shading along with the card movement so the incoming
     image does not suddenly brighten at the start of a transition. */
  .lab-carousel__slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #020408;
    opacity: 0;
    transition: opacity 0.65s ease;
    pointer-events: none;
  }

  .lab-carousel__slide[data-offset="1"]::after {
    opacity: 0.38;
  }

  .lab-carousel__slide[data-offset="2"]::after {
    opacity: 0.62;
  }

  .lab-carousel__slide[data-offset="3"]::after {
    opacity: 0.8;
  }
}

.lab-details {
  padding: clamp(72px, 9vw, 116px) var(--pad-x) clamp(86px, 11vw, 140px);
  border-top: 1px solid rgba(216, 221, 232, 0.08);
  background: rgba(2, 4, 8, 0.8);
}

.lab-details__header {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(32px, 7vw, 110px);
  align-items: start;
  margin-bottom: clamp(52px, 7vw, 86px);
}

.lab-details__header h2 {
  margin: 12px 0 0;
  max-width: 10ch;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 66px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #edf3fa;
}

.lab-details__header p:last-child {
  max-width: 720px;
  margin: 0;
  font-size: clamp(17px, 1.8vw, 22px);
  color: #9ca8ba;
}

.lab-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(142, 180, 212, 0.16);
  border: 1px solid rgba(142, 180, 212, 0.16);
}

.lab-feature {
  min-height: 260px;
  padding: clamp(24px, 3vw, 38px);
  background: rgba(3, 6, 14, 0.95);
}

.lab-feature__number {
  margin: 0 0 56px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--highlight);
}

.lab-feature h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #edf3fa;
}

.lab-feature p:last-child {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 960px) {
  .lab-hero__inner {
    grid-template-columns: 1fr;
  }

  .lab-copy {
    max-width: 720px;
  }

  .lab-title {
    max-width: none;
  }

  .lab-preview__frame {
    transform: none;
  }

  .lab-carousel .lab-preview__frame {
    transform: none;
  }

  .lab-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .lab-hero {
    padding-top: 64px;
  }

  .lab-title {
    font-size: clamp(58px, 22vw, 86px);
  }

  .lab-actions {
    display: grid;
  }

  .lab-actions .btn-ghost {
    width: 100%;
  }

  .lab-details__header,
  .lab-features {
    grid-template-columns: 1fr;
  }

  .lab-feature {
    min-height: 0;
  }

  .lab-feature__number {
    margin-bottom: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-preview__frame {
    transform: none;
  }
  .lab-carousel .lab-preview__frame {
    transform: none;
  }
  .lab-carousel__track,
  .lab-carousel__slide {
    transition: none;
  }
}
