/* ═══════════════════════════════════════════════════════════════════════════
   LAB STYLES — Horizontal Immersive Showcase
   Glassmorphic + Neumorphic, 3D liquid, futuristic minimal
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
    --void:           #000000;
    --void-soft:      #020208;
    --surface-1:      #08081a;
    --surface-2:      #0e0e24;
    --surface-3:      #161636;
    --border:         rgba(255,255,255,0.04);
    --border-hover:   rgba(255,255,255,0.10);
    --glass:          rgba(255,255,255,0.025);
    --glass-hover:    rgba(255,255,255,0.05);
    --glass-solid:    rgba(12, 12, 35, 0.65);

    --text-primary:   #e8e8f0;
    --text-secondary: #7a7a9e;
    --text-muted:     #484868;

    --accent:         #6c63ff;
    --accent-rgb:     108, 99, 255;
    --accent-glow:    rgba(108, 99, 255, 0.35);
    --accent-soft:    rgba(108, 99, 255, 0.06);
    --accent-hot:     #a78bfa;
    --accent-hot-rgb: 167, 139, 250;

    --cyan:           #00e5ff;
    --cyan-rgb:       0, 229, 255;

    --emerald:        #34d399;
    --emerald-rgb:    52, 211, 153;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body:    'Outfit', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    height: 100%;
    background: var(--void);
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: default;
    user-select: none;
}

::selection {
    background: var(--accent);
    color: var(--void);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── WEBGL CANVAS ─── */
#lab-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    display: block;
}

/* ─── PROGRESS BAR ─── */
.lab-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 2px;
    z-index: 1000;
    background: rgba(255,255,255,0.02);
}
.lab-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--cyan), var(--accent-hot));
    background-size: 200% 100%;
    animation: lab-gradient-shift 3s ease infinite;
    transition: width 0.15s linear;
    box-shadow: 0 0 20px var(--accent-glow), 0 0 6px var(--accent);
}
@keyframes lab-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ─── BACK BUTTON ─── */
.lab-back-btn {
    position: fixed;
    top: 28px; left: 28px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 40px;
    background: var(--glass-solid);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    transition: all 0.4s var(--ease-out-expo);
    cursor: pointer;
}
.lab-back-btn:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.06);
    transform: translateX(-4px);
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.1);
}

/* ─── HUD COUNTER ─── */
.lab-hud {
    position: fixed;
    bottom: 32px; right: 32px;
    z-index: 900;
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}
.lab-hud-current {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-display);
    transition: all 0.3s var(--ease-out-expo);
}
.lab-hud-sep {
    opacity: 0.3;
    margin: 0 2px;
}

/* ─── SCROLL HINT ─── */
.lab-scroll-hint {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
    opacity: 0.6;
    transition: opacity 1s ease;
}
.lab-scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}
.scroll-hint-arrows {
    display: flex;
    gap: 4px;
    animation: hint-slide 1.5s ease-in-out infinite;
}
.scroll-hint-arrows i {
    font-size: 0.55rem;
    opacity: 0.4;
}
.scroll-hint-arrows i:nth-child(2) { opacity: 0.6; }
.scroll-hint-arrows i:nth-child(3) { opacity: 0.9; }

@keyframes hint-slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

/* ═══════════════════════════════════════════════════
   HORIZONTAL VIEWPORT & TRACK
   ═══════════════════════════════════════════════════ */
.lab-viewport {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    overflow: hidden;
    cursor: grab;
}
.lab-viewport:active {
    cursor: grabbing;
}

.lab-track {
    display: flex;
    height: 100%;
    will-change: transform;
}

/* ─── PANEL (each full-screen slide) ─── */
.lab-panel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 40px;
}

.panel-inner {
    max-width: 560px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateX(60px) scale(0.95);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.lab-panel.active .panel-inner {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* ═══════════════════════════════════════════════════
   INTRO PANEL
   ═══════════════════════════════════════════════════ */
.lab-intro .panel-inner {
    text-align: center;
    gap: 28px;
    max-width: 640px;
}

.intro-badge {
    width: 64px; height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    background: var(--glass-solid);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 0 40px rgba(var(--accent-rgb), 0.08);
    margin: 0 auto;
}

.intro-title {
    font-family: var(--font-display);
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.intro-line-1 {
    display: block;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    color: var(--text-secondary);
}
.intro-line-2 {
    display: block;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(var(--accent-rgb), 0.2));
}

.intro-sub {
    font-size: clamp(0.88rem, 1.4vw, 1.02rem);
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
}

.intro-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.meta-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 40px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.meta-pill i {
    color: var(--accent);
    font-size: 0.6rem;
}

/* ═══════════════════════════════════════════════════
   GLASS CARD — 3D Glassmorphic + Neumorphic
   ═══════════════════════════════════════════════════ */
.lab-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    border-radius: 28px;
    overflow: hidden;
    transition: all 0.6s var(--ease-out-expo);
}

.glass-card {
    background: var(--glass-solid);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(40px) saturate(1.2);
    -webkit-backdrop-filter: blur(40px) saturate(1.2);
    box-shadow:
        0 24px 80px rgba(0,0,0,0.35),
        0 4px 20px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.05),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    --holo-x: 50%;
    --holo-y: 50%;
}

/* Holographic prismatic overlay */
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    background:
        radial-gradient(
            circle at var(--holo-x) var(--holo-y),
            rgba(108, 99, 255, 0.12) 0%,
            rgba(0, 229, 255, 0.08) 25%,
            rgba(167, 139, 250, 0.06) 50%,
            transparent 70%
        );
    mix-blend-mode: screen;
}

/* Holographic scan line */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.008) 2px,
            rgba(255,255,255,0.008) 4px
        );
}

.glass-card.holo-active::before {
    opacity: 1;
}
.glass-card.holo-active::after {
    opacity: 1;
}

.glass-card.holo-active {
    border-color: rgba(255,255,255,0.1);
    box-shadow:
        0 32px 100px rgba(0,0,0,0.4),
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.07),
        inset 0 -1px 0 rgba(0,0,0,0.15),
        0 0 60px rgba(var(--accent-rgb), 0.04);
}

.glass-card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow:
        0 32px 100px rgba(0,0,0,0.4),
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.07),
        inset 0 -1px 0 rgba(0,0,0,0.15),
        0 0 60px rgba(var(--accent-rgb), 0.04);
}

/* Liquid orb background */
.card-orb {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 40% 40%,
        hsla(var(--orb-hue, 250), 80%, 65%, 0.12),
        hsla(var(--orb-hue, 250), 60%, 40%, 0.04),
        transparent 70%
    );
    filter: blur(30px);
    pointer-events: none;
    transition: all 1s var(--ease-out-expo);
    animation: orb-breathe 6s ease-in-out infinite;
}
.glass-card:hover .card-orb {
    transform: scale(1.2) translate(-10px, 10px);
    filter: blur(25px);
}

@keyframes orb-breathe {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.8; }
    50% { transform: scale(1.08) translate(-5px, 5px); opacity: 1; }
}

/* Card content */
.card-content {
    position: relative;
    z-index: 2;
    padding: 40px 36px 36px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(var(--accent-rgb), 0.06);
    line-height: 1;
    letter-spacing: -0.04em;
    position: absolute;
    top: 20px;
    right: 28px;
}

.card-icon-wrap {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent);
    /* Neumorphic inset */
    background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.15));
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow:
        4px 4px 12px rgba(0,0,0,0.3),
        -2px -2px 8px rgba(255,255,255,0.02),
        inset 0 0 0 1px rgba(var(--accent-rgb), 0.05);
    transition: all 0.5s var(--ease-out-expo);
}
.glass-card:hover .card-icon-wrap {
    box-shadow:
        4px 4px 16px rgba(0,0,0,0.35),
        -2px -2px 10px rgba(255,255,255,0.03),
        inset 0 0 0 1px rgba(var(--accent-rgb), 0.15),
        0 0 24px rgba(var(--accent-rgb), 0.12);
    color: var(--accent-hot);
}

.card-name {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 300;
}

.card-tech-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.card-tech-row span {
    padding: 4px 12px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    transition: all 0.4s ease;
}
.glass-card:hover .card-tech-row span {
    border-color: rgba(var(--accent-rgb), 0.12);
    color: var(--text-secondary);
}

.card-enter-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 40px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    /* Neumorphic button */
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.06), rgba(var(--accent-rgb), 0.02));
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    box-shadow:
        4px 4px 14px rgba(0,0,0,0.25),
        -2px -2px 8px rgba(255,255,255,0.01);
    transition: all 0.5s var(--ease-out-expo);
    margin-top: 8px;
    cursor: pointer;
}
.card-enter-btn:hover {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow:
        0 0 28px rgba(var(--accent-rgb), 0.15),
        4px 4px 18px rgba(0,0,0,0.3),
        -2px -2px 10px rgba(255,255,255,0.02);
    transform: translateX(4px);
}
.card-enter-btn i {
    transition: transform 0.4s var(--ease-out-expo);
}
.card-enter-btn:hover i {
    transform: translateX(4px);
}

/* Liquid animated border glow — holographic prismatic edge */
.card-liquid-border {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    z-index: 1;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(108, 99, 255, 0.2) 5%,
        rgba(0, 229, 255, 0.15) 10%,
        transparent 15%,
        transparent 30%,
        rgba(167, 139, 250, 0.18) 35%,
        rgba(52, 211, 153, 0.12) 40%,
        transparent 45%,
        transparent 60%,
        rgba(0, 229, 255, 0.15) 65%,
        rgba(108, 99, 255, 0.2) 70%,
        transparent 75%,
        transparent 90%,
        rgba(167, 139, 250, 0.12) 95%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: liquid-spin 8s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
}
.glass-card.holo-active .card-liquid-border,
.glass-card:hover .card-liquid-border {
    opacity: 1;
}
@keyframes liquid-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   FX OVERLAYS
   ═══════════════════════════════════════════════════ */

/* Film grain */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: grain-drift 0.5s steps(1) infinite;
}
@keyframes grain-drift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-1px, 1px); }
    50%  { transform: translate(1px, -1px); }
    75%  { transform: translate(-1px, -1px); }
    100% { transform: translate(1px, 1px); }
}

/* Vignette */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .lab-panel { padding: 60px 24px; }
    .card-content { padding: 32px 24px 28px; }
    .card-number { font-size: 2.2rem; right: 20px; top: 16px; }
    .card-icon-wrap { width: 40px; height: 40px; font-size: 0.95rem; border-radius: 12px; }
    .card-name { font-size: 1.15rem; }
    .card-summary { font-size: 0.82rem; }
    .lab-back-btn { top: 16px; left: 16px; padding: 8px 14px; font-size: 0.6rem; }
    .lab-back-btn span { display: none; }
    .lab-hud { bottom: 20px; right: 20px; }
    .lab-scroll-hint { bottom: 20px; font-size: 0.55rem; }
    .intro-badge { width: 52px; height: 52px; font-size: 1.2rem; border-radius: 16px; }
}

@media (max-width: 400px) {
    .lab-card { border-radius: 20px; }
    .card-content { padding: 24px 20px 22px; gap: 14px; }
    .meta-pill { font-size: 0.55rem; padding: 4px 10px; }
}
