/* ==========================================================================
   TNAADO Lab — AI Research wing (cinematic-dark, defense-grade restraint)
   Mirrors the services-tech / home visual system: ink canvas, hairlines,
   Fraunces italic display, JetBrains Mono caps eyebrows, red accent only.
   The Lab is NOT a fourth practice — visually adjacent but holds its own
   chapter prefix (L.) and its own concentration list pattern.
   ========================================================================== */

/* ==================== BODY ==================== */
.lab-page {
    background: var(--ink);
    color: var(--on-black);
    font-family: var(--font-body);
}

.lab-page main {
    background: var(--ink);
}

/* ==================== HAS-VIDEO UTILITIES ==================== */
.has-video {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.has-video .section-bg-video {
    background: var(--ink);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    filter: contrast(1.06) saturate(0.88);
}

.has-video .section-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            to bottom,
            rgba(10, 10, 10, 0.58) 0%,
            rgba(10, 10, 10, 0.80) 55%,
            rgba(10, 10, 10, 0.94) 100%
        );
}

.has-video > *:not(.section-bg-video):not(.section-bg-overlay) {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .has-video .section-bg-video { display: none; }
    .has-video .section-bg-overlay { background: var(--ink); }
}
@media (prefers-reduced-data: reduce) {
    .has-video .section-bg-video { display: none; }
}

/* ==================== HERO ==================== */

.lab-hero {
    position: relative;
    min-height: 82vh;
    display: flex;
    align-items: flex-end;
    padding: 0;
    background: var(--ink);
}

.lab-hero__inner {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 176px 32px 144px;
}

/* Subtle red ember from the lower-right — held back, atmosphere only */
.lab-hero::after {
    content: "";
    position: absolute;
    right: -8%;
    bottom: -22%;
    width: 58%;
    height: 78%;
    background: radial-gradient(
        ellipse at center,
        rgba(200, 16, 46, 0.13) 0%,
        rgba(200, 16, 46, 0.04) 42%,
        transparent 76%
    );
    pointer-events: none;
    z-index: 1;
    filter: blur(48px);
}

.lab-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    margin: 0 0 36px;
}

.lab-hero__eyebrow::before {
    content: "";
    width: 36px;
    height: 1px;
    background: var(--red);
    opacity: 0.85;
}

.lab-hero h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.75rem, 6.4vw, 5.25rem);
    line-height: 1.0;
    color: var(--on-black);
    letter-spacing: -0.028em;
    font-variation-settings: 'opsz' 144;
    margin: 0;
    max-width: 17ch;
}

.lab-hero h1 em {
    font-style: italic;
    font-weight: 400;
    color: color-mix(in oklab, var(--red) 78%, var(--on-black));
}

.lab-hero__lede {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.25rem, 1.55vw, 1.5rem);
    line-height: 1.4;
    color: var(--on-black);
    margin: 44px 0 0;
    max-width: 40ch;
}

.lab-hero__lede em {
    font-style: italic;
    color: color-mix(in oklab, var(--red) 70%, var(--on-black));
}

.lab-hero__detail {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--on-black-mute);
    margin: 28px 0 0;
    max-width: 60ch;
}

/* Seam between hero and mission — faint red mist */
.lab-seam {
    position: relative;
    height: 200px;
    margin-top: -100px;
    margin-bottom: -100px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(200, 16, 46, 0.04) 35%,
        rgba(200, 16, 46, 0.08) 50%,
        rgba(200, 16, 46, 0.04) 65%,
        transparent 100%
    );
    filter: blur(8px);
}

/* ==================== SECTION SHELL ==================== */

.lab-section {
    position: relative;
    padding: 128px 0;
    background: var(--ink);
    color: var(--on-black);
}

.lab-section__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.lab-section__grid {
    display: grid;
    grid-template-columns: 4fr 8fr;
    gap: 96px;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.lab-section h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 3.4vw, 2.875rem);
    line-height: 1.05;
    color: var(--on-black);
    letter-spacing: -0.022em;
    font-variation-settings: 'opsz' 144;
    margin: 0 0 28px;
    max-width: 22ch;
}

.lab-section h2 em {
    font-style: italic;
    font-weight: 400;
    color: color-mix(in oklab, var(--red) 70%, var(--on-black));
}

.lab-section__eyebrow {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    margin: 0 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.lab-section__eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--red);
    opacity: 0.85;
}

.lab-section__lede {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-lg);
    line-height: 1.65;
    color: var(--on-black-mute);
    margin: 0 0 56px;
    max-width: 56ch;
}

/* ==================== SECTION ANCHOR (sticky chapter mark) ==================== */

.section-anchor {
    position: sticky;
    top: 112px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
    border-top: 1px solid rgba(245, 241, 232, 0.10);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: 1;
    color: var(--on-black-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-anchor .anchor-figure {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--red);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.section-anchor .anchor-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.section-anchor .anchor-label::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--red);
    opacity: 0.85;
}

/* ==================== MISSION ==================== */

.lab-mission__body p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--on-black);
    margin: 0 0 24px;
    max-width: 60ch;
}

.lab-mission__body p:last-child {
    margin-bottom: 0;
}

.lab-mission__body em {
    font-style: italic;
    color: color-mix(in oklab, var(--red) 70%, var(--on-black));
    font-family: var(--font-display);
}

/* ==================== CONCENTRATIONS — Roman-numeral practice list ==================== */

.lab-section--tinted {
    background:
        linear-gradient(to bottom,
            rgba(200, 16, 46, 0.022) 0%,
            transparent 25%,
            transparent 75%,
            rgba(200, 16, 46, 0.014) 100%
        ),
        var(--ink);
}

.lab-list {
    list-style: none;
    padding: 0;
    margin: 72px 0 0;
    border-top: 1px solid rgba(245, 241, 232, 0.14);
}

.lab-list .lab-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 40px;
    padding: 44px 0;
    border-bottom: 1px solid rgba(245, 241, 232, 0.10);
    align-items: baseline;
    transition:
        padding-left 420ms cubic-bezier(0.22, 1, 0.36, 1),
        background 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-list .lab-item:hover {
    padding-left: 16px;
    background: linear-gradient(to right, rgba(200, 16, 46, 0.05), transparent 40%);
}

.lab-list .lab-num {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.625rem, 2.4vw, 2rem);
    line-height: 1;
    color: var(--red);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    font-variation-settings: 'opsz' 96;
}

.lab-list .lab-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.375rem, 1.8vw, 1.625rem);
    line-height: 1.15;
    color: var(--on-black);
    letter-spacing: -0.022em;
    font-variation-settings: 'opsz' 96;
    margin: 0 0 14px;
}

.lab-list .lab-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--on-black-mute);
    max-width: 62ch;
    margin: 0;
}

.lab-list .lab-desc em {
    font-style: italic;
    color: color-mix(in oklab, var(--red) 65%, var(--on-black));
    font-family: var(--font-display);
}

.lab-list .lab-item:last-child {
    border-bottom: none;
}

/* ==========================================================================
   ART DIRECTION PASS — lab hero overlay + concentrations editorial upgrade
   ========================================================================== */

/* Constrain text panel to left so the server rack shows on the right */
.lab-hero__inner--left {
    max-width: 680px;
}

/* Hero overlay: let the server rack video show on the right */
.lab-page .has-video .section-bg-overlay,
.lab-page .lab-hero .section-bg-overlay {
    background:
        linear-gradient(
            112deg,
            rgba(10, 10, 10, 0.96) 0%,
            rgba(10, 10, 10, 0.85) 28%,
            rgba(10, 10, 10, 0.45) 55%,
            rgba(10, 10, 10, 0.15) 78%,
            transparent 95%
        );
}

/* Concentrations list — red vertical tick on hover */
.lab-list .lab-item {
    position: relative;
}

/* Red vertical tick — scales in on hover */
.lab-list .lab-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: -1px;
    width: 1px;
    background: var(--red);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(200, 16, 46, 0.45);
}

.lab-list .lab-item:hover::before {
    transform: scaleY(1);
}

/* Concentration number — red mono, left column */
.lab-list .lab-num {
    font: 500 var(--text-xs)/1 var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red);
    align-self: start;
    padding-top: 6px;
}

/* Concentration title — italic display */
.lab-list .lab-name {
    font: 400 clamp(1.25rem, 1.8vw, 1.625rem)/1.2 var(--font-display);
    font-style: italic;
    letter-spacing: -0.015em;
    color: var(--on-black);
    margin: 0 0 14px;
}

/* ==================== IN PRODUCTION — hairline cards ==================== */

.lab-prod-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 64px;
}

.lab-prod-card {
    position: relative;
    padding: 36px 32px 40px;
    background: rgba(245, 241, 232, 0.012);
    border: 1px solid rgba(245, 241, 232, 0.10);
    transition:
        border-color 420ms cubic-bezier(0.22, 1, 0.36, 1),
        background 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-prod-card:hover {
    border-color: rgba(200, 16, 46, 0.42);
    background: rgba(200, 16, 46, 0.02);
}

.lab-prod-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 1px;
    background: var(--red);
    opacity: 0.85;
}

.lab-prod-tag {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    margin: 0 0 24px;
    line-height: 1;
}

.lab-prod-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.375rem, 1.8vw, 1.625rem);
    line-height: 1.15;
    color: var(--on-black);
    letter-spacing: -0.022em;
    font-variation-settings: 'opsz' 96;
    margin: 0 0 16px;
}

.lab-prod-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--on-black-mute);
    margin: 0;
}

/* ==================== PARTNERS CTA ==================== */

.lab-section--cta {
    background:
        radial-gradient(
            ellipse 50% 70% at 50% 100%,
            rgba(200, 16, 46, 0.20) 0%,
            rgba(200, 16, 46, 0.06) 35%,
            transparent 70%
        ),
        var(--ink);
    color: var(--on-black);
    position: relative;
    overflow: hidden;
}

.lab-section--cta .lab-section__inner {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 144px 32px;
    text-align: center;
}

.cta-eyebrow {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: 1;
    color: var(--red);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 36px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.cta-eyebrow::before {
    content: "";
    width: 36px;
    height: 1px;
    background: var(--red);
    opacity: 0.85;
}

.lab-section--cta h2 {
    color: var(--on-black);
    font-size: clamp(2.5rem, 4.8vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: -0.024em;
    margin: 0 auto 28px;
    max-width: 18ch;
}

.lab-section--cta h2 em {
    color: color-mix(in oklab, var(--red) 78%, var(--on-black));
}

.cta-detail {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--on-black-mute);
    margin: 0 auto 56px;
    max-width: 56ch;
}

.lab-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 20px 36px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--red);
    box-shadow:
        0 0 24px rgba(200, 16, 46, 0.12),
        0 0 64px rgba(200, 16, 46, 0.08);
    animation: lab-cta-breathe 6s ease-in-out infinite;
    transition:
        background-color 280ms ease-out,
        border-color 280ms ease-out,
        color 280ms ease-out,
        box-shadow 280ms ease-out;
}

.lab-cta:hover,
.lab-cta:focus-visible {
    background: var(--red);
    color: var(--on-black);
    outline: none;
    animation-play-state: paused;
    box-shadow:
        inset 0 0 16px rgba(255, 255, 255, 0.10),
        0 0 48px rgba(200, 16, 46, 0.42),
        0 0 96px rgba(200, 16, 46, 0.22);
}

.lab-cta .arrow {
    display: inline-block;
    transition: transform 320ms ease-out;
}

.lab-cta:hover .arrow,
.lab-cta:focus-visible .arrow {
    transform: translateX(6px);
}

@keyframes lab-cta-breathe {
    0%, 100% {
        box-shadow:
            0 0 24px rgba(200, 16, 46, 0.12),
            0 0 64px rgba(200, 16, 46, 0.08);
    }
    50% {
        box-shadow:
            0 0 36px rgba(200, 16, 46, 0.26),
            0 0 88px rgba(200, 16, 46, 0.16);
    }
}

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

/* ==================== MOBILE ==================== */

@media (max-width: 1024px) {
    .lab-section__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .section-anchor {
        position: static;
        padding-top: 12px;
    }

    .lab-section {
        padding: 96px 0;
    }

    .lab-section--cta .lab-section__inner {
        padding: 112px 24px;
    }

    .lab-list .lab-item {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 32px 0;
    }

    .lab-list .lab-item:hover {
        padding-left: 0;
    }

    .lab-prod-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .lab-hero__inner {
        padding: 144px 20px 104px;
    }

    .lab-section__inner,
    .lab-section__grid {
        padding: 0 20px;
    }

    .lab-section h2 {
        font-size: clamp(1.875rem, 7vw, 2.25rem);
    }

    .lab-prod-card {
        padding: 28px 24px 32px;
    }
}
