/* Test page only: 3D rotating column homepage prototype. */

.lab-body {
    overflow-x: hidden;
    background: #060a10;
}

/* Hacker terminal window wrapping the whole scene */
.lab-shell {
    position: fixed;
    inset: clamp(8px, 1.6vh, 20px) clamp(8px, 1.4vw, 26px);
    z-index: 2;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(120, 255, 235, 0.35);
    border-radius: 10px;
    background: rgba(4, 10, 13, 0.72);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 30px 90px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    font-family: var(--mono);
}

.lab-titlebar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-bottom: 1px solid rgba(120, 255, 235, 0.28);
    background: linear-gradient(180deg, rgba(12, 30, 34, 0.95), rgba(6, 16, 19, 0.95));
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(120, 255, 235, 0.85);
}

.lab-dots {
    display: inline-flex;
    gap: 6px;
}

.lab-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2c3b3e;
}

.lab-dots i:first-child {
    background: var(--accent);
}

.lab-dots i:nth-child(2) {
    background: #d9a441;
}

.lab-dots i:last-child {
    background: #4bd68a;
}

.lab-titlebar-path {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lab-titlebar-home {
    color: inherit;
    text-decoration: none;
}

.lab-titlebar-home:hover {
    text-decoration: underline;
    text-decoration-color: currentColor;
}

.lab-caret {
    display: inline-block;
    width: 8px;
    height: 12px;
    margin-left: 4px;
    vertical-align: -2px;
    background: rgba(120, 255, 235, 0.9);
    animation: lab-caret 1s steps(2, end) infinite;
}

@keyframes lab-caret {
    50% {
        opacity: 0;
    }
}

.lab-titlebar-state {
    text-transform: uppercase;
    color: rgba(75, 214, 138, 0.9);
}

.lab-titlebar-state::before {
    content: "\25cf";
    margin-right: 0.4rem;
    animation: lab-caret 1.6s steps(2, end) infinite;
}

.lab-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(120, 255, 235, 0.4);
    border-radius: 4px;
    color: rgba(120, 255, 235, 0.9);
    text-decoration: none;
    letter-spacing: 0.14em;
    transition: background 0.2s ease, color 0.2s ease;
}

.lab-lang:hover {
    background: rgba(120, 255, 235, 0.85);
    color: #04100f;
}

.lab-lang-flag {
    font-size: 0.95rem;
    line-height: 1;
}

/* Hexagonal nav buttons */
.lab-hexnav {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(120, 255, 235, 0.18);
    background: rgba(6, 18, 21, 0.6);
}

.lab-hex {
    --hex-color: rgba(120, 255, 235, 0.85);
    position: relative;
    display: grid;
    place-items: center;
    width: 104px;
    height: 46px;
    padding: 0;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: linear-gradient(180deg, rgba(120, 255, 235, 0.22), rgba(120, 255, 235, 0.05));
    color: var(--hex-color);
    font-size: 0.63rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lab-hex span {
    display: grid;
    place-items: center;
    width: calc(100% - 3px);
    height: calc(100% - 3px);
    padding: 0 12px;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: rgba(4, 12, 14, 0.92);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.1;
    transition: background 0.2s ease;
}

.lab-hex-main {
    width: 120px;
}

.lab-hex:hover {
    background: linear-gradient(180deg, rgba(120, 255, 235, 0.95), rgba(120, 255, 235, 0.45));
    color: rgba(210, 255, 250, 0.95);
    transform: translateY(-2px);
}

.lab-hex:hover span {
    background: rgba(8, 34, 34, 0.92);
}

.lab-hex-tag {
    --hex-color: rgba(255, 140, 150, 0.9);
    width: 120px;
    height: 46px;
    background: linear-gradient(180deg, rgba(226, 0, 26, 0.35), rgba(226, 0, 26, 0.08));
}

.lab-hex-tag:hover {
    background: linear-gradient(180deg, rgba(255, 59, 59, 0.95), rgba(226, 0, 26, 0.5));
    color: rgba(255, 220, 220, 0.95);
}

.lab-hex-tag:hover span {
    background: rgba(40, 6, 10, 0.92);
}

/* Current tag: lit up and pinned in its "on" state */
.lab-hex-tag.is-active {
    background: linear-gradient(180deg, rgba(255, 59, 59, 0.95), rgba(226, 0, 26, 0.55));
    color: rgba(255, 226, 226, 0.98);
    box-shadow: 0 0 14px rgba(255, 59, 59, 0.55);
}

.lab-hex-tag.is-active span {
    background: rgba(40, 6, 10, 0.92);
}

/* Brand logo, pushed to the far right of the nav row */
.lab-nav-logo {
    display: inline-flex;
    align-items: center;
    padding: 0 0.4rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.lab-nav-logo:hover {
    opacity: 1;
}

.lab-nav-logo img {
    display: block;
    height: 22px;
    width: auto;
}

.lab-screen {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.lab-statusbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 0.35rem 0.8rem;
    border-top: 1px solid rgba(120, 255, 235, 0.22);
    background: rgba(6, 16, 19, 0.9);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(120, 255, 235, 0.6);
}

/* Continue past the current batch of items. Only revealed once scrolled to the end. */
.lab-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid rgba(120, 255, 235, 0.22);
    background: rgba(6, 16, 19, 0.9);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    border-top-width: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.lab-pagination.is-visible {
    max-height: 60px;
    padding: 0.55rem 0.8rem;
    border-top-width: 1px;
    opacity: 1;
}

.lab-page-link {
    color: rgba(120, 255, 235, 0.9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.lab-page-link:hover {
    color: rgba(220, 255, 252, 0.98);
    border-color: rgba(120, 255, 235, 0.7);
}

.lab-page-current {
    color: rgba(255, 59, 59, 0.85);
    text-transform: uppercase;
}

/* Social links, terminal-tag style */
.lab-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Footer placement (mobile): full-width bar under the pagination */
.lab-social-footer {
    justify-content: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    border-top: 1px solid rgba(120, 255, 235, 0.18);
    background: rgba(6, 16, 19, 0.75);
}

/* Desktop placement: sits left of the logo, inside the nav row */
.lab-social-desktop {
    margin-left: auto;
    padding-right: 0.6rem;
    margin-right: 0.6rem;
    border-right: 1px solid rgba(120, 255, 235, 0.22);
}

.lab-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(120, 255, 235, 0.35);
    border-radius: 50%;
    color: rgba(120, 255, 235, 0.85);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lab-social-icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.lab-social-link:hover {
    background: rgba(120, 255, 235, 0.85);
    color: #04100f;
    border-color: rgba(120, 255, 235, 0.85);
    transform: translateY(-2px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* The terminal prompt already conveys location; keep the BreadcrumbList JSON-LD only. */
.lab-body .breadcrumb {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lab-stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    place-items: center;
    perspective: 1900px;
    perspective-origin: 50% 45%;
    overflow: hidden;
    pointer-events: none;
}

.lab-world {
    position: relative;
    width: 1px;
    height: 1px;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Column */
.lab-column {
    position: absolute;
    left: 0;
    top: 0;
    transform-style: preserve-3d;
    animation: lab-shake 0.22s steps(2, end) infinite;
}

.lab-column-slat {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 84px;
    height: 200vh;
    margin-left: -42px;
    margin-top: -100vh;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 9px),
        linear-gradient(0deg,
            rgba(226, 0, 26, 0.05) 0%,
            rgba(255, 59, 59, 0.55) 18%,
            rgba(120, 255, 235, 0.75) 32%,
            rgba(226, 0, 26, 0.35) 46%,
            rgba(226, 0, 26, 0.05) 60%,
            rgba(255, 59, 59, 0.5) 78%,
            rgba(226, 0, 26, 0.05) 100%);
    background-size: 100% 24px, 100% 900px;
    background-repeat: repeat, repeat;
    border-left: 1px solid rgba(226, 0, 26, 0.45);
    border-right: 1px solid rgba(120, 255, 235, 0.12);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 0 26px rgba(226, 0, 26, 0.28);
    backface-visibility: hidden;
    animation: lab-flux-slat 2.4s linear infinite;
}

.lab-column-rail {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 220vh;
    margin: -110vh 0 0 -1.5px;
    background: linear-gradient(0deg, transparent, rgba(180, 255, 245, 0.95) 40%, rgba(255, 59, 59, 0.9) 60%, transparent);
    background-size: 100% 600px;
    filter: blur(0.4px);
    animation: lab-flux-rail 1.1s linear infinite, lab-pulse 0.3s ease-in-out infinite alternate;
}

.lab-column-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 240px;
    height: 200vh;
    margin: -100vh 0 0 -120px;
    background: linear-gradient(0deg, transparent, rgba(226, 0, 26, 0.35), rgba(120, 255, 235, 0.25), transparent);
    background-size: 100% 1200px;
    filter: blur(26px);
    animation: lab-flux-core 3.1s linear infinite;
}

@keyframes lab-flux-slat {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 0 -24px, 0 -900px;
    }
}

@keyframes lab-flux-rail {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 0 -600px;
    }
}

@keyframes lab-flux-core {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 0 -1200px;
    }
}

@keyframes lab-pulse {
    from {
        opacity: 0.55;
    }
    to {
        opacity: 1;
    }
}

@keyframes lab-shake {
    0% {
        transform: translate3d(-1.5px, 0, 0);
    }
    50% {
        transform: translate3d(1.5px, 0, 1px);
    }
    100% {
        transform: translate3d(-0.5px, 0, 0);
    }
}

/* Cyberpunk / matrix cylinder, rotates with the world */
.lab-matrix {
    position: absolute;
    left: 0;
    top: 0;
    transform-style: preserve-3d;
}

.lab-matrix-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 720px;
    height: 150vh;
    margin: -75vh 0 0 -360px;
    opacity: 0.85;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(120, 255, 235, 0.14) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(0deg, rgba(120, 255, 235, 0.08) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(180deg, rgba(120, 255, 235, 0.22) 0 6px, rgba(120, 255, 235, 0.03) 6px 14px, transparent 14px 260px);
    background-size: 100% 3px, 28px 100%, 100% 34px, 120px 420px;
    animation: lab-rain 7.5s linear infinite;
    backface-visibility: hidden;
}

@keyframes lab-rain {
    from {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    to {
        background-position: 0 0, 0 0, 0 34px, 0 420px;
    }
}

/* Animus-style code blocks living on the backdrop cylinder */
.lab-code-block {
    position: absolute;
    left: 50%;
    padding: 8px 10px;
    display: grid;
    gap: 5px;
    border: 1px solid rgba(120, 255, 235, 0.28);
    border-left: 2px solid rgba(120, 255, 235, 0.7);
    background: rgba(6, 22, 26, 0.55);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
    transition: border-color 0.25s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.lab-code-head {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    color: rgba(120, 255, 235, 0.75);
    border-bottom: 1px solid rgba(120, 255, 235, 0.2);
    padding-bottom: 4px;
}

.lab-code-line {
    height: 4px;
    border-radius: 2px;
    background: rgba(120, 255, 235, 0.45);
    animation: lab-code-flicker 3.4s steps(3, end) infinite;
}

.lab-code-line.is-hot {
    background: rgba(255, 59, 59, 0.6);
}

/* Block variants so no two look alike */
.lab-code-block.is-terminal {
    border-left-color: rgba(120, 255, 235, 0.9);
    background: rgba(4, 18, 22, 0.7);
}

.lab-code-block.is-hexdump {
    gap: 3px;
    border-style: dashed;
    border-left-color: rgba(255, 214, 92, 0.75);
    background: rgba(16, 14, 6, 0.55);
}

.lab-code-block.is-hexdump .lab-code-head {
    color: rgba(255, 214, 92, 0.8);
}

.lab-code-block.is-hexdump .lab-code-line {
    height: 3px;
    background: rgba(255, 214, 92, 0.45);
}

.lab-code-block.is-memory {
    gap: 8px;
    border-color: rgba(226, 0, 26, 0.4);
    border-left-color: rgba(255, 59, 59, 0.9);
    background: rgba(24, 5, 8, 0.6);
}

.lab-code-block.is-memory .lab-code-head {
    color: rgba(255, 120, 120, 0.85);
}

.lab-code-block.is-memory .lab-code-line {
    height: 6px;
    border-radius: 0;
    background: rgba(255, 59, 59, 0.4);
}

.lab-code-block.is-glitch {
    border-color: rgba(200, 160, 255, 0.4);
    border-left-color: rgba(200, 160, 255, 0.9);
    background: rgba(14, 8, 26, 0.6);
    animation: lab-block-glitch 4.6s steps(4, end) infinite;
}

.lab-code-block.is-glitch .lab-code-head {
    color: rgba(210, 180, 255, 0.85);
}

.lab-code-block.is-glitch .lab-code-line {
    background: rgba(200, 160, 255, 0.5);
}

.lab-code-block.is-log {
    gap: 2px;
    border-width: 0 0 0 2px;
    background: rgba(2, 12, 14, 0.4);
    box-shadow: none;
}

.lab-code-block.is-log .lab-code-line {
    height: 2px;
}

@keyframes lab-block-glitch {
    0%,
    88% {
        transform: translateX(0);
        filter: none;
    }
    90% {
        transform: translateX(-6px);
        filter: hue-rotate(60deg);
    }
    93% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes lab-code-flicker {
    0%,
    72% {
        opacity: 0.35;
    }
    76% {
        opacity: 1;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.35;
    }
}

.lab-code-block.is-charged {
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(20, 70, 78, 0.75);
    box-shadow: 0 0 34px rgba(120, 255, 235, 0.55), inset 0 0 24px rgba(120, 255, 235, 0.35);
}

.lab-code-block.is-charged .lab-code-line {
    background: rgba(220, 255, 252, 0.95);
    animation-duration: 0.4s;
}

/* Energy jet fired from the column toward a code block */
.lab-jet-layer {
    position: absolute;
    left: 0;
    top: 0;
    transform-style: preserve-3d;
}

.lab-jet {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 5px;
    margin-top: -2.5px;
    pointer-events: none;
}

.lab-jet-beam {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0, rgba(255, 59, 59, 0.9) 35%, rgba(220, 255, 252, 1) 50%, rgba(120, 255, 235, 0.9) 65%, transparent 100%);
    background-size: 260px 100%;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 8px rgba(120, 255, 235, 0.9));
    animation: lab-jet-travel 0.85s linear forwards;
}

@keyframes lab-jet-travel {
    from {
        background-position: -260px 0;
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    to {
        background-position: 100% 0;
        opacity: 1;
    }
}

/* Items ring */
.lab-ring {
    position: absolute;
    left: 0;
    top: 0;
    transform-style: preserve-3d;
}

.lab-slot {
    position: absolute;
    left: 0;
    top: 0;
    width: 340px;
    height: 340px;
    margin-left: -170px;
    margin-top: -170px;
    transform-style: preserve-3d;
    pointer-events: auto;
}

.lab-card {
    position: relative;
    display: grid;
    gap: 0.55rem;
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    grid-template-rows: auto auto auto auto 1fr;
    backdrop-filter: blur(2px);
    transform-style: preserve-3d;
    touch-action: manipulation;
}

.lab-card:hover {
    border-color: var(--accent-strong);
}

.lab-card.is-upcoming {
    border-color: rgba(255, 191, 71, 0.72);
    background:
        linear-gradient(135deg, rgba(255, 191, 71, 0.13), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow), inset 0 0 28px rgba(255, 167, 38, 0.09);
}

.lab-card-soon {
    position: absolute;
    top: 0.8rem;
    right: -0.35rem;
    z-index: 2;
    padding: 0.28rem 0.65rem 0.28rem 0.8rem;
    border: 1px solid rgba(255, 225, 149, 0.88);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    background: rgba(129, 59, 0, 0.9);
    box-shadow: 0 0 16px rgba(255, 167, 38, 0.45);
    color: #fff0c4;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
    text-shadow: 0 0 7px rgba(255, 235, 183, 0.72);
    animation: lab-soon-signal 1.8s steps(2, end) infinite;
}

@keyframes lab-soon-signal {
    50% {
        box-shadow: 0 0 24px rgba(255, 167, 38, 0.85);
    }
}

/* Front item: fully opaque and crisp, transparency returns once it rotates away. */
.lab-slot.is-front .lab-card {
    background: #0b0a0c;
    border-color: var(--accent-strong);
    backdrop-filter: none;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.75), 0 0 34px rgba(226, 0, 26, 0.3);
}

.lab-slot.is-front .lab-card.is-upcoming {
    border-color: rgba(255, 213, 114, 0.94);
    background:
        linear-gradient(135deg, rgba(255, 191, 71, 0.18), transparent 42%),
        #161007;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.75), 0 0 38px rgba(255, 167, 38, 0.34);
}

.lab-slot.is-front .lab-card-excerpt {
    color: #d9d4d8;
}

/* Hover: the card dips back toward the column then springs to the foreground.
   Triggered by a JS class, not :hover, because the Z shift would retrigger it. */
.lab-slot.is-front .lab-card.is-bouncing {
    animation: lab-card-bounce 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes lab-card-bounce {
    0% {
        transform: translateZ(0);
    }
    38% {
        transform: translateZ(-30px) scale(0.985);
    }
    72% {
        transform: translateZ(12px) scale(1.006);
    }
    100% {
        transform: translateZ(0) scale(1);
    }
}

/* Click: VR headset command validation */
.lab-card.is-validating {
    animation: lab-validate-card 0.62s ease-out forwards;
    border-color: rgba(220, 255, 252, 0.95);
}

@keyframes lab-validate-card {
    0% {
        transform: translateZ(0);
        filter: none;
    }
    18% {
        transform: translateZ(-26px);
        filter: brightness(2.4) saturate(0.4);
    }
    34% {
        filter: brightness(1) contrast(1.6) hue-rotate(140deg);
    }
    100% {
        transform: translateZ(150px) scale(1.06);
        filter: brightness(1.5);
        opacity: 0.15;
    }
}

.lab-validate-ring {
    position: absolute;
    inset: -12px;
    border: 2px solid rgba(120, 255, 235, 0.9);
    border-radius: 18px;
    pointer-events: none;
    animation: lab-validate-ring 0.62s ease-out forwards;
}

@keyframes lab-validate-ring {
    from {
        transform: scale(0.82);
        opacity: 0;
        box-shadow: 0 0 0 rgba(120, 255, 235, 0.8);
    }
    30% {
        opacity: 1;
    }
    to {
        transform: scale(1.55);
        opacity: 0;
        box-shadow: 0 0 60px rgba(120, 255, 235, 0.6);
    }
}

.lab-validate-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(220, 255, 252, 0.98);
    text-shadow: 0 0 14px rgba(120, 255, 235, 0.9);
    white-space: nowrap;
    pointer-events: none;
    animation: lab-validate-label 0.62s steps(6, end) forwards;
}

@keyframes lab-validate-label {
    0% {
        opacity: 0;
        letter-spacing: 0.8em;
    }
    25% {
        opacity: 1;
        letter-spacing: 0.35em;
    }
    75% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        letter-spacing: 0.15em;
    }
}

/* Full-screen HUD flash when a command is confirmed */
.lab-validate-flash {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 45%, rgba(120, 255, 235, 0.28), transparent 55%),
        repeating-linear-gradient(0deg, rgba(120, 255, 235, 0.12) 0 2px, transparent 2px 6px);
    animation: lab-validate-flash 0.62s ease-out forwards;
}

@keyframes lab-validate-flash {
    0% {
        opacity: 0;
        transform: scale(1.04);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.lab-card-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    background: #111;
}

.lab-card-meta {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lab-card-title {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.lab-card-flag {
    font-size: 1rem;
    white-space: nowrap;
}

.lab-card-excerpt {
    margin: 0;
    font-size: 0.74rem;
    color: var(--muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

/* Terminal-style "> author / location" line under each item */
.lab-card-tag {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(120, 255, 235, 0.85);
    text-shadow: 0 0 8px rgba(120, 255, 235, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lab-card-tag-prompt {
    color: rgba(255, 59, 59, 0.9);
    margin-right: 0.15rem;
    animation: lab-caret 1.1s steps(2, end) infinite;
}

/* HUD */
.lab-hud {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    pointer-events: none;
}

.lab-hud-bar {
    width: min(38vw, 320px);
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.lab-hud-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
}

.lab-intro {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem clamp(1rem, 4vw, 3rem) 0;
    text-align: center;
    pointer-events: none;
}

.lab-intro h1 {
    margin: 0;
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.lab-intro p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Scroll spacer that drives the rotation */
.lab-scroll-track {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* No-JS / fallback list */
.lab-fallback {
    position: relative;
    z-index: 2;
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.js-lab-ready .lab-fallback {
    display: none;
}

.js-lab-ready .lab-shell {
    display: flex;
}

.no-js-note {
    color: var(--muted);
}

/* Mobile step controls */
.lab-step {
    display: none;
    position: absolute;
    bottom: 0.9rem;
    z-index: 4;
    width: 52px;
    height: 46px;
    padding: 0;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    border: 0;
    background: rgba(120, 255, 235, 0.85);
    color: #04100f;
    font-size: 0.85rem;
    cursor: pointer;
}

.lab-step:active {
    background: rgba(255, 59, 59, 0.9);
}

.lab-step-prev {
    left: 0.7rem;
}

.lab-step-next {
    right: 0.7rem;
}

/* Desktop step controls, pinned just below the logo row without affecting its height */
.lab-step-desk-group {
    position: absolute;
    top: 100%;
    right: 0.7rem;
    margin-top: 0.5rem;
    z-index: 5;
    display: flex;
    gap: 0.5rem;
}

.lab-step-desk {
    display: block;
    position: static;
    bottom: auto;
}

@media (min-width: 721px) {
    .lab-social-footer {
        display: none;
    }
}

@media (max-width: 720px) {
    .lab-step {
        display: block;
    }

    .lab-step-desk-group {
        display: none;
    }

    .lab-social-desktop {
        display: none;
    }

    .lab-nav-logo {
        margin-left: auto;
    }

    .lab-social-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .lab-social-link {
        width: 40px;
        height: 40px;
    }

    .lab-social-icon {
        width: 19px;
        height: 19px;
    }

    .lab-hud {
        bottom: 1.6rem;
    }

    .lab-hud-bar {
        width: 34vw;
    }

    /* Trim the heaviest effects so the rotation stays smooth on phones. */
    .lab-column-core {
        display: none;
    }

    .lab-statusbar {
        display: none;
    }

    .lab-column {
        animation: none;
    }

    .lab-column-slat {
        background: linear-gradient(0deg,
            rgba(226, 0, 26, 0.06) 0%,
            rgba(255, 59, 59, 0.5) 25%,
            rgba(120, 255, 235, 0.55) 45%,
            rgba(226, 0, 26, 0.06) 100%);
        background-size: 100% 900px;
        box-shadow: none;
        animation-duration: 4s;
    }

    .lab-column-rail {
        filter: none;
        animation: lab-flux-rail 2.2s linear infinite;
    }

    .lab-card {
        backdrop-filter: none;
    }

    .lab-code-block.is-glitch {
        animation: none;
    }

    .lab-code-line {
        animation: none;
        opacity: 0.45;
    }

    .lab-shell {
        inset: 0;
        border-radius: 0;
        border-width: 0;
        box-shadow: none;
    }

    .lab-hexnav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .lab-hex {
        flex: 0 0 auto;
        width: 120px;
        height: 46px;
        font-size: 0.63rem;
    }

    .lab-hex-tag {
        width: 120px;
        height: 46px;
    }

    .lab-slot {
        width: 250px;
        height: 330px;
        margin-left: -125px;
        margin-top: -165px;
    }

    .lab-column-slat {
        width: 56px;
        margin-left: -28px;
    }

    .lab-matrix-panel {
        width: 440px;
        margin-left: -220px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .js-lab-ready .lab-fallback {
        display: block;
    }

    .lab-shell {
        display: none;
    }
}
