/*
Theme Name: Grupo Kan v4 (Ultra-Vision)
Theme URI: https://grupokan.com
Author: Antigravity AI
Author URI: https://grupokan.com
Description: Nivel Internacional V4. Rendimiento Extremo, WebGL interactivo, Custom Cursors y Tipografía Cinética.
Version: 4.0
Text Domain: grupokan
*/

/* ==========================================================================
   1. VARIABLES & RESET (Performance Optimized)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@200;300;400;600;800;900&display=swap');

:root {
    /* Extreme Dark Aesthetics */
    --bg-base: #030303;
    --bg-surface: #0a0a0a;
    --bg-elevated: rgba(20, 20, 20, 0.4);

    /* Neon Accents (Web Safe) */
    --color-accent: #FF4500;
    /* Pure Neon Orange */
    --color-accent-dim: rgba(255, 69, 0, 0.2);
    --color-accent-secondary: #00E1FF;
    /* Cyber Blue */
    --color-accent-secondary-dim: rgba(0, 225, 255, 0.2);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #888888;
    --text-muted: #555555;

    /* Fast Transitions */
    --ease-cb: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --glass-blur: blur(16px);
}

/* Hide default cursor only if pointer is fine (mouse) */
@media (pointer: fine) {
    body {
        cursor: none !important;
    }

    a,
    button,
    .btn {
        cursor: none !important;
    }
}

html {
    scroll-behavior: auto;
}

/* Lenis handles this */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
    font-weight: 800;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 8rem);
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.8rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
}

h3 {
    font-size: clamp(1.3rem, 3vw, 2.5rem);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    background: none;
    border: none;
    font: inherit;
}

/* ==========================================================================
   2. CUSTOM CURSOR
   ========================================================================== */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    /* Hardware acceleration */
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--text-primary);
    margin: -3px 0 0 -3px;
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin: -16px 0 0 -16px;
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), transform 0.1s linear, background-color 0.3s, mix-blend-mode 0.3s;
}

/* Hover States for cursor */
body.cursor-hover .cursor-ring {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    background-color: #fff;
    mix-blend-mode: difference;
    border-color: transparent;
}

body.cursor-hover .cursor-dot {
    transform: scale(0);
}

@media (max-width: 1024px) {

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
}

/* ==========================================================================
   3. PRELOADER
   ========================================================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    will-change: transform, opacity;
}

.preloader-count {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
}

.preloader-bar-bg {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.preloader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-accent);
}


/* ==========================================================================
   4. LAYOUT & TYPOGRAPHY
   ========================================================================== */
.container {
    width: 92%;
    max-width: 1600px;
    margin: 0 auto;
}

.section {
    padding: 8rem 0;
    position: relative;
}

/* Cinematic Tag */
.tag-neo {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-accent-dim);
    border-radius: 100px;
    color: var(--color-accent);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(255, 69, 0, 0.05);
    margin-bottom: 2rem;
}

.tag-neo .dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    margin-right: 8px;
    animation: blink 2s infinite ease-in-out;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

/* Kinetic Typography (Marquee) */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 4rem 0;
    /* Isolate layer for performance */
    transform: translateZ(0);
    will-change: transform;
}

.marquee {
    display: flex;
    white-space: nowrap;
    width: max-content;
}

.marquee span {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(3.5rem, 10vw, 12rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
    padding: 0 2rem;
}

.marquee span.solid {
    color: var(--text-primary);
    -webkit-text-stroke: 0;
}

.marquee span.brand {
    color: var(--color-accent);
    -webkit-text-stroke: 0;
}


/* Liquid Button (SVG Filter technique or just sleek borders) */
.btn-magnetic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 3rem;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* GSAP magnetic target */
}

.btn-solid {
    background: var(--text-primary);
    color: #000;
    box-shadow: 0 10px 40px -10px rgba(255, 255, 255, 0.2);
}

.btn-solid::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--color-accent);
    z-index: -1;
    transition: height 0.4s var(--ease-cb);
}

.btn-solid:hover {
    color: #fff;
    border-color: var(--color-accent);
}

.btn-solid:hover::before {
    height: 100%;
}

/* ==========================================================================
   5. WEBGL HERO SECTION
   ========================================================================== */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Canvas Container */
#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

/* Gradient Overlay to ensure text readability */
.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(3, 3, 3, 0.3) 0%, var(--bg-base) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
}

.hero h1 .word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    margin-right: -0.05em;
    /* Tight letter spacing */
}

.hero h1 .char {
    display: inline-block;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-top: 2rem;
    margin-bottom: 3rem;
    font-weight: 300;
}


/* ==========================================================================
   6. HORIZONTAL SCROLL SERVICES
   ========================================================================== */
.services-pin-wrapper {
    height: 100vh;
    overflow: hidden;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    position: relative;
}

.services-scroll-container {
    display: flex;
    gap: 4rem;
    padding: 0 5vw;
    height: max-content;
    will-change: transform;
}

.service-intro {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-intro h2 {
    font-size: clamp(3rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.service-intro p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.service-card {
    width: 450px;
    height: 550px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.service-card h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    margin-top: auto;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.service-card .icon {
    font-size: 4rem;
    color: var(--color-accent);
}

.service-card::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-cb);
}

.service-card:hover::after {
    transform: scaleX(1);
}


/* ==========================================================================
   7. HEADER PILL
   ========================================================================== */
.site-header {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    mix-blend-mode: difference;
    /* Ultra-modern contrast */
    will-change: transform;
}

.nav-pill {
    background: transparent;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.site-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}

.site-logo span {
    color: var(--color-accent);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #fff;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-cb);
}

.nav-link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}


/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
    .services-pin-wrapper {
        height: auto;
        padding: 6rem 0;
        overflow: visible;
        display: block;
    }

    .services-scroll-container {
        flex-direction: column;
        padding: 0;
        gap: 2rem;
        width: 100%;
        align-items: center;
    }

    .service-intro,
    .service-card {
        width: 90%;
        max-width: 500px;
    }

    .nav-menu {
        display: none;
    }
}