/* ==========================================================================
   slednik security — estilos principales
   Índice:
     1. Tokens (colores, tipografía, espaciado) — tema claro y oscuro
     2. Base y utilidades
     3. Header, navegación, selector de idioma y de tema
     4. Componentes (botones, chips, regla, tarjetas, toast)
     5. Página About (hero, historia, radar, ahora)
     6. Blog y Writeups (listas, filtros)
     7. Artículo (post.html)
     8. Contacto
     9. Footer
    10. Animaciones y responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #f4f3ef;
  --surface: #fbfaf7;
  --surface-2: #ebe9e3;
  --ink: #15171c;
  --ink-2: #3b3f48;
  --muted: #696d76;
  --line: #d9d7cf;
  --line-strong: #b9b6ac;
  --accent: #d94a14;
  --accent-ink: #ffffff;
  --accent-soft: rgba(217, 74, 20, 0.1);
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);
  --header-bg: rgba(244, 243, 239, 0.82);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0e1013;
  --surface: #15181d;
  --surface-2: #1d2128;
  --ink: #ecebe6;
  --ink-2: #c4c5c9;
  --muted: #8d929b;
  --line: #262a32;
  --line-strong: #3a3f49;
  --accent: #ff6a2b;
  --accent-ink: #0e1013;
  --accent-soft: rgba(255, 106, 43, 0.13);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(14, 16, 19, 0.8);
  color-scheme: dark;
}

/* Sin JavaScript: respetar la preferencia del sistema */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0e1013; --surface: #15181d; --surface-2: #1d2128; --ink: #ecebe6; --ink-2: #c4c5c9;
    --muted: #8d929b; --line: #262a32; --line-strong: #3a3f49; --accent: #ff6a2b; --accent-ink: #0e1013;
    --accent-soft: rgba(255, 106, 43, 0.13); --header-bg: rgba(14, 16, 19, 0.8); color-scheme: dark;
  }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
#site-header { min-height: 69px; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg);
  padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* Mientras se aplica un idioma distinto al del HTML, evitamos el parpadeo de texto */
html.i18n-pending body { visibility: hidden; animation: i18n-failsafe 0s 1.2s forwards; }
@keyframes i18n-failsafe { to { visibility: visible; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1.25rem;
}
.eyebrow::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none;
}

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { display: grid; gap: .5rem; margin-bottom: clamp(32px, 5vw, 56px); max-width: 720px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0; }
.section-head p { color: var(--ink-2); margin: 0; }
.section-index { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); letter-spacing: .06em; }

.page-hero { padding: clamp(56px, 8vw, 104px) 0 clamp(32px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: 16ch; }
.page-hero .trail { margin: 32px 0; max-width: 480px; }
.page-hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }

/* 3. Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 7px; }
/* En modo oscuro, un borde sutil separa el ícono (fondo oscuro) del header */
html[data-theme='dark'] .brand-mark { box-shadow: 0 0 0 1px var(--line-strong); }
.brand-name { font-family: var(--font-mono); font-size: 1.02rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-suffix { font-weight: 400; color: var(--muted); }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; text-decoration: none; font-size: .95rem; color: var(--ink-2);
  padding: 8px 12px; border-radius: var(--radius-sm); transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page']::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.controls { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
}
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 9px; border-radius: 999px; font-family: var(--font-mono); font-size: .72rem;
  color: var(--muted); letter-spacing: .04em; transition: background-color .15s, color .15s;
}
.lang-btn img {
  width: 20px; height: 14px; object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); filter: saturate(.85);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.lang-btn[aria-pressed='true'] img { filter: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
html[data-theme='dark'] .theme-toggle .i-sun { display: block; }
html[data-theme='dark'] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }

/* 4. Componentes ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; transition: transform .2s; }
.btn:hover svg { transform: translateX(3px); }
.btn:hover svg.i-down { transform: translateY(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .74rem;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
  background: var(--surface); white-space: nowrap;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }

/* Rastro: línea de puntos que termina en un objetivo (motivo de la marca) */
.trail {
  position: relative; height: 14px; width: 100%;
  background-image: radial-gradient(circle, var(--line-strong) 1.6px, transparent 2.2px);
  background-size: 12px 14px;
  background-repeat: repeat-x;
  background-position: left center;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.35), #000 40%);
  mask-image: linear-gradient(to right, rgba(0,0,0,.35), #000 40%);
}
.trail::after {
  content: ''; position: absolute; right: 0; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); transform: translateY(-50%); box-shadow: 0 0 0 4px var(--accent-soft);
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  background: var(--ink); color: var(--bg); border-radius: 999px; font-size: .95rem; font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s;
  max-width: calc(100vw - 32px);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast-icon {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); flex: none;
}
.toast-icon svg { width: 14px; height: 14px; }

/* 5. About ----------------------------------------------------------------- */
/* Perfil: foto a la izquierda, presentación a la derecha */
.profile { padding: clamp(48px, 7vw, 96px) 0 0; }
/* Sobre mí: secciones más compactas (menos aire entre Recorrido, Capacidades y Certificaciones) */
body[data-page='about'] .section { padding: clamp(32px, 4vw, 40px) 0; }
body[data-page='about'] .chapter:last-child { padding-bottom: 0; }
body[data-page='about'] #certificaciones { padding-bottom: clamp(48px, 6vw, 72px); }
.profile-text .btn-row { margin-top: 1.8rem; }
.profile-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.profile-text h1 { font-size: clamp(3rem, 7.5vw, 5.4rem); letter-spacing: -0.05em; margin-bottom: .15em; }
.profile-text .tagline { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 650; letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 1.4rem; color: var(--ink); }
.profile-text .tagline .accent, .accent { color: var(--accent); }
.profile-text > p:not(.eyebrow):not(.tagline) { color: var(--ink-2); max-width: 62ch; }

.portrait { margin: 0; display: grid; gap: 12px; position: sticky; top: 96px; }
.portrait-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.portrait-empty {
  position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 12px;
  color: var(--muted); font-family: var(--font-mono); font-size: .8rem; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: inherit;
}
.portrait-empty svg { width: 64px; height: 64px; color: var(--accent); }
.portrait-empty svg circle:last-child { fill: currentColor; }
.portrait.is-empty img { display: none; }
.portrait.is-empty .portrait-empty { display: grid; }
[id] { scroll-margin-top: 90px; }

/* Recorrido: capítulos con número fijo a la izquierda */
.story { position: relative; }
.chapter {
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 64px);
  padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); position: relative;
}
.chapter-meta { position: relative; }
.chapter-meta-inner { position: sticky; top: 100px; display: grid; gap: 6px; }
.chapter-num {
  font-family: var(--font-mono); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 300; line-height: 1;
  color: var(--line-strong); letter-spacing: -0.04em; transition: color .4s;
}
.chapter.is-visible .chapter-num { color: var(--accent); }
.chapter-label { font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.chapter-body h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 22ch; }
.chapter-body p { color: var(--ink-2); max-width: 62ch; }
.chapter-body p strong { color: var(--ink); font-weight: 600; }
.chapter-body .chip-list { margin-top: 1.25rem; }
.pullquote {
  margin: 1.5rem 0 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent);
  font-size: 1.15rem; font-weight: 500; color: var(--ink); max-width: 52ch;
}

/* Radar */
.skills-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.radar-wrap { padding: clamp(12px, 3vw, 28px); }
.radar { width: 100%; height: auto; overflow: visible; }
.radar .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .ring-outer { stroke: var(--line-strong); }
.radar .axis { stroke: var(--line); stroke-width: 1; }
.radar .area {
  fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round;
  transform-origin: center; transform-box: view-box; transform: scale(0.05); opacity: 0;
  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity .6s;
}
.radar.is-drawn .area { transform: scale(1); opacity: 1; }
.radar .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .4s .8s, r .15s; }
.radar.is-drawn .pt { opacity: 1; }
.radar .pt.is-active { r: 6; fill: var(--accent); }
.radar .lbl { font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; fill: var(--ink-2); }
.radar .lbl.is-active { fill: var(--accent); }
.radar .lbl-num { display: none; font-family: var(--font-mono); font-size: 22px; font-weight: 600; fill: var(--ink-2); }
.radar .lbl-num.is-active { fill: var(--accent); }
.radar .lvl { font-family: var(--font-mono); font-size: 9.5px; fill: var(--muted); }

.skill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.skill-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: default; transition: background-color .15s; }
.skill-item:hover, .skill-item.is-active { background: var(--surface-2); }
.skill-name { font-weight: 600; font-size: .95rem; }
.skill-idx { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-right: 10px; font-weight: 500; }
.skill-val { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.skill-bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.skill-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.skill-note { font-size: .82rem; color: var(--muted); margin-top: 14px; }

/* Certificaciones */
.cert-groups { display: grid; gap: clamp(32px, 4vw, 44px); }
.cert-group-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.15rem; letter-spacing: -0.01em;
}
.cert-count { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.cert-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cert-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; padding: 20px; transition: border-color .2s, transform .2s; }
.cert-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cert-text { min-width: 0; }
.cert-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; margin: 0; }
.cert-full { color: var(--ink-2); font-size: .9rem; margin: 2px 0 8px; line-height: 1.4; }
.cert-meta { display: block; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.cert-link { display: inline-block; margin-top: 10px; font-size: .84rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.cert-link:hover { text-decoration: underline; }
/* Ícono: badge oficial sobre una ficha clara (se ve bien en ambos temas) */
.cert-badge {
  display: grid; place-items: center; width: 64px; height: 64px; padding: 5px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
}
.cert-badge img { width: 100%; height: 100%; object-fit: contain; }
/* Ícono sin badge: sello con siglas */
.cert-seal {
  position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--line-strong); overflow: hidden;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--ink);
}
.cert-seal::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); }

/* Cierre */
.cta-band { padding: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-band h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: 0 0 .3em; max-width: 20ch; }
.cta-band p { color: var(--ink-2); margin: 0; max-width: 56ch; }

/* 6. Blog y writeups ------------------------------------------------------- */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-row { border-bottom: 1px solid var(--line); }
.post-row a {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 28px 8px; text-decoration: none;
  transition: background-color .15s; border-radius: 6px;
}
.post-row a:hover { background: var(--surface); }
.post-row a:hover h2 { color: var(--accent); }
.post-date { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); padding-top: 6px; }
.post-row h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin: 0 0 .35em; transition: color .15s; letter-spacing: -0.02em; }
.post-row p { margin: 0 0 .8em; color: var(--ink-2); font-size: .98rem; max-width: 64ch; }
.post-read { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); padding-top: 6px; white-space: nowrap; }

.toolbar { display: grid; gap: 18px; margin-bottom: 28px; }
.search {
  display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; max-width: 460px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: .98rem; min-width: 0; }
.search input::placeholder { color: var(--muted); }

.tag-filter { display: grid; gap: 10px; }
.tag-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tag-filter-head span { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tag-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: .8rem;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.tag-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.tag-btn .count { font-size: .7rem; color: var(--muted); }
.tag-btn[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tag-btn[aria-pressed='true'] .count { color: inherit; opacity: .7; }
.tag-btn::before { content: '#'; opacity: .5; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }
.result-count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 0 0 16px; }

.wu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.wu-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: border-color .15s, transform .2s; }
.wu-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.wu-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.diff { display: inline-flex; align-items: center; gap: 6px; }
.diff i { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.diff[data-level='easy'] i:nth-child(-n+1),
.diff[data-level='medium'] i:nth-child(-n+2),
.diff[data-level='hard'] i:nth-child(-n+3),
.diff[data-level='insane'] i { background: var(--accent); }
.wu-card h2 { font-size: 1.25rem; margin: 0; letter-spacing: -0.02em; }
.wu-card h2 a { text-decoration: none; }
.wu-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.wu-card h2 a:hover { color: var(--accent); }
.wu-card p { color: var(--ink-2); font-size: .95rem; margin: 0; flex: 1; }
.wu-card .chip-list { position: relative; z-index: 1; }
.wu-card .chip { cursor: pointer; }
.wu-card .chip:hover { border-color: var(--accent); color: var(--accent); }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* 7. Artículo --------------------------------------------------------------- */
.article { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 100px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); text-decoration: none; margin-bottom: 32px; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 14px; height: 14px; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.035em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 18px 0 8px; }
.article-head .chip-list { margin-top: 14px; }
.article-head .trail { margin: 32px 0 40px; }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: .92rem; margin-bottom: 28px; }

.prose { font-size: 1.075rem; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 1.6rem; margin: 2em 0 .2em; }
.prose h3 { font-size: 1.25rem; margin: 1.7em 0 .2em; }
.prose a { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose code { font-family: var(--font-mono); font-size: .86em; padding: .15em .4em; border-radius: 5px; background: var(--surface-2); }
.prose pre {
  font-family: var(--font-mono); font-size: .86rem; line-height: 1.6; padding: 18px 20px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { display: block; margin-inline: auto; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }.prose hr { border: 0; height: 14px; background-image: radial-gradient(circle, var(--line-strong) 1.6px, transparent 2.2px); background-size: 12px 14px; background-repeat: repeat-x; background-position: left center; margin: 2.5em 0; }
.prose .center { text-align: center; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* 8. Contacto -------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.contact-card {
  display: flex; flex-direction: column; gap: 18px; padding: 26px; text-align: left; text-decoration: none;
  cursor: pointer; transition: border-color .2s, transform .2s; width: 100%;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.contact-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface-2); color: var(--ink); transition: background-color .2s, color .2s;
}
.contact-card:hover .contact-icon { background: var(--accent); color: var(--accent-ink); }
.contact-icon svg { width: 24px; height: 24px; }
.contact-text { display: grid; gap: 4px; }
.contact-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.contact-desc { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.contact-action { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .78rem; color: var(--ink-2); }
.contact-action svg { width: 14px; height: 14px; }
.contact-note { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--muted); font-size: .92rem; }
.contact-note span { display: inline-flex; align-items: center; gap: 8px; }
.contact-note svg { width: 16px; height: 16px; color: var(--accent); }

/* 9. Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid p { color: var(--muted); font-size: .92rem; max-width: 40ch; margin-top: 14px; }
.footer-grid h2 { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid ul a { text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.footer-grid ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }

/* 10. Animaciones y responsive -------------------------------------------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
html.js .reveal-delay-1 { transition-delay: .08s; }
html.js .reveal-delay-2 { transition-delay: .16s; }
html.js .reveal-delay-3 { transition-delay: .24s; }

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

@media (max-width: 960px) {
  .skills-grid, .profile-grid { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 260px; }
  .contact-grid, .cert-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .cta-band { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .menu-toggle { display: inline-grid; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.05rem; }
  .nav a:hover { background: transparent; }
  .nav a[aria-current='page']::after { left: auto; right: 4px; top: 50%; bottom: auto; width: 8px; height: 8px; border-radius: 2px; transform: translateY(-50%); }
  .controls { margin-left: auto; }
  .chapter { grid-template-columns: 1fr; gap: 16px; }
  .chapter-meta-inner { position: static; display: flex; align-items: baseline; gap: 14px; }
  .wu-grid { grid-template-columns: 1fr; }
  .post-row a { grid-template-columns: 1fr; gap: 6px; padding: 24px 4px; }
  .post-date, .post-read { padding-top: 0; }
  .post-read { order: 3; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .header-inner { gap: 10px; }
  .brand-suffix { display: none; }
  .lang-btn { padding: 5px 7px; }
  .lang-btn span { display: none; }
  .contact-grid, .footer-grid, .cert-grid { grid-template-columns: 1fr; }
  .toast { bottom: 18px; }
  .radar .lbl { display: none; }
  .radar .lbl-num { display: block; }
}
