/* --- CONFIGURACIÓN Y ESTILO PREMIUM --- */
:root {
    --bg-color: #0d0d0d;
    --surface-color: rgba(26, 26, 26, 0.5);
    --primary-text-color: #f5f5f7;
    --secondary-text-color: #a1a1a6;
    --accent-color: #007aff;
    --accent-hover-color: #3395ff;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(0, 122, 255, 0.7);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

@keyframes bounce-arrow {
    0%, 100% {
        transform: translateY(0) rotate(45deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(15px) rotate(45deg);
        opacity: 0.4;
    }
}

html {
    scroll-behavior: smooth;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    line-height: 1.8; 
    margin: 0; 
    background-color: var(--bg-color); 
    color: var(--primary-text-color);
    overflow-x: hidden;
}

/* --- CURSOR INTERACTIVO --- */
#cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1px solid var(--primary-text-color);
    border-radius: 50%;
    left: 0;
    top: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
    z-index: 9999;
}
#cursor.grow {
    width: 50px;
    height: 50px;
    background-color: var(--glow-color);
    border: none;
}

.container { 
    max-width: 950px; 
    margin: 0 auto; 
    padding: 60px 25px; 
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

h2 { 
    color: var(--primary-text-color); 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 15px; 
    margin-top: 60px;
    margin-bottom: 40px;
    font-size: clamp(2rem, 5vw, 2.5rem);
}
        
a { 
    color: var(--accent-color); 
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
}
a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-hover-color);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}
a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- HERO SECTION INMERSIVA --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    position: relative;
}
.hero-content {
    max-width: 1400px;
}
.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--primary-text-color);
    overflow: hidden; 
    border-right: .15em solid var(--accent-color);
    white-space: nowrap; 
    margin: 0 auto; 
    letter-spacing: .05em;
    width: 23ch; 
    animation: 
        typing 1.5s steps(23, end) 0.3s 1 forwards,
        blink-caret .75s 1s infinite;
}
.hero .subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--secondary-text-color);
    margin: 1.5rem auto 2.5rem auto;
    max-width: 600px;
    opacity: 0;
    animation: fadeIn 1s 2.5s forwards;
}
.hero .contact-links {
     opacity: 0;
     animation: fadeIn 1s 3s forwards;
}
.hero .contact-links a {
    margin: 10px 20px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}
.hero .contact-links a:hover {
    transform: scale(1.1);
}
.hero .contact-links i {
    margin-right: 10px;
}

/* --- INDICADOR DE SCROLL (FLECHA ANIMADA) --- */
.scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1s 3.5s forwards;
}

.arrow-down {
    width: 24px;
    height: 24px;
    border: solid var(--primary-text-color);
    border-width: 0 3px 3px 0;
    opacity: 0.8;
    animation: bounce-arrow 2s ease-in-out infinite;
}

/* --- ANIMACIONES DE SCROLL --- */
.reveal-up {
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    filter: blur(5px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.8s ease-out;
}
.reveal-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}
        
/* --- TARJETA DE PROYECTO --- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}
.project-card { 
    background: var(--surface-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color); 
    padding: 35px; 
    border-radius: 16px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
}
.project-card h3 { 
    font-size: 1.7rem;
    color: var(--primary-text-color);
}
.project-card .project-description {
    color: var(--secondary-text-color);
    flex-grow: 1;
}
.project-card .project-description p {
    color: var(--secondary-text-color);
}
.project-card .implementation-note {
    font-style: italic;
    color: var(--secondary-text-color);
    margin-top: 15px;
    font-size: 0.9rem;
}
.project-stack {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.project-stack .stack-item {
    background-color: rgba(51, 51, 51, 0.7);
    color: #e0e0e0;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}
.project-stack .stack-item:hover {
    transform: scale(1.05);
}

/* --- BOTONES PREMIUM --- */
.button, .button-disabled { 
    display: inline-block; 
    padding: 14px 30px; 
    margin-top: 30px;
    border-radius: 10px; 
    font-weight: 600; 
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid transparent;
}
.button {
    background-color: var(--accent-color); 
    color: #fff; 
}
.button:hover { 
    background-color: var(--accent-hover-color); 
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.25);
}
.button i, .button-disabled i {
    margin-right: 10px;
}
.button-disabled {
    background-color: rgba(51, 51, 51, 0.5);
    color: #888;
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

/* --- BLOQUE AUTODIDACTA --- */
.autodidact-note {
    margin-top: 60px;
    padding: 30px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 25px;
}
.autodidact-note i {
    font-size: 2.5rem;
    color: var(--accent-color);
}
.autodidact-note p {
    margin: 0;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
    line-height: 1.7;
}

footer { 
    text-align: center; 
    margin-top: 50px; 
    padding: 50px 25px; 
    border-top: 1px solid var(--border-color); 
    color: var(--secondary-text-color); 
    background-color: #090a0f;
}
footer .footer-links a {
     margin: 0 15px;
}

/* ===== INICIO DE ESTILOS PARA LA SECCIÓN DE SMARTCFO ===== */
.smartcfo-showcase {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 35px;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    overflow: hidden;
    padding: 35px;
    /* Re-aplicamos los estilos base de la tarjeta */
    background: var(--surface-color);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.smartcfo-preview {
    /* Variables de color de SmartCFO, aplicadas solo a este componente */
    --scfo-primary-blue: #0A192F;
    --scfo-accent-cyan: #00AEEF;
    --scfo-text-light: #ccd6f6;
    --scfo-text-dark: #8892b0;
    
    font-family: 'Poppins', 'Inter', sans-serif;
    background-color: var(--scfo-primary-blue);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    text-align: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 174, 239, 0.2);
}

.smartcfo-preview::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(17, 34, 64, 0.2), transparent 70%);
    pointer-events: none;
}

.smartcfo-preview .preview-header {
    width: 100%;
    margin-bottom: auto;
}

.smartcfo-preview .preview-logo {
    height: 35px;
    width: auto;
    opacity: 0.9;
}

.smartcfo-preview .preview-hero-content {
    margin-bottom: auto;
}

.smartcfo-preview h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    color: var(--scfo-text-light);
    margin-bottom: 1rem;
    font-weight: 700;
}

.smartcfo-preview h1 span {
    color: var(--scfo-accent-cyan);
    display: block;
}

.smartcfo-preview p {
    color: var(--scfo-text-dark);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.smartcfo-preview .preview-btn {
    display: inline-block;
    background: var(--scfo-accent-cyan);
    color: var(--scfo-primary-blue);
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: default;
}

.project-description-wrapper {
    display: flex;
    flex-direction: column;
}

/* ===== FIN DE ESTILOS PARA LA SECCIÓN DE SMARTCFO ===== */

/* --- MEDIA QUERIES PARA RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .hero h1 { animation: none; border-right: none; white-space: normal; width: auto; }
    .hero .subtitle, .hero .contact-links, .scroll-indicator { opacity: 1; animation: none; }
    #cursor { display: none; }
    .autodidact-note {
        flex-direction: column;
        text-align: center;
    }
    
    /* Media query para la tarjeta de SmartCFO */
    .smartcfo-showcase {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}