/* =====================================================
   KABALA LABS — CSS v5
   60% negro · 30% azul · 10% rosa
   ===================================================== */

:root {
    --bg:      #07070e;
    --surface: #0e0e16;
    --border:  rgba(255,255,255,0.07);
    --text:    #f0f0f5;
    --muted:   #9090a8;
    --blue:    #00d2ff;
    --pink:    #ff2896;
    --font-d:  'Space Grotesk', sans-serif;
    --font-b:  'Inter', sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-b);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── LOADER ───────────────────────────────────────── */
#loader {
    position: fixed; inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.loader-bar-wrap {
    width: 180px; height: 1px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--pink));
    transition: width 0.12s ease;
}

#loader-pct {
    font-family: var(--font-d);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--muted);
}

/* ── CANVAS WEBGL — fondo fijo ───────────────────── */
#particle-canvas {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ── NAV ──────────────────────────────────────────── */
#nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 5%;
    opacity: 0;
    transition: background 0.4s, border-color 0.4s;
}

#nav.scrolled {
    background: rgba(7,7,14,0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-d);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    color: var(--text);
    text-decoration: none;
}

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a {
    font-size: 0.82rem;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-github {
    display: flex;
    align-items: center;
    color: var(--muted) !important;
    transition: color 0.2s;
}
.nav-github:hover { color: var(--text) !important; }
.nav-github svg { width: 17px; height: 17px; fill: currentColor; }

/* ── MAIN ─────────────────────────────────────────── */
#main-content {
    position: relative;
    z-index: 2;
    opacity: 0;
}

/* ── HERO ─────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 5% 5rem;
    position: relative;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

/* Logo — sin máscara negra, aparece con animación GSAP pura */
.logo-wrap {
    width: 280px; height: 280px;
    margin-bottom: 0.4rem;
}

#kabala-logo {
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: 0;
    filter: blur(20px);
    transform: scale(1.08);
    /* lighten hace el negro del PNG transparente */
    mix-blend-mode: lighten;
}

.hero-title {
    font-family: var(--font-d);
    font-size: clamp(4rem, 12vw, 11rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.92;
    display: flex;
    gap: 0.25em;
    overflow: hidden;
}

.title-word {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
}

.hero-sub {
    font-family: var(--font-d);
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    color: var(--text);
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(10px);
    text-shadow: 0 0 60px rgba(0,210,255,0.25);
}

.hero-code-line {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--blue);
    opacity: 0;
    letter-spacing: 0.08em;
    height: 1.4em;
}
.hero-code-line::after { content:'▊'; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity:0; } }

.scroll-hint {
    position: absolute;
    bottom: 2.5rem; left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    opacity: 0;
}
.scroll-hint span {
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
}
.scroll-line {
    width: 1px; height: 44px;
    background: linear-gradient(to bottom, var(--muted), transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%,100%{ transform:scaleY(1); opacity:0.35; }
    50%    { transform:scaleY(0.55); opacity:0.9; }
}

/* ── SHARED ───────────────────────────────────────── */
.eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1.6rem;
}
.eyebrow--pink { color: var(--pink); }

.section-title {
    font-family: var(--font-d);
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 5rem;
}

.container { max-width: 1200px; }
.reveal-up { opacity:0; transform:translateY(40px); }

/* ── MANIFESTO ────────────────────────────────────── */
.manifesto {
    padding: 20vh 5%;
    display: flex;
    align-items: center;
}
.manifesto-headline {
    font-family: var(--font-d);
    font-size: clamp(1.9rem, 4.5vw, 3.8rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 2.5rem;
    max-width: 900px;
}
.manifesto-body {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    color: var(--muted);
    line-height: 1.85;
    max-width: 580px;
}

/* ── PRODUCTS ─────────────────────────────────────── */
.products { padding: 14vh 5%; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.product-card {
    background: var(--surface);
    padding: 2.8rem 2.4rem;
    display: flex;
    flex-direction: column;
    min-height: 640px;
    position: relative;
    overflow: hidden;
    transition: background 0.35s;
    opacity: 0;
    transform: translateY(35px);
}

.product-card::after {
    content:'';
    position: absolute; top:0; left:0; right:0; height:1px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    opacity: 0; transition: opacity 0.4s;
}
.product-card--soon::after {
    background: linear-gradient(90deg, transparent, var(--pink), transparent);
}
.product-card:hover { background: #13131e; }
.product-card:hover::after { opacity: 1; }

.product-card-top {
    display: flex; flex-direction: column; gap: 1rem; flex: 1;
}

.product-header-row {
    display: flex; justify-content: space-between; align-items: center;
}

.product-badge {
    font-size: 0.63rem; letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--blue); background: rgba(0,210,255,0.07);
    border: 1px solid rgba(0,210,255,0.15);
    padding: 0.2rem 0.55rem; border-radius: 2px;
}
.product-badge--soon {
    color: var(--pink); background: rgba(255,40,150,0.07);
    border-color: rgba(255,40,150,0.15);
}

.product-num {
    font-family: var(--font-d); font-size: 0.7rem;
    color: rgba(255,255,255,0.1); font-weight: 600;
}

.product-logo-wrap { width: 96px; height: 96px; margin: 0.4rem 0; }
.product-logo {
    width: 100%; height: 100%; object-fit: contain;
    filter: brightness(0.92) saturate(1.1);
    transition: filter 0.3s, transform 0.3s;
}
.product-card:hover .product-logo {
    filter: brightness(1.2) saturate(1.3);
    transform: scale(1.06);
}

.product-name {
    font-family: var(--font-d); font-size: 2.5rem;
    font-weight: 700; letter-spacing: -0.04em; line-height: 1;
}

.product-type { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; }

.product-desc {
    font-size: 0.88rem; color: rgba(240,240,245,0.58); line-height: 1.8;
}

.product-features {
    list-style: none; display: flex; flex-direction: column;
    gap: 0.55rem; margin-top: 0.2rem; flex: 1;
}
.product-features li {
    font-size: 0.82rem; color: rgba(240,240,245,0.5);
    line-height: 1.55; padding-left: 1.1rem; position: relative;
}
.product-features li::before {
    content:'—'; position:absolute; left:0;
    color: var(--blue); font-size: 0.7rem;
}
.product-card--soon .product-features li::before { color: var(--pink); }

/* Stack técnico colapsable */
.product-stack {
    margin-top: 0.8rem; border-top: 1px solid var(--border); padding-top: 0.8rem;
}
.stack-toggle {
    background: none; border: none; color: var(--muted);
    font-family: var(--font-b); font-size: 0.72rem;
    letter-spacing: 0.08em; cursor: pointer;
    display: flex; align-items: center; gap: 0.4rem; padding: 0;
    transition: color 0.2s;
}
.stack-toggle:hover { color: var(--blue); }
.stack-toggle .arrow { display:inline-block; transition: transform 0.3s; font-size: 0.6rem; }
.stack-toggle.open .arrow { transform: rotate(90deg); }

.stack-content {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem; margin-top: 0.8rem;
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}
.stack-content.open { max-height: 200px; }
.stack-item {
    font-size: 0.7rem; color: rgba(240,240,245,0.35);
    letter-spacing: 0.04em; padding-left: 0.8rem; position: relative;
}
.stack-item::before { content:'·'; position:absolute; left:0; color: var(--blue); }

.product-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    padding-top: 1.6rem; border-top: 1px solid var(--border); margin-top: 1.5rem;
}
.product-price { font-family: var(--font-d); font-size: 0.95rem; font-weight: 600; }
.product-tech { font-size: 0.65rem; color: var(--muted); text-align: right; letter-spacing: 0.04em; line-height: 1.6; }

/* ── MÉTODO ───────────────────────────────────────── */
.method { padding: 14vh 5%; }
.method-steps {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
}
.method-step {
    padding: 3rem 3rem 3rem 0; border-right: 1px solid var(--border);
    opacity: 0; transform: translateY(25px);
}
.method-step:last-child { border-right:none; padding-right:0; }
.method-step:not(:first-child) { padding-left: 3rem; }
.step-num {
    display:block; font-family: var(--font-d); font-size: 0.65rem;
    letter-spacing: 0.2em; color: var(--muted); margin-bottom: 0.6rem;
}
.step-label {
    display:block; font-family: var(--font-d); font-size: 1.3rem;
    font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.2rem;
}
.method-step p { font-size: 0.9rem; color: var(--muted); line-height: 1.8; }

/* ── FOOTER ───────────────────────────────────────── */
.footer { padding: 14vh 5% 5vh; border-top: 1px solid var(--border); }
.footer-cta { margin-bottom: 8rem; }
.footer-question {
    font-family: var(--font-d);
    font-size: clamp(1.8rem, 4.5vw, 4rem);
    font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 2.5rem;
}
.cta-email {
    font-family: var(--font-d); font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    font-weight: 500; color: var(--blue); text-decoration: none;
    border-bottom: 1px solid rgba(0,210,255,0.25); padding-bottom: 0.2rem;
    transition: color 0.2s, border-color 0.2s;
}
.cta-email:hover { color:#fff; border-color: rgba(255,255,255,0.3); }

.footer-bottom { display:flex; justify-content:space-between; align-items:center; }
.footer-copy { font-size: 0.78rem; color: var(--muted); }

.footer-socials { display:flex; gap: 1.8rem; align-items: center; }
.footer-socials a {
    font-size: 0.78rem; color: var(--muted); text-decoration: none;
    letter-spacing: 0.06em; transition: color 0.2s;
    display: flex; align-items: center;
}
.footer-socials a:hover { color: var(--text); }
.footer-socials .github-icon { display:flex; align-items:center; }
.footer-socials .github-icon svg { width:16px; height:16px; fill:currentColor; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 900px) {
    .products-grid { grid-template-columns: 1fr; }
    .method-steps  { grid-template-columns: 1fr; }
    .method-step { border-right:none; border-bottom:1px solid var(--border); padding:2.5rem 0; }
    .method-step:last-child { border-bottom:none; }
    .method-step:not(:first-child) { padding-left:0; }
    .nav-links { gap: 1.5rem; }
    .footer-bottom { flex-direction:column; gap:1.5rem; align-items:flex-start; }
    .stack-content { grid-template-columns: 1fr; }
    .logo-wrap { width: 200px; height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}