* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Merriweather Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f3ec;
    color: #1f2528;
    line-height: 1.65;
}

p {
    color: #445056;
    line-height: 1.75;
    text-align: left;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 22px 7vw;
    background: rgba(247, 243, 236, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(31, 37, 40, 0.08);
}

.logo {
    justify-self: start;
    color: #1f2528;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: normal;
    font-size: 1.15rem;
}

nav {
    justify-self: center;
    display: flex;
    gap: 24px;
    font-size: 0.95rem;
}

nav a {
    color: #445056;
    text-decoration: none;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #8a4b2f;
}

main {
    width: min(1120px, 86vw);
    margin: 0 auto;
}

.hero {
    min-height: 78vh;
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    align-items: center;
    gap: clamp(36px, 6vw, 76px);
    padding: 72px 0;
}

.hero-photo-wrapper {
    display: flex;
    justify-content: center;
}

.hero-photo {
    width: clamp(210px, 28vw, 330px);
    height: clamp(210px, 28vw, 330px);
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    border: 8px solid #fffaf2;
    box-shadow: 0 24px 60px rgba(31, 37, 40, 0.16);
}

.hero-content {
    min-width: 0;
}

.eyebrow {
    color: #8a4b2f;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.82rem;
    font-weight: 700;
}

h1 {
    max-width: 850px;
    margin: 12px 0 20px;
    font-size: clamp(1.6rem, 2.6vw, 2.6rem);
    line-height: 1.2;
    letter-spacing: normal;
}

h2 {
    margin: 8px 0 20px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.2;
    letter-spacing: normal;
}

.hero-subtitle {
    max-width: 720px;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    color: #445056;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.primary {
    background: #1f2528;
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 37, 40, 0.15);
}

.secondary {
    color: #1f2528;
    border: 1px solid rgba(31, 37, 40, 0.25);
}

.content-section {
    padding: 92px 0;
    border-top: 1px solid rgba(31, 37, 40, 0.1);
}

.section-number {
    color: #8a4b2f;
    font-weight: 800;
    font-size: 0.85rem;
}

.content-section > p {
    max-width: 100%;
    font-size: 1.08rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 34px;
}

.card {
    padding: 26px;
    background: #fffaf2;
    border: 1px solid rgba(31, 37, 40, 0.09);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(31, 37, 40, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(31, 37, 40, 0.1);
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card h3 {
    margin-top: 0;
    line-height: 1.2;
}

.card p {
    max-width: none;
    font-size: 0.96rem;
    line-height: 1.65;
}

.split {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 44px;
    align-items: start;
}

.stats {
    display: grid;
    gap: 16px;
}

.stats div {
    padding: 24px;
    border-radius: 20px;
    background: #1f2528;
    color: white;
}

.stats strong {
    display: block;
    font-size: 2.2rem;
    line-height: 1;
}

.stats span {
    color: #d9d0c4;
}

.specialty-detail {
    margin-top: 34px;
    padding: 32px;
    background: #fffaf2;
    border: 1px solid rgba(31, 37, 40, 0.09);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(31, 37, 40, 0.045);
    scroll-margin-top: 110px;
}

.specialty-detail h3 {
    margin-top: 0;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.2;
    letter-spacing: normal;
}

.specialty-detail h4 {
    margin: 28px 0 8px;
    font-size: 1rem;
    color: #8a4b2f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.specialty-detail p {
    max-width: none;
}

.skills-list {
    font-weight: 700;
    color: #1f2528;
}

.timeline {
    display: grid;
    gap: 18px;
    margin-top: 34px;
}

.timeline-item {
    position: relative;
    padding: 28px 28px 28px 34px;
    background: #fffaf2;
    border: 1px solid rgba(31, 37, 40, 0.09);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(31, 37, 40, 0.045);
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 28px;
    left: 0;
    width: 5px;
    height: calc(100% - 56px);
    border-radius: 999px;
    background: #8a4b2f;
}

.timeline-item h3 {
    margin: 0 0 8px;
    line-height: 1.2;
}

.timeline-item p {
    margin: 8px 0 0;
}

.timeline-meta {
    font-weight: 800;
    color: #8a4b2f;
}

.contact-section {
    margin: 80px 0;
    padding: 54px;
    border-radius: 32px;
    background: #8a4b2f;
    color: white;
}

.contact-section p {
    max-width: 620px;
    color: #f4e7dd;
}

.contact-section .primary {
    background: white;
    color: #8a4b2f;
}

footer {
    width: min(1120px, 86vw);
    margin: 0 auto;
    padding: 40px 0 60px;
    color: #6c777d;
    border-top: 1px solid rgba(31, 37, 40, 0.1);
}

footer p {
    color: inherit;
}

#sobre-mi,
#especialidades,
#experiencia,
#especialidades-ampliadas,
#formacion,
#contacto {
    scroll-margin-top: 100px;
}

.logo:focus-visible,
nav a:focus-visible,
.button:focus-visible,
.card-link:focus-visible {
    outline: 3px solid rgba(138, 75, 47, 0.45);
    outline-offset: 4px;
}

.fade-in {
    animation: fadeIn 0.9s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    nav {
        display: none;
    }

    .cards-grid,
    .split {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero p {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .stats strong {
        font-size: 1.75rem;
    }
}

@media (max-width: 560px) {
    main,
    footer {
        width: min(92vw, 1120px);
    }

    .site-header {
        display: flex;
        justify-content: center;
        padding: 18px 4vw;
    }

    .content-section {
        padding: 64px 0;
    }

    .contact-section {
        padding: 34px;
    }

    .specialty-detail,
    .timeline-item {
        padding: 24px;
    }
}
