/* =============================================================================
   LV_DESIGN_ENGINE | PROFESSIONAL_BUILD_v9.2026
   DEVELOPER: Valentino Lorenti (UX/UI Designer)
   STYLE: Professional Cyberpunk Minimalist
   MEJORA: Secciones más estratégicas y maduras
   ============================================================================= */

/* --- [0. SYSTEM CONFIGURATION] --- */
:root {
    --color-bg: #000000;
    --color-surface: #0a0a0a;
    --color-surface-hover: #111111;
    
    /* MEJORA CLAVE: Accesibilidad UX */
    --color-text-main: #ffffff;
    --color-text-muted: #e0e0e0; 
    --color-text-dim: #777777;
    
    /* Accents */
    --color-accent: #ffffff;
    --color-border: #222222;
    --color-border-bright: #444444;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    
    /* Motion - PREMIUM BEZIER */
    --bezier-premium: cubic-bezier(0.19, 1, 0.22, 1);
    --transition-base: 0.4s var(--bezier-premium);
    --transition-slow: 0.8s var(--bezier-premium);
}

/* --- [1. GLOBAL STABILIZATION] --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar Profesional */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

/* --- [2. HEADER & NAVIGATION] --- */
header {
    height: 90px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
}

/* Fix para el logo que pediste */
.logo img {
    transition: var(--transition-base);
}

.studio-info p {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    /* SOMBRAS ALREDEDOR DE LA LETRA */
}

/* Botón de Menú (Corregido) */
.menu-btn, .menu-trigger {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 8px 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition-base);
    cursor: pointer;
}

.menu-btn:hover, .menu-trigger:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}

/* --- [3. HERO SECTION] --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 90px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.2);
}

.hero-section h1,
.display-mega {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 2rem;
    
    /* Sombra sutil con glow blanco */
    text-shadow: 
        0 0 20px rgba(43, 43, 43, 0.3),
        0 0 40px rgba(43, 43, 43, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.8);
}

.hero-section .lead {
    color: var(--color-text-muted);
    max-width: 600px;
    font-size: 1.1rem;
    border-left: 2px solid var(--color-accent);
    padding-left: 25px;
}

/* --- [4. PROYECTOS (ESTRUCTURA ROBUSTA)] --- */
#projects {
    padding: 120px 0;
}

.project-item, .project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-base);
}

.project-item:hover {
    border-color: var(--color-accent);
    transform: translateY(-10px);
}

/* Asegurar tamaño de imagen */
.project-image, .project-img-box {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
}

.project-image img, .project-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: var(--transition-slow);
}

.project-item:hover img {
    filter: grayscale(0);
}

.project-content, .project-data {
    padding: 25px;
}

.project-name, .p-title {
    color: var(--color-text-main);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin: 10px 0;
}

/* --- [5. ABOUT SECTION - MEJORADA] --- */
.about-section {
    padding: 150px 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.exp-stat {
    text-align: center;
    padding: 30px 20px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-base);
}

.exp-stat:hover {
    border-color: var(--color-accent);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-accent);
    margin: 0;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--color-text-dim);
    margin: 10px 0 0 0;
}

.about-text-premium {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    font-weight: 300;
}

/* --- [6. SERVICES SECTION - NUEVA] --- */
.services-section {
    padding: 150px 0;
}

.service-card-pro {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 40px;
    height: 100%;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.service-card-pro::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--color-accent);
    transition: var(--transition-base);
}

.service-card-pro:hover::before {
    left: 0;
}

.service-card-pro:hover {
    border-color: var(--color-border-bright);
    transform: translateY(-8px);
}

.service-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-accent);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.service-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 25px;
}

.service-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    color: var(--color-text-dim);
    letter-spacing: 1px;
    transition: var(--transition-base);
}

.service-card-pro:hover .tool-tag {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* --- [7. CONTACTO (ANIMACIÓN PREMIUM)] --- */
.contact-section, .contact-wrap {
    padding: 150px 0;
    text-align: center;
}

.social-links-grid, .social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.social-card, .social-item {
    position: relative;
    padding: 70px 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none !important;
    overflow: hidden;
    display: block;
    z-index: 1;
}

/* MEJORA CLAVE: Pseudo-elemento deslizante */
.social-card::before, .social-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-accent);
    transition: transform 0.6s var(--bezier-premium);
    z-index: -1;
}

.social-card:hover::before, .social-item:hover::before {
    transform: translateX(100%);
}

.social-card i, .social-card span, .social-card p,
.social-item i, .social-item span, .social-item p {
    position: relative;
    z-index: 2;
    transition: color 0.6s var(--bezier-premium);
}

.social-card:hover i, .social-card:hover span, .social-card:hover p,
.social-item:hover i, .social-item:hover span, .social-item:hover p {
    color: var(--color-bg) !important;
}

.social-card i, .social-item i {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 20px;
    display: block;
}

.social-card span, .social-item span {
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--color-accent);
    display: block;
}

/* --- [8. GLITCH & DECORACIÓN] --- */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--color-bg);
}

.glitch::before {
    left: 2px; text-shadow: -2px 0 #fff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    100% { clip: rect(24px, 9999px, 85px, 0); }
}

/* --- [9. BOTONES CUSTOM (MEJORA CLAVE)] --- */
.btn-custom-cyber {
    display: inline-block;
    padding: 18px 45px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.75rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s var(--bezier-premium);
    text-decoration: none !important;
}

.btn-custom-cyber::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: #fff;
    z-index: -1;
    transition: transform 0.5s var(--bezier-premium);
}

.btn-custom-cyber:hover::before {
    transform: translateX(100%);
}

.btn-custom-cyber:hover {
    color: #000 !important;
}

/* --- [10. CARDS DE PROYECTO MEJORADAS] --- */
/* =============================================================================
   CARDS DE PROYECTO - ALTURA UNIFORME
   Todas las cards tienen exactamente la misma altura
   ============================================================================= */

.project-card-cyber {
    background: #080808;
    border: 1px solid #222;
    transition: all 0.5s var(--bezier-premium);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Indicador de estado hover - línea superior animada */
.project-card-cyber::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s var(--bezier-premium);
}

.project-card-cyber:hover::after {
    transform: translateX(100%);
}

.project-card-cyber:hover {
    border-color: #444;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Imagen del proyecto */
.p-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
    flex-shrink: 0; /* Evita que la imagen se comprima */
}

/* Overlay sutil en hover */
.p-img::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.project-card-cyber:hover .p-img::before {
    opacity: 1;
}

.p-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.8) brightness(0.9);
    transition: all 0.8s var(--bezier-premium);
}

.project-card-cyber:hover .p-img img {
    filter: grayscale(0) brightness(1);
    transform: scale(1.05);
}

/* Contenido de la card */
.p-info {
    padding: 30px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1; /* Permite que crezca para llenar el espacio */
    min-height: 0; /* Necesario para que funcione correctamente */
}

/* Etiqueta técnica superior */
.text-tech-visible {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #888 !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    transition: color 0.3s ease;
    flex-shrink: 0; /* No se comprime */
}

.project-card-cyber:hover .text-tech-visible {
    color: #fff !important;
}

/* Título del proyecto */
.p-info h3 {
    font-size: 1.75rem;
    font-weight: 900;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.2;
    flex-shrink: 0; /* No se comprime */
}

/* Descripción del proyecto - ALTURA FIJA */
.project-desc {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.6;
    margin: 8px 0 12px;
    transition: color 0.3s ease;
    
    /* CLAVE: Limitar a 3 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.8em; /* 3 líneas × 1.6 line-height = 4.8em */
    flex-shrink: 0; /* No se comprime */
}

.project-card-cyber:hover .project-desc {
    color: #ccc;
}

/* Tags del proyecto - ALTURA FIJA */
.project-tags {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 1px;
    line-height: 1.8;
    transition: color 0.3s ease;
    
    /* CLAVE: Limitar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.52em; /* 2 líneas × 1.8 line-height = 3.6em */
    margin: 8px 0;
    flex-shrink: 0; /* No se comprime */
}

.project-card-cyber:hover .project-tags {
    color: #888;
}

/* Spacer flexible - empuja el link hacia abajo */
.p-info::after {
    content: "";
    flex-grow: 1;
}

/* Link "Ver Detalles" - SIEMPRE AL FINAL */
.p-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #666 !important;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 2px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #1a1a1a;
    transition: all 0.3s ease;
    margin-top: auto; /* Siempre al final */
    flex-shrink: 0; /* No se comprime */
}

.p-link::after {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.project-card-cyber:hover .p-link {
    color: #fff !important;
    gap: 12px;
}

.project-card-cyber:hover .p-link::after {
    transform: translateX(4px);
}

/* Enlaces de proyecto */
.project-link-wrapper {
    text-decoration: none !important;
    color: inherit;
    display: block;
    height: 100%;
}

.project-link-wrapper:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* IMPORTANTE: Grid container debe tener align-items: stretch */
.row.g-4 {
    align-items: stretch;
}

/* Asegurar que las columnas tengan altura completa */
.project-item {
    display: flex;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--bezier-premium), transform 0.6s var(--bezier-premium);
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .p-info {
        padding: 25px 20px 20px;
        gap: 10px;
    }
    
    .p-info h3 {
        font-size: 1.5rem;
    }
    
    .project-desc {
        font-size: 0.9rem;
        height: 4.32em; /* Ajustar proporcionalmente */
    }
    
    .project-tags {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .p-img {
        aspect-ratio: 4/3;
    }
    
    .p-info h3 {
        font-size: 1.3rem;
    }
    
    .project-desc {
        font-size: 0.85rem;
        height: 4.08em; /* Ajustar proporcionalmente */
        -webkit-line-clamp: 3;
    }
}

/* --- [11. MENÚ CYBER OVERLAY] --- */
.cyber-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.cyber-menu.active {
    transform: translateY(0);
}

.menu-content {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.menu-link {
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 900;
    color: #fff !important;
    position: relative;
    padding: 10px;
    margin: 5px 0;
    text-decoration: none !important;
    transition: var(--transition-base);
}

.menu-link:hover {
    color: #555 !important;
}

.close-menu {
    position: absolute;
    top: 40px; right: 40px;
    background: none; border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
}

/* --- [12. FIX DE VISIBILIDAD] --- */
.text-tech-visible {
    color: #e0e0e0 !important;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.text-muted-ux {
    color: var(--color-text-muted) !important;
}

/* --- [13. UTILIDADES] --- */
.py-150 { padding: 150px 0; }
.py-cyber { padding: 150px 0; }
.mt-100 { margin-top: 100px; }
.border-top-thin { border-top: 1px solid var(--color-border); }
.border-bottom-thin { border-bottom: 1px solid var(--color-border); }

/* Eliminar colores de link por defecto */
a, a:hover {
    color: inherit;
    text-decoration: none !important;
}

/* --- [14. RESPONSIVE] --- */
@media (max-width: 992px) {
    .hero-section h1 { font-size: 4rem; }
    header { height: 70px; }
    .experience-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .social-links-grid, .social-grid { grid-template-columns: 1fr; }
    .hero-section { text-align: center; }
    .hero-section .lead { border: none; padding: 0; }
    .experience-grid { 
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .service-card-pro {
        padding: 30px;
    }
}

@media (max-width: 576px) {
    .stat-number { font-size: 2rem; }
    .service-title { font-size: 1.2rem; }
}

/* LV_SYSTEM_PROFESSIONAL_2026 */

/* =============================================================================
   FIX RESPONSIVE HERO - VERSIÓN CORREGIDA
   Soluciona texto cortado Y mantiene el espaciado correcto
   ============================================================================= */

/* --- FIX PRINCIPAL PARA EL TÍTULO --- */
/* =============================================================================
   FIX DEFINITIVO RESPONSIVE HERO - Galaxy S8
   Tamaño de fuente reducido para evitar cortes
   ============================================================================= */

/* --- TÍTULO HERO BASE --- */
.hero-section h1,
.display-mega {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 2rem;
    
    /* Sombra sutil cyberpunk */
    /* Sombra sutil con glow blanco */
    text-shadow: 
        0 0 20px rgba(43, 43, 43, 0.3),
        0 0 40px rgba(43, 43, 43, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.8);

    /* Prevenir overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- TABLETS --- */
@media (max-width: 768px) {
    .hero-section h1,
    .display-mega {
        font-size: clamp(2.5rem, 9vw, 5rem) !important;
        line-height: 1;
    }
}

/* --- MÓVILES GRANDES (iPhone 12, Pixel) --- */
@media (max-width: 576px) {
    .hero-section h1,
    .display-mega {
        font-size: 2.8rem !important;
        line-height: 1;
        letter-spacing: -2px;
    }
    
    .hero-section {
        min-height: 90vh;
        padding-top: 100px;
        padding-bottom: 40px;
    }
}

/* --- GALAXY S8 Y SIMILARES (360px - 414px) --- */
@media (max-width: 414px) {
    .hero-section h1,
    .display-mega {
        font-size: 2rem !important; /* Más pequeño */
        line-height: 1.05;
        letter-spacing: -1px;
        margin-bottom: 1.5rem;
    }
    
    /* Mantener saltos de línea */
    .hero-section h1 br,
    .display-mega br {
        display: block !important;
    }
    
    /* Reducir padding lateral */
    .hero-section .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .hero-section .col-lg-10 {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* Ajustar etiqueta técnica */
    .hero-section .text-tech-visible {
        font-size: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    /* Ajustar descripción */
    .hero-section .lead {
        font-size: 0.9rem;
        line-height: 1.5;
        padding-left: 12px;
        border-left-width: 2px;
    }
    
    /* Botón full width */
    .hero-section .btn-custom-cyber {
        padding: 12px 25px;
        font-size: 0.65rem;
        width: 100%;
        text-align: center;
        justify-content: center;
        letter-spacing: 2px;
    }
}

/* --- PANTALLAS MUY PEQUEÑAS (< 360px) --- */
@media (max-width: 359px) {
    .hero-section h1,
    .display-mega {
        font-size: 1.75rem !important;
        letter-spacing: -0.5px;
        line-height: 1.1;
    }
    
    .hero-section .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* --- IPHONE SE, 5/5S (320px) --- */
@media (max-width: 320px) {
    .hero-section h1,
    .display-mega {
        font-size: 1.6rem !important;
        line-height: 1.15;
    }
    
    .hero-section .lead {
        font-size: 0.85rem;
        padding-left: 10px;
    }
    
    .hero-section .btn-custom-cyber {
        padding: 10px 20px;
        font-size: 0.6rem;
    }
}

/* --- FIX VIDEO BACKGROUND --- */
@media (max-width: 576px) {
    .hero-bg video {
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
    }
}

/* --- AJUSTE DE OFFSET EN MÓVIL --- */
@media (max-width: 576px) {
    .hero-section .col-lg-10.offset-lg-1 {
        margin-left: 0;
        max-width: 100%;
    }
}