:root {
  --ink: #322118;
  --ink-soft: #5c4336;
  --dark: #411f0e;
  --accent: #ea580c;
  --accent-soft: #fdeae0;
  --accent-hover: #ac4a17;
  --accent-on-dark: #edb497;
  --accent-border: #f3c6af;
  --tag-bg: #f2ece8;
  --paper: #fcfaf9;
  --white: #ffffff;
  --line: #ebe5e2;
  --shadow: 0 24px 70px rgba(50,33,24, .10);
  --radius-lg: 2rem;
  --radius-md: 1.25rem;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: min(calc(100% - 2rem), var(--content));
  margin: 1rem auto 0;
  padding: .7rem .75rem .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  border: 1px solid rgba(235,229,226, .86);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 35px rgba(50,33,24,.08);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; color: #fff; background: var(--dark); border-radius: 50%; font-size: .78rem; letter-spacing: .03em; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; font-weight: 650; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 3.25rem; padding: .85rem 1.35rem; border: 1px solid var(--accent); border-radius: 999px; color: #fff; background: var(--accent); text-decoration: none; font-weight: 750; box-shadow: 0 10px 25px rgba(234,88,12,.18); transition: transform .2s, background .2s, box-shadow .2s; }
.button:hover { transform: translateY(-2px); background: var(--accent-hover); box-shadow: 0 14px 30px rgba(234,88,12,.25); }
.button-small { min-height: 2.5rem; padding: .55rem 1rem; font-size: .88rem; }

main { overflow: clip; }
.hero { width: min(calc(100% - 2rem), var(--content)); margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 148px 1fr; gap: clamp(1.75rem, 4vw, 3rem); align-items: center; }
.portrait-wrap { position: relative; width: 136px; height: 136px; }
.portrait-wrap::before { content: ""; position: absolute; inset: -9%; z-index: -1; border-radius: 50%; background: var(--accent-soft); }
.portrait { display: block; width: 136px; height: 136px; object-fit: cover; object-position: center; border: 5px solid var(--white); border-radius: 50%; filter: saturate(.88) contrast(1.02); box-shadow: 0 14px 35px rgba(50,33,24,.16); }
.portrait-ring { position: absolute; right: -.5rem; bottom: -.5rem; width: 3.25rem; height: 3.25rem; border: 1px solid var(--accent); border-radius: 50%; opacity: .45; }
.portrait-ring::after { content: ""; position: absolute; inset: .7rem; border: 1px solid var(--accent); border-radius: inherit; }
.eyebrow { margin: 0 0 .7rem; color: var(--accent); font-size: .82rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.2rem; font-size: clamp(3rem, 7vw, 6.1rem); line-height: .94; letter-spacing: -.065em; font-weight: 820; }
h1 span { color: var(--accent); }
.role { max-width: 760px; margin-bottom: 1.4rem; color: var(--ink-soft); font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 620; }
.contact-list { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; margin-bottom: 2rem; }
.contact-list a, .contact-list span { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.contact-list a:hover { color: var(--accent); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.4rem; }
.text-link { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-weight: 750; border-bottom: 1px solid var(--line); }
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(3rem, 6vw, 5rem); border-block: 1px solid var(--line); }
.hero-facts div { padding: 1.4rem clamp(1rem, 3vw, 2.2rem); }
.hero-facts div + div { border-left: 1px solid var(--line); }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts strong { font-size: 1.35rem; letter-spacing: -.025em; }
.hero-facts span { color: var(--ink-soft); font-size: .88rem; }

.section { width: min(calc(100% - 2rem), var(--content)); margin: 0 auto; padding: clamp(4.5rem, 8vw, 7rem) 0; }
.section-heading { display: grid; grid-template-columns: .7fr 1.5fr; align-items: end; margin-bottom: 2.5rem; }
.section-heading .eyebrow { margin: 0 0 .5rem; }
h2 { margin-bottom: 0; font-size: clamp(2.4rem, 5vw, 4.7rem); line-height: .98; letter-spacing: -.055em; }
.profile-card { margin-left: 32%; padding: clamp(2rem, 5vw, 4rem); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); }
.profile-card > p { margin-bottom: 2rem; color: var(--ink-soft); font-size: clamp(1.08rem, 2vw, 1.28rem); line-height: 1.75; }
.profile-tags, .tech-list { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.profile-tags span, .tech-list li { padding: .48rem .78rem; color: var(--dark); background: var(--tag-bg); border-radius: 999px; font-size: .82rem; font-weight: 720; }
.availability { display: grid; gap: .55rem; margin: 1.7rem 0 0; padding: 1.15rem 1.25rem; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.availability li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; color: var(--ink-soft); font-size: .92rem; font-weight: 600; }
.availability li span { color: var(--ink); font-weight: 750; }
.availability li b { color: var(--dark); font-weight: 650; }
.availability li.on { padding-left: .8rem; border-left: 3px solid var(--accent); }
.availability li.on span, .availability li.on b { color: var(--ink); }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: calc(28% - 1px); top: 1rem; bottom: 1rem; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 28% 1fr; margin-bottom: 1.5rem; }
.timeline-item::before { content: ""; position: absolute; left: calc(28% - .42rem); top: 2.05rem; width: .8rem; height: .8rem; border: .28rem solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-date { padding: 1.65rem 2.5rem 0 0; }
.timeline-date span { display: block; color: var(--ink-soft); font-size: .9rem; font-weight: 750; }
.timeline-date span:last-child { color: var(--accent); }
.timeline-card { padding: clamp(1.6rem, 4vw, 2.7rem); border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.8); transition: transform .25s, box-shadow .25s, border-color .25s; }
.timeline-card:hover { transform: translateY(-4px); border-color: var(--accent-border); box-shadow: var(--shadow); }
.company { margin-bottom: .45rem; color: var(--accent); font-size: .82rem; font-weight: 820; letter-spacing: .1em; text-transform: uppercase; }
.timeline-card h3 { margin-bottom: 1rem; font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.2; letter-spacing: -.025em; }
.timeline-card > p:last-of-type { margin-bottom: 1.25rem; color: var(--ink-soft); }

.skills-section { width: 100%; max-width: none; padding-inline: max(1rem, calc((100vw - var(--content))/2)); background: var(--dark); color: #fff; }
.skills-section .eyebrow { color: var(--accent-on-dark); }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-lg); overflow: hidden; }
.skill-card { min-height: 190px; padding: 1.8rem; background: var(--dark); }
.skill-card span { display: block; margin-bottom: 2.5rem; color: var(--accent-on-dark); font-size: .78rem; font-weight: 800; }
.skill-card h3 { max-width: 320px; margin: 0; font-size: 1.15rem; line-height: 1.35; }
.skill-card p { margin: .6rem 0 0; color: rgba(255,255,255,.76); font-size: .9rem; }

.education-section .section-heading { margin-bottom: 1.5rem; }
.education-list { margin-left: 32%; }
.education-item { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.education-item:last-child { border-bottom: 1px solid var(--line); }
.education-year { color: var(--accent); font-size: 1.25rem; font-weight: 800; }
.education-item h3 { margin: 0; font-size: 1.45rem; }
.education-item p { margin: .2rem 0 0; color: var(--ink-soft); }
.education-item .note { color: var(--accent); font-size: .9rem; font-weight: 650; }

.courses-block { margin-left: 32%; margin-top: 2.2rem; }
.courses-title { margin: 0 0 .9rem; color: var(--ink-soft); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.courses-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.courses-list li { position: relative; padding-left: 1.05rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.5; }
.courses-list li::before { content: "•"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.courses-list .c-year { color: var(--accent); font-weight: 800; }
.courses-list .c-org { color: var(--ink-soft); }

.contact-panel { width: min(calc(100% - 2rem), var(--content)); margin: 1rem auto clamp(4rem, 8vw, 7rem); padding: clamp(2.2rem, 5vw, 4.5rem); display: flex; justify-content: space-between; align-items: end; gap: 2rem; color: #fff; background: var(--accent); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(234,88,12,.2); }
.contact-panel .eyebrow { color: rgba(255,255,255,.82); }
.contact-panel h2 { font-size: clamp(2.7rem, 6vw, 5.6rem); }
.contact-panel p:last-child { margin: .85rem 0 0; color: rgba(255,255,255,.88); }
.contact-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .9rem; }
.button-light { color: var(--accent); background: #fff; border-color: #fff; box-shadow: none; }
.button-light:hover { color: #fff; background: var(--dark); border-color: var(--dark); }
.contact-phone { color: #fff; text-decoration: none; font-weight: 750; }
footer { width: min(calc(100% - 2rem), var(--content)); margin: 0 auto; padding: 1.5rem 0 2.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: .9rem; }
footer p { margin: 0; }
footer a { text-decoration: none; font-weight: 700; }
footer a.cvgo { color: var(--accent); }

/* Animación de aparición: SIN JavaScript todo es visible (la clase .js la pone main.js) */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.7,.2,1); }
.js .reveal.visible { opacity: 1; transform: none; }
.skills-grid .reveal:nth-child(2), .hero-grid .reveal:nth-child(2) { transition-delay: .08s; }
.skills-grid .reveal:nth-child(3) { transition-delay: .16s; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .hero-grid { grid-template-columns: 128px 1fr; gap: 1.75rem; }
  .portrait-wrap, .portrait { width: 116px; height: 116px; }
  h1 { font-size: clamp(2.8rem, 7.8vw, 4.6rem); }
  .section-heading { grid-template-columns: 1fr; gap: .5rem; }
  .profile-card, .education-list, .courses-block { margin-left: 0; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  body { line-height: 1.55; }
  .site-header { width: calc(100% - 1rem); margin-top: .5rem; }
  .brand > span:last-child { display: none; }
  .hero { padding-top: 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-wrap, .portrait { width: 104px; height: 104px; }
  h1 { font-size: clamp(2.75rem, 14vw, 4.3rem); }
  .contact-list { flex-direction: column; align-items: flex-start; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div + div { border-left: 0; border-top: 1px solid var(--line); }
  .section { padding-block: 4rem; }
  .profile-card { padding: 1.6rem; border-radius: 1.25rem; }
  .timeline::before { left: .4rem; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 1.8rem; }
  .timeline-item::before { left: 0; top: .55rem; }
  .timeline-date { padding: 0 0 .8rem; }
  .timeline-date span { display: inline; }
  .timeline-date span + span::before { content: " — "; }
  .skills-grid { grid-template-columns: 1fr; }
  .skill-card { min-height: 0; }
  .skill-card span { margin-bottom: 1.5rem; }
  .education-item { grid-template-columns: 1fr; gap: .25rem; }
  .contact-panel { align-items: flex-start; flex-direction: column; }
  .contact-actions { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-actions, .contact-panel, footer { display: none; }
  body { background: #fff; }
  .reveal { opacity: 1; transform: none; }
  .hero, .section { width: 100%; padding: 1rem 0; }
}
