/* The Lab — R&D hub design system.
   Dark, editorial, on-brand with style.css :root tokens. */

/* ---------- Page shell ---------- */
.lab-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}
.lab-article-page { max-width: 1060px; }
.lab-dev-page { max-width: 1080px; }

/* ---------- Hero ---------- */
.lab-hero {
    text-align: center;
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}
.lab-hero-compact { padding: 1.25rem 0 1.75rem; margin-bottom: 2rem; }
.lab-hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 1.1rem;
}
.lab-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--text-bright);
    margin: 0 0 0.85rem;
    letter-spacing: -0.02em;
}
.lab-hero-compact .lab-hero-title { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.lab-hero-sub {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
}

/* Split hero with the wireframe fish (glow-on-black → screen-blended so it floats) */
.lab-hero-fish { margin: 0.5rem auto 0; max-width: 460px; }
.lab-hero-fish img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 0 45px rgba(88, 166, 255, 0.2));
}
@media (min-width: 880px) {
    .lab-hero-split {
        display: grid;
        grid-template-columns: 1fr 1.05fr;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }
    .lab-hero-split .lab-hero-sub { margin: 0; }
    .lab-hero-split .lab-hero-fish { margin: 0; max-width: none; }
}

/* ---------- Manifesto ---------- */
.lab-manifesto {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text);
    text-align: center;
    max-width: 680px;
    margin: 0 auto 2.75rem;
}

/* ---------- Section cards (hub) ---------- */
.lab-section-cards { display: grid; gap: 1rem; }
.lab-section-card {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 1.4rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.lab-section-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    background: var(--bg-elevated);
}
.lab-section-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-dim);
    color: var(--accent);
}
.lab-section-icon svg { width: 24px; height: 24px; }
.lab-icon-research { background: rgba(63, 185, 80, 0.12); color: var(--accent-green); }
.lab-icon-articles { background: rgba(210, 153, 34, 0.14); color: var(--accent-yellow); }
.lab-section-body { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 auto; }
.lab-section-title { font-size: 1.15rem; font-weight: 700; color: var(--text-bright); }
.lab-section-blurb { font-size: 0.94rem; line-height: 1.55; color: var(--text-muted); }
.lab-section-arrow { flex: 0 0 auto; color: var(--text-muted); transition: transform 0.18s ease, color 0.18s ease; }
.lab-section-arrow svg { width: 20px; height: 20px; display: block; }
.lab-section-card:hover .lab-section-arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- Recent strip (hub) ---------- */
.lab-recent { margin-top: 2.75rem; }
.lab-recent-heading {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}
.lab-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.lab-recent-list a {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.lab-recent-list a:hover { border-color: var(--border-light); background: var(--bg-card); }
.lab-recent-kind {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    flex: 0 0 auto;
}
.lab-recent-title { flex: 1 1 auto; color: var(--text-bright); font-weight: 500; }
.lab-recent-date { flex: 0 0 auto; font-size: 0.82rem; color: var(--text-muted); }

/* ---------- Chips ---------- */
.lab-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    background: var(--bg-elevated);
    white-space: nowrap;
}
.lab-chip-current { color: var(--accent); border-color: rgba(88, 166, 255, 0.4); background: var(--accent-dim); }
.lab-chip-released { color: var(--text-muted); }
.lab-chip-closed { color: var(--accent-green); border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.1); }
.lab-chip-ongoing { color: var(--accent-yellow); border-color: rgba(210, 153, 34, 0.45); background: rgba(210, 153, 34, 0.1); }
.lab-chip-upcoming { color: var(--accent-orange); border-color: rgba(219, 109, 40, 0.45); background: rgba(219, 109, 40, 0.1); }

/* ---------- Development timeline ---------- */
.lab-timeline { position: relative; display: grid; gap: 1.5rem; }
.lab-release {
    position: relative;
    padding: 1.6rem 1.6rem 1.6rem 2.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.lab-release.is-current { border-color: rgba(88, 166, 255, 0.35); }
.lab-release-marker {
    position: absolute;
    left: 0.95rem;
    top: 1.9rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-faint);
    box-shadow: 0 0 0 4px var(--bg-deep);
}
.lab-release.is-current .lab-release-marker { background: var(--accent); box-shadow: 0 0 0 4px var(--bg-deep), 0 0 12px rgba(88,166,255,0.6); }
.lab-release-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.lab-version-tag {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
}
.lab-release-name { font-size: 1.3rem; font-weight: 700; color: var(--text-bright); margin: 0; }
.lab-release-date { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); }
.lab-release-tagline { font-size: 1rem; line-height: 1.6; color: var(--text); margin: 0.75rem 0 1.1rem; }
/* Feature screenshots inside a release (the free-user upsell) */
.lab-shot-grid {
    display: grid;
    gap: 1rem;
    margin: 0.4rem 0 1.5rem;
}
@media (min-width: 640px) { .lab-shot-grid { grid-template-columns: 1fr 1fr; } }
.lab-shot { margin: 0; }
.lab-shot-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg-deep);
    aspect-ratio: 16 / 10;
}
.lab-shot-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
/* Full-width shot variant — for wide timeline heatmaps that span both columns */
.lab-shot--wide { grid-column: 1 / -1; }
.lab-shot--wide .lab-shot-frame { aspect-ratio: 17 / 5; }
.lab-shot-tier {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.lab-shot-tier::before { content: "\1F512\00A0"; font-weight: 400; opacity: 0.85; }  /* lock glyph */
.lab-shot-tier-explorer { color: #cfe6ff; background: rgba(88, 166, 255, 0.28); border: 1px solid rgba(88, 166, 255, 0.5); }
.lab-shot-tier-specialist { color: #ffe6c2; background: rgba(219, 109, 40, 0.28); border: 1px solid rgba(219, 109, 40, 0.55); }
.lab-shot figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Prominent model cards inside a release */
.lab-release-models { margin: 0.4rem 0 1.4rem; }
.lab-release-models-label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.7rem;
}
.lab-model-grid { display: grid; gap: 0.7rem; }
@media (min-width: 620px) { .lab-model-grid { grid-template-columns: 1fr 1fr; } }
.lab-model-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem 1.05rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.lab-model-icon {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--accent-dim);
    color: var(--accent);
}
.lab-model-icon svg { width: 19px; height: 19px; }
.lab-model-body { min-width: 0; }
.lab-model-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.3rem; }
.lab-model-name { font-size: 1.02rem; font-weight: 700; color: var(--text-bright); }
.lab-model-tag {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.7rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.12rem 0.45rem;
    border-radius: 5px;
    /* Was `white-space: nowrap`, but long tags (e.g. DE "Gradient Boosting ·
       pro Art trainiert") then pinned the whole card wider than a phone and the
       page's `overflow-x: hidden` clipped its right edge. Let them wrap. */
    overflow-wrap: anywhere;
}
.lab-model-blurb { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }

.lab-release-groups { display: grid; gap: 1.15rem; }
@media (min-width: 620px) { .lab-release-groups { grid-template-columns: 1fr 1fr; } }
.lab-release-group-title {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}
.lab-release-items { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.lab-release-items li { font-size: 0.92rem; line-height: 1.55; color: var(--text); }
.lab-release-items li::marker { color: var(--accent); }

/* Mobile: the page uses `overflow-x: hidden`, so any child wider than the
   viewport is CLIPPED (not scrollable). Grid/flex items default to
   `min-width: auto` (= their content's min-content), which lets long words and
   the single-column `.lab-timeline` track pin a card wider than a phone. Give
   the nested items `min-width: 0` so they can shrink, and break long DE/NL
   compound words instead of overflowing. */
.lab-release { min-width: 0; overflow-wrap: break-word; }
.lab-release-group,
.lab-shot,
.lab-model-card { min-width: 0; }

/* ---------- Card grid (index) ---------- */
.lab-card-grid { display: grid; gap: 1.15rem; }
@media (min-width: 680px) { .lab-card-grid { grid-template-columns: 1fr 1fr; } }
.lab-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.lab-card:hover { transform: translateY(-3px); border-color: var(--border-light); background: var(--bg-elevated); }
.lab-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.85rem; }
.lab-card-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
}
.lab-card-title { font-size: 1.28rem; line-height: 1.28; font-weight: 700; color: var(--text-bright); margin: 0 0 0.6rem; }
.lab-card-summary { font-size: 0.96rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 1.15rem; flex: 1 1 auto; }
.lab-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.82rem; color: var(--text-muted); }
.lab-card-dot { opacity: 0.5; }
.lab-card-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; color: var(--accent); font-weight: 600; }
.lab-card:hover .lab-card-cta svg { transform: translateX(2px); }
.lab-card-cta svg { transition: transform 0.15s ease; }
.lab-empty { text-align: center; color: var(--text-muted); padding: 3rem 0; }

/* ---------- Topic cards (hub overview) ---------- */
.lab-topic-grid { display: grid; gap: 1.25rem; }
@media (min-width: 700px) { .lab-topic-grid { grid-template-columns: 1fr 1fr; } }
.lab-topic-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.lab-topic-card:hover { transform: translateY(-3px); border-color: var(--border-light); background: var(--bg-elevated); }
.lab-topic-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-deep);
    overflow: hidden;
}
.lab-topic-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.lab-topic-card:hover .lab-topic-media img { transform: scale(1.03); }
.lab-topic-media.is-empty { background: linear-gradient(135deg, var(--bg-elevated), var(--bg-deep)); }
.lab-topic-cat {
    position: absolute;
    top: 0.7rem; left: 0.7rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.lab-cat-research { color: #7ee787; }
.lab-cat-articles { color: #f2cc60; }
.lab-cat-development { color: #79c0ff; }
.lab-topic-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1.1rem 1.25rem 1.25rem; }
.lab-topic-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.55rem; min-height: 1.1rem; }
.lab-topic-kicker { font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.lab-topic-title { font-size: 1.22rem; line-height: 1.3; font-weight: 700; color: var(--text-bright); margin: 0 0 0.5rem; }
.lab-topic-summary {
    font-size: 0.94rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 1rem; flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lab-topic-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted); }
.lab-topic-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; color: var(--accent); font-weight: 600; }
.lab-topic-cta svg { transition: transform 0.15s ease; }
.lab-topic-card:hover .lab-topic-cta svg { transform: translateX(2px); }

/* ---------- Article ---------- */
.lab-article-header { max-width: 720px; margin: 0 auto 2rem; text-align: center; }
.lab-article-kicker {
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
.lab-article-title {
    font-size: clamp(1.8rem, 4.2vw, 2.6rem);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-bright);
    margin: 0 0 1rem;
}
.lab-article-standfirst { font-size: 1.2rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 1.25rem; }
.lab-article-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.86rem; color: var(--text-muted); }
.lab-article-byline { font-weight: 600; color: var(--text); }

/* Hero band — sits full-width between the (centered) header and the content */
.lab-article-hero {
    margin: 0 0 2.5rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-elevated);
    line-height: 0;
}
.lab-article-hero img { display: block; width: 100%; height: auto; }
.lab-article-hero figcaption {
    line-height: 1.5;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.6rem 1rem 0.7rem;
}

/* Single mobile column MUST be minmax(0, 1fr), not a bare `auto` track — an
   `auto` track grows to its widest child's min-content, so a min-width'd
   .lab-svg-flow diagram (or wide table) blows the body past the viewport and
   `html { overflow-x: hidden }` then clips every line ("cut off mid-sentence").
   minmax(0, …) lets the column shrink to the viewport so those overflow-x:auto
   children scroll inside their own box instead. */
.lab-article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 900px) {
    .lab-article-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 2.5rem; }
    /* Short articles have no TOC — collapse to one column so the body isn't
       squeezed into the empty 220px sidebar track. */
    .lab-article-layout-solo { grid-template-columns: minmax(0, 1fr); }
}
.lab-article-layout-solo .lab-article-body { margin-left: auto; margin-right: auto; }

/* TOC */
.lab-toc { display: none; }
@media (min-width: 900px) { .lab-toc { display: block; } }
.lab-toc-sticky { position: sticky; top: 4.5rem; }
.lab-toc-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.lab-toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; border-left: 1px solid var(--border); }
.lab-toc-list a {
    display: block;
    padding: 0.3rem 0 0.3rem 0.9rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.4;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.lab-toc-list a:hover { color: var(--text-bright); }
.lab-toc-list a.active { color: var(--accent); border-left-color: var(--accent); }

/* Article body typography */
.lab-article-body { min-width: 0; max-width: 720px; font-size: 1.06rem; line-height: 1.75; color: var(--text); }
.lab-article-body > p { margin: 0 0 1.25rem; }
.lab-article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.lab-article-body a:hover { color: var(--text-bright); }
.lab-article-body strong { color: var(--text-bright); font-weight: 700; }
.lab-article-body em { font-style: italic; color: var(--text-bright); }
.lab-article-body code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.88em;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1em 0.4em;
}
.lab-article-body h2 {
    font-size: 1.55rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-bright);
    margin: 2.6rem 0 1rem;
    scroll-margin-top: 4.5rem;
    letter-spacing: -0.01em;
}
.lab-article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 1.9rem 0 0.75rem;
    scroll-margin-top: 4.5rem;
}
.lab-lead { font-size: 1.28rem; line-height: 1.6; color: var(--text-bright); margin: 0 0 1.6rem; font-weight: 400; }
.lab-note { font-size: 0.92rem; color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }
.lab-divider { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.lab-list { margin: 0 0 1.4rem; padding-left: 1.3rem; display: grid; gap: 0.55rem; }
.lab-list li { line-height: 1.65; }
.lab-list li::marker { color: var(--accent); }

/* Quote */
.lab-quote { margin: 1.8rem 0; padding: 0.4rem 0 0.4rem 1.4rem; border-left: 3px solid var(--accent); }
.lab-quote p { font-size: 1.3rem; line-height: 1.5; color: var(--text-bright); font-weight: 500; margin: 0; }
.lab-quote cite { display: block; margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-muted); font-style: normal; }

/* Callouts — full tinted border, no left-stripe (matches product taste) */
.lab-callout {
    margin: 1.75rem 0;
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
}
.lab-callout p { margin: 0; font-size: 1rem; line-height: 1.65; }
.lab-callout p + p { margin-top: 0.7rem; }
.lab-callout-label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.55rem;
}
.lab-callout-info { border-color: rgba(88, 166, 255, 0.35); background: rgba(88, 166, 255, 0.06); }
.lab-callout-info .lab-callout-label { color: var(--accent); }
.lab-callout-success { border-color: rgba(63, 185, 80, 0.35); background: rgba(63, 185, 80, 0.07); }
.lab-callout-success .lab-callout-label { color: var(--accent-green); }
.lab-callout-warn { border-color: rgba(210, 153, 34, 0.4); background: rgba(210, 153, 34, 0.07); }
.lab-callout-warn .lab-callout-label { color: var(--accent-yellow); }
.lab-callout-closed { border-color: var(--border-light); background: var(--bg-elevated); }
.lab-callout-closed .lab-callout-label { color: var(--text-muted); }
/* moat = the rigor signal; make it stand out */
.lab-callout-moat {
    border-color: rgba(88, 166, 255, 0.45);
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(63, 185, 80, 0.06));
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.08), 0 8px 30px rgba(0, 0, 0, 0.25);
}
.lab-callout-moat .lab-callout-label { color: var(--accent); }
.lab-callout-moat .lab-callout-label::before { content: "◆ "; }

/* Stat grid */
.lab-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    margin: 1.75rem 0;
}
.lab-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1.1rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}
.lab-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-bright); line-height: 1.1; letter-spacing: -0.02em; }
.lab-stat-label { font-size: 0.85rem; color: var(--text-muted); line-height: 1.35; }
.lab-stat-sub { font-size: 0.75rem; color: var(--text-faint); line-height: 1.35; margin-top: 0.2rem; }

/* Comparison bars */
.lab-bars {
    margin: 1.75rem 0;
    padding: 1.35rem 1.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.lab-bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr auto;
    align-items: center;
    gap: 0.6rem 0.85rem;
    margin-bottom: 0.85rem;
}
.lab-bar-row:last-of-type { margin-bottom: 0; }
.lab-bar-label { font-size: 0.9rem; color: var(--text); font-weight: 500; }
.lab-bar-track { height: 12px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.lab-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.lab-bar-good { background: linear-gradient(90deg, var(--accent-green), #56d364); }
.lab-bar-bad { background: linear-gradient(90deg, var(--accent-red), #ff7b72); }
.lab-bar-neutral { background: linear-gradient(90deg, var(--accent), #79c0ff); }
.lab-bar-value { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); font-variant-numeric: tabular-nums; text-align: right; }
.lab-bar-note { grid-column: 2 / 4; font-size: 0.78rem; color: var(--text-muted); margin-top: -0.4rem; }
.lab-bars figcaption { margin-top: 1.05rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* Tables */
.lab-table-wrap { margin: 1.75rem 0; }
.lab-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.lab-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.lab-table th, .lab-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.lab-table th { background: var(--bg-elevated); color: var(--text-muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.03em; text-transform: uppercase; }
.lab-table td { color: var(--text); }
.lab-table tbody tr:last-child td { border-bottom: 0; }
.lab-table tbody tr:hover td { background: var(--bg-card); }
.lab-table .align-right { text-align: right; font-variant-numeric: tabular-nums; }
.lab-table .align-center { text-align: center; }
.lab-table-wrap figcaption { margin-top: 0.7rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* Steps */
.lab-steps { list-style: none; margin: 1.75rem 0; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
.lab-step { display: flex; gap: 1rem; }
.lab-step-n {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
}
.lab-step-body h4 { margin: 0.2rem 0 0.3rem; font-size: 1.02rem; color: var(--text-bright); }
.lab-step-body p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); }

/* Figure */
.lab-figure { margin: 1.75rem 0; }
.lab-figure img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.lab-figure figcaption { margin-top: 0.7rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; text-align: center; }
/* wide figures may bleed past the 720px text column on large screens */
@media (min-width: 1180px) {
    .lab-figure-wide { width: calc(100% + 120px); margin-left: -60px; margin-right: -60px; }
}

/* Inline SVG diagrams */
.lab-diagram {
    margin: 1.9rem 0;
    padding: 1.35rem 1.4rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}
.lab-diagram-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}
.lab-diagram figcaption { margin-top: 1rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; text-align: center; }
.lab-svg { display: block; width: 100%; height: auto; max-width: 660px; margin: 0 auto; }
.lab-svg-flow { min-width: 520px; max-width: none; }
/* SVG text — fills default to black, so set them from tokens */
.lab-svg-tick { fill: var(--text-muted); font-size: 12px; }
.lab-svg-axis { fill: var(--text-muted); font-size: 12px; letter-spacing: 0.02em; }
.lab-svg-value { fill: var(--text-bright); font-size: 15px; font-weight: 700; }
.lab-svg-cat { fill: var(--text); font-size: 12.5px; }
.lab-svg-delta { fill: var(--accent-green); font-size: 12.5px; font-weight: 700; }
.lab-svg-box { fill: var(--text-bright); font-size: 13px; font-weight: 500; }
.lab-svg-colh { fill: var(--text-bright); font-size: 12.5px; font-weight: 600; }
.lab-svg-rowh { fill: var(--text); font-size: 12.5px; }
.lab-svg-cell { fill: #fff; font-size: 17px; font-weight: 700; }
.lab-svg-legend { fill: var(--text-muted); font-size: 12px; }

/* Article foot */
.lab-updated { font-size: 0.85rem; color: var(--text-muted); margin: 2rem 0 0; }
.lab-article-foot { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.lab-back { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.lab-back:hover { color: var(--text-bright); }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].visible { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.06s; }
[data-reveal][data-delay="2"] { transition-delay: 0.12s; }
[data-reveal][data-delay="3"] { transition-delay: 0.18s; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .lab-bar-fill { transition: none; }
    .lab-section-card, .lab-card { transition: none; }
}
