:root {
    --bg-color: #050816;
    --bg-elevated: #0b1020;
    --bg-soft: #111827;
    --border-subtle: rgba(148, 163, 184, 0.35);
    --text-color: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.18);
    --accent-strong: #16a34a;
    --accent-contrast: #0b1120;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.8);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --transition-fast: 0.18s ease-out;
    --transition-slow: 0.28s ease;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    display: block;
    font-family: var(--font-sans);
    background: radial-gradient(circle at top left, #0f172a 0, #020617 40%, #020617 100%);
    color: var(--text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Fallback si las variables CSS no se cargan */
body:not([data-theme]) {
    background: #0f172a;
    color: #e5e7eb;
}

.container {
    width: min(1120px, 100% - 2.5rem);
    margin-inline: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(16px);
    background: linear-gradient(to bottom, var(--nav-bg), transparent);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid var(--accent-soft);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.brand-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.brand-name {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-color);
}

.brand-role {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1.1rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-list a {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-list a:hover {
    color: var(--accent);
    border-color: var(--accent-soft);
    text-decoration: none;
}

.nav-list a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.85);
    padding: 0.4rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.8));
    transition: border-color 0.3s ease, background 0.3s ease;
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-btn.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.site-main {
    display: block;
    padding-bottom: 4rem;
}

.hero {
    padding: 3.5rem 0 2.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
    gap: 2.3rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(1.9rem, 2.3rem + 0.5vw, 2.5rem);
    letter-spacing: 0.03em;
    line-height: 1.2;
    margin: 0 0 0.9rem;
    color: var(--text-color);
}

.hero-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 36rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform 0.08s ease-out,
        box-shadow 0.08s ease-out;
}

.btn-primary {
    background: linear-gradient(to right, var(--accent-strong), var(--accent));
    color: var(--accent-contrast);
    box-shadow: 0 18px 45px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 55px rgba(16, 185, 129, 0.55);
    text-decoration: none;
}

.btn-outline {
    border-color: var(--border-subtle);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}

.hero-card {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), rgba(15, 23, 42, 0.96));
    border-radius: 26px;
    padding: 1.4rem 1.5rem 1.6rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: var(--shadow-soft);
}

.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.45rem;
}

.hero-highlights {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-highlights li {
    padding-left: 1.2rem;
    position: relative;
}

.hero-highlights li::before {
    content: "";
    position: absolute;
    left: 0.1rem;
    top: 0.6rem;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.section {
    padding: 2.7rem 0 2.5rem;
}

.section-alt {
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 1));
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
    gap: 2.1rem;
    align-items: flex-start;
}

.section-title {
    font-size: 1.4rem;
    margin: 0 0 0.8rem;
    color: var(--text-color);
}

.section-text {
    margin: 0 0 0.7rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.8;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.25rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.info-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin: 0 0 0.4rem;
    color: var(--text-color);
}

.info-text {
    margin: 0 0 0.7rem;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.7;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 1.6rem;
}

/* Centrar el último elemento (Soft Skills) en la cuadrícula de 3 columnas */
.skills-grid > :last-child {
    grid-column: 2;
}

.skill-group {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 1rem 1.05rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-group h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 0.55rem;
    color: var(--text-color);
}

.skill-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.skill-group li + li {
    margin-top: 0.2rem;
}

.section-header {
    max-width: 38rem;
    margin-bottom: 1.6rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
}

.project-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) auto;
    gap: 0.85rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-main {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.project-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0;
    color: var(--text-color);
}

.project-role {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    margin: 0;
}

.project-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.project-tag {
    font-size: 0.74rem;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    color: var(--text-muted);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.project-logo-wrap {
    width: 76px;
    height: 76px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(248, 250, 252, 0.85), rgba(15, 23, 42, 0.9));
    transition: border-color 0.3s ease, background 0.3s ease;
}

.project-logo-wrap img {
    max-width: 60px;
    max-height: 60px;
    opacity: 0.9;
}

.resume-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.resume-frame-wrapper {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.resume-frame-wrapper iframe {
    width: 100%;
    min-height: min(1200px, 80vh);
    border: none;
    background: var(--bg-elevated);
    transition: background 0.3s ease;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.contact-label {
    display: inline-block;
    min-width: 4.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-right: 0.4rem;
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    padding: 1.4rem 0 1.6rem;
    background: rgba(15, 23, 42, 0.98);
}

.footer-inner {
    display: flex;
    justify-content: center;
}

.footer-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 960px) {
    .hero-grid,
    .section-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding-top: 2.6rem;
    }

    .hero-card {
        order: -1;
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* En 2 columnas, el último (7º) elemento debe ocupar todo el ancho para centrarse */
    .skills-grid > :last-child {
        grid-column: 1 / -1;
        max-width: 600px; /* Opcional: para que no se estire demasiado */
        margin-inline: auto;
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        align-items: center;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        padding-inline: 1.25rem;
        padding-bottom: 0.75rem;
        justify-content: flex-end;
    }

    .nav-list {
        position: absolute;
        right: 1.2rem;
        top: 0.7rem;
        flex-direction: column;
        align-items: flex-start;
        background: rgba(15, 23, 42, 0.97);
        border-radius: 0.9rem;
        padding: 0.5rem 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.5);
        transform-origin: top right;
        transform: scale(0.95);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.16s ease, transform 0.16s ease, background 0.3s ease, border-color 0.3s ease;
        backdrop-filter: blur(16px);
    }

    .nav-list.is-open {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    .site-main {
        padding-bottom: 3rem;
    }

    .hero {
        padding-top: 2.2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .skills-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .skills-grid > :last-child {
        grid-column: auto; /* Resetear en móvil */
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 0.9rem;
    }

    .brand-role {
        display: none;
    }

    .hero-card {
        padding: 1rem 1rem 1.1rem;
    }

    .resume-frame-wrapper iframe {
        min-height: 900px;
    }
}


.linkedin-btn {
    padding: 0.5rem 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.linkedin-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}
