/* 
   CLASSO - Sistema de Diseño "Premium Dark Mode"
   Acento: Electric Blue (#3B82F6)
*/

:root {
    /* Fondos */
    --bg-primary: #000000;
    --bg-secondary: #09090b;
    --bg-tertiary: #18181b;

    /* Acento (Blue Scale - #4261fc) */
    --primary-400: #6b84ff;
    --primary-500: #4261fc;
    --primary-600: #354ed9;
    --primary-glow: rgba(66, 97, 252, 0.5);

    /* Textos */
    --text-primary: #ffffff;
    --text-secondary: #e4e4e7;
    --text-tertiary: #a1a1aa;

    /* Otros */
    --accent: #4261fc;
    /* Rosa sutil para contraste ocasional */
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- HEADER / NAVBAR RE-DISEÑADO --- */
header {
    padding: 40px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

header.scrolled {
    padding: 15px 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(66, 97, 252, 0.2);
}

.nav-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Cambiado para permitir logo gigante arriba */
    align-items: center;
    gap: 30px;
}

header.scrolled .nav-inner {
    flex-direction: row;
    justify-content: space-between;
}

.logo {
    width: 100%;
    max-width: 1400px;
    /* Alineado con el contenedor */
    display: flex;
    justify-content: center;
    transition: var(--transition);
}

.logo img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-500);
    /* Borde más visible */
    background-color: white;
    /* Asegura contraste si el logo tiene transparencia */
    filter: drop-shadow(0 0 15px var(--primary-glow));
    transition: var(--transition);
}

header.scrolled .logo {
    max-width: 250px;
}

header.scrolled .logo img {
    width: 65px;
    height: 65px;
    border-width: 2px;
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-500);
    text-shadow: 0 0 10px var(--primary-glow);
}

.btn-cta {
    background: var(--primary-500);
    color: black !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 800 !important;
    box-shadow: 0 0 20px var(--primary-glow);
    text-transform: uppercase;
    transition: var(--transition);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px var(--primary-500);
    filter: brightness(1.1);
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 100px;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
}

.hero h1 {
    font-size: 5.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h1 span.glow {
    color: var(--primary-500);
    -webkit-text-fill-color: var(--primary-500);
    text-shadow: 0 0 40px var(--primary-glow);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* --- STATS --- */
.stats-section {
    padding: 80px 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-grid {
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
}

.stat-item h2 {
    font-size: 3.5rem;
    color: var(--primary-500);
}

.stat-item p {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-tertiary);
}

/* --- FLIP CARDS (REDISEÑADO) --- */
.products-section {
    padding: 120px 0;
    background: var(--bg-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.product-card-flip {
    perspective: 1000px;
    height: 480px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.product-card-flip:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.card-back {
    background: var(--bg-tertiary);
    transform: rotateY(180deg);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back h3 {
    font-size: 1.8rem;
    color: var(--primary-500);
    margin-bottom: 20px;
}

.card-back p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.tech-specs {
    list-style: none;
}

.tech-specs li {
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
}

.tech-specs li span {
    color: var(--primary-400);
}

/* --- ENGINEERING PROCESS --- */
.process-section {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.process-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 25px;
    filter: none;
    /* Quitamos el grayscale para asegurar visibilidad */
    transition: var(--transition);
}

.process-item:hover .process-image {
    transform: scale(1.05);
}

/* --- PARTICLES BG --- */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    /* Definitivamente por encima de casi todo */
}

.particle {
    position: absolute;
    background: var(--primary-500);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-v1 {
    0% {
        transform: translate(-10vw, -10vh) rotate(0deg);
    }

    50% {
        transform: translate(110vw, 50vh) rotate(180deg);
    }

    100% {
        transform: translate(-10vw, 110vh) rotate(360deg);
    }
}

@keyframes float-v2 {
    0% {
        transform: translate(110vw, 20vh) rotate(0deg);
    }

    50% {
        transform: translate(-10vw, 80vh) rotate(-180deg);
    }

    100% {
        transform: translate(110vw, -10vh) rotate(-360deg);
    }
}

@keyframes float-v3 {
    0% {
        transform: translate(50vw, 110vh) rotate(0deg);
    }

    50% {
        transform: translate(20vw, -10vh) rotate(90deg);
    }

    100% {
        transform: translate(80vw, 110vh) rotate(180deg);
    }
}

@keyframes float-v4 {
    0% {
        transform: translate(-20vw, 50vh) rotate(0deg);
    }

    50% {
        transform: translate(110vw, 20vh) rotate(-45deg);
    }

    100% {
        transform: translate(-20vw, 80vh) rotate(-90deg);
    }
}

/* --- SKETCH PARTICLES (DIBUJOS FLOTANTES) --- */
.sketch-particle {
    position: absolute;
    pointer-events: none;
    opacity: 0.2;
    filter: grayscale(1) invert(1) drop-shadow(0 0 12px var(--primary-glow));
    mix-blend-mode: screen;
    user-select: none;
    max-width: 180px;
    height: auto;
    z-index: 100;
}

@keyframes float-sketch {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(15vw, 15vh);
    }

    66% {
        transform: translate(-10vw, 20vh);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes rotate-sketch {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float-particle {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100vh);
    }
}

/* --- ANIMATIONS --- */
.animate-in {
    animation: fadeInUp 1s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3.5rem;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    header {
        padding: 20px 0;
    }

    .nav-inner {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 20px;
    }

    .logo {
        justify-content: flex-start;
        max-width: 120px;
    }

    .logo img {
        width: 60px !important;
        height: 60px !important;
        border-width: 2px;
    }

    /* Hamburguesa */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 1100;
    }

    .hamburger span {
        width: 30px;
        height: 2px;
        background: var(--primary-500);
        transition: var(--transition);
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -7px);
    }

    /* Menú móvil */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: var(--transition);
        z-index: 1000;
        border-left: 1px solid rgba(66, 97, 252, 0.2);
    }

    .nav-links.active {
        right: 0;
    }

    .hero h1 {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .hero-btns .btn-cta {
        width: 100%;
        text-align: center;
    }

    /* Stats Mobile */
    .stats-grid {
        flex-direction: column;
        gap: 40px;
    }

    .stat-item h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem !important;
    }
}