/* STYLE.CSS — HÉCTOR SAAVEDRA // 2026 */

/* 1. RESET & FUNDAMENTOS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #151717;
    background-image: radial-gradient(circle at top, #151717 0%, #151717 100%);
    color: #f8fafc;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    overflow-y: auto; /* Permitir scroll vertical siempre */
}

/* 1.1. margin estadisticas experiencia, marcas, etc */
/* Reducir el espacio entre el párrafo de la bio y las stats */
header .mt-5.flex.flex-col.items-center {
    margin-top: 1rem !important; /* Ajusta este valor para acercar el párrafo a la línea verde */
}

#stats-section {
    margin-top: -20px !important; /* "Succiona" la sección hacia arriba */
}

/* Opcional: si quieres que el párrafo esté más cerca de las stats */
header p.leading-relaxed {
    margin-bottom: 0 !important;
}

/* 2. GRID DINÁMICO (BENTO MAIN) */
main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 300px;
    grid-auto-flow: dense;
    gap: 1.5rem;
    padding-bottom: 0 !important;
}

.card-wide { grid-column: span 2; }
.card-tall { grid-row: span 2; }

@media (max-width: 768px) {
    .card-wide { grid-column: span 1; }
    main { 
        grid-template-columns: 1fr; 
        gap: 0; 
    }
}

/* ANULADOR DE CLASE TAILWIND */
main.pb-20, 
section.pb-20, 
.pb-20 {
    padding-bottom: 0 !important; /* Matamos los 5rem */
}

@media (max-width: 768px) {
    main {
        margin-bottom: 0 !important;
        padding-bottom: 0.5rem !important; /* Un espacio mínimo de cortesía */
    }
}

/* 3. FOOTER & BIO */
footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    clear: both;
    padding-top: 0 !important; /* <--- Añade esto para quitar espacio interno arriba */
}

.mx-auto.max-w-2xl.text-center.px-4.mt-12.mb-20 { 
    margin-top: 0 !important; 
    margin-bottom: 0 !important; 
}

/* 4. EFECTO DE ENFOQUE (HOVER) - Solo para Desktop */
@media (min-width: 769px) {
    main:hover > div:not(.pointer-events-none) {
        opacity: 0.5;
        filter: grayscale(0.4) blur(1px);
        transform: scale(0.98);
        transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    }

    main > div:not(.pointer-events-none):hover {
        opacity: 1 !important;
        filter: grayscale(0) blur(0px) !important;
        transform: scale(1.03) !important;
        z-index: 20;
        box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    }
}

/* 5. ANIMACIONES DE ENTRADA (REVEAL) */
.reveal-card {
    opacity: 0;
    transition: 
        opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1), 
        transform 1.2s cubic-bezier(0.23, 1, 0.32, 1), 
        background-size 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    background-size: 115% !important;
    will-change: opacity, transform, background-size;
}

.reveal-card.is-revealed {
    opacity: 1 !important;
    background-size: 110% !important;
}

/* 6. MODAL CINEMÁTICO & SCROLLBAR */
.pointer-events-none {
    pointer-events: none !important;
    user-select: none !important;
    cursor: default;
    transform: none !important; 
    transition: none !important;
}

#projectModal {
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(12px);
    background-color: rgba(28, 28, 30, 0.95);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto !important;
    -ms-overflow-style: none !important;
}

/* El contenedor interno donde se inyecta la info del proyecto */
#modalContent {
    background-color: #151717; /* Azul muy oscuro actual */
    color: #f8fafc; /* Color del texto */
    border-radius: 24px;
    padding: 20px;
}

#projectModal.is-active {
    opacity: 1;
    visibility: visible;
}

#projectModal > div {
    transform: scale(0.9) translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

#projectModal.is-active > div {
    transform: scale(1) translateY(0);
}

#projectModal, 
#projectModal * {
    scrollbar-width: none !important;
}

#projectModal::-webkit-scrollbar,
#projectModal *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 7. WHATSAPP & PROGRESS */
#whatsappBtn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999;
    transition: transform 0.3s ease;
}

#scroll-progress {
    height: 3px !important;
    background: linear-gradient(90deg, #00ffd5 0%, #5efce8 100%) !important;
    box-shadow: 0 0 15px rgba(0, 255, 213, 0.7);
    border-radius: 0 4px 4px 0;
    transition: width 0.15s ease-out;
}

/* 8. SISTEMA DE REELS MÓVIL */
#reels-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scrollbar-width: none;
}

#reels-overlay::-webkit-scrollbar {
    display: none;
}

.reel-item {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    background: #000;
}

.reel-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 80px 24px 50px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0.3) 70%, transparent 100%);
    z-index: 20;
    pointer-events: none;
}

.reel-content h3 { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.reel-content p { max-width: 85%; text-shadow: 0 1px 5px rgba(0,0,0,0.5); }

#close-reels {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#close-reels:active { transform: scale(0.9); background-color: rgba(255, 255, 255, 0.2); }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* La versión de toda la vida */
    line-clamp: 2;         /* La propiedad estándar que te pide el editor */
    overflow: hidden;
}

.btn-more {
    cursor: pointer;
    padding-top: 4px;
}

/* Esto blinda la lectura en los Reels */
.description-container p, 
.description-container h3 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 1);
    letter-spacing: 0.01em; /* Un pelín de aire ayuda a leer en pantallas pequeñas */
}

/* Opcional: Oscurece un pelín el vídeo de fondo globalmente si es muy brillante */
.reel-item video {
    filter: brightness(0.9);
}

/* 9. UTILIDADES DE TEXTO */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.line-clamp-none {
    display: block !important;
}

.btn-more {
    color: #ffffff;
    font-weight: bold;
    margin-left: 5px;
    cursor: pointer;
    text-decoration: underline;
    display: inline-block;
}

.description-container p.line-clamp-none {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 10px;
    border-radius: 8px;
    margin-left: -10px;
    width: calc(100% + 20px);
}

/* 10. ANIMACIÓN HERO (LA OLA) */
.hero-title-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 1.2em; 
    overflow: hidden;
    width: 100%;
    padding: 0 20px; 
}

.absolute-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.letter-wave {
    display: inline-block;
    white-space: pre;
    font-weight: 900;
    color: white;
/* TAMAÑO PARA DESKTOP (Grande y de impacto) */
    font-size: 4rem;
    
    transition: 
        transform 0.9s cubic-bezier(0.23, 1, 0.32, 1), 
        opacity 0.6s ease, 
        filter 0.7s ease,
        font-weight 0.8s ease;
    will-change: transform, opacity, font-weight;
    letter-spacing: 0.06em; /* Refuerza la separación */
}

.letter-initial {
    opacity: 0;
    transform: translateY(100%) scaleY(0.5) scaleX(0.3);
    font-weight: 100; 
    filter: blur(12px);
}

.letter-in {
    opacity: 1;
    transform: translateY(0) scaleY(1) scaleX(1);
    font-weight: 900;
    filter: blur(0);
}

.letter-out {
    opacity: 0;
    transform: translateY(-120%) scaleY(2) scaleX(0.7);
    font-weight: 100;
    filter: blur(15px) brightness(1.2);
    color: #94a3b8;
}

/* --- CONFIGURACIÓN FINAL PARA MÓVIL --- */
@media (max-width: 768px) {
    /* Ajuste para tablets y móviles en horizontal */
    .letter-wave { 
        font-size: 2rem !important; 
        letter-spacing: 0.02em !important; 
    }
    .hero-title-container { 
        height: 1.2em !important; 
    }
}

@media (max-width: 480px) {
    /* Ajuste para móviles verticales (iPhone, Android) */
    .letter-wave { 
        font-size: 1.5rem !important; /* Aquí es donde bajamos el tamaño de verdad */
        letter-spacing: 0.01em !important; 
    }
    .hero-title-container { 
        height: 1.1em !important; 
    }
}

/* --- EFECTO BRILLO DISCRETO --- */
.software-badge {
    position: relative;
    overflow: hidden; /* Necesario para que el destello no se salga de la cápsula */
}

.software-badge:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 11 El destello de luz */
.software-badge::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: none;
}

.software-badge:hover::after {
    left: 100%;
    transition: all 0.6s ease; /* El rayo de luz cruza en 0.6 segundos */
    /* Cambia el 'slate-800/50' por un color sólido si prefieres */
    /* O ajusta el color de fondo aquí: */
    background-color: rgba(30, 31, 32, 0.5);
}

/* --- AJUSTE DISPARADOR REELS MÓVIL --- */
@media (max-width: 768px) {
    #mobile-reels-trigger {
        margin-top: 20px !important; /* Ajusta este valor a tu gusto */
    }
}