/* The Lab (/lab) — layered on the Story template (site/assets/css/main.css).
   Loaded via an ABSOLUTE /assets/css/lab.css href so it resolves at the `/lab` clean URL;
   a relative href would resolve against `/` under vercel.json trailingSlash:false. Keep the
   page's asset + image hrefs absolute for the same reason (see site/posts/assets/css/posts.css). */

/* ---- Intro ---- */
/* Inline-SVG test-tube glyph on the heading — an intentional, theme-aware accent (not an emoji;
   emoji read as vibe-coded per docs/ui-system.md and render inconsistently cross-platform). Matches
   the site's inline-SVG icon convention (footer LinkedIn). currentColor-overridable tint. */
.lab-index h1 .lab-glyph {
	color: #1f5fa5;
	vertical-align: -0.09em;
	margin-right: 0.55rem;
}

.lab-index .lab-intro {
	max-width: 42rem;
}

.lab-index .lab-intro p {
	color: #555;
	line-height: 1.7;
}

.lab-index .lab-home {
	display: inline-block;
	font-size: 0.9rem;
	margin: 0 0 1.25rem 0;
}

/* ---- Featured experiments: card grid (mirrors .work-grid / .posts-grid) ---- */
.lab-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
	gap: 1.5rem;
	margin: 2.5rem 0 0 0;
	padding: 0;
	list-style: none;
}

.lab-grid li {
	margin: 0;
	padding: 0;
}

.lab-grid a {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.lab-grid a:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
	border-color: #d0d0d0;
}

/* Thumb holds the app's own brand banner (~1200x630); show it whole, no crop. */
.lab-grid .lab-thumb {
	aspect-ratio: 1200 / 630;
	overflow: hidden;
	border-bottom: 1px solid #eee;
}

.lab-grid .lab-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lab-grid .lab-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem 1.35rem 1.4rem 1.35rem;
	flex: 1;
}

.lab-grid .lab-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.lab-grid h3 {
	font-size: 1.15rem;
	line-height: 1.3;
	margin: 0;
}

.lab-grid .lab-hyp {
	font-size: 0.95rem;
	line-height: 1.55;
	color: #555;
	margin: 0;
}

/* Separate the bet from the app description — the eye gets a rest. Spacing lives here, not as
   presentational <br><br> in the markup, so the rhythm stays consistent and adjustable. */
.lab-grid .lab-hyp + .lab-hyp {
	margin-top: 0.5rem;
}

.lab-grid .lab-visit {
	margin-top: auto;
	padding-top: 0.25rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: #1f5fa5;
}

/* ---- Status pill ----
   Deliberately NOT a schema. The label text is the source of truth: any string renders as a
   clean neutral pill via the base rule below, so adding/renaming/removing a status never breaks
   the page. The [data-status="..."] rules are OPTIONAL accents — an unknown status simply falls
   back to neutral. To add an accent for a new status, copy a block and swap the three colors. */
.lab-status {
	flex: none;
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: #f1f1f1;
	color: #555;
	border: 1px solid #e2e2e2;
}

.lab-status[data-status="live"]      { background: #e7f5ec; color: #1b7a44; border-color: #cfe9d8; }
.lab-status[data-status="waitlist"]  { background: #fdf3e3; color: #9a6a12; border-color: #f4e3c2; }
.lab-status[data-status="graduated"] { background: #e9f0fb; color: #1f5fa5; border-color: #d3e2f6; }

/* ---- Ledger: the scale mechanism ----
   When the count outgrows featured cards (~4+), demote the tail here. One row per experiment;
   scans to 20+ without a card each. Hidden until it has rows (see the .lab-ledger:empty guard is
   not reliable across markup, so the section is simply omitted from the HTML until needed). */
.lab-ledger {
	margin: 3rem 0 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid #eee;
}

.lab-ledger li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #eee;
}

.lab-ledger a,
.lab-ledger .row {
	display: grid;
	grid-template-columns: minmax(8rem, auto) 1fr auto;
	align-items: center;
	gap: 1rem;
	padding: 0.85rem 0.25rem;
	text-decoration: none;
	color: inherit;
}

.lab-ledger a:hover {
	background: #fafafa;
}

.lab-ledger .lab-name {
	font-weight: 600;
	font-size: 0.98rem;
}

.lab-ledger .lab-hyp {
	font-size: 0.9rem;
	color: #666;
	margin: 0;
}

@media screen and (max-width: 640px) {
	.lab-ledger a,
	.lab-ledger .row {
		grid-template-columns: 1fr auto;
	}
	.lab-ledger .lab-hyp {
		display: none;
	}
}
