/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #38bdf8;
    --secondary-color: #94a3b8;
    --card-bg: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- NAVIGATION --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    z-index: 1001;
}
.logo span { color: var(--accent-color); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-size: 0.9rem; font-weight: 500; opacity: 0.8; }
.nav-links a:hover { opacity: 1; color: var(--accent-color); }
.texto-alineado { text-align: center !important; }

.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; z-index: 1001; }

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 2rem;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 70%);
}

.hero-content { max-width: 800px; width: 100%; }

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--secondary-color);
    margin: 0 auto 2.5rem;
    max-width: 90%;
}

/* --- BUTTONS --- */
.cta-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--accent-color);
    color: #0f172a;
    font-weight: 700;
    border-radius: 6px;
    border: 2px solid var(--accent-color);
    text-align: center;
}

.btn:hover { background: transparent; color: var(--accent-color); }

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--secondary-color);
}
.btn-outline:hover { border-color: var(--accent-color); color: var(--accent-color); }
.btn-contact { margin-top: 1rem; width: 100%; max-width: 300px; }

/* --- SECTIONS --- */
section { 
    padding: 4rem 1.5rem; 
    max-width: 1100px; 
    margin: 0 auto; 
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 3rem;
    text-align: center;
}
.section-title span { border-bottom: 3px solid var(--accent-color); padding-bottom: 0.5rem; }

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 350px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.about-text p { margin-bottom: 1rem; color: #94a3b8; text-align: justify; }

.stats {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.stat-item { flex: 1; min-width: 80px; text-align: center; padding: 1rem; background: rgba(255,255,255,0.03); border-radius: 8px; }
.stat-item h3 { font-size: 1.8rem; color: var(--accent-color); margin-bottom: 0.2rem; }
.stat-item p { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- CURRICULUM --- */
.cv-container {
    background: var(--card-bg);
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}
.cv-iframe-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 141.4286%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
}
.cv-iframe-wrapper iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    border: none;
}

/* --- SERVICES --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent-color); }
.card i { font-size: 2rem; color: var(--accent-color); margin-bottom: 1.5rem; }

/* --- PORTFOLIO --- */
.portfolio-intro { max-width: 800px; margin: 0 auto 2rem auto; text-align: center; color: #94a3b8; }
.portfolio-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}
.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.portfolio-info { padding: 1.5rem 2rem; }
.tech-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tech-stack span {
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}
.transparency-note {
    background: rgba(148, 163, 184, 0.05);
    border-left: 3px solid #475569;
    padding: 15px;
    border-radius: 4px;
}
.transparency-note p { font-style: italic; font-size: 13px; color: #64748b; margin: 0; }

/* --- CONTACT --- */
.contact-box {
    background: var(--card-bg);
    padding: 3rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10rem; /* Da más espacio para que el scroll respire al final */

}
.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}
.contact-links a { font-size: 1.8rem; color: var(--text-color); }
.contact-links a:hover { color: var(--accent-color); transform: scale(1.1); }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* --- MEDIA QUERIES (MÓVIL) --- */
@media (max-width: 768px) {
    .hero { background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); }
    section { padding: 2rem 1rem; }
    .hero-content h1 { font-size: 2.2rem; }
    .section-title { margin-bottom: 2rem; font-size: 1.8rem; }
    .texto-alineado { font-size:0.6rem !important; }
    .menu-toggle { display: block; }
    
    .nav-links {
        position: fixed;
        top: 0; right: -100%;
        height: 100vh; width: 75%;
        background: #0f172a;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        z-index: 999;
    }

    .nav-links.active { right: 0; }
    .about-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .about-text p { text-align: left; }
    .stats { justify-content: center; }
    .btn, .btn-outline { width: 100%; margin: 0.5rem 0; }
}

/* Estado Activo para el Menú */
.nav-links a.active {
    color: var(--accent-color) !important;
    opacity: 1 !important;
    font-weight: 800;
    position: relative;
}

/* Línea decorativa debajo del link activo */
.nav-links a.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
}