/* The lab: floor plan and room headers.
   Loaded after styles.css and built entirely from its tokens.
   Every element styled here is created by lab.js. */

:root {
    --lab-wall: var(--secondary-color);
    --lab-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* ---- nav: seven rooms instead of sixteen sections ------------------------ */
.nav-menu.lab-nav { gap: 1.5rem; }
.nav-menu.lab-nav a { font-size: 0.9rem; }

/* ---- live mode: the hero shrinks to a name plate so the lab is on screen -- */
.lab-live .hero {
    min-height: 0;
    padding: calc(var(--lab-nav-h, 71px) + 1.75rem) 1.5rem 1.5rem;
    text-align: left;
    justify-content: center;
}
.lab-live .hero-content {
    width: min(1280px, 100%);
    max-width: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 1.75rem;
    align-items: center;
}
.lab-live .hero-image { grid-row: 1 / span 6; margin: 0; }
.lab-live .profile-image { width: 124px; height: 124px; }
.lab-live .hero-content > :not(.hero-image):not(.hero-cta) { grid-column: 2; }
.lab-live .hero h1 { font-size: 2.4rem; margin-bottom: 0.1rem; }
.lab-live .hero-subtitle { font-size: 0.95rem; margin-bottom: 0.35rem; }
.lab-live .hero-positioning { font-size: 1.05rem; margin: 0 0 0.2rem; max-width: none; }
.lab-live .hero-title { font-size: 1rem; margin-bottom: 0.2rem; }
.lab-live .hero-tagline { font-size: 0.9rem; margin: 0 0 0.2rem; max-width: none; }
.lab-live .hero-metrics { margin-bottom: 0 !important; font-size: 0.85rem !important; }
.lab-live .hero-cta {
    grid-column: 3;
    grid-row: 1 / span 6;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    text-align: center;
}
.lab-live .hero-cta .btn { padding-top: 0.6rem; padding-bottom: 0.6rem; }

/* ---- the lab, after hours (the illustration itself is lab/scene.css) ------- */
.lab-plan { background: #1a1e28; outline: none; }
.lab-stage {
    width: 100%;
    /* the room is 3.77 times as wide as it is tall, plus its floor labels */
    height: min(58vh, max(400px, 38.75vw));
}
.lab-stage-plain {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
}
.lab-stage-plain a {
    padding: 0.8rem 1.1rem;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
}
.lab-stage-plain a span { margin-right: 0.6rem; font-family: var(--lab-mono); font-size: 0.75rem; color: #ffd58a; }

.lab-plan-bar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.08);
    background: #12151d;
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c9cdd6;
}
.lab-plan-kicker { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: #fff; white-space: nowrap; }
.lab-plan-kicker i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #ffd58a;
    animation: lab-live-dot 2.4s ease-in-out infinite;
}
@keyframes lab-live-dot { 50% { opacity: 0.3; } }
.lab-plan-hint {
    margin-right: auto;
    color: #8f95a3;
    text-transform: none;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.85rem;
}
.lab-pill {
    font: inherit;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.lab-pill:hover, .lab-pill.lab-all-toggle[aria-pressed="true"] { background: #ffd58a; border-color: #ffd58a; color: #12151d; }

/* ---- the drawer ----------------------------------------------------------- */
.lab-drawer-bar { display: none; }

.lab-live:not(.lab-linear) .lab-drawer {
    position: fixed;
    z-index: 900;
    top: var(--lab-nav-h, 71px);
    right: 0;
    bottom: 0;
    width: min(900px, 62vw);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-top: 4.5rem;
    background: var(--background);
    box-shadow: -18px 0 50px rgb(0 0 0 / 0.22);
    transform: translateX(105%);
    transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lab-live.lab-open:not(.lab-linear) .lab-drawer { transform: none; }

.lab-live:not(.lab-linear) .lab-drawer-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    background: rgb(255 255 255 / 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.lab-chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: auto;
}
.lab-chips-room {
    flex: none;
    font-family: var(--lab-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-right: 0.4rem;
}
.lab-chips a {
    flex: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-primary);
}
.lab-chips a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.lab-close {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem 0.4rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #fff;
    cursor: pointer;
}
.lab-close span { font-size: 1.2rem; line-height: 1; }
.lab-close:hover { background: var(--primary-color); }

/* ---- a room -------------------------------------------------------------- */
.lab-room-head {
    background: var(--secondary-color);
    color: #fff;
}
.lab-room-head-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.lab-room-num {
    font-family: var(--lab-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-light);
}
.lab-room-name {
    font-size: 2.5rem;
    letter-spacing: -0.01em;
    outline: none;
}
/* Rooms open with a short fade so a change of room reads as a change. */
.lab-room:not([hidden]) > .section,
.lab-room:not([hidden]) > .lab-room-head {
    animation: lab-enter 0.35s ease both;
}
@keyframes lab-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.lab-room-foot {
    border-top: 1px solid var(--border-color);
    background: var(--background);
}
.lab-room-foot-in {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
.lab-door {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--text-primary);
}
.lab-door span {
    font-family: var(--lab-mono);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.lab-door-next { text-align: right; align-items: flex-end; }
.lab-door-plan {
    font-family: var(--lab-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.lab-door:hover { color: var(--primary-color); }

/* While a room is open the lab takes the whole window behind the drawer, so
   the white name plate is not left hanging beside a night-time room. */
@media (min-width: 901px) {
    .lab-live.lab-open:not(.lab-linear) .lab-plan {
        position: fixed;
        z-index: 880;
        top: var(--lab-nav-h, 71px);
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: column;
    }
    .lab-live.lab-open:not(.lab-linear) .lab-stage { flex: 1; height: auto; min-height: 0; }
    .lab-live.lab-open:not(.lab-linear) .lab-plan-bar { padding-right: calc(min(900px, 62vw) + 1.5rem); }
    .lab-live.lab-open:not(.lab-linear) .lab-plan-hint { display: none; }
}

/* ---- small screens ------------------------------------------------------- */
@media (max-width: 900px) {
    .lab-live .hero-content { grid-template-columns: auto minmax(0, 1fr); }
    .lab-live .hero-cta { grid-column: 1 / -1; grid-row: auto; flex-direction: row; margin-top: 1rem; }
    .lab-plan-hint { display: none; }
    .lab-plan-kicker { margin-right: auto; }
    .lab-plan-bar { padding: 0.6rem 0.9rem; gap: 0.5rem; }
    /* the drawer takes the whole screen, so the page behind must not scroll */
    .lab-live:not(.lab-linear) .lab-drawer { width: 100%; }
    .lab-live.lab-open:not(.lab-linear) { overflow: hidden; }
    .lab-stage { height: 62vh; }

    .lab-room-head-in { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
    .lab-room-name { font-size: 2rem; }
}

@media (max-width: 760px) {
    .lab-live .hero { padding-left: 1rem; padding-right: 1rem; }
    .lab-live .hero-content { column-gap: 1rem; }
    .lab-live .profile-image { width: 76px; height: 76px; border-width: 3px; }
    .lab-live .hero-image { grid-row: 1 / span 2; align-self: start; }
    .lab-live .hero h1 { font-size: 1.7rem; }
    .lab-live .hero-content > p { grid-column: 1 / -1 !important; }
    .lab-live .hero-content > .hero-subtitle { grid-column: 2 !important; }
    .lab-live .hero-positioning { margin-top: 0.75rem; }
    .lab-plan-kicker { font-size: 0; gap: 0; }
    .lab-live:not(.lab-linear) .lab-drawer-bar { padding: 0.6rem 0.9rem; }
    .lab-close { padding: 0.4rem 0.7rem; }
    .lab-close { font-size: 0; gap: 0; }
    .lab-close span { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .lab-live .hero-cta { flex-direction: row; flex-wrap: nowrap; gap: 0.4rem; }
    .lab-live .hero-cta .btn { width: auto; flex: 1; padding: 0.55rem 0.3rem; font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .lab-plan-kicker i,
    .lab-room:not([hidden]) > .section,
    .lab-room:not([hidden]) > .lab-room-head { animation: none; }
    .lab-live:not(.lab-linear) .lab-drawer { transition: none; }
}

@media print {
    .lab-plan, .lab-room-foot, .lab-drawer-bar { display: none; }
    .lab-live .lab-drawer { position: static !important; transform: none !important; width: auto !important; }
}
