/* ============================================================
   ACHIROU · CURSOS — Base + Components
   ============================================================ */

/* ---------- Reset moderno ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
[hidden] { display: none !important; }
.card[hidden] { display: none !important; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
h1 { font-size: var(--fs-4xl); font-weight: 700; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { max-width: 68ch; color: var(--text-muted); }
a { color: var(--link); text-decoration: none; transition: color var(--motion-fast) var(--easing); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
::selection { background: var(--brand-cyan); color: #fff; }

/* ---------- Textura de fondo (atmósfera) ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(42, 183, 230, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(27, 95, 191, 0.08), transparent 60%);
}
:root[data-theme='dark'] body::before,
body::before {
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(42, 183, 230, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(27, 95, 191, 0.08), transparent 60%);
}
:root[data-theme='dark'] body::before {
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(42, 183, 230, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(27, 95, 191, 0.14), transparent 60%);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container.narrow { max-width: var(--container-narrow); }
.container.wide { max-width: var(--container-wide); }

.section { padding-block: clamp(var(--sp-12), 8vw, var(--sp-24)); }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--brand-blue); font-weight: 600;
  padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--brand-cyan) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand-cyan) 25%, transparent);
}
:root[data-theme='dark'] .section-eyebrow { color: var(--brand-cyan); }

.section-title { margin-block: var(--sp-4) var(--sp-3); max-width: 22ch; }
.section-lead { font-size: var(--fs-md); color: var(--text-muted); max-width: 62ch; }

/* Línea de acento con el degradado del logo — firma visual */
.accent-line {
  height: 3px; width: 64px; border-radius: 2px;
  background: var(--brand-gradient);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background var(--motion-fast) var(--easing), border-color var(--motion-fast) var(--easing);
}
.site-header.is-menu-open {
  background: var(--bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom-color: var(--border-strong);
}
.nav {
  display: flex; align-items: center; gap: var(--sp-6);
  height: var(--header-h);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md);
  color: var(--text); letter-spacing: var(--tracking-tight);
}
.nav-brand:hover { color: var(--text); }
.nav-brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--brand-gradient); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.nav-brand-name { display: none; }
@media (min-width: 480px) { .nav-brand-name { display: inline; } }
.nav-brand-name small {
  display: block; font-family: var(--font-mono);
  font-size: 10px; color: var(--text-subtle); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px;
}

.nav-links {
  display: none; list-style: none; padding: 0;
  gap: var(--sp-1); margin-inline-start: auto; align-items: center;
}
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-link {
  color: var(--text-muted); font-weight: 500;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  transition: background var(--motion-fast) var(--easing), color var(--motion-fast) var(--easing);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--text); background: var(--surface-2); }

.nav-actions { margin-inline-start: auto; display: flex; gap: var(--sp-2); align-items: center; }
@media (min-width: 900px) { .nav-actions { margin-inline-start: 0; } }

.theme-toggle, .nav-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-sm); color: var(--text-muted);
  transition: color var(--motion-fast) var(--easing), background var(--motion-fast) var(--easing), border-color var(--motion-fast) var(--easing);
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--text); background: var(--surface-2); }
.nav-toggle {
  display: grid;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
@media (min-width: 900px) { .nav-toggle { display: none; } }
.nav-toggle svg line {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--motion-base) var(--easing), opacity var(--motion-fast) var(--easing);
}
.nav-toggle[aria-expanded="true"] svg line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] svg line:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] svg line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme='light']):not([data-theme='dark']) .theme-toggle .icon-sun { display: block; }
}

/* Menú móvil optimizado */
.mobile-menu {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100dvh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  background-color: var(--bg) !important;
  z-index: var(--z-modal);
  padding: var(--sp-4) var(--sp-5) var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--motion-base) var(--easing),
              transform var(--motion-base) var(--easing),
              visibility var(--motion-base);
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.mobile-menu a:not(.mobile-social-pill) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background var(--motion-fast) var(--easing),
              border-color var(--motion-fast) var(--easing),
              transform var(--motion-fast) var(--easing),
              color var(--motion-fast) var(--easing);
}
.mobile-menu a:not(.mobile-social-pill)::after {
  content: '→';
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-subtle);
  font-weight: 400;
  margin-left: 8px;
  transition: transform var(--motion-fast) var(--easing), color var(--motion-fast) var(--easing);
}
.mobile-menu a:not(.mobile-social-pill):hover,
.mobile-menu a:not(.mobile-social-pill):active {
  background: var(--surface-2);
  border-color: color-mix(in oklab, var(--brand-cyan) 60%, var(--border));
  color: var(--brand-blue);
  transform: translateX(3px);
}
:root[data-theme='dark'] .mobile-menu a:not(.mobile-social-pill):hover,
:root[data-theme='dark'] .mobile-menu a:not(.mobile-social-pill):active {
  color: var(--brand-cyan);
}
.mobile-menu a:not(.mobile-social-pill):hover::after,
.mobile-menu a:not(.mobile-social-pill):active::after {
  color: var(--brand-cyan);
  transform: translateX(3px);
}
.mobile-menu a:not(.mobile-social-pill).is-active {
  background: color-mix(in oklab, var(--brand-blue) 8%, var(--surface));
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  border-left: 4px solid var(--brand-blue);
  font-weight: 700;
}
:root[data-theme='dark'] .mobile-menu a:not(.mobile-social-pill).is-active {
  background: color-mix(in oklab, var(--brand-cyan) 12%, var(--surface));
  border-color: var(--brand-cyan);
  border-left-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;                /* touch target ui-ux-pro-max */
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  cursor: pointer; text-decoration: none;
  transition: background var(--motion-fast) var(--easing),
              color var(--motion-fast) var(--easing),
              border-color var(--motion-fast) var(--easing),
              box-shadow var(--motion-base) var(--easing);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--brand-blue); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, var(--shadow-sm);
}
.btn-primary:hover { background: color-mix(in oklab, var(--brand-blue) 88%, black); color: #fff; box-shadow: var(--shadow-md); }

.btn-cyan {
  background: var(--brand-cyan); color: #06283D;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, var(--shadow-sm);
}
.btn-cyan:hover { background: color-mix(in oklab, var(--brand-cyan) 90%, black); color: #06283D; box-shadow: var(--shadow-glow); }

.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-subtle); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { min-height: 36px; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.4;
}
.badge-free {
  background: color-mix(in oklab, var(--success) 15%, transparent);
  color: color-mix(in oklab, var(--success) 85%, black);
  border-color: color-mix(in oklab, var(--success) 30%, transparent);
}
:root[data-theme='dark'] .badge-free { color: #34D399; }
.badge-nivel {
  background: var(--surface-2); color: var(--text-muted); border-color: var(--border);
}
.badge-tag {
  background: color-mix(in oklab, var(--brand-cyan) 10%, transparent);
  color: var(--brand-blue); border-color: color-mix(in oklab, var(--brand-cyan) 22%, transparent);
}
:root[data-theme='dark'] .badge-tag { color: var(--brand-cyan); }
.badge-popular {
  background: color-mix(in oklab, var(--warning) 15%, transparent);
  color: color-mix(in oklab, var(--warning) 82%, black);
  border-color: color-mix(in oklab, var(--warning) 30%, transparent);
}
.badge-icon { width: 12px; height: 12px; }

/* ---------- Card de curso ---------- */
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--motion-base) var(--easing),
              box-shadow var(--motion-base) var(--easing),
              transform var(--motion-base) var(--easing);
  position: relative;
  min-height: 260px;
}
.card:hover {
  border-color: color-mix(in oklab, var(--brand-cyan) 55%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card:focus-within { border-color: var(--brand-cyan); box-shadow: var(--focus-ring); }

.card-visual {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--surface-2);
  color: #fff; padding: 0;
  display: block;
  overflow: hidden;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform var(--motion-base) var(--easing);
  backface-visibility: hidden;
}
.card:hover .card-img {
  transform: scale(1.04);
}
.card-visual-code {
  position: absolute; top: var(--sp-3); left: var(--sp-3); z-index: 2;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: var(--radius-sm);
  background: rgba(10, 22, 40, 0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  pointer-events: none;
}
.card-visual-title {
  display: none;
}
.card-visual-pattern {
  display: none;
}

/* Fallback de color por categoría para el visual */
.card[data-cat='ciberseguridad'] .card-visual {
  background: linear-gradient(135deg, #1B5FBF 0%, #0A1628 100%);
}
.card[data-cat='inteligencia-artificial'] .card-visual {
  background: linear-gradient(135deg, #2AB7E6 0%, #1B5FBF 100%);
}
.card[data-cat='programacion'] .card-visual {
  background: linear-gradient(135deg, #0EA5A8 0%, #0F3A87 100%);
}
.card[data-cat='certificaciones'] .card-visual {
  background: linear-gradient(135deg, #8B5CF6 0%, #1B5FBF 100%);
}
.card[data-cat='analisis-de-datos'] .card-visual {
  background: linear-gradient(135deg, #F59E0B 0%, #B45309 100%);
}

.card-body {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5); flex: 1;
}
.card-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem;
  line-height: 1.32; color: var(--text); letter-spacing: -0.01em; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-subtitle {
  font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-normal); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-cta { margin-top: auto; }

/* Card destacada (gratuito o especial) */
.card.is-featured {
  border-color: color-mix(in oklab, var(--success) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--success) 30%, transparent), var(--shadow-md);
}

/* ---------- Bento grid (categorías home) ---------- */
.bento {
  display: grid; gap: var(--sp-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(220px, auto); } }

/* ---------- Layout de rutas destacadas dentro de una categoría ---------- */
.rutas-lista {
  display: flex; flex-direction: column; gap: var(--sp-5);
}
.rutas-dos {
  display: grid; gap: var(--sp-5);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .rutas-dos { grid-template-columns: 1fr 1fr; } }

.bento-item {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6); display: flex; flex-direction: column;
  justify-content: space-between; gap: var(--sp-4);
  transition: border-color var(--motion-base) var(--easing),
              box-shadow var(--motion-base) var(--easing);
  min-height: 200px;
  color: var(--text); text-decoration: none;
}
.bento-item:hover {
  border-color: color-mix(in oklab, var(--brand-cyan) 55%, var(--border));
  box-shadow: var(--shadow-md); color: var(--text);
}
.bento-item h3 { font-size: var(--fs-xl); }
.bento-item p { font-size: var(--fs-sm); color: var(--text-muted); }
.bento-item .bento-count {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.bento-item .bento-arrow {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--text-muted); transition: background var(--motion-fast) var(--easing);
}
.bento-item:hover .bento-arrow { background: var(--brand-cyan); color: #06283D; }
.bento-item .bento-footer { display: flex; justify-content: space-between; align-items: center; }

/* Grid asignaciones bento (desktop): 6 cols, categorías con tamaños desiguales */
@media (min-width: 1024px) {
  .bento-item[data-slot='hero']    { grid-column: span 4; grid-row: span 2; }
  .bento-item[data-slot='wide']    { grid-column: span 4; grid-row: span 1; }
  .bento-item[data-slot='tall']    { grid-column: span 2; grid-row: span 2; }
  .bento-item[data-slot='normal']  { grid-column: span 2; grid-row: span 1; }
}

/* ---------- Bento Grid Personalizado (Captura "Elige tu camino") ---------- */
.bento-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-bottom: var(--sp-10);
}
.bento-header-wrap .section-title {
  margin: 0;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  letter-spacing: -0.03em;
}
.bento-header-wrap .section-lead {
  max-width: 44ch;
  font-size: var(--fs-md);
  margin: 0;
  color: var(--text-muted);
}

.bento-grid-custom {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .bento-grid-custom {
    grid-template-columns: 1.35fr 1fr;
    grid-template-areas:
      "ciber ia"
      "ciber prog"
      "cert  datos";
  }
  .bento-card-ciber { grid-area: ciber; min-height: 380px; }
  .bento-card-ia    { grid-area: ia; min-height: 175px; }
  .bento-card-prog  { grid-area: prog; min-height: 175px; }
  .bento-card-cert  { grid-area: cert; min-height: 220px; }
  .bento-card-datos { grid-area: datos; min-height: 220px; }
}

.bento-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-4);
  transition: border-color var(--motion-base) var(--easing),
              box-shadow var(--motion-base) var(--easing),
              transform var(--motion-base) var(--easing);
  color: var(--text);
  text-decoration: none;
}
@media (min-width: 768px) {
  .bento-card {
    padding: var(--sp-8);
  }
}
.bento-card:hover {
  border-color: color-mix(in oklab, var(--brand-cyan) 60%, var(--border));
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.bento-card-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  margin-bottom: var(--sp-2);
}
.bento-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 0;
  line-height: 1.2;
}
.bento-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: var(--sp-2);
}
.bento-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--sp-6);
  gap: var(--sp-3);
  flex-wrap: nowrap;
}
.bento-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bento-card-arrow {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  margin-inline-start: auto;
  transition: all var(--motion-fast) var(--easing);
}
.bento-card:hover .bento-card-arrow {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
  transform: translateX(3px);
}

/* Bento item con acento visual (categoría) */
.bento-item[data-accent='ciberseguridad'] {
  background: linear-gradient(160deg, color-mix(in oklab, #1B5FBF 10%, var(--surface)) 0%, var(--surface) 60%);
}
.bento-item[data-accent='inteligencia-artificial'] {
  background: linear-gradient(160deg, color-mix(in oklab, #2AB7E6 12%, var(--surface)) 0%, var(--surface) 60%);
}
.bento-item[data-accent='programacion'] {
  background: linear-gradient(160deg, color-mix(in oklab, #0EA5A8 12%, var(--surface)) 0%, var(--surface) 60%);
}
.bento-item[data-accent='certificaciones'] {
  background: linear-gradient(160deg, color-mix(in oklab, #8B5CF6 10%, var(--surface)) 0%, var(--surface) 60%);
}
.bento-item[data-accent='analisis-de-datos'] {
  background: linear-gradient(160deg, color-mix(in oklab, #F59E0B 10%, var(--surface)) 0%, var(--surface) 60%);
}

/* ---------- Grid de cursos ---------- */
.grid-cursos {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ---------- Filtros ---------- */
.filters {
  position: sticky; top: var(--header-h); z-index: 20;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-4);
  margin-block-end: var(--sp-6);
}
.filters-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.search-input {
  flex: 1; min-width: 220px; max-width: 380px;
  min-height: 40px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); color: var(--text);
  transition: border-color var(--motion-fast) var(--easing), box-shadow var(--motion-fast) var(--easing);
}
.search-input:focus { border-color: var(--brand-cyan); box-shadow: var(--focus-ring); outline: none; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  min-height: 32px; padding: 0 var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; transition: background var(--motion-fast) var(--easing),
              border-color var(--motion-fast) var(--easing), color var(--motion-fast) var(--easing);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { border-color: var(--text-subtle); color: var(--text); }
.pill.is-active {
  background: var(--brand-blue); color: #fff; border-color: var(--brand-blue);
}
.pill-count { opacity: 0.7; font-family: var(--font-mono); font-size: 10px; }

/* Estado vacío cuando ningún curso coincide con los filtros */
.empty-filter-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-block: var(--sp-4);
}
.empty-filter-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-subtle);
  margin-bottom: var(--sp-2);
}
.empty-filter-state h3 {
  font-size: var(--fs-lg);
  color: var(--text);
}
.empty-filter-state p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 46ch;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; padding-block: clamp(var(--sp-16), 10vw, var(--sp-24));
  overflow: hidden;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--brand-blue); font-weight: 600;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--brand-cyan) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand-cyan) 25%, transparent);
  margin-bottom: var(--sp-5);
}
:root[data-theme='dark'] .hero-eyebrow { color: var(--brand-cyan); }
.hero-eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-cyan);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-cyan) 25%, transparent);
}
.hero-title {
  font-size: var(--fs-4xl); font-weight: 700;
  line-height: 1.04; letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: var(--sp-5);
}
.hero-title .grad {
  background: var(--brand-gradient); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.hero-highlight {
  color: #2563EB;
  background: linear-gradient(135deg, #38BDF8 0%, #2563EB 55%, #1D4ED8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}
.hero-lead {
  font-size: var(--fs-md); color: var(--text-muted);
  max-width: 64ch; margin-bottom: var(--sp-8); line-height: var(--lh-relaxed);
}
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* Stats */
.stats {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(2, 1fr);
  padding-block: var(--sp-8);
  margin-top: var(--sp-10);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-3xl); line-height: 1; letter-spacing: -0.03em;
  color: var(--brand-cyan);
}
.stat-value small {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text);
  margin-inline-start: 4px;
}
.stat-value .grad {
  background: var(--brand-gradient); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.stat-label {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
  margin-top: var(--sp-2);
}

/* ---------- Ruta (Timeline) ---------- */
.ruta-header {
  display: grid; gap: var(--sp-6); grid-template-columns: 1fr;
  align-items: end; margin-bottom: var(--sp-10);
}
@media (min-width: 900px) { .ruta-header { grid-template-columns: 1.4fr 1fr; } }
.ruta-header-meta {
  display: grid; gap: var(--sp-4);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.ruta-header-meta dt {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
}
.ruta-header-meta dd { font-size: var(--fs-md); color: var(--text); font-weight: 500; margin-inline-start: 0; }

.timeline {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-8);
}
.timeline::before {
  content: ''; position: absolute; left: 32px; top: 12px; bottom: 12px; width: 2px;
  background: linear-gradient(to bottom, var(--brand-cyan), var(--brand-blue) 30%, var(--border) 100%);
  border-radius: 2px;
}
.timeline-step { display: grid; grid-template-columns: 68px 1fr; gap: var(--sp-4); }
.timeline-num {
  width: 68px; text-align: center; z-index: 1;
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-2xl); line-height: 1;
  color: var(--text); letter-spacing: -0.03em;
  position: relative;
}
.timeline-num::before {
  content: ''; position: absolute; left: 16px; top: 100%; width: 34px; height: 34px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-cyan);
  transform: translateY(-38px);
  box-shadow: var(--shadow-sm);
}
.timeline-step-body {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color var(--motion-base) var(--easing), box-shadow var(--motion-base) var(--easing);
}
.timeline-step-body:hover {
  border-color: color-mix(in oklab, var(--brand-cyan) 55%, var(--border));
  box-shadow: var(--shadow-md);
}
.timeline-step-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); }
.timeline-step-subtitle { font-size: var(--fs-sm); color: var(--text-muted); }
.timeline-step-reason {
  font-size: var(--fs-sm); color: var(--text-muted);
  padding: var(--sp-3); border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 3px solid var(--brand-cyan);
}
.timeline-step-reason strong { color: var(--text); font-weight: 600; }
.timeline-step-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.timeline-step-cta { margin-top: var(--sp-2); }

/* ---------- Ruta relacionada ---------- */
.next-routes { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; margin-top: var(--sp-10); }
@media (min-width: 700px) { .next-routes { grid-template-columns: repeat(2, 1fr); } }
.next-route {
  padding: var(--sp-5); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: border-color var(--motion-base) var(--easing);
  color: var(--text);
}
.next-route:hover { border-color: var(--brand-cyan); color: var(--text); }
.next-route .eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
}

/* ---------- CTA gratuito (embudo ciber-gratis) ---------- */
.free-cta {
  position: relative; overflow: hidden;
  padding: var(--sp-8);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0F3A87 0%, #0A1628 100%);
  color: #fff; display: grid; gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 800px) { .free-cta { grid-template-columns: 1.5fr auto; } }
.free-cta::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(400px 200px at 90% 10%, rgba(42,183,230,0.30), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(42,183,230,0.20), transparent 60%);
  pointer-events: none;
}
.free-cta > * { position: relative; }
.free-cta .badge-free { background: color-mix(in oklab, var(--success) 25%, transparent); color: #34D399; border-color: color-mix(in oklab, var(--success) 50%, transparent); }
.free-cta h3 { font-size: var(--fs-2xl); color: #fff; margin-bottom: var(--sp-2); }
.free-cta p { color: #CBD5E1; }

/* ---------- Instructor block ---------- */
.instructor {
  display: grid; gap: var(--sp-6); grid-template-columns: 1fr;
  padding: var(--sp-8); border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--border);
}
@media (min-width: 700px) { .instructor { grid-template-columns: 120px 1fr; align-items: center; } }
.instructor-avatar {
  width: 120px; height: 120px;
  min-width: 120px; min-height: 120px;
  max-width: 120px; max-height: 120px;
  flex-shrink: 0;
  justify-self: start;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 40px;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.instructor h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-1); }
.instructor .role {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
  margin-bottom: var(--sp-3);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--sp-24);
  padding-block: var(--sp-12) var(--sp-8);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-grid {
  display: grid; gap: var(--sp-8); grid-template-columns: 1fr;
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand p { font-size: var(--fs-sm); color: var(--text-muted); max-width: 42ch; margin-top: var(--sp-3); }
.footer-col h4 { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--text-subtle); margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col a { color: var(--text-muted); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: var(--sp-10); padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--text-subtle);
}

/* ---------- Reveal animation ---------- */
/* Progressive enhancement:
   - Sin JS (o si main.js no carga): el contenido es VISIBLE por defecto.
   - Con JS (html.js): se oculta para animar al entrar en viewport.
   - Failsafe: si el observer nunca dispara, la animación lo muestra igual a los 2,5s.
   Esto evita que un fallo de JS/caché deje contenido invisible para siempre. */
.reveal { opacity: 1; transform: none; }

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--motion-slow) var(--easing), transform var(--motion-slow) var(--easing);
  animation: ac-reveal-failsafe 0.01s linear 2.5s forwards;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  animation: none;
}
@keyframes ac-reveal-failsafe { to { opacity: 1; transform: none; } }

.reveal[data-delay='1'] { transition-delay: 60ms; }
.reveal[data-delay='2'] { transition-delay: 120ms; }
.reveal[data-delay='3'] { transition-delay: 180ms; }
.reveal[data-delay='4'] { transition-delay: 240ms; }
.reveal[data-delay='5'] { transition-delay: 300ms; }
.reveal[data-delay='6'] { transition-delay: 360ms; }

/* ---------- Utilidades ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* Grid genérico de 2 cols en desktop */
.two-col { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.5fr 1fr; align-items: end; } }

/* ============================================================
   BLOG — listado
   ============================================================ */
.post-grid {
  display: grid; gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--motion-base) var(--easing),
              box-shadow var(--motion-base) var(--easing);
}
.post-card:hover {
  border-color: color-mix(in oklab, var(--brand-cyan) 55%, var(--border));
  box-shadow: var(--shadow-md);
}
.post-card-media {
  display: block; aspect-ratio: 1200 / 630;
  overflow: hidden; background: var(--surface-2);
}
.post-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--motion-slow) var(--easing);
}
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-card-body {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5);
}
.post-card-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.post-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg); font-weight: 700;
  line-height: 1.25; letter-spacing: -0.01em;
}
.post-card-title a { color: var(--text); text-decoration: none; }
.post-card-title a:hover { color: var(--brand-blue); }
:root[data-theme='dark'] .post-card-title a:hover { color: var(--brand-cyan); }
.post-card-resumen {
  font-size: var(--fs-sm); color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-footer {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); margin-top: auto;
}

/* ============================================================
   BLOG — post individual
   ============================================================ */
.post-hero {
  display: grid; gap: var(--sp-5);
  padding-top: var(--sp-8);
}
.post-hero-meta {
  display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
}
.post-hero-meta .dot { color: var(--brand-cyan); }
.post-hero h1 {
  font-size: var(--fs-3xl);
  line-height: 1.05; letter-spacing: -0.03em;
  max-width: 22ch;
}
.post-hero-lead {
  font-size: var(--fs-md); color: var(--text-muted);
  line-height: var(--lh-relaxed); max-width: 65ch;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--brand-cyan);
  background: var(--surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.post-hero-lead strong { color: var(--text); }
.post-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.post-featured-img {
  margin-top: var(--sp-6); margin-bottom: var(--sp-8);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.post-featured-img img { width: 100%; height: auto; display: block; }

/* Video embed 16:9 responsive */
.post-video {
  position: relative; padding-top: 56.25%;
  border-radius: var(--radius-lg); overflow: hidden;
  margin: var(--sp-8) 0;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.post-video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* Layout post: contenido + TOC (arriba en mobile, sticky lateral en desktop) */
.post-layout {
  display: grid; gap: var(--sp-6); grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1100px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-areas: "main toc";
    gap: var(--sp-8);
  }
  .post-layout > .post-toc  { grid-area: toc; }
  .post-layout > .post-main { grid-area: main; }
}
.post-toc {
  padding: var(--sp-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
  font-size: var(--fs-sm);
}
@media (min-width: 1100px) {
  .post-toc {
    position: sticky; top: calc(var(--header-h) + var(--sp-4));
    max-height: calc(100vh - var(--header-h) - var(--sp-8));
    overflow-y: auto;
  }
}
.post-toc-title {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
  margin-bottom: var(--sp-3);
}
.post-toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: toc; }
.post-toc li { counter-increment: toc; }
.post-toc a {
  display: block; padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; line-height: 1.4;
  border-left: 2px solid transparent;
}
.post-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-subtle); margin-right: 8px;
}
.post-toc a:hover { color: var(--text); background: var(--surface-2); }
.post-toc a.is-active {
  color: var(--brand-blue); border-left-color: var(--brand-cyan);
  background: color-mix(in oklab, var(--brand-cyan) 8%, transparent);
}
:root[data-theme='dark'] .post-toc a.is-active { color: var(--brand-cyan); }

/* ---- Prose: typography del contenido del artículo ---- */
.prose {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text);
  max-width: 68ch;
}
.prose > * + * { margin-top: var(--sp-5); }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display); font-weight: 700;
  line-height: 1.2; letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + var(--sp-6));
}
.prose h2 {
  margin-top: var(--sp-16); margin-bottom: var(--sp-4);
  font-size: var(--fs-2xl);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.prose h3 { margin-top: var(--sp-10); margin-bottom: var(--sp-3); font-size: var(--fs-xl); }
.prose h4 { margin-top: var(--sp-8); margin-bottom: var(--sp-2); font-size: var(--fs-lg); }
.prose h2 .anchor, .prose h3 .anchor, .prose h4 .anchor {
  color: var(--text-subtle); text-decoration: none;
  opacity: 0; margin-left: 8px;
  transition: opacity var(--motion-fast) var(--easing);
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose p { color: var(--text); max-width: 68ch; }
.prose a {
  color: var(--brand-blue); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--brand-cyan) 40%, transparent);
}
.prose a:hover { color: var(--brand-cyan); text-decoration-color: var(--brand-cyan); }
:root[data-theme='dark'] .prose a { color: var(--brand-cyan); }
.prose strong { color: var(--text); font-weight: 700; }
.prose em { color: var(--text); font-style: italic; }
.prose ul, .prose ol {
  padding-left: var(--sp-6); display: flex; flex-direction: column; gap: 8px;
}
.prose li { padding-left: var(--sp-1); }
.prose li::marker { color: var(--brand-cyan); font-weight: 700; }
.prose blockquote {
  font-size: var(--fs-lg); line-height: 1.5;
  font-family: var(--font-display); font-weight: 500;
  color: var(--text);
  padding: var(--sp-5) var(--sp-6);
  border-left: 4px solid var(--brand-cyan);
  background: var(--surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-block: var(--sp-8);
}
.prose blockquote p { color: var(--text); }
.prose code {
  font-family: var(--font-mono); font-size: 0.92em;
  padding: 2px 6px; border-radius: 4px;
  background: color-mix(in oklab, var(--brand-cyan) 10%, var(--surface-2));
  color: var(--brand-blue);
  border: 1px solid color-mix(in oklab, var(--brand-cyan) 20%, transparent);
}
:root[data-theme='dark'] .prose code { color: var(--brand-cyan); }
.prose pre {
  font-family: var(--font-mono); font-size: var(--fs-sm);
  padding: var(--sp-5); border-radius: var(--radius-md);
  background: var(--brand-blue-deep); color: #E2E8F0;
  overflow-x: auto; border: 1px solid var(--border);
  line-height: 1.5;
}
.prose pre code {
  background: transparent; padding: 0; border: 0;
  color: inherit; font-size: inherit;
}
.prose table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-sm);
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border);
}
.prose thead {
  background: var(--surface-2);
}
.prose th {
  text-align: left; padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--text-muted); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.prose td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.prose tr:last-child td { border-bottom: 0; }
.prose figure {
  margin-block: var(--sp-8);
}
.prose figure img {
  width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border);
}
.prose figcaption {
  font-size: var(--fs-sm); color: var(--text-muted);
  text-align: center; margin-top: var(--sp-3); font-style: italic;
}
.prose hr {
  border: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin-block: var(--sp-12);
}

/* Callout / CTA embebido en el artículo — enlace a curso */
.prose .curso-callout {
  display: flex; gap: var(--sp-4); align-items: center;
  padding: var(--sp-5);
  border: 1px solid color-mix(in oklab, var(--brand-cyan) 30%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--brand-cyan) 6%, var(--surface));
  text-decoration: none; color: var(--text);
  transition: border-color var(--motion-fast) var(--easing), box-shadow var(--motion-fast) var(--easing);
  margin-block: var(--sp-8);
}
.prose .curso-callout:hover {
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-glow);
  color: var(--text);
  text-decoration: none;
}
.prose .curso-callout-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  display: grid; place-items: center;
  color: #fff;
}
.prose .curso-callout-body { flex: 1; min-width: 0; }
.prose .curso-callout-tag {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--brand-blue); text-transform: uppercase; letter-spacing: var(--tracking-wide);
  font-weight: 700;
}
:root[data-theme='dark'] .prose .curso-callout-tag { color: var(--brand-cyan); }
.prose .curso-callout-title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md);
  color: var(--text); margin: 4px 0;
}
.prose .curso-callout-sub {
  font-size: var(--fs-sm); color: var(--text-muted); margin: 0;
}
.prose .curso-callout-arrow {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-cyan); color: #06283D;
  display: grid; place-items: center;
}

/* Callout info / warning genérico */
.callout {
  padding: var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: var(--sp-3);
  margin-block: var(--sp-6);
}
.callout-icon { flex-shrink: 0; width: 24px; height: 24px; color: var(--brand-cyan); }
.callout-body { flex: 1; }
.callout-body > *:first-child { margin-top: 0; }

/* CTA final del post */
.post-final-cta {
  margin-top: var(--sp-8);
  padding: var(--sp-6) var(--sp-8);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0F3A87 0%, #0A1628 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 768px) {
  .post-final-cta {
    grid-template-columns: 1.35fr auto;
    gap: var(--sp-6);
  }
}
.post-final-cta::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(400px 200px at 90% 10%, rgba(42,183,230,0.30), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(42,183,230,0.20), transparent 60%);
  pointer-events: none;
}
.post-final-cta > * { position: relative; }
.post-final-cta h2,
.post-final-cta h3 {
  color: #fff;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: clamp(1.2rem, 1.05rem + 0.55vw, 1.45rem);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
}
.post-final-cta p {
  color: #CBD5E1;
  margin-top: var(--sp-2);
  margin-bottom: 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  max-width: 54ch;
}
.post-final-cta .badge-free {
  display: inline-flex;
  margin-bottom: var(--sp-2);
  background: color-mix(in oklab, var(--success) 25%, transparent);
  color: #34D399;
  border-color: color-mix(in oklab, var(--success) 50%, transparent);
}
.post-final-cta .post-cta-actions,
.post-final-cta .flex {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .post-final-cta .post-cta-actions,
  .post-final-cta .flex {
    flex-direction: column;
    align-items: stretch;
    min-width: 210px;
    margin-top: 0 !important;
  }
}

/* Cursos relacionados (bloque final) */
.related-cursos {
  margin-top: var(--sp-16);
  padding-top: var(--sp-10);
  border-top: 1px solid var(--border);
}
.related-cursos h2 {
  font-family: var(--font-display); font-size: var(--fs-2xl);
  margin-bottom: var(--sp-6);
}

/* Compartir en redes */
.post-share {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  margin-top: var(--sp-8); padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}
.post-share-label {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide);
  margin-right: var(--sp-2);
}
.post-share a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); text-decoration: none;
  transition: all var(--motion-fast) var(--easing);
}
.post-share a:hover {
  background: var(--brand-cyan); color: #06283D; border-color: var(--brand-cyan);
}

/* ============================================================
   REDES SOCIALES Y PRUEBA SOCIAL (GLOBAL)
   ============================================================ */

/* ---------- Redes en Cabecera (Desktop / Tablet) ---------- */
.nav-socials {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 600px) {
  .nav-socials {
    display: flex;
  }
}
.nav-social-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--motion-fast) var(--easing), background var(--motion-fast) var(--easing), transform var(--motion-fast) var(--easing);
  text-decoration: none;
}
.nav-social-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.nav-social-btn.is-youtube:hover { color: #EF4444; }
.nav-social-btn.is-linkedin:hover { color: #0A66C2; }
.nav-social-btn.is-instagram:hover { color: #E1306C; }
:root[data-theme='dark'] .nav-social-btn.is-youtube:hover { color: #F87171; }
:root[data-theme='dark'] .nav-social-btn.is-linkedin:hover { color: #38BDF8; }
:root[data-theme='dark'] .nav-social-btn.is-instagram:hover { color: #F472B6; }

/* ---------- Redes en Menú Móvil ---------- */
.mobile-socials {
  margin-top: auto;
  padding-top: var(--sp-5);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.mobile-socials-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.mobile-socials-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.mobile-social-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 600 !important;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-fast) var(--easing),
              background var(--motion-fast) var(--easing),
              transform var(--motion-fast) var(--easing);
}
.mobile-social-pill:hover,
.mobile-social-pill:active {
  border-color: var(--brand-cyan);
  background: var(--surface-2);
  transform: translateY(-1px);
}

/* ---------- Redes Sociales & Social Proof en Footer ---------- */
.footer-socials {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--motion-fast) var(--easing);
  text-decoration: none;
}
.footer-social-btn:hover {
  color: var(--text);
  border-color: var(--brand-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.footer-social-btn.is-youtube:hover { color: #EF4444; }
.footer-social-btn.is-linkedin:hover { color: #0A66C2; }
.footer-social-btn.is-instagram:hover { color: #E1306C; }
.footer-social-btn.is-udemy:hover { color: #A435F0; }
:root[data-theme='dark'] .footer-social-btn.is-youtube:hover { color: #F87171; }
:root[data-theme='dark'] .footer-social-btn.is-linkedin:hover { color: #38BDF8; }
:root[data-theme='dark'] .footer-social-btn.is-instagram:hover { color: #F472B6; }
:root[data-theme='dark'] .footer-social-btn.is-udemy:hover { color: #C084FC; }

.footer-social-proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: var(--sp-3);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color var(--motion-fast) var(--easing), color var(--motion-fast) var(--easing);
}
.footer-social-proof:hover {
  border-color: var(--brand-cyan);
  color: var(--text);
}

/* ---------- Píldora de Confianza / Trust Pill ---------- */
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--motion-fast) var(--easing), box-shadow var(--motion-fast) var(--easing), transform var(--motion-fast) var(--easing);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--sp-4);
}
.trust-pill:hover {
  border-color: var(--brand-cyan);
  color: var(--text);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.trust-pill-stars {
  color: #F59E0B;
  display: inline-flex;
  gap: 2px;
  font-size: 11px;
}
.trust-pill-highlight {
  font-weight: 700;
  color: var(--brand-blue);
}
:root[data-theme='dark'] .trust-pill-highlight {
  color: var(--brand-cyan);
}
.trust-pill-arrow {
  color: var(--text-subtle);
  transition: transform var(--motion-fast) var(--easing);
}
.trust-pill:hover .trust-pill-arrow {
  transform: translateX(3px);
  color: var(--brand-cyan);
}

/* ---------- Instructor Enriquecido ---------- */
.instructor-metrics {
  display: flex;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-block: var(--sp-3) var(--sp-3);
}
.instructor-metric {
  display: flex;
  flex-direction: column;
}
.instructor-metric-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--brand-cyan);
  line-height: 1.1;
}
.instructor-metric-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.instructor-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}
.instructor-socials {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Autor en Blog ---------- */
.author-box {
  display: grid;
  gap: var(--sp-5);
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: var(--sp-12);
}
@media (min-width: 600px) {
  .author-box {
    grid-template-columns: 80px 1fr;
    align-items: center;
  }
}
.author-avatar {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  flex-shrink: 0;
  justify-self: start;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Fix: el atributo `hidden` de HTML pierde ante cualquier `display` explícito.
   Los filtros del catálogo y del blog usan el atributo hidden o clases específicas. */
[hidden] { display: none !important; }
.card[hidden], .post-card[hidden] { display: none !important; }

/* ============================================================
   BLOG — Paginación y Filtros
   ============================================================ */
.blog-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.blog-results-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-results-count strong {
  color: var(--text);
  font-weight: 700;
}
.blog-reset-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--brand-blue);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all var(--motion-fast) var(--easing);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
:root[data-theme='dark'] .blog-reset-btn {
  color: var(--brand-cyan);
}
.blog-reset-btn:hover {
  background: var(--surface-2);
  text-decoration: underline;
}

/* Paginador */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination-btn,
.pagination-num {
  min-height: 40px;
  min-width: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--motion-fast) var(--easing),
              border-color var(--motion-fast) var(--easing),
              color var(--motion-fast) var(--easing),
              box-shadow var(--motion-fast) var(--easing);
  text-decoration: none;
}
.pagination-btn:hover:not(:disabled),
.pagination-num:hover:not(.is-active) {
  background: var(--surface-2);
  border-color: var(--brand-cyan);
  color: var(--brand-blue);
}
:root[data-theme='dark'] .pagination-btn:hover:not(:disabled),
:root[data-theme='dark'] .pagination-num:hover:not(.is-active) {
  color: var(--brand-cyan);
}
.pagination-num.is-active {
  background: var(--brand-blue);
  color: #ffffff !important;
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
  cursor: default;
  pointer-events: none;
}
:root[data-theme='dark'] .pagination-num.is-active {
  background: var(--brand-cyan);
  color: #06283D !important;
  border-color: var(--brand-cyan);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-subtle);
}
.pagination-ellipsis {
  min-width: 32px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.pagination-info {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}