/* ============================================================
   CV — Alejandro López Balderas
   Sistema: minimalista moderno · acento verde · mucho aire
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* Neutros — blancos/negros muy ligeramente fríos */
  --bg:        oklch(0.991 0.002 150);
  --bg-2:      oklch(0.965 0.004 150);
  --surface:   oklch(1 0 0);
  --ink:       oklch(0.22 0.012 160);
  --ink-soft:  oklch(0.44 0.012 160);
  --ink-faint: oklch(0.60 0.010 160);
  --line:      oklch(0.90 0.006 160);
  --line-soft: oklch(0.94 0.005 160);

  /* Acento verde sofisticado */
  --accent:        oklch(0.585 0.115 158);
  --accent-deep:   oklch(0.48 0.10 159);
  --accent-tint:   oklch(0.95 0.035 158);
  --accent-tint-2: oklch(0.90 0.05 158);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;

  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 64px);

  --shadow-sm: 0 1px 2px oklch(0.4 0.02 160 / 0.04), 0 2px 8px oklch(0.4 0.02 160 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.4 0.02 160 / 0.07), 0 12px 32px oklch(0.4 0.02 160 / 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Idioma: mostrar solo el activo */
[data-lang="es"] .en { display: none !important; }
[data-lang="en"] .es { display: none !important; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Tipografía utilitaria ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1.5px;
  background: var(--accent);
  display: inline-block;
}

h2.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 14px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: oklch(0.991 0.002 150 / 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; gap: 18px;
}
.monogram {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 9px;
}
.monogram .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--accent); transition: width .25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-tools { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--surface);
}
.lang-toggle button {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  border: 0; background: transparent; color: var(--ink-faint);
  padding: 6px 12px; cursor: pointer; transition: color .2s, background .2s;
}
.lang-toggle button.active { background: var(--ink); color: var(--bg); }

.btn {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  transition: transform .15s ease, box-shadow .2s ease, background .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: oklch(0.99 0.01 158); }
.btn.accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-grid {
  display: grid; grid-template-columns: 1fr auto; gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.hero-eyebrow-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 7.5vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 22px 0 0;
}
.hero h1 .accent-word { color: var(--accent); }
.hero-role {
  font-size: clamp(18px, 2.4vw, 23px);
  font-weight: 500; color: var(--ink-soft);
  margin-top: 18px; line-height: 1.35;
}
.hero-role b { color: var(--ink); font-weight: 600; }
.hero-intro {
  margin-top: 22px; max-width: 46ch; color: var(--ink-soft);
  font-size: 17px; line-height: 1.65; text-wrap: pretty;
}
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

.hero-photo-wrap { position: relative; }
.hero-photo {
  display: block;
  width: clamp(200px, 26vw, 280px);
  height: clamp(240px, 32vw, 340px);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.photo-badge {
  position: absolute; bottom: -14px; left: -14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600;
}
.photo-badge .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.585 0.115 158 / 0.5); }
  70% { box-shadow: 0 0 0 9px oklch(0.585 0.115 158 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.585 0.115 158 / 0); }
}

/* contact chips */
.contact-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px; transition: all .2s;
}
.chip svg { width: 15px; height: 15px; color: var(--accent-deep); flex: none; }
a.chip:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }

/* ============================================================
   STATS BAND
   ============================================================ */
.stats {
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: var(--maxw); margin: 0 auto;
}
.stat {
  padding: clamp(28px, 4vw, 44px) var(--pad);
  text-align: center; border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat .num {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 6vw, 60px); line-height: 1;
  letter-spacing: -0.03em; color: var(--ink);
  display: inline-flex; align-items: baseline;
}
.stat .num .suffix { color: var(--accent); }
.stat .label {
  margin-top: 10px; font-size: 14px; font-weight: 500;
  color: var(--ink-faint); letter-spacing: 0.01em;
}

/* ============================================================
   SECTION shell
   ============================================================ */
section.block { padding-block: clamp(56px, 8vw, 104px); }
.block-head { max-width: 60ch; margin-bottom: clamp(32px, 5vw, 56px); }
.block-head p.lead {
  margin-top: 18px; color: var(--ink-soft); font-size: 18px;
  line-height: 1.6; text-wrap: pretty;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 64px); align-items: start; }
.about-body p { color: var(--ink-soft); font-size: 17.5px; line-height: 1.7; margin-top: 16px; max-width: 52ch; }
.about-body p:first-child { margin-top: 0; }
.about-body strong { color: var(--ink); font-weight: 600; }
.pull {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 22px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(19px, 2.6vw, 24px); line-height: 1.4;
  letter-spacing: -0.01em; color: var(--ink);
  text-wrap: balance;
}

/* ---------- Capabilities cards ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.cap:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-tint-2); }
.cap-ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-tint); color: var(--accent-deep);
  display: grid; place-items: center; margin-bottom: 18px;
}
.cap-ico svg { width: 22px; height: 22px; }
.cap h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.cap p { margin-top: 9px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }

/* ---------- Skills ---------- */
.skill-cluster { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 44px); }
.skill-group h4 {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.skill-group h4::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  font-size: 14.5px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 10px; transition: all .2s;
}
.tag:hover { border-color: var(--accent); background: var(--accent-tint); }
.tag.primary { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-deep); font-weight: 600; }

/* ---------- Personal / intereses ---------- */
.interest-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.interest {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 12px 18px 12px 12px; border-radius: 14px;
  font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.interest:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-tint-2); }
.interest .ico {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--accent-tint); color: var(--accent-deep);
  display: grid; place-items: center;
}
.interest .ico svg { width: 20px; height: 20px; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; }
.tl-item {
  display: grid; grid-template-columns: 180px 1fr; gap: clamp(20px, 4vw, 48px);
  padding-bottom: 48px; position: relative;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-when { padding-top: 4px; }
.tl-when .range { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.tl-when .dur { font-size: 13.5px; color: var(--ink-faint); margin-top: 3px; }
.tl-when .place { font-size: 13.5px; color: var(--ink-faint); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.tl-when .place svg { width: 13px; height: 13px; }
.tl-body { position: relative; padding-left: 30px; border-left: 1px solid var(--line); padding-bottom: 4px; }
.tl-body::before {
  content: ""; position: absolute; left: -6.5px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--accent);
}
.tl-item.current .tl-body::before { background: var(--accent); }
.tl-role { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.tl-org { font-size: 15.5px; font-weight: 600; color: var(--accent-deep); margin-top: 3px; }
.tl-desc { color: var(--ink-soft); font-size: 16px; line-height: 1.62; margin-top: 14px; max-width: 56ch; }
.tl-points { list-style: none; margin-top: 14px; display: grid; gap: 9px; }
.tl-points li { position: relative; padding-left: 22px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }
.tl-points li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--accent);
}
.tl-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tl-chips span {
  font-family: var(--font-display); font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft); background: var(--bg-2); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 7px;
}

/* ---------- Education + meta two-col ---------- */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 6vw, 72px); align-items: start; }
.edu-list { display: grid; gap: 4px; }
.edu {
  display: grid; gap: 4px; padding: 22px 0; border-top: 1px solid var(--line);
}
.edu:first-child { border-top: 0; padding-top: 0; }
.edu .deg { font-family: var(--font-display); font-weight: 600; font-size: 17.5px; letter-spacing: -0.01em; }
.edu .inst { font-size: 15px; color: var(--accent-deep); font-weight: 600; }
.edu .yr { font-size: 14px; color: var(--ink-faint); }

.meta-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px;
}
.meta-card + .meta-card { margin-top: 18px; }
.meta-card h4 {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 16px;
}
.lang-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.lang-row:first-of-type { border-top: 0; padding-top: 0; }
.lang-row .name { font-weight: 600; font-size: 15.5px; }
.lang-row .lvl { font-size: 13.5px; color: var(--ink-faint); font-family: var(--font-display); }
.lang-dots { display: inline-flex; gap: 4px; margin-left: 10px; }
.lang-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.lang-dots i.on { background: var(--accent); }
.cert { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.cert:first-of-type { border-top: 0; padding-top: 0; }
.cert svg { width: 18px; height: 18px; color: var(--accent-deep); flex: none; margin-top: 2px; }
.cert span { font-size: 14.5px; color: var(--ink); line-height: 1.45; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { background: var(--ink); color: var(--bg); padding-block: clamp(64px, 9vw, 112px); }
.contact .eyebrow { color: oklch(0.78 0.09 158); }
.contact .eyebrow::before { background: var(--accent); }
.contact h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 6vw, 64px); letter-spacing: -0.03em; line-height: 1.02;
  margin-top: 16px;
}
.contact h2 .accent-word { color: oklch(0.78 0.11 158); }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.clink {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 500;
  background: oklch(1 0 0 / 0.06); border: 1px solid oklch(1 0 0 / 0.14);
  padding: 13px 20px; border-radius: 12px; transition: all .2s;
}
.clink svg { width: 18px; height: 18px; color: oklch(0.82 0.1 158); }
.clink:hover { background: oklch(1 0 0 / 0.12); transform: translateY(-2px); border-color: oklch(1 0 0 / 0.3); }
.foot-note {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid oklch(1 0 0 / 0.12);
  font-size: 13.5px; color: oklch(0.72 0.01 160); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ============================================================
   Scroll reveal
   ============================================================ */
/* Visible por defecto — la animación es puramente aditiva, nunca puede
   dejar el contenido atascado en invisible (importante para captura/print). */
.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  /* Solo cuando JS confirma que puede animar (clase en <html>) ocultamos
     y dejamos que .in lo traiga de vuelta con transición. */
  html.anim .reveal { opacity: 0; transform: translateY(22px);
    transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
  html.anim .reveal.in { opacity: 1; transform: none; }
  html.anim .reveal.d1 { transition-delay: .07s; }
  html.anim .reveal.d2 { transition-delay: .14s; }
  html.anim .reveal.d3 { transition-delay: .21s; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo-wrap { order: -1; }
  .hero-photo { width: 150px; height: 180px; }
  .about-grid, .cap-grid, .skill-cluster, .split { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-body { padding-bottom: 0; }
  .nav-links { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
}
@media (max-width: 540px) {
  .lang-toggle { order: 3; }
  .nav-inner { flex-wrap: wrap; gap: 12px; }
}

/* ============================================================
   PRINT  →  PDF FIEL A LA WEB
   A4 apaisado + colores exactos para conservar la maquetación
   de escritorio (fondos, verde, sección de contacto oscura…).
   ============================================================ */
@media print {
  @page { size: A4 landscape; margin: 0; }

  /* Forzar que los fondos y colores se impriman tal cual */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html { font-size: 13.5px; }
  body { background: var(--bg); color: var(--ink); }

  /* Solo ocultamos los controles interactivos, nada del diseño */
  .nav, .hero-cta, .lang-toggle, .nav-tools, #pdf-fab { display: none !important; }

  /* El contenido siempre visible (sin estados de animación) */
  .reveal, html.anim .reveal { opacity: 1 !important; transform: none !important; }

  /* Márgenes laterales internos para que respire sin perder el sangrado */
  .wrap, .nav-inner, .stats-grid { padding-inline: 12mm !important; }
  :root { --maxw: 100%; }

  /* Ritmo vertical algo más compacto para aprovechar la página */
  .hero { padding: 14mm 0 8mm !important; }
  section.block { padding-block: 12mm !important; }
  .stats { padding-block: 0 !important; }
  .stat { padding-block: 9mm !important; }
  .contact { padding-block: 14mm !important; }

  /* Evitar cortes feos a mitad de un bloque */
  .hero-grid, .stat, .cap, .tl-item, .edu, .meta-card,
  .pull, .block-head, .lang-row, .cert, .foot-note { break-inside: avoid; }
  .block-head { break-after: avoid; }
  #contact { break-inside: avoid; }

  /* Sombras suaves -> fuera (se imprimen como cajas grises) */
  .cap, .meta-card, .hero-photo, .chip, .photo-badge { box-shadow: none !important; }

  a { text-decoration: none; color: inherit; }
}
