:root {
    --main-bg: #f9f9f9;
    --main-text: #222;
    --accent: #007aff;
    --subtitle: #666;
    --card-bg: #fff;
    --shadow: 0 2px 24px 0 rgba(0,0,0,0.06);
    --border-radius: 18px;
    --font-main: 'Inter', 'Segoe UI', Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--main-bg);
    color: var(--main-text);
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.6;
}

main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.centered {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 420px;
    width: min(100%, 420px);
    margin: 2.5rem auto 0 auto;
}


/* NAVBAR */
header {
    width: 100%;
    background: var(--card-bg);
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.03);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}
.navbar {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
}
.logo {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--main-text);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.nav-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s;
    margin-left: 1.5rem;
}
.nav-link:hover,
.nav-link:focus {
    color: #005bb5;
    text-decoration: underline;
}

/* Espacio para compensar el header fijo */
body {
    padding-top: 70px;
}

.profile-photo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.7rem;
}
.profile-photo img {
    width: 170px;
    height: 170px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--main-bg);
    box-shadow: 0 2px 18px 0 rgba(0,0,0,0.10);
    background: #eaeaea;
    transition: box-shadow 0.3s;
}
.profile-photo img:hover {
    box-shadow: 0 4px 32px 0 rgba(0,122,255,0.13);
}

.info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    font-size: 1.08rem;
    color: var(--main-text);
}

.info .edad {
    font-weight: 500;
}

.info .telefono {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phone-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.phone-link:hover,
.phone-link:focus {
    color: #005bb5;
    text-decoration: underline;
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    color: #fff;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    margin-left: 0.2rem;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    border: none;
}

.whatsapp-link:hover,
.whatsapp-link:focus {
    background: #1ebe5d;
    color: #fff;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--subtitle);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.links {
    margin-top: 1.5rem;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--main-bg);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 1px 8px 0 rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-size: 1.1rem;
}

.github-link:hover,
.github-link:focus {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 16px 0 rgba(0,122,255,0.10);
}

/* SOBRE MÍ SECTION */
.sobre-mi-section {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(.4,0,.2,1), transform 0.8s cubic-bezier(.4,0,.2,1);
    max-width: 540px;
    margin: 4.5rem auto 4.5rem auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 3rem 2.5rem;
    text-align: left;
    width: min(100%, 540px);
}
.sobre-mi-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.sobre-mi-section h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -1px;
}
.sobre-mi-content p {
    margin-bottom: 1.1rem;
    color: var(--main-text);
    font-size: 1.08rem;
    line-height: 1.7;
}
.sobre-mi-content p:last-child {
    margin-bottom: 0;
}

/* SKILLS SECTION */
.skills-section {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(.4,0,.2,1), transform 0.8s cubic-bezier(.4,0,.2,1);
    max-width: 900px;
    margin: 4.5rem auto 4.5rem auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 3rem 2.5rem;
    text-align: left;
    width: min(100%, 900px);
}
.skills-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.skills-section h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -1px;
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}
.skill-card {
    background: #f5f8ff;
    border-radius: 14px;
    box-shadow: 0 1px 8px 0 rgba(0,122,255,0.04);
    padding: 1.1rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
    cursor: pointer;
    border: 1.5px solid transparent;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}
.skill-card:hover, .skill-card:focus,
.skill-card.active {
    background: #e6f0ff;
    box-shadow: 0 4px 24px 0 rgba(0,122,255,0.13);
    border: 1.5px solid var(--accent);
    transform: translateY(-4px) scale(1.03);
}
.skill-title {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.08rem;
    margin-bottom: 0.3rem;
    z-index: 2;
    position: relative;
}
.skill-desc {
    color: var(--main-text);
    font-size: 0.98rem;
    opacity: 0.85;
    margin-top: 0.2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s cubic-bezier(.4,0,.2,1);
    opacity: 0;
    pointer-events: none;
}
.skill-card:hover .skill-desc,
.skill-card:focus .skill-desc,
.skill-card.active .skill-desc {
    max-height: 80px;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .centered,
    .sobre-mi-section,
    .skills-section {
        width: calc(100% - 2rem);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
        padding: 2rem 1.25rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }

    .navbar {
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 600px) {
    .centered,
    .sobre-mi-section,
    .skills-section {
        width: calc(100% - 1.5rem);
        max-width: none;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 1.25rem 1rem;
        border-radius: 16px;
    }

    .navbar {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-link {
        margin-left: 0.75rem;
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.7rem;
    }

    .sobre-mi-section h2,
    .skills-section h2 {
        font-size: 1.8rem;
    }

    .profile-photo img {
        width: 100px;
        height: 100px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .skill-card {
        min-height: 70px;
        padding: 0.85rem;
    }
}
