/* ==========================================================================
   Ana María Vaduva Serban — hoja de estilos
   Estilo editorial: serif clásica + marfil / azul marino / burdeos
   ========================================================================== */

/* ---------- Fuentes autoalojadas (sin peticiones a terceros) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f8f6f1;
  --surface: #efebe3;
  --surface-2: #ffffff;
  --ink: #14243b;
  --text: #2a2f38;
  --muted: #5a5f68;
  --rule: #dcd6cb;
  --accent: #7d6026;
  --accent-soft: #efe6d3;
  --footer-bg: #14243b;
  --footer-ink: #efebe3;
  --footer-muted: #b7bfcb;
  --focus: #7d6026;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1.03rem, 1rem + 0.15vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.45rem + 0.75vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.8rem + 1.5vw, 3.1rem);
  --step-4: clamp(2.9rem, 2.2rem + 3.4vw, 5.4rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: clamp(4.5rem, 3rem + 6vw, 8rem);

  --radius: 4px;
  --maxw: 72rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151d;
    --surface: #161d28;
    --surface-2: #1b2431;
    --ink: #eef0f3;
    --text: #d6dae0;
    --muted: #a3abb7;
    --rule: #2c3644;
    --accent: #c9a96a;
    --accent-soft: #2a2418;
    --footer-bg: #0b0f15;
    --footer-ink: #eef0f3;
    --footer-muted: #98a1ae;
    --focus: #c9a96a;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.skip-link {
  position: absolute; left: var(--space-3); top: -10rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: var(--space-2) var(--space-3);
  text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--ink); border-radius: 50%;
  font-family: var(--serif); font-style: italic; font-size: 1.15rem; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1;
}
.brand-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }

.nav { display: flex; align-items: center; gap: var(--space-4); }
.nav-list { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.nav-list a {
  color: var(--text); text-decoration: none; font-size: var(--step--1);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  padding-block: 0.4rem; position: relative;
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-list a:hover::after, .nav-list a[aria-current="true"]::after { transform: scaleX(1); }
.nav-list a[aria-current="true"] { color: var(--accent); }

.lang-switch {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.75rem;
}
.lang-switch:hover { border-color: var(--ink); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink); padding: 0.45rem 0.6rem; cursor: pointer; font: inherit;
  font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-toggle-bars { display: inline-block; width: 1.1rem; vertical-align: middle; margin-right: 0.35rem; }
.nav-toggle-bars span { display: block; height: 1px; background: currentColor; margin: 4px 0; transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child { transform: translateY(2.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child { transform: translateY(-2.5px) rotate(-45deg); }

@media (max-width: 52rem) {
  .brand-name { display: none; }
  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .nav-list {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: var(--space-2) var(--gutter) var(--space-4);
    display: none;
  }
  .js .nav-list.is-open { display: flex; }
  .js .nav-list a { display: block; padding-block: 0.85rem; border-bottom: 1px solid var(--rule); }
  .js .nav-list a::after { display: none; }
  .nav-list { flex-wrap: wrap; gap: var(--space-3); }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: inherit; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.9rem 1.5rem; border-radius: var(--radius); text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 7rem) var(--space-7); position: relative; }
.hero-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-4);
}
.eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; }
.hero h1 { font-size: var(--step-4); font-weight: 400; line-height: 0.98; letter-spacing: -0.02em; }
.hero h1 .line { display: block; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.hero-role {
  font-family: var(--serif); font-size: var(--step-2); color: var(--ink); font-weight: 400;
  margin: var(--space-4) 0 var(--space-3); line-height: 1.25;
}
.hero-lede { max-width: 38rem; color: var(--muted); font-size: var(--step-1); line-height: 1.55; font-weight: 300; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.hero-current {
  margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule);
  display: flex; gap: var(--space-3); align-items: baseline; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--muted);
}
.hero-current strong { color: var(--ink); font-weight: 600; }
.status-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #3f7d5a; display: inline-block;
  box-shadow: 0 0 0 3px color-mix(in srgb, #3f7d5a 22%, transparent);
  transform: translateY(-1px);
}

.portrait { justify-self: center; position: relative; width: min(100%, 22rem); }
.portrait-frame {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  padding: 0.9rem; border: 1px solid var(--rule);
}
.portrait-frame::before {
  content: ""; position: absolute; inset: -1.6rem; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  pointer-events: none;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  filter: saturate(0.92) contrast(1.02);
  background: var(--surface);
}
.portrait-caption {
  position: absolute; right: -0.5rem; bottom: 8%;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.45rem 1rem; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em;
  box-shadow: 0 10px 30px -18px rgba(20, 36, 59, 0.45);
}

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .portrait { order: -1; width: min(62%, 15rem); justify-self: start; margin-left: 1.6rem; margin-top: 1rem; }
  .portrait-caption { right: -2.5rem; }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--space-7); border-top: 1px solid var(--rule); }
.section-alt { background: var(--surface); }
.section-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
}
.section-head { position: relative; }
.section-head .index {
  display: block; font-family: var(--serif); font-style: italic; color: var(--accent);
  font-size: var(--step-1); margin-bottom: var(--space-2);
}
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--muted); margin-top: var(--space-3); font-size: var(--step--1); max-width: 15rem; }
@media (min-width: 52.01rem) { .section-head { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
@media (max-width: 52rem) {
  .section-grid { grid-template-columns: 1fr; }
  .section-head p { max-width: none; }
}

/* Sobre mí */
.prose { max-width: 40rem; }
.prose p:first-child::first-letter {
  font-family: var(--serif); float: left; font-size: 4.2em; line-height: 0.82;
  padding: 0.08em 0.1em 0 0; color: var(--accent); font-weight: 500;
}
.prose .lead { font-family: var(--serif); font-size: var(--step-2); color: var(--ink); line-height: 1.3; font-weight: 400; }
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  margin: var(--space-5) 0 0; padding: 0; list-style: none;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.facts li { padding: var(--space-4) var(--space-3); border-left: 1px solid var(--rule); }
.facts li:first-child { border-left: 0; padding-left: 0; }
.facts .num { display: block; font-family: var(--serif); font-size: var(--step-3); color: var(--ink); line-height: 1; }
.facts .label { display: block; font-size: var(--step--1); color: var(--muted); margin-top: var(--space-2); line-height: 1.35; }
@media (max-width: 40rem) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* Áreas */
.areas {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.area {
  padding: var(--space-4) var(--space-4) var(--space-5) 0;
  border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--space-2) var(--space-3);
}
.area:nth-child(even) { padding-left: var(--space-4); border-left: 1px solid var(--rule); }
.area-num { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: var(--step-1); line-height: 1.2; }
.area h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.25; }
.area p { grid-column: 2; color: var(--muted); margin: 0; font-size: var(--step--1); line-height: 1.6; }
.area-note { margin-top: var(--space-4); font-size: var(--step--1); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.tags li {
  font-size: var(--step--1); padding: 0.25rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--ink); background: var(--surface-2);
}
@media (max-width: 40rem) {
  .areas { grid-template-columns: 1fr; }
  .area:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* Trayectoria */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 9.5rem; top: 0.6rem; bottom: 0.6rem; width: 1px; background: var(--rule);
}
.job { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0 var(--space-5); padding-bottom: var(--space-5); position: relative; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: calc(9.5rem - 4px); top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent);
}
.job.is-current::before { background: var(--accent); }
.job-date { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.5; padding-top: 0.15rem; padding-right: var(--space-3); text-align: right; }
.job-body { padding-left: var(--space-1); }
.job h3 { font-size: var(--step-2); font-weight: 500; }
.job-org { font-weight: 600; color: var(--ink); margin: 0.35rem 0 0.15rem; font-size: var(--step-0); }
.job-meta { font-size: var(--step--1); color: var(--muted); margin-bottom: var(--space-3); }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 0.15rem 0.55rem; border-radius: 999px;
  vertical-align: middle; margin-left: 0.4rem;
}
.job-summary { margin-bottom: var(--space-2); max-width: 42rem; }
.job details { max-width: 42rem; }
.job summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
  padding-block: 0.3rem;
}
.job summary::-webkit-details-marker { display: none; }
.job summary::before { content: "+"; font-size: 1.1rem; line-height: 1; width: 1rem; display: inline-block; transition: transform 0.25s var(--ease); }
.job details[open] summary::before { transform: rotate(45deg); }
.job details ul { margin: var(--space-2) 0 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--step--1); }
.job details li { margin-bottom: 0.4rem; }
.job details li::marker { color: var(--accent); }
@media (max-width: 40rem) {
  .timeline::before { left: 0; }
  .job { grid-template-columns: 1fr; padding-left: var(--space-4); }
  .job::before { left: -4px; }
  .job-date { text-align: left; padding: 0; margin-bottom: var(--space-1); }
  .job-body { padding-left: 0; }
}

/* Formación */
.edu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.edu-item {
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.edu-item:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.edu-year { font-size: var(--step--1); color: var(--accent); font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.edu-item h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.25; }
.edu-inst { color: var(--muted); font-size: var(--step--1); margin: 0; margin-top: auto; }
.edu-item.is-featured { grid-column: 1 / -1; background: var(--ink); border-color: var(--ink); }
.edu-item.is-featured h3, .edu-item.is-featured .edu-inst { color: var(--bg); }
.edu-item.is-featured .edu-year { color: color-mix(in srgb, var(--bg) 78%, var(--accent)); }
@media (prefers-color-scheme: dark) {
  .edu-item.is-featured { background: var(--surface-2); border-color: var(--accent); }
  .edu-item.is-featured h3 { color: var(--ink); }
  .edu-item.is-featured .edu-inst { color: var(--muted); }
  .edu-item.is-featured .edu-year { color: var(--accent); }
}
@media (max-width: 40rem) { .edu { grid-template-columns: 1fr; } }

.membership {
  margin-top: var(--space-5); display: flex; gap: var(--space-4); align-items: center;
  padding: var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius);
}
.membership-seal {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 1px solid var(--accent);
  display: grid; place-items: center; font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.05rem;
}
.membership h3 { font-size: var(--step-1); font-weight: 600; }
.membership p { margin: 0.2rem 0 0; color: var(--muted); font-size: var(--step--1); }

/* Publicaciones */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding-block: var(--space-5); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 5rem 1fr; gap: var(--space-4); }
.pub:first-child { padding-top: 0; }
.pub-year { font-family: var(--serif); font-size: var(--step-3); color: var(--accent); line-height: 1; font-variant-numeric: lining-nums; }
.pub h3 { font-size: var(--step-2); font-weight: 500; font-style: italic; line-height: 1.2; }
.pub-meta { color: var(--muted); font-size: var(--step--1); margin: var(--space-2) 0 var(--space-3); }
.pub-cite { font-size: var(--step--1); color: var(--muted); border-left: 2px solid var(--accent-soft); padding-left: var(--space-3); margin: 0 0 var(--space-3); }
.link-arrow { font-weight: 600; font-size: var(--step--1); letter-spacing: 0.04em; text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; }
.link-arrow:hover { text-decoration: underline; }
@media (max-width: 40rem) { .pub { grid-template-columns: 1fr; gap: var(--space-2); } }

/* Contacto */
.contact { background: var(--ink); color: var(--bg); border-top: 0; }
.contact h2, .contact .section-head .index { color: var(--bg); }
.contact .section-head p { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.contact-lead { font-family: var(--serif); font-size: var(--step-3); line-height: 1.15; max-width: 34rem; margin-bottom: var(--space-5); font-weight: 400; }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent); }
.contact-list li {
  display: grid; grid-template-columns: 8rem 1fr auto; gap: var(--space-3); align-items: center;
  padding-block: var(--space-4); border-bottom: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}
.contact-label { font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 75%, transparent); }
.contact-list a { color: var(--bg); font-size: var(--step-1); text-decoration: none; word-break: break-word; }
.contact-list a:hover { text-decoration: underline; }
.copy-btn {
  font: inherit; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent);
  border-radius: var(--radius); padding: 0.45rem 0.85rem; cursor: pointer;
}
.copy-btn:hover { background: var(--bg); color: var(--ink); }
.contact :focus-visible { outline-color: var(--bg); }
.contact-actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.contact .btn-light { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.contact .btn-light:hover { background: transparent; color: var(--bg); }
.contact .btn-outline-light { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 50%, transparent); }
.contact .btn-outline-light:hover { border-color: var(--bg); }
@media (prefers-color-scheme: dark) {
  .contact { background: var(--surface); color: var(--ink); }
  .contact h2, .contact .section-head .index, .contact-list a, .copy-btn, .contact .btn-outline-light { color: var(--ink); }
  .contact-label, .contact .section-head p { color: var(--muted); }
  .contact-list, .contact-list li { border-color: var(--rule); }
  .copy-btn, .contact .btn-outline-light { border-color: var(--rule); }
  .copy-btn:hover { background: var(--ink); color: var(--bg); }
  .contact .btn-light { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .contact .btn-light:hover { background: transparent; color: var(--ink); }
  .contact :focus-visible { outline-color: var(--focus); }
}
@media (max-width: 40rem) {
  .contact-list li { grid-template-columns: 1fr auto; }
  .contact-label { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-muted); padding-block: var(--space-5); font-size: var(--step--1); }
.contact + .site-footer { border-top: 1px solid color-mix(in srgb, var(--footer-ink) 14%, transparent); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; align-items: center; }
.site-footer a { color: var(--footer-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }

/* ---------- Páginas legales / 404 ---------- */
.page { padding-block: var(--space-6) var(--space-7); }
.page .prose { max-width: 46rem; }
.page .prose p:first-child::first-letter { all: unset; }
.page h1 { font-size: var(--step-3); margin-bottom: var(--space-4); }
.page h2 { font-size: var(--step-2); margin: var(--space-5) 0 var(--space-3); }
.page dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-4); }
.page dt { font-weight: 600; color: var(--ink); }
.page dd { margin: 0; }
@media (max-width: 40rem) { .page dl { grid-template-columns: 1fr; } .page dd { margin-bottom: var(--space-2); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 0.7rem 1.2rem; border-radius: var(--radius);
  font-size: var(--step--1); pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease); z-index: 60;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animación de entrada (solo con JS y sin reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Impresión: la web se convierte en CV ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #14243b; --text: #222; --muted: #444;
    --rule: #ccc; --accent: #7d6026; --accent-soft: #eee;
  }
  html { font-size: 10.5pt; }
  body { background: #fff; color: #222; line-height: 1.45; }
  .site-header, .skip-link, .hero-actions, .contact-actions, .copy-btn, .nav-toggle, .lang-switch,
  .site-footer, .toast, .portrait-caption, .no-print, .job summary, .portrait-frame::before { display: none !important; }
  .print-only { display: block; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  a { color: inherit; text-decoration: none; }
  .container { width: 100%; }
  .hero { padding: 0 0 6mm; }
  .hero-grid { grid-template-columns: 1fr 30mm; gap: 8mm; }
  .portrait { width: 30mm; order: 0; margin: 0; }
  .portrait-frame { padding: 0; border: 0; }
  .hero h1 { font-size: 26pt; line-height: 1.05; }
  .hero h1 .line { display: inline; }
  .hero-role { font-size: 14pt; margin: 2mm 0; }
  .hero-lede { font-size: 10.5pt; color: #333; }
  .hero-current { margin-top: 3mm; padding-top: 2mm; }
  .eyebrow { margin-bottom: 2mm; }
  .section, .section-alt, .contact { padding: 5mm 0; background: #fff; color: #222; border-top: 1px solid #ccc; }
  .section-grid { grid-template-columns: 1fr; gap: 3mm; }
  .section-head { position: static; }
  .section-head .index, .section-head p { display: none; }
  .section-head h2 { font-size: 15pt; color: #14243b !important; }
  .prose { max-width: none; }
  .prose p:first-child::first-letter { all: unset; }
  .prose .lead { font-size: 12pt; }
  .facts { display: none; }
  .areas { display: block; columns: 2; column-gap: 6mm; border-top: 0; }
  .area { padding: 2mm 0; break-inside: avoid; border-left: 0 !important; padding-left: 0 !important; }
  .section-grid > * { min-width: 0; }
  .reveal, .section-grid, .section { display: block; }
  .section-head { margin-bottom: 3mm; }
  .area h3 { font-size: 11pt; }
  .timeline::before, .job::before { display: none; }
  .job { grid-template-columns: 30mm 1fr; gap: 0 4mm; padding: 0 0 3mm; break-inside: avoid; }
  .job-date { text-align: left; }
  .job h3 { font-size: 12pt; }
  .job details > *:not(summary) { display: block !important; }
  .edu { grid-template-columns: 1fr 1fr; gap: 2mm; }
  .edu-item, .edu-item.is-featured { padding: 2.5mm; background: #fff !important; border: 1px solid #ccc; break-inside: avoid; }
  .edu-item.is-featured { grid-column: auto; }
  .edu-item.is-featured h3, .edu-item.is-featured .edu-inst { color: #222 !important; }
  .edu-item.is-featured .edu-year { color: var(--accent) !important; }
  .edu-item h3 { font-size: 10.5pt; }
  .membership { margin-top: 3mm; padding: 2.5mm; }
  .pub { grid-template-columns: 16mm 1fr; padding: 2mm 0; break-inside: avoid; }
  .pub-year { font-size: 16pt; }
  .pub h3 { font-size: 12pt; }
  .contact h2, .contact .section-head .index, .contact-list a { color: #14243b !important; }
  .contact-lead { display: none; }
  .contact-label { color: #444 !important; }
  .contact-list, .contact-list li { border-color: #ccc !important; padding-block: 1.5mm; }
  .contact-list a { font-size: 10.5pt; }
  .contact-list li { grid-template-columns: 30mm 1fr; }
  .job-summary, .job details ul { font-size: 9.5pt; }
  .pub-cite { display: none; }
  .area-note { break-after: avoid; }
  .tags { break-inside: avoid; }
  .tags li { padding: 0.5mm 2mm; }
}

/* Sin JS: ocultar controles que dependen de él */
html:not(.js) [data-print], html:not(.js) [data-copy] { display: none; }

/* Ajustes tras QA visual */
.hero-current { flex-wrap: nowrap; align-items: flex-start; }
.hero-current .status-dot { flex: none; margin-top: 0.45em; transform: none; }
@media (max-width: 40rem) { .prose p:first-child::first-letter { all: unset; } }

/* ==========================================================================
   Experiencia móvil y tableta
   (envuelto en "screen" para no afectar a la versión impresa del CV)
   ========================================================================== */
:root { --gutter: max(clamp(1rem, 0.5rem + 2.5vw, 2.5rem), env(safe-area-inset-left), env(safe-area-inset-right)); }
html { -webkit-tap-highlight-color: transparent; }

@media screen {
  /* Cabecera que se oculta al bajar y reaparece al subir */
  .site-header { transition: border-color 0.3s var(--ease), transform 0.35s var(--ease); }
  .site-header.is-hidden { transform: translateY(-100%); }

  /* Zonas táctiles de al menos 44 px */
  .brand { min-height: 44px; }
  .lang-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .nav-toggle { min-height: 44px; }
  .job summary { min-height: 44px; }
  .link-arrow { min-height: 44px; }
  .copy-btn { min-height: 44px; }
  .contact-list a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn { min-height: 48px; justify-content: center; }
  .btn:active, .copy-btn:active { transform: scale(0.98); }

  /* La letra capital solo en pantallas grandes */
  .prose p:first-child::first-letter { all: unset; }
}
@media screen and (min-width: 64rem) {
  .prose p:first-child::first-letter {
    font-family: var(--serif); float: left; font-size: 4.2em; line-height: 0.82;
    padding: 0.08em 0.1em 0 0; color: var(--accent); font-weight: 500;
  }
}

/* ---------- Tableta (hasta 64rem / 1024px) ---------- */
@media screen and (max-width: 64rem) {
  .section { padding-block: clamp(3.5rem, 2rem + 5vw, 5.5rem); }
  .hero { padding-block: clamp(2rem, 1rem + 4vw, 4rem) clamp(3rem, 2rem + 5vw, 5rem); }
}

/* Tableta vertical: foto a la derecha del nombre */
@media screen and (min-width: 44rem) and (max-width: 52rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-5); }
  .portrait { order: 0; width: min(100%, 15rem); justify-self: end; margin: 0 1.6rem 0 0; }
  .portrait-caption { right: -1rem; }
  .hero-current { flex-wrap: nowrap; }
}

/* Menú a pantalla completa en móvil y tableta vertical */
@media screen and (max-width: 52rem) {
  .js .nav-list {
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    overflow-y: auto; overscroll-behavior: contain;
    padding: var(--space-4) var(--gutter) calc(var(--space-5) + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--rule); border-bottom: 0;
    counter-reset: navitem;
  }
  .js .nav-list.is-open { display: flex; animation: menu-in 0.3s var(--ease); }
  .js .nav-list li { counter-increment: navitem; }
  .js .nav-list a {
    display: flex; align-items: baseline; gap: var(--space-3);
    font-family: var(--serif); font-size: var(--step-2); font-weight: 500;
    text-transform: none; letter-spacing: 0; color: var(--ink);
    padding-block: 0.9rem; border-bottom: 1px solid var(--rule);
  }
  .js .nav-list a::before {
    content: counter(navitem, upper-roman) "."; font-style: italic; font-size: var(--step-0);
    color: var(--accent); min-width: 2.2rem;
  }
  .js .nav-list a[aria-current="true"] { color: var(--accent); }
  html.menu-open, html.menu-open body { overflow: hidden; }
  .section-head p { max-width: 36rem; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Móvil (hasta 44rem / 704px) ---------- */
@media screen and (max-width: 43.99rem) {
  .hero { padding-top: var(--space-4); }
  .hero-grid { gap: var(--space-4); }
  .portrait { width: 8.75rem; margin: 0.9rem 0 0 0.9rem; justify-self: start; }
  .portrait-frame { padding: 0.4rem; }
  .portrait-frame::before { inset: -0.75rem; }
  .portrait-caption { display: none; }
  .eyebrow { margin-bottom: var(--space-3); }
  .hero-role { margin-top: var(--space-3); }
  .hero-lede { font-weight: 400; font-size: var(--step-0); }
  .hero-actions { margin-top: var(--space-4); }
  .hero-actions .btn { flex: 1 1 10rem; }
  .hero-current { margin-top: var(--space-4); }

  .section-grid { gap: var(--space-4); }
  .prose .lead { font-size: var(--step-1); line-height: 1.35; }
  .facts { margin-top: var(--space-4); }
  .facts li { padding: var(--space-3) var(--space-3); }

  .area { grid-template-columns: 2rem 1fr; padding: var(--space-3) 0 var(--space-4); }

  .timeline::before { left: 0; }
  .job { padding-bottom: var(--space-4); }
  .job h3 { font-size: var(--step-1); line-height: 1.2; }
  .job .badge { margin-left: 0.25rem; }

  .edu { gap: var(--space-2); }
  .edu-item { padding: var(--space-3) var(--space-3) var(--space-3); gap: 0.35rem; }
  .membership { padding: var(--space-3); gap: var(--space-3); }

  .pub { padding-block: var(--space-4); }
  .pub h3 { font-size: var(--step-1); }
  .pub-year { font-size: var(--step-2); }
  .link-arrow { word-break: break-word; }

  .contact-lead { font-size: var(--step-2); margin-bottom: var(--space-4); }
  .contact-list li { padding-block: var(--space-3); }
  .contact-actions .btn { flex: 1 1 100%; }
  .site-footer { padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}
@media screen and (max-width: 43.99rem) {
  .hero-actions .btn { flex: 1 1 auto; white-space: nowrap; padding-inline: 1.1rem; letter-spacing: 0.06em; }
}
