/* ============================================
   QUIMATRIX CINEMATIC SHOWCASE
   Premium Design System — Matching App Branding
   ============================================ */

/* --- DESIGN TOKENS (Matching QuiMatrix App) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #5c67f2;
    --primary-light: #7a82ff;
    --primary-dark: #4a54d4;
    --primary-glow: rgba(92, 103, 242, 0.35);
    --accent: #7a82ff;
    --dark-950: #030712;
    --dark-900: #0a0f1a;
    --dark-800: #111827;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #F9FAFB;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-accent: var(--primary-light);
    --font: 'Inter', -apple-system, system-ui, sans-serif;
    --radius: 20px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    height: 100%; width: 100%;
    overflow: hidden;
    background: var(--dark-950);
    color: var(--text-primary);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

/* --- APP SHELL --- */
#app {
    position: relative;
    width: 100%; height: 100%;
}

/* --- PRELOADER --- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--dark-950);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
}

.loader-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
}

.loader-atom {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--primary-glow);
}

.loader-atom svg {
    width: 32px;
    height: 32px;
    color: white;
}

.loader-brand {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: white;
}

.loader-track {
    width: 240px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.loader-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.1s;
}

.loader-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* --- PROGRESS BAR --- */
.progress-track {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    z-index: 100;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 12px var(--primary);
    transition: none;
}

/* --- SCENE NAV DOTS --- */
.scene-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 100;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dot.active {
    background: var(--primary-light);
    box-shadow: 0 0 14px var(--primary-light);
    transform: scale(1.3);
}

.dot span {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dot:hover span { opacity: 1; }

/* --- PARTICLE CANVAS --- */
#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* --- BACKGROUND LAYERS --- */
.bg-layers {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease;
    filter: brightness(0.12) saturate(0.8) blur(10px); /* DEEPER BLUR AND DARKER */
    transform: scale(1.1); /* Slight zoom for cleaner edges with blur */
}

.bg-layer.active { opacity: 1; }

.bg-layer[data-bg="0"] { background-image: url('assets/hero-bg.png'); }
.bg-layer[data-bg="1"] { background-image: url('assets/dashboard-bg.png'); }
.bg-layer[data-bg="2"] { background-image: url('assets/ai-bg.png'); }

/* --- SCENES --- */
.scenes {
    position: relative;
    width: 100%;
    height: 100%;
}

.scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    z-index: 10;
    background: radial-gradient(circle at center, rgba(3, 7, 18, 0.4) 0%, rgba(3, 7, 18, 0.95) 100%);
    transition: none; /* Controlled by GSAP */
}

.scene--active {
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999 !important;
}

.scene__inner {
    width: 98%;
    max-width: 1580px;
    z-index: 5;
    padding: 0 10px;
}

/* --- SPLIT LAYOUT (Texto Izquierda, Imagen Derecha) --- */
.split-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr;
    gap: 24px;
    align-items: center;
    text-align: left;
}

.split-layout.reverse {
    grid-template-columns: 1.4fr 0.8fr;
}

.split-layout.reverse .text-block { order: 2; }
.split-layout.reverse .visual-block { order: 1; text-align: left; }

/* --- TYPOGRAPHY UPGRADE --- */
.text-block {
    position: relative;
}

.pre-headline {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 20px;
    display: block;
    animation: fadeInDown 0.8s forwards;
}

.headline {
    font-size: 3.6rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.headline.massive {
    font-size: 4.8rem;
}

.subtitle {
    font-size: 1.38rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 550px;
}

/* --- TAG ROW --- */
.tag-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* --- VISUALS & DEVICE FRAME --- */
.visual-block {
    position: relative;
    perspective: 1500px;
}

.device-mockup {
    position: relative;
    background: #0f172a;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 30px 80px -15px rgba(0,0,0,0.8),
        0 0 40px -10px var(--primary-glow);
    transform: rotateY(-12deg) rotateX(4deg);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-layout.reverse .device-mockup {
    transform: rotateY(12deg) rotateX(4deg);
}

.device-mockup:hover {
    transform: rotateY(0deg) rotateX(0deg) scale(1.02);
    z-index: 10;
}

.device-mockup img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}


/* --- INTRO & CTA SPECIALS --- */
#scene-0 .scene__inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scene-0 .tag-row {
    justify-content: center;
}

#scene-0 .subtitle {
    margin-inline: auto;
}

.intro-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.intro-atom {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 16px;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px var(--primary-glow);
}

.intro-atom svg {
    width: 36px;
    height: 36px;
    color: white;
}

.intro-brand-text {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -2px;
}

/* --- BROWSER UI (Simulated) --- */
.browser-header {
    background: rgba(30, 41, 59, 0.5);
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.browser-dot { width: 8px; height: 8px; border-radius: 50%; }
.browser-dot.red { background: #ff5f57; }
.browser-dot.yellow { background: #febc2e; }
.browser-dot.green { background: #28c840; }

/* --- CTA SCENE --- */
.cta-scene {
    text-align: center;
}

.cta-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(92,103,242,0.2) 0%, transparent 70%);
    z-index: -1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: white;
    color: var(--primary);
    padding: 20px 50px;
    border-radius: 100px;
    font-weight: 900;
    font-size: 1.4rem;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    box-shadow: 0 20px 60px rgba(255,255,255,0.2);
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 25px 70px rgba(255,255,255,0.3);
}

/* --- RESPONSIVE ADAPTATION --- */
@media (max-width: 1100px) {
    .headline { font-size: 2.8rem; }
    .headline.massive { font-size: 3.5rem; }
    .split-layout { gap: 30px; }
}

@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .split-layout.reverse .text-block { order: 1; }
    .split-layout.reverse .visual-block { order: 2; }
    .text-block { display: flex; flex-direction: column; align-items: center; }
    .subtitle { margin-inline: auto; }
    .tag-row { justify-content: center; }
    .device-mockup { transform: none !important; max-width: 500px; margin: 0 auto; }
}
