:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #000000;
  --muted: #4a5360;
  --border: #dde3ea;
  --accent: #1d5fa8;
  --accent-hover: #123f73;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.container { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }

/* Cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}
.brand { font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--muted); font-size: .95rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav .lang {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .5rem;
  font-size: .85rem;
}

/* Presentación */
.hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 2.5rem 0; }
.hero .container { display: flex; gap: 2rem; align-items: center; }
.hero img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}
.hero h1 { margin: 0 0 .25rem; font-size: 1.9rem; line-height: 1.2; }
.hero .role { margin: 0 0 1rem; color: var(--muted); }
.contact { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.contact li { margin: .15rem 0; }
.contact .label { color: var(--muted); }

/* Secciones */
section { padding: 2.5rem 0 .5rem; }
h2 {
  margin: 0 0 1.25rem;
  padding-bottom: .4rem;
  font-size: 1.6rem;
  border-bottom: 2px solid var(--accent);
}
h3 { margin: 2rem 0 .75rem; font-size: 1.15rem; color: var(--accent); }
h4 { margin: 1.25rem 0 .25rem; font-size: 1rem; }

ul { padding-left: 1.25rem; }
li { margin: .4rem 0; }

/* Cursos y desplegables */
details {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: .75rem 0;
  background: var(--card);
}
details > summary {
  cursor: pointer;
  padding: .6rem 1rem;
  font-weight: 600;
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1.2em; color: var(--accent); }
details[open] > summary::before { content: "▾"; }
details > .body { padding: 0 1rem .5rem; }

.year { font-style: italic; margin: 1.25rem 0 .25rem; font-weight: 600; }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.card .title { font-weight: 600; color: var(--accent); }
.card .desc { display: block; margin-top: .25rem; font-size: .9rem; color: var(--muted); }

/* Currículum */
.entry { margin: 0 0 1rem; }
.entry .meta { color: var(--muted); font-size: .9rem; }
.timeline { border-left: 2px solid var(--border); padding-left: 1.25rem; margin-left: .25rem; }
.timeline .entry { position: relative; }
.timeline .entry::before {
  content: "";
  position: absolute;
  left: -1.7rem;
  top: .55rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when { color: var(--muted); font-size: .9rem; }

/* Pie */
footer { margin-top: 3rem; border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; text-align: center; }

@media (max-width: 40rem) {
  .hero .container { flex-direction: column; text-align: center; }
  .site-header .container { padding-top: .5rem; padding-bottom: .5rem; }
  .site-nav { gap: .75rem; }
}
