@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
    --bg-page: #eef3f8;
    --bg-grad-a: #f7fafc;
    --bg-grad-b: #dfeaf6;
    --ink: #172635;
    --ink-soft: #3a4f63;
    --brand-900: #0f2d4a;
    --brand-700: #1f4f7a;
    --brand-500: #2f76aa;
    --brand-100: #d6e6f4;
    --surface: #ffffff;
    --surface-2: #f7fbff;
    --line: #d4e1ee;
    --line-strong: #9db9d4;
    --focus: #ffb347;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-soft: 0 8px 24px rgba(16, 38, 64, 0.08);
    --shadow-card: 0 14px 34px rgba(22, 48, 75, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    line-height: 1.7;
    background:
        radial-gradient(circle at 10% 10%, rgba(47, 118, 170, 0.16), transparent 36%),
        radial-gradient(circle at 88% 18%, rgba(15, 45, 74, 0.1), transparent 40%),
        linear-gradient(160deg, var(--bg-grad-a), var(--bg-grad-b));
}

a {
    color: var(--brand-700);
}

.theme-executive {
    --bg-page: #eef3f8;
    --bg-grad-a: #f7fafc;
    --bg-grad-b: #dfeaf6;
    --ink: #172635;
    --ink-soft: #3a4f63;
    --brand-900: #0f2d4a;
    --brand-700: #1f4f7a;
    --brand-500: #2f76aa;
    --brand-100: #d6e6f4;
    --surface: #ffffff;
    --surface-2: #f7fbff;
    --line: #d4e1ee;
    --line-strong: #9db9d4;
    --focus: #ffb347;
}

.theme-editorial {
    --bg-page: #f4f2ec;
    --bg-grad-a: #fcfbf8;
    --bg-grad-b: #ece6da;
    --ink: #2d2620;
    --ink-soft: #53473a;
    --brand-900: #433126;
    --brand-700: #6f4d36;
    --brand-500: #9a6a44;
    --brand-100: #efe0cf;
    --surface: #fffcf7;
    --surface-2: #f8f1e8;
    --line: #dfcfbf;
    --line-strong: #bf9f80;
    --focus: #e08a38;
}

.theme-switch {
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.theme-switch-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.theme-btn {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.6);
}

.theme-btn.is-active {
    background: rgba(255, 255, 255, 0.92);
    color: #153652;
    border-color: rgba(255, 255, 255, 0.9);
}

/* Encabezado */
.header {
    color: #ffffff;
    padding: 44px 20px 28px;
    background:
        linear-gradient(135deg, rgba(9, 26, 44, 0.96), rgba(31, 79, 122, 0.92)),
        linear-gradient(45deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.theme-editorial .header {
    background:
        linear-gradient(135deg, rgba(57, 42, 33, 0.97), rgba(111, 77, 54, 0.92)),
        linear-gradient(45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.header::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.profile-photo {
    width: 148px;
    height: 148px;
    border-radius: 18px;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.header-text {
    max-width: 760px;
    text-align: center;
}

.title {
    margin: 0;
    font-family: "Merriweather", Georgia, serif;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.subtitle {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    opacity: 0.95;
}

.subtitle-small {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: clamp(0.88rem, 1.8vw, 0.98rem);
    opacity: 0.88;
}

/* Navegacion */
.nav {
    margin: 28px auto 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 1100px;
    position: relative;
    z-index: 1;
}

.nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.015em;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.27);
    background: rgba(255, 255, 255, 0.09);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.theme-editorial .nav a {
    background: rgba(255, 248, 238, 0.15);
    border-color: rgba(255, 234, 212, 0.45);
}

.nav a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.17);
    border-color: rgba(255, 255, 255, 0.45);
}

/* Secciones */
.section {
    max-width: 980px;
    margin: 48px auto;
    padding: 0 20px;
    animation: section-enter 0.55s ease both;
}

.section-title {
    margin: 0 0 22px;
    font-family: "Merriweather", Georgia, serif;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 700;
    color: var(--brand-900);
    line-height: 1.3;
    padding: 12px 16px;
    border-left: 6px solid var(--brand-700);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: linear-gradient(90deg, rgba(214, 230, 244, 0.9), rgba(214, 230, 244, 0));
}

/* Tarjetas */
.card {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    padding: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 40px rgba(19, 45, 72, 0.14);
}

.card-title {
    font-family: "Merriweather", Georgia, serif;
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    font-weight: 700;
    color: var(--brand-900);
    margin-top: 0;
    margin-bottom: 12px;
}

/* Texto y listas */
.text,
.list li {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--ink);
}

.list {
    padding-left: 20px;
    margin: 10px 0 0;
}

.list li {
    margin-bottom: 9px;
}

.contact-list {
    display: grid;
    gap: 14px;
}

.contact-item {
    display: grid;
    grid-template-columns: 44px minmax(92px, 125px) 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(130deg, #ffffff, #f0f6fc);
    color: var(--brand-900);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-item:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 8px 22px rgba(24, 54, 84, 0.12);
}

.contact-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
    color: #ffffff;
}

.theme-editorial .contact-icon {
    background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
}

.contact-icon svg {
    width: 20px;
    height: 20px;
}

.contact-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-700);
}

.contact-value {
    font-size: 1rem;
    word-break: break-word;
}

/* Boton volver */
.section-back {
    margin-top: 2px;
    display: flex;
    justify-content: flex-end;
}

.back-to-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--brand-500);
    background: linear-gradient(135deg, #ffffff, #e8f1fa);
    color: var(--brand-900);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    min-height: 42px;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(20, 47, 74, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.back-to-menu::before {
    content: "↑";
    font-size: 13px;
    line-height: 1;
}

.back-to-menu:hover {
    background: linear-gradient(135deg, #ffffff, #dcecff);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(20, 47, 74, 0.17);
}

.back-to-menu:active {
    transform: translateY(0);
}

/* Boton CV */
.cv-download {
    margin-top: 20px;
}

.btn {
    background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 16px rgba(14, 37, 62, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(14, 37, 62, 0.28);
}

/* Pie */
.footer {
    background: linear-gradient(160deg, #102f4e, #173f66);
    color: #e6eef7;
    text-align: center;
    padding: 24px 20px;
    margin-top: 54px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-editorial .footer {
    background: linear-gradient(160deg, #493528, #795338);
    color: #fff4e8;
}

.footer p {
    margin: 4px 0;
}

/* Foco accesible */
.nav a:focus-visible,
.back-to-menu:focus-visible,
.btn:focus-visible,
.contact-item:focus-visible,
a:focus-visible,
.theme-btn:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 8px;
}

@keyframes section-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .profile-photo {
        width: 126px;
        height: 126px;
    }

    .nav a {
        padding: 8px 12px;
    }

    .theme-switch {
        margin-top: 14px;
    }
}

/* Telefonos grandes */
@media (max-width: 640px) {
    .header {
        padding-top: 34px;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .profile-photo {
        width: 112px;
        height: 112px;
        border-radius: 14px;
    }

    .section {
        margin: 34px auto;
    }

    .card {
        padding: 22px;
        border-radius: 14px;
    }

    .contact-item {
        grid-template-columns: 44px 1fr;
    }

    .contact-label,
    .contact-value {
        grid-column: 2;
    }

    .contact-label {
        margin-bottom: -6px;
    }

    .back-to-menu {
        width: 100%;
        max-width: 280px;
    }

    .theme-switch-label {
        width: 100%;
        text-align: center;
    }
}

/* Telefonos pequenos */
@media (max-width: 420px) {
    .section {
        padding: 0 14px;
    }

    .nav {
        gap: 8px;
    }

    .nav a {
        font-size: 0.84rem;
        padding: 8px 11px;
    }

    .subtitle {
        font-size: 0.9rem;
    }
}
