/* =========================================================
   AI Lab page — loads AFTER case-study.css.
   Reuses the case study look (cream page, white card, Poppins
   headings, marker title) with a single-column log: each experiment
   has a tools eyebrow, title, summary, body and optional media.
   Entries work with or without images.
   ========================================================= */

/* ---------- Title ---------- */
/* Purple marker title — same treatment as "My Work" on work.html */
.lab-title { margin-bottom: 20px; }
.lab-title .marker {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  font: 400 clamp(2.4rem, 6vw, 2.9rem)/1.3 Kalam, cursive;
  color: oklch(30% 0.05 300);
}
.lab-title .marker::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: 6px;
  height: 52%;
  background: oklch(83% 0.09 300);
  z-index: -1;
  transform: rotate(-1.4deg);
  border-radius: 2px 10px 3px 12px;
}

/* ---------- Intro ---------- */
.lab-intro {
  max-width: 620px;
  margin: 0 0 40px;
  color: rgba(27, 27, 34, 0.7);
}

/* ---------- Entries ----------
   One column. Tools sit above the title as a small eyebrow,
   like the tags on the Work page cards. Media spans full width. */
.lab-list { border-top: 1px solid rgba(27, 27, 34, 0.08); }

.lab-entry {
  padding: 48px 0;
  border-bottom: 1px solid rgba(27, 27, 34, 0.08);
}
.lab-entry:last-child { border-bottom: none; padding-bottom: 0; }

.lab-tools {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font: 700 0.72rem/1.4 Inter, sans-serif;
  color: var(--accent);
  margin-bottom: 10px;
}

.lab-entry h2 {
  font: 600 1.45rem/1.3 'Poppins', sans-serif;
  margin: 0 0 10px;
}
.lab-lede {
  font-weight: 600;
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 0 12px;
}
.lab-body { max-width: 640px; }
.lab-body p { margin: 0 0 14px; color: rgba(27, 27, 34, 0.8); }
.lab-body p:last-child { margin-bottom: 0; }

/* Before → after number, for entries with a clear result */
.lab-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}
.lab-stat .stat-number { font-size: 1.6rem; }
.lab-stat .stat-number .from {
  color: rgba(27, 27, 34, 0.35);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.lab-stat .stat-label { margin: 0; }

/* A line she learned — reuses the caveat look */
.lab-takeaway {
  margin: 18px 0 0;
  border-left: 3px solid var(--highlight-bg);
  padding-left: 16px;
  font-size: 0.95rem;
  color: rgba(27, 27, 34, 0.75);
}
.lab-takeaway strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 2px;
}

/* ---------- Media (optional per entry) ---------- */
.lab-media { margin: 28px 0 0; }

/* Phone row — reuses .phone-row/.phones/.phone from case-study.css */
.lab-media.phone-row { margin-bottom: 0; }

.lab-clip {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(27, 27, 34, 0.08);
}
.lab-clip video {
  width: 150px;
  flex: none;
  display: block;
  border-radius: 26px;
  border: 7px solid #1B1B22;
  background: #1B1B22;
  aspect-ratio: 1170 / 2532;
  object-fit: cover;
}
.lab-clip p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(27, 27, 34, 0.65);
}
.lab-clip p strong { color: var(--ink); }

.lab-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 34, 0.08);
  cursor: zoom-in;
}
.lab-image figcaption {
  margin-top: 10px;
  font-size: 0.8rem;
  color: rgba(27, 27, 34, 0.55);
}


/* ---------- Lightbox ---------- */
.lab-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(27, 27, 34, 0.88);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lab-lightbox.open { display: flex; }
.lab-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .lab-entry { padding: 36px 0; }
  .lab-entry h2 { font-size: 1.3rem; }
  .lab-clip { flex-direction: column; text-align: center; }
  /* phones become a swipeable row instead of a tall stack */
  .lab-media .phones {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .lab-media .phone { scroll-snap-align: center; }
}
