:root {
    /* Paleta Deep Obsidian Slate - Rompe el molde genérico de IA */
    --bg: #090d16;
    --surface: #111827;
    --surface-hover: #1f2937;
    --border: #1f293d;
    --border-hover: #3b82f6;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --accent: #6366f1; /* Indigo moderno */
    --accent-glow: rgba(99, 102, 241, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 10% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    width: min(1000px, 92%);
    margin: auto;
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text);
}

.logo span {
    color: var(--accent);
}

nav {
    display: flex;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text);
}

/* Hero Section */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 0;
}

.avatar-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    animation: spin 40s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);
    display: block;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    line-height: 1.1;
}

.hero h1 span {
    background: linear-gradient(to right, #a5b4fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    max-width: 650px;
    line-height: 1.6;
    color: var(--muted);
    font-size: 1.15rem;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    margin-top: 2.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.85rem 1.6rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--muted);
}

/* Secciones globales */
.section {
    padding: 7rem 0; /* Ajuste balanceado de separación */
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.section h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.about-text strong {
    color: var(--text);
    font-weight: 600;
}

.about-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.about-box h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-box h3 svg {
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-container span {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
}

/* Resume Section */
.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.resume-block {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.2rem;
    border: 1px solid var(--border);
}

.resume-block h3 {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.resume-block h3 svg {
    color: var(--accent);
    width: 20px;
    height: 20px;
}

.resume-title {
    font-weight: 700;
    color: var(--text) !important;
    font-size: 1.1rem;
    margin-bottom: 0.2rem !important;
}

.resume-date {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc !important;
    border-radius: 4px;
}

.resume-block p {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* Tags globales */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Projects Section */
.projects {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr; /* Una columna para dar jerarquía y espacio */
}

.project-card {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    display: grid;
    grid-template-columns: 4.5fr 5.5fr; /* Diseño moderno asimétrico */
    height: 420px;
}

.project-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.2rem;
    font-size: 0.98rem;
}

.project-content .tags {
    margin: 1rem 0 2rem 0; /* Mayor espacio superior para solucionar la queja de UI */
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem; /* Corrección de separación superior */
}

.project-link {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.github-link { color: var(--text); }
.github-link:hover { color: var(--accent); }
.demo-link { color: #10b981; } /* Esmeralda para demo */
.demo-link:hover { color: #34d399; }
.api-link { color: #3b82f6; } /* Azul swagger */
.api-link:hover { color: #60a5fa; }

/* Slider Interno */
.slider {
    position: relative;
    overflow: hidden;
    background: #0b0f17;
    height: 100%;
    width: 100%;
    min-height: 300px;
}

.slides {
    width: 100%;
    height: 100%;
}

.slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: none;
}

.slides img.active {
    display: block;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.8);
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.prev { left: 12px; }
.next { right: 12px; }
.prev:hover, .next:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Contact Section */
.contact-subtitle {
    text-align: center;
    color: var(--muted);
    margin-top: -2.5rem;
    margin-bottom: 3rem;
}

.contact-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.contact-card:not(.location-card):hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.01);
}

.contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    color: var(--accent);
    width: 20px;
    height: 20px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

.footer-sub {
    font-size: 0.8rem;
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.2);
}

/* Responsive UI */
@media (max-width: 850px) {
    .project-card {
        grid-template-columns: 1fr;
        height: auto;
    }
    .slider {
        height: 220px;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.4rem; }
    .nav { flex-direction: column; gap: 1.2rem; }
    nav { gap: 1.5rem; }
    .hero-buttons { flex-direction: column; width: 100%; max-width: 280px; }
    .resume-grid { grid-template-columns: 1fr; }
    .section { padding: 4.5rem 0; }
}
