/* Portfolio — Minimal · Plus Jakarta Sans · UX-first */

:root {
    --bg:        #ffffff;
    --bg-soft:   #f4f6f9;
    --text:      #3a4250;
    --text-soft: #5a6578;
    --text-faint:#8a94a6;
    --ink:       #0f2744;
    --navy:      #0f2744;
    --navy-soft: #1e3a5f;
    --metal:     #9aa3b2;
    --metal-light: #d1d7e0;
    --metal-dark: #6b7585;
    --accent:    #8a94a6;
    --accent-soft: rgba(138, 148, 166, 0.12);
    --line:      #dfe4ec;
    --line-soft: #eef1f6;

    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --header: 64px;
    --max:    1080px;
    --ease:   cubic-bezier(0.25, 0.1, 0.25, 1);
    --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.intro-active { overflow: hidden; }

/* ── Intro bienvenida (10s) ── */
.intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.intro.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: grayscale(30%) contrast(1.05);
    opacity: 0.35;
}

.intro-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 39, 68, 0.78) 0%, rgba(15, 39, 68, 0.92) 100%);
}

.intro-eyebrow::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, var(--metal-light), var(--metal));
    margin: 14px auto 0;
}

.intro-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 24px;
    max-width: 640px;
}

.intro-eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(12px);
    animation: introFadeUp 0.8s var(--ease) 0.4s forwards;
}

.intro-title {
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: #fff;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(16px);
    animation: introFadeUp 0.9s var(--ease) 0.9s forwards;
}

.intro-title span {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}

.intro-sub {
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: translateY(12px);
    animation: introFadeUp 0.8s var(--ease) 1.6s forwards;
}

@keyframes introFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.intro-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 2;
}

.intro-progress-bar {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--metal-dark), var(--metal-light));
    transform-origin: left;
}

.intro.is-playing .intro-progress-bar {
    animation: introProgress 10s linear forwards;
}

@keyframes introProgress {
    to { width: 100%; }
}

.intro-skip {
    position: absolute;
    top: 24px;
    right: clamp(20px, 4vw, 40px);
    z-index: 3;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.intro-skip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.intro-skip:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

body.intro-active .header,
body.intro-active .drawer,
body.intro-active #main,
body.intro-active .footer {
    visibility: hidden;
}

body:not(.intro-active) .header,
body:not(.intro-active) #main,
body:not(.intro-active) .footer {
    animation: pageIn 0.6s var(--ease) both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }

.wrap {
    width: min(var(--max), calc(100% - 40px));
    margin-inline: auto;
}

/* ── Skip link (accesibilidad) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--bg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    z-index: 200;
}

.skip-link:focus {
    top: 16px;
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* ── Header ── */
.header {
    position: fixed;
    inset: 0 0 auto;
    height: var(--header);
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 clamp(20px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    z-index: 100;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.header.scrolled {
    border-color: var(--line);
    box-shadow: 0 1px 0 var(--line-soft);
}

.header.scrolled::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line);
}

.header-logo {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-right: auto;
    padding-left: 12px;
    border-left: 2px solid var(--metal);
}

.header-nav {
    display: flex;
    gap: 28px;
}

.header-nav a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active { color: var(--ink); }

.header-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: background 0.2s, border-color 0.2s;
}

.header-cta:hover {
    background: var(--bg-soft);
    border-color: var(--text-faint);
}

.header-cta:focus-visible,
.header-nav a:focus-visible,
.btn:focus-visible,
.contact-links a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.header-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.header-menu span {
    display: block;
    height: 1.5px;
    background: var(--ink);
    border-radius: 1px;
}

.drawer {
    position: fixed;
    inset: var(--header) 0 0;
    background: var(--bg);
    padding: 32px clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 99;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.drawer.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.drawer a {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* ── Hero — editorial, institucional ── */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--header) + 56px) clamp(20px, 4vw, 40px) 72px;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(135deg, transparent 40%, rgba(15, 39, 68, 0.03) 100%);
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(40px, 6vw, 72px);
    align-items: center;
    max-width: calc(var(--max) + 80px);
    margin-inline: auto;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 560px;
}

.hero-head {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.hero-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.hero-head .label { margin-bottom: 0; }

.hero-institution {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--navy-soft);
}

.hero h1 {
    font-size: clamp(2.125rem, 4.8vw, 3.375rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--ink);
    margin-bottom: 20px;
}

.hero-name-light {
    display: block;
    font-weight: 500;
    color: var(--text-soft);
    margin-top: 0.12em;
}

.lead {
    font-size: clamp(1rem, 1.8vw, 1.0625rem);
    color: var(--text-soft);
    line-height: 1.75;
    max-width: 44ch;
    margin-bottom: 32px;
}

.lead-accent {
    color: var(--ink);
    font-weight: 600;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
}

.hero-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
}

.hero-metric:last-child { border-right: none; }

.hero-metrics strong {
    display: block;
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.hero-metrics span {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    line-height: 1.35;
    max-width: 12ch;
}

.hero-domains {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
}

.hero-domain {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.hero-domain:last-child { border-bottom: none; }

.hero-domain-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(145deg, #eef2f7 0%, #e2e8f0 100%);
    border: 1px solid var(--line);
    color: var(--navy);
}

.hero-domain-icon svg {
    width: 22px;
    height: 22px;
}

.hero-domain-text h2 {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink);
    margin-bottom: 2px;
    line-height: 1.3;
}

.hero-domain-text p {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-faint);
    line-height: 1.4;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.hero-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--navy);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.hero-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3d9a5f;
    flex-shrink: 0;
}

.hero-visual {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4 / 5;
    max-height: min(72vh, 580px);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy);
    border: 1px solid var(--line);
    box-shadow: 0 20px 40px -16px rgba(15, 39, 68, 0.18);
}

.hero-scroll {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    transition: color 0.2s;
}

.hero-scroll:hover { color: var(--ink); }

.hero-scroll svg {
    animation: heroScrollBounce 2.4s ease-in-out infinite;
}

@keyframes heroScrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Entrada escalonada del hero */
.hero-reveal {
    opacity: 0;
    transform: translateY(14px);
}

.hero.is-visible .hero-reveal {
    animation: heroReveal 0.7s var(--ease) forwards;
}

.hero.is-visible .hero-content > .hero-reveal:nth-child(1) { animation-delay: 0.05s; }
.hero.is-visible .hero-content > .hero-reveal:nth-child(2) { animation-delay: 0.12s; }
.hero.is-visible .hero-content > .hero-reveal:nth-child(3) { animation-delay: 0.19s; }
.hero.is-visible .hero-content > .hero-reveal:nth-child(4) { animation-delay: 0.26s; }
.hero.is-visible .hero-content > .hero-reveal:nth-child(5) { animation-delay: 0.34s; }
.hero.is-visible .hero-content > .hero-reveal:nth-child(6) { animation-delay: 0.42s; }
.hero.is-visible .hero-aside.hero-reveal { animation-delay: 0.22s; }
.hero.is-visible .hero-scroll.hero-reveal { animation-delay: 0.55s; }

@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

.label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.btn-fill {
    background: var(--navy);
    color: var(--bg);
    border: 1px solid var(--navy);
}

.btn-fill:hover {
    background: var(--navy-soft);
    border-color: var(--navy-soft);
}

.btn-line {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-line:hover {
    border-color: var(--text-faint);
    background: var(--bg-soft);
}

.hero-visual video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(15%);
    transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-visual:not(.no-video) img {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
}

.hero-visual.video-ended video {
    opacity: 0;
    visibility: hidden;
}

.hero-visual.video-ended img {
    opacity: 1;
}

/* ── Blocks ── */
.block {
    padding: clamp(72px, 10vw, 112px) 0;
}

.block-alt { background: var(--bg-soft); }

.block-head {
    margin-bottom: 40px;
    max-width: 560px;
}

.block-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ink);
}

.block-link {
    margin-top: 40px;
}

.block-link a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}

.block-link a:hover { border-color: var(--ink); }

/* ── Prose ── */
.prose {
    max-width: 58ch;
}

.prose p {
    font-size: 1.0625rem;
    color: var(--text-soft);
    margin-bottom: 16px;
    line-height: 1.75;
}

.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

.about .block-head { margin-bottom: 32px; }

/* ── Perfil segmentado ── */
.about-segments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

.about-segment {
    padding: 28px 24px;
    border-right: 1px solid var(--line);
}

.about-segment:last-child { border-right: none; }

.about-segment h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 12px;
}

.about-segment-accent {
    background: linear-gradient(180deg, rgba(196, 165, 116, 0.08) 0%, transparent 100%);
}

.about-segment-accent h3 {
    color: var(--navy-soft);
}

.about-segment p {
    font-size: 0.9375rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.about-segment strong { color: var(--ink); font-weight: 600; }

/* ── Filtros de sección ── */
.block-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    max-width: none;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-soft);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-btn:hover {
    border-color: var(--text-faint);
    color: var(--ink);
}

.filter-btn[aria-pressed="true"] {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.filter-btn:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.exp-viewport,
.train-viewport {
    min-height: 120px;
}

.exp-area-chrono {
    margin-bottom: 0;
}

/* ── Skills — escaneable, sin ruido visual ── */
.skill-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
}

.skill-list li {
    padding: 28px 24px 28px 0;
    border-bottom: 1px solid var(--line);
}

.skill-list li:nth-child(even) { padding-left: 24px; padding-right: 0; }

.skill-list span {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.skill-list p {
    font-size: 0.875rem;
    color: var(--text-soft);
    line-height: 1.6;
}

/* ── Experience — timeline ── */
.exp-area {
    margin-bottom: 2.5rem;
}

.exp-area:last-of-type {
    margin-bottom: 0;
}

.exp-area-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent, #c4a574);
    margin: 0 0 1.25rem 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.exp-item.exp-highlight::before {
    background: var(--accent, #c4a574);
    box-shadow: 0 0 0 4px rgba(196, 165, 116, 0.2);
}

.exp-list {
    list-style: none;
    position: relative;
    margin-left: 8px;
    padding-left: 28px;
}

.exp-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--metal-light) 55%, var(--line) 100%);
    border-radius: 1px;
}

.exp-item {
    position: relative;
    padding: 0 0 44px 0;
}

.exp-item:last-child { padding-bottom: 0; }

.exp-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 6px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--metal);
    box-shadow: 0 0 0 3px var(--bg);
    z-index: 1;
}

.exp-item.exp-current::before {
    background: var(--navy);
    border-color: var(--navy);
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(15, 39, 68, 0.12);
}

.exp-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.exp-meta time {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-faint);
}

.tag {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 4px;
}

.exp-item h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 4px;
    line-height: 1.35;
}

.exp-org {
    font-size: 0.875rem;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.exp-item > p:last-child {
    font-size: 0.9375rem;
    color: var(--text-soft);
    max-width: 58ch;
    line-height: 1.65;
}

/* ── Training — lista densa, fácil de escanear ── */
.train-area {
    margin-bottom: 2rem;
}

.train-area:last-child {
    margin-bottom: 0;
}

.train-area-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-soft);
    margin: 0 0 0.75rem 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.train-list {
    border-top: 1px solid var(--line);
}

.train-list div,
.train-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}

.train-row.train-highlight {
    background: linear-gradient(90deg, rgba(196, 165, 116, 0.06) 0%, transparent 55%);
    padding-left: 12px;
    margin-left: -12px;
    padding-right: 12px;
    border-radius: 4px;
}

.train-list dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

.train-list dd {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.55;
}

/* ── Contact — CTA claro, mínima fricción ── */
.contact { background: var(--ink); color: var(--bg); }

.contact .label { color: rgba(255, 255, 255, 0.45); }
.contact .block-head h2 { color: var(--bg); }

.contact-note {
    margin-top: 12px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    max-width: 42ch;
}

.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: end;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-links a,
.contact-links p {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 1rem;
    font-weight: 500;
    color: var(--bg);
    transition: opacity 0.2s;
}

.contact-links a:hover { opacity: 0.75; }

.contact-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

/* ── CV downloads ── */
.cv-intro {
    margin-top: 12px;
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.6;
    max-width: 48ch;
}

.cv-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 1024px) {
    .cv-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.cv-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 100%;
}

.cv-card:hover {
    border-color: var(--text-faint);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.cv-card-primary {
    border-color: var(--ink);
    background: var(--bg-soft);
}

.cv-card-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 12px;
}

.cv-card strong {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 8px;
}

.cv-card p {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-soft);
    line-height: 1.55;
    margin-bottom: 16px;
}

.cv-card-action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.footer-links {
    display: flex;
    gap: 20px;
}

/* ── Footer ── */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px clamp(20px, 4vw, 40px);
    font-size: 0.8125rem;
    color: var(--text-faint);
    border-top: 1px solid var(--line);
}

.footer a {
    font-weight: 600;
    color: var(--text-soft);
    transition: color 0.2s;
}

.footer a:hover { color: var(--ink); }

/* ── Scroll reveal ── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Volver arriba ── */
.back-top {
    position: fixed;
    right: clamp(16px, 3vw, 28px);
    bottom: 28px;
    z-index: 90;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    color: var(--navy);
    box-shadow: 0 8px 24px -8px rgba(15, 39, 68, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, border-color 0.2s;
}

.back-top.is-shown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-top:hover {
    border-color: var(--metal);
    color: var(--ink);
}

.back-top:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
}

/* ── Contacto WhatsApp ── */
.contact-wa:hover {
    opacity: 0.85;
}

.contact-wa-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-wa-text::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325D366'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* ── CV card PDF ── */
.cv-card-accent {
    border-color: var(--navy);
    background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
}

.cv-card-accent .cv-card-tag {
    color: var(--navy-soft);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--header) + 32px);
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-aside { order: -1; }

    .hero-visual {
        max-width: 300px;
        max-height: 380px;
    }

    .hero-metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-metric {
        padding: 14px 8px;
    }

    .hero-cta .btn { flex: 1; }

    .hero-scroll { display: none; }

    .header-nav, .header-cta { display: none; }
    .header-menu { display: flex; }

    .skill-list { grid-template-columns: 1fr; }
    .skill-list li,
    .skill-list li:nth-child(even) { padding: 24px 0; }

    .about-segments {
        grid-template-columns: 1fr;
    }

    .about-segment {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .about-segment:last-child { border-bottom: none; }

    .block-head-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-inner { grid-template-columns: 1fr; gap: 32px; }

    .cv-cards { grid-template-columns: 1fr; }

    .train-list div,
    .train-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .hero-metrics span { font-size: 0.5625rem; }
    .hero-cta .btn { flex: 1; min-width: 140px; }

    .footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .intro { display: none !important; }
    body.intro-active { overflow: auto; }
    body.intro-active .header,
    body.intro-active #main,
    body.intro-active .footer { visibility: visible; }
    .hero-reveal { opacity: 1; transform: none; }
    .scroll-reveal { opacity: 1; transform: none; transition: none; }
    .hero-scroll svg { animation: none; }
    .hero-visual video { display: none; }
    .hero-visual img { opacity: 1; }
}
