/* Lab: same skeleton as About and the Sober case.
   Text starts right of the fixed avatar (gutter 24 + avatar 88 + gap 32 = 144px). */
.page--lab {
  background: var(--color-bg);
}

.l-page-shell--lab {
  width: min(100%, var(--container-max));
  margin: 0 auto;
}

.l-shell {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
}

.lab-hero,
.lab-more {
  padding-left: calc(var(--page-gutter) + 88px + 32px);
}

.lab-hero {
  padding-top: 22px;
}

.lab-title {
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 56px;
  font-weight: 500;
}

/* A Rick and Morty nod under the title: portal-green mono, every letter
   twitches on its own beat (steps() makes the jumps abrupt, like a glitch).
   Hovering makes it twitch faster. Still for reduced motion. */
.lab-wubba {
  margin-top: 4px;
  color: #97ce4c;
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 36px;
  font-weight: 500;
  text-shadow: 0 0 14px rgb(151 206 76 / 35%);
  cursor: default;
  user-select: none;
}

.lab-wubba__word {
  white-space: nowrap;
}

.lab-wubba + .lab-lead {
  margin-top: 16px;
}

.lab-wubba__word > span {
  display: inline-block;
  animation: lab-twitch var(--t, 2s) steps(1, end) var(--d, 0s) infinite;
}

.lab-wubba:hover .lab-wubba__word > span {
  animation-duration: calc(var(--t, 2s) / 4);
}

@keyframes lab-twitch {
  0%, 100% { transform: none; }
  8% { transform: translate(0.05em, -0.07em) rotate(-6deg); }
  14% { transform: none; }
  46% { transform: translate(-0.04em, 0.05em) rotate(5deg) scale(1.06); }
  52% { transform: none; }
  78% { transform: translateY(-0.1em); }
  82% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lab-wubba__word > span {
    animation: none;
  }
}

.lab-lead {
  margin-top: 8px;
  max-width: 680px;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 24px;
  line-height: 32px;
}

/* Experiments: a two-column grid of compact cards. Preview on top,
   then status, title, one line and an Open button pinned to the bottom. */
.lab-list {
  margin-top: 64px;
  padding-left: calc(var(--page-gutter) + 88px + 32px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.lab-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #111111;
}

.lab-item__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0b0b;
}

.lab-item__media picture {
  display: contents;
}

.lab-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.lab-item:hover .lab-item__media img {
  transform: scale(1.015);
}

.lab-item__copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 28px 28px;
}

.lab-item__status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
}

.lab-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 16px;
}

.lab-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.lab-status--shipped::before {
  background: #65c879;
}

.lab-item__title {
  margin-top: 16px;
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 36px;
  font-weight: 500;
}

.lab-item__text {
  margin-top: 8px;
  margin-bottom: 24px;
  max-width: 520px;
  color: rgb(255 255 255 / 80%);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 26px;
}

.lab-item__cta.c-button {
  margin-top: auto;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 20px;
}

.lab-link {
  color: var(--color-link);
  transition: color var(--transition-fast);
}

.lab-link:hover {
  color: var(--color-link-hover);
}

.lab-more {
  margin-top: 64px;
}

.lab-more p {
  max-width: 680px;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: 20px;
  line-height: 28px;
}

.page--lab .site-footer {
  margin-top: 120px;
}

@media (max-width: 1100px) {
  .l-shell {
    padding-inline: var(--page-gutter-mobile);
  }

  .lab-hero {
    padding-top: 188px;
  }

  .lab-hero,
  .lab-more {
    padding-left: var(--page-gutter-mobile);
  }

  .lab-list {
    margin-top: 48px;
    padding-left: var(--page-gutter-mobile);
    gap: 20px;
  }
}

@media (max-width: 860px) {
  .lab-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phones: a taller stage so the suitcase doesn't sit on its caption. */
@media (max-width: 600px) {
  .lab-item .lab-item__media--mascot {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 768px) {
  .lab-title {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1.12;
  }

  .lab-wubba {
    font-size: 22px;
    line-height: 30px;
  }

  .lab-lead {
    font-size: 20px;
    line-height: 28px;
  }

  .lab-item__copy {
    padding: 20px 20px 24px;
  }

  .lab-item__title {
    font-size: 24px;
    line-height: 32px;
  }

  .lab-item__text {
    font-size: 17px;
    line-height: 24px;
  }

  .lab-more p {
    font-size: 18px;
    line-height: 26px;
  }

  .page--lab .site-footer {
    margin-top: 80px;
  }
}
