/* Todohack. Barra lateral con autor + contenido. Azul #263959 = identidad desde 2024.
   Tipografía del sistema de Apple (SF Pro) con Inter como equivalente en Windows/Android. */

/* ---------- Tokens ---------- */
:root {
  --navy: #263959;
  --bg: #ffffff;
  --surface: #f4f6f9;
  --raised: #ffffff;
  --text: #3d4352;
  --ink: #141a26;
  --muted: #6b7385;
  --line: #e4e7ee;
  --accent: #263959;
  --accent-hover: #1a2944;
  --accent-soft: #e8edf6;
  --dot: #263959;
  --amber: #f2b33d;
  --amber-bg: #fff7e6;
  --link: #2a5199;
  --code-bg: #1b2538;
  --code-text: #e3e8f2;
  --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 8px 24px -12px rgba(20, 28, 45, .18);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --side: 264px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1522; --surface: #161e2e; --raised: #1a2336; --text: #c5cddb; --ink: #f1f4f9; --muted: #8b95a8; --line: #253049;
  --accent: #3b5a96; --accent-hover: #4a6cad; --accent-soft: #1d2840; --dot: #f2b33d; --amber-bg: #262214; --link: #93b4f2;
  --code-bg: #0b111d; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1522; --surface: #161e2e; --raised: #1a2336; --text: #c5cddb; --ink: #f1f4f9; --muted: #8b95a8; --line: #253049;
    --accent: #3b5a96; --accent-hover: #4a6cad; --accent-soft: #1d2840; --dot: #f2b33d; --amber-bg: #262214; --link: #93b4f2;
    --code-bg: #0b111d; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--sans); font-optical-sizing: auto; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s var(--ease); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:root[data-theme="dark"] :focus-visible { outline-color: var(--amber); } /* ámbar sobre blanco no llega a 3:1 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :focus-visible { outline-color: var(--amber); } }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.18; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--amber) 40%, transparent); color: var(--ink); }
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; scrollbar-width: thin; }
input, textarea { caret-color: var(--accent); }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea { caret-color: var(--dot); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 14px; color: var(--muted); }

/* ---------- Transiciones entre páginas (View Transitions) ---------- */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
::view-transition-old(root) { animation: vt-out .18s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
/* Cambio de tema: una sola capa animada (revelado circular desde JS); nada más se mueve */
.theme-anim .sidebar { view-transition-name: none; }
.theme-anim::view-transition-old(root), .theme-anim::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: none !important; }
/* Respaldo sin View Transitions: todos los colores cambian juntos y al mismo ritmo */
.theme-fade *, .theme-fade *::before, .theme-fade *::after {
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), fill .35s var(--ease), box-shadow .35s var(--ease) !important;
}
/* Las portadas impresas no deslumbran en modo oscuro */
:root[data-theme="dark"] .card-thumb img, :root[data-theme="dark"] .post-cover img { filter: brightness(.9) contrast(1.02); }

/* «Menos movimiento» suaviza, no apaga: sin desplazamientos grandes; las transiciones entre páginas quedan en un fundido simple */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root) { animation: vt-soft-out .2s ease both !important; -webkit-mask-image: none !important; mask-image: none !important; }
  ::view-transition-new(root) { animation: vt-soft-in .3s ease both !important; -webkit-mask-image: none !important; mask-image: none !important; }
}
@keyframes vt-soft-out { to { opacity: 0; } }
@keyframes vt-soft-in { from { opacity: 0; } }

/* ---------- Barra lateral ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 10;
  display: flex; flex-direction: column; padding: 36px 18px 18px;
  border-right: 1px solid var(--line); background: var(--bg); overflow: hidden;
}
.sidebar > :not(.matrix) { position: relative; z-index: 1; }
/* Campo de datos detrás del menú: lo dibuja site.js solo alrededor del cursor */
.matrix { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.theme-toggle {
  /* z-index por encima del bloque de identidad, que antes tapaba la mitad inferior del botón */
  position: absolute !important; z-index: 3 !important; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle:active { transform: scale(.94); }
/* Zona de clic invisible algo mayor que el botón: más fácil de acertar */
.theme-toggle::after { content: ""; position: absolute; inset: -8px; border-radius: 16px; }
.theme-toggle svg { transition: transform .5s var(--ease); }
.theme-toggle:hover svg { transform: rotate(-20deg); }
.i-sun, :root[data-theme="dark"] .i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
/* Con morphicons cargado, la luna se transforma en sol; los SVG fijos quedan como respaldo */
morph-icon { display: inline-grid; line-height: 0; flex: none; }
.i-morph { display: none; }
.i-morph:defined { display: block; line-height: 0; }
.theme-toggle:has(.i-morph:defined) .i-moon, .theme-toggle:has(.i-morph:defined) .i-sun { display: none; }

.side-id { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.avatar { border-radius: 50%; transition: transform .35s var(--ease); }
.avatar:hover { transform: scale(1.04); }
.avatar img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--dot); }
.author-name { font: 700 18px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); margin: 16px 0 6px; }
.author-role { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 220px; margin: 2px 0 0; padding: 0; list-style: none; }
.author-role li {
  font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .01em; color: var(--ink);
  padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--line);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 550; font-size: 14.5px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav a svg { flex: none; color: var(--muted); transition: color .2s var(--ease); }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a:hover svg { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.nav a[aria-current="page"] svg { color: var(--accent); }
:root[data-theme="dark"] .nav a[aria-current="page"] svg { color: var(--dot); }
.nav kbd { margin-left: auto; font: 500 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }

/* Pie siempre visible: redes y fecha anclados al fondo del menú */
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact { display: flex; gap: 2px; }
.contact a { display: inline-flex; padding: 7px; color: var(--muted); border-radius: 8px; transition: color .2s var(--ease), background-color .2s var(--ease); }
.contact a:hover { color: var(--ink); background: var(--surface); }
.contact svg { width: 17px; height: 17px; }
.copyright { font-size: 12px; color: var(--muted); margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.main-foot { display: none; }

/* Pantallas bajas: se compacta la identidad para que el pie siga a la vista */
@media (min-width: 901px) and (max-height: 640px) {
  .sidebar { padding-top: 22px; }
  .avatar img { width: 64px; height: 64px; }
  .author-role { display: none; }
  .side-id { padding-bottom: 14px; margin-bottom: 10px; }
  .nav a { padding: 8px 12px; }
}

/* ---------- Contenido ---------- */
/* En pantallas grandes el bloque de 1100px se centra en el espacio que deja la barra lateral */
.main { margin-left: var(--side); padding: 56px max(56px, calc((100vw - var(--side) - 1100px) / 2)) 96px; }
.hero { max-width: 780px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -.035em; line-height: 1.06; margin-bottom: 22px; }
.hero-lead { font-size: 19px; line-height: 1.6; max-width: 62ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 44px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px;
  background: var(--accent); color: #fff; font: 600 15px var(--sans); text-decoration: none; border: 1px solid var(--accent);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--muted); }
.focus { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 28px 36px; }
.focus li { border-top: 2px solid var(--accent); padding-top: 14px; font-size: 15px; line-height: 1.55; }
.focus strong { display: block; font: 650 17px/1.3 var(--display); letter-spacing: -.015em; color: var(--ink); margin-bottom: 6px; }

.section { margin-top: 64px; }
.section-title { font-size: 28px; letter-spacing: -.028em; }
.section-lead { margin: 0 0 30px; color: var(--muted); max-width: 62ch; }
.page-header { max-width: 780px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.035em; }
.about-p { font-size: 18px; line-height: 1.65; max-width: 66ch; }

/* ---------- Tarjetas ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 40px 28px; margin-bottom: 36px; }
.card { display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--surface); margin-bottom: 16px; box-shadow: var(--shadow); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-title { font-size: 20px; letter-spacing: -.02em; margin: 6px 0 8px; }
.card-title a { color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease); }
.card:hover .card-title a, .card-title a:focus-visible { background-size: 100% 1.5px; }
.card-desc { margin: 0 0 12px; font-size: 15.5px; line-height: 1.55; }
.card-lesson { background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; line-height: 1.5; margin-bottom: 14px; }
.card-lesson p, .card-lesson ul { margin: 0; padding: 0; list-style: none; }
.meta { font-size: 13.5px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.tags { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; transition: background-color .2s var(--ease), color .2s var(--ease); }
.tag:hover { background: var(--accent); color: #fff; }

/* Buscador de artículos */
.search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 8px 0 20px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.search input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; color: var(--ink); font: 400 16px var(--sans); outline: none; }
.search input::placeholder { color: var(--muted); }
.search-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -10px; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.search-icon:disabled { cursor: default; opacity: 1; }
.search-icon:not(:disabled):hover { background: var(--surface); color: var(--ink); }
.search kbd { font: 500 12px var(--mono); padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.results { min-height: 1.4em; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.empty { padding: 28px 0; color: var(--text); }
.empty[hidden] { display: none; }
.link-reset { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
@media (hover: none) { .search kbd { display: none; } }
.filter span { margin-left: 4px; font-weight: 500; opacity: .6; font-variant-numeric: tabular-nums; }
.filter {
  font: 600 13.5px var(--sans); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.filter:hover { border-color: var(--muted); color: var(--ink); }
.filter:active { transform: scale(.96); }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.year { margin-top: 44px; }
.year[hidden] { display: none; }
.year-title { font-size: 15px; font-weight: 650; color: var(--muted); letter-spacing: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 26px; font-variant-numeric: tabular-nums; }
/* Años anteriores: lista compacta en dos columnas, miniatura + fecha + título */
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 4px 28px; margin-bottom: 36px; }
.card-row { flex-direction: row; align-items: center; gap: 16px; padding: 10px 0; }
.card-row .card-thumb { flex: none; width: 128px; margin: 0; border-radius: 8px; box-shadow: none; outline: 1px solid var(--line); outline-offset: -1px; }
.card-row .card-body { min-width: 0; }
.card-row .card-title { font-size: 16px; line-height: 1.35; margin: 3px 0 0; }
.card-row .meta { font-size: 12.5px; }

/* ---------- Artículo + índice lateral ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 20; background: var(--amber); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.post-grid { display: grid; grid-template-columns: minmax(0, 720px); gap: 56px; }
.post { min-width: 0; }
.post-header h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; line-height: 1.1; margin: 12px 0 16px; }
.post-lead { font-size: 19px; line-height: 1.55; color: var(--text); margin: 0 0 18px; }
.post-header .tags { margin: 0; }
.post-cover { margin: 32px 0 0; }
.post-cover img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); }

.toc-rail { min-width: 0; }
.toc { font-size: 14px; }
.toc-title { font-weight: 650; color: var(--ink); cursor: pointer; list-style: none; padding: 4px 0; margin-bottom: 6px; }
.toc-title::-webkit-details-marker { display: none; }
.toc-ico { display: none !important; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4;
  transition: color .2s var(--ease), border-color .2s var(--ease), padding-left .25s var(--ease);
}
.toc li a:hover { color: var(--ink); padding-left: 18px; }
.toc li a.active { color: var(--ink); font-weight: 600; border-left-color: var(--amber); }
.toc-top { display: inline-block; padding: 4px 0; margin-top: 10px; font-size: 13px; color: var(--muted); text-decoration: none; }
.toc-top:hover { color: var(--ink); }

@media (min-width: 1240px) {
  .post-grid { grid-template-columns: minmax(0, 720px) 220px; }
  .toc-rail { position: relative; }
  .toc { position: sticky; top: 48px; max-height: calc(100vh - 96px); overflow: auto; padding-top: 4px; }
  .toc-title { pointer-events: none; }
}
@media (max-width: 1239px) {
  /* Índice flotante: una pastilla abajo a la derecha que se despliega */
  .toc-rail { position: fixed; right: 16px; bottom: 16px; z-index: 15; }
  .toc { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-width: min(320px, calc(100vw - 32px)); }
  .toc-title { margin: 0; padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
  .toc-title .toc-ico { display: inline-grid !important; }
  .toc-title.has-morph::before { display: none; }
  .toc-title::before { content: ""; width: 14px; height: 10px; background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 70% 2px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 85% 2px no-repeat; }
  .toc[open] .toc-title { border-bottom: 1px solid var(--line); }
  .toc ol { margin: 10px 16px 0; max-height: 50vh; overflow: auto; }
  .toc-top { margin: 10px 16px 14px; }
  .toc[open] ol, .toc[open] .toc-top { animation: toc-in .25s var(--ease); }
}
@keyframes toc-in { from { opacity: 0; transform: translateY(6px); } }

.prose { font-size: 18px; line-height: 1.72; margin-top: 36px; letter-spacing: -.012em; }
.page .prose { max-width: 68ch; } /* páginas sueltas: sin la columna de los posts, la línea se iba a ~110 caracteres */
.prose h2 { font-size: 26px; letter-spacing: -.026em; margin: 1.9em 0 .6em; }
.prose h3 { font-size: 20px; letter-spacing: -.02em; margin: 1.6em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote { margin: 1.5em 0; padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--text); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose code { font: 500 .84em var(--mono); background: var(--surface); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); -webkit-box-decoration-break: clone; box-decoration-break: clone; overflow-wrap: anywhere; }
.prose pre { background: var(--code-bg); color: var(--code-text); padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.65; margin: 0 0 1.5em; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; white-space: pre; }
.prose img { border-radius: 8px; margin: 0 auto; }
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose thead th { color: var(--ink); background: var(--surface); font-weight: 650; }
.prose tbody td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.prose tbody tr { transition: background-color .15s var(--ease); }
.prose tbody tr:hover { background: var(--surface); }

/* Capturas de tutoriales: marco uniforme sin importar el tamaño original */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; margin: 1.6em 0 1.8em; }
.shot { margin: 0; }
.shot a {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 18px;
  border: 1px solid var(--line); border-radius: 12px; cursor: zoom-in; overflow: hidden;
  background: radial-gradient(circle, color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1.5px) 0 0 / 14px 14px, var(--surface);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.shot img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; border-radius: 4px; margin: 0; box-shadow: 0 1px 2px rgba(20, 30, 55, .12), 0 10px 28px -8px rgba(20, 30, 55, .35); transition: transform .4s var(--ease); }
.shot a::after {
  content: ""; position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: .85; transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.shot a:hover { border-color: var(--muted); box-shadow: var(--shadow); }
.shot a:hover img { transform: scale(1.025); }
.shot a:hover::after { opacity: 1; transform: scale(1.08); }
.shot figcaption { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-align: center; }

/* El recuadro de la lección: el elemento que se repite al final de cada análisis */
.box { margin: 2.2em 0; padding: 22px 26px; border-radius: 14px; font-size: 16.5px; line-height: 1.6; }
.box > :last-child { margin-bottom: 0; }
.box-title { font: 700 19px var(--display); letter-spacing: -.02em; color: var(--ink); margin: 0 0 10px; }
.box-leccion { background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); }
.box-leccion .box-title { display: flex; align-items: center; gap: 10px; }
.box-leccion .box-title::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--amber);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 0h10a7 7 0 0 1 7 7v10a7 7 0 0 1-7 7H7a7 7 0 0 1-7-7V7a7 7 0 0 1 7-7zm10.7 8.3a1.1 1.1 0 0 0-1.6 0l-6 6-2.6-2.6a1.1 1.1 0 1 0-1.6 1.6l3.4 3.4a1.1 1.1 0 0 0 1.6 0l6.8-6.8a1.1 1.1 0 0 0 0-1.6z'/%3E%3C/svg%3E");
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}
.box-fuentes { background: var(--surface); font-size: 15px; }
.box-fuentes a { word-break: break-word; }

.post-footer { margin-top: 52px; border-top: 1px solid var(--line); padding-top: 26px; font-size: 15px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.share span { color: var(--muted); }
.share a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.share a:hover { border-color: var(--muted); background: var(--surface); }
.copy-link { display: inline-flex; align-items: center; gap: 8px; }
.copy-link, .load-comments {
  font: 600 14px var(--sans); background: var(--bg); border: 1px solid var(--line); color: var(--ink); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
}
.copy-link:hover, .load-comments:hover { border-color: var(--muted); background: var(--surface); }
.copy-link:active, .load-comments:active { transform: scale(.97); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.post-nav a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.35;
  transition: border-color .2s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.post-nav a:hover { border-color: var(--muted); transform: translateY(-2px); box-shadow: var(--shadow); }
.post-nav a span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.post-nav a[rel="next"] { text-align: right; grid-column: 2; }
.comments { margin-top: 32px; }

/* ---------- Sobre mí ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 26px 24px; position: relative; max-width: 58ch; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline h3 { font-size: 19px; margin: 2px 0 6px; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.skills h3 { font-size: 16px; }
.skills ul { margin: 0; padding-left: 18px; font-size: 15.5px; }
.skills li { margin-bottom: 4px; }
.skills.certs { grid-template-columns: 1fr; gap: 0; max-width: 860px; }
.certs > div { display: grid; grid-template-columns: 210px 1fr; gap: 8px 20px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.certs h3 { margin: 5px 0 0; }
.certs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.certs li { font-size: 13.5px; font-weight: 500; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); margin: 0; transition: border-color .2s var(--ease); }
.certs li:hover { border-color: var(--muted); }
.projects { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; max-width: 980px; }
.projects li { padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.projects li:hover { border-color: var(--muted); transform: translateY(-2px); box-shadow: var(--shadow); }
.projects h3 { font-size: 17px; line-height: 1.5; margin-bottom: 6px; }
.projects p { margin: 0; font-size: 15px; line-height: 1.55; }
@media (max-width: 700px) { .certs > div { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.lb-open { overflow: hidden; }
.lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden; }
.lb::backdrop { background: rgba(10, 14, 24, .88); backdrop-filter: blur(10px) saturate(1.2); }
.lb[open] { animation: lb-fade .25s ease-out; }
@keyframes lb-fade { from { opacity: 0; } }
.lb-stage { height: 100%; margin: 0; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 64px 88px 20px; gap: 14px; touch-action: pan-y; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08); user-select: none; -webkit-user-drag: none; }
.lb-cap { display: flex; gap: 14px; align-items: baseline; font: 15px var(--sans); }
.lb-title { font-weight: 600; }
.lb-count { color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; backdrop-filter: blur(8px); transition: background-color .2s var(--ease), transform .2s var(--ease); }
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-btn:active { transform: scale(.94); }
.lb-close { top: 16px; right: 16px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb[data-single] .lb-prev, .lb[data-single] .lb-next, .lb[data-single] .lb-count { display: none; }
@media (max-width: 700px) {
  .lb-stage { padding: 64px 12px 84px; }
  .lb-img { max-height: calc(100dvh - 190px); }
  .lb-prev, .lb-next { top: auto; bottom: 20px; margin: 0; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: sticky; inset: 0 auto auto 0; width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px 12px;
    display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "avatar name toggle" "nav nav nav"; column-gap: 12px; text-align: left; align-items: center; overflow: visible;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }
  .side-id { display: contents; }
  .avatar { grid-area: avatar; }
  .avatar img { width: 40px; height: 40px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--dot); }
  .author-name { grid-area: name; margin: 0; font-size: 18px; text-align: left; }
  .author-role, .side-foot, .matrix, .nav kbd { display: none; }
  /* Pie fijo en móvil: redes y © siempre a mano, misma superficie translúcida que la cabecera */
  .main-foot {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; margin: 0;
    padding: 6px 16px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }
  .main-foot .contact a { display: grid; place-items: center; min-width: 36px; min-height: 36px; }
  .main-foot { transition: transform .3s var(--ease); }
  .toc-rail { bottom: calc(64px + env(safe-area-inset-bottom)); transition: transform .3s var(--ease); } /* el índice flotante, por encima del pie */
  .foot-hidden .main-foot { transform: translateY(100%); }
  .foot-hidden .toc-rail { transform: translateY(48px); } /* baja con el pie para no quedar flotando alto */
  .theme-toggle { position: static !important; grid-area: toggle; width: 40px; height: 40px; border-color: transparent; background: var(--surface); }
  .theme-toggle::after { inset: -6px 0; } /* sin ampliación lateral: pegado al borde provocaba scroll horizontal */
  /* Menú como control segmentado: 5 columnas iguales, icono sobre la etiqueta; cabe entero desde 320px */
  .nav { grid-area: nav; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 12px 0 0; padding: 3px; border-radius: 14px; background: var(--surface); }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 48px; padding: 6px 2px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
  .nav a:hover { background: transparent; }
  .nav a[aria-current="page"] { background: var(--raised); box-shadow: 0 1px 2px rgba(20, 28, 45, .1), 0 2px 8px -2px rgba(20, 28, 45, .12); }
  :root[data-theme="dark"] .nav a[aria-current="page"] { background: var(--line); box-shadow: none; }
  .main { margin-left: 0; padding: 28px 16px 96px; }
  .hero { padding-bottom: 36px; }
  .prose { font-size: 17px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a[rel="next"] { grid-column: auto; }
  .cards { grid-template-columns: 1fr; }
  .card-row .card-thumb { width: 96px; }
  /* Temas en una sola fila deslizable: no ocupan media pantalla en el móvil */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
  /* Áreas táctiles cómodas (~40px) en pantallas táctiles */
  .filter { padding: 10px 16px; }
  .tag { padding: 6px 11px; }
  .copy-link { display: inline-flex; align-items: center; gap: 8px; }
.copy-link, .load-comments { padding: 10px 16px; }
}

/* Bienvenida rotativa: oculta hasta que site.js elige el mensaje; si el JS falla, aparece igual a los 1,5 s. */
.js .welcome .welcome-h, .js .welcome .hero-lead { opacity: 0; animation: welcome-fallback 0s 1.5s forwards; }
.js .welcome.is-ready .welcome-h, .js .welcome.is-ready .hero-lead { opacity: 1; animation: none; }
.js .welcome.is-ready .hero-lead { animation: welcome-in .5s .55s both; }
@keyframes welcome-fallback { to { opacity: 1; } }
@keyframes welcome-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.welcome-h .g-off, .post-header h1 .g-off { visibility: hidden; }
.welcome-h .g-bad, .post-header h1 .g-bad { color: var(--dot); text-shadow: 2px 0 var(--link), -2px 0 color-mix(in srgb, var(--dot) 60%, transparent); }
}
.welcome-link { font-weight: 600; white-space: nowrap; }

/* Sigue leyendo: enlaces a posts del mismo tema al final de cada artículo */
.related { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 20px; margin-bottom: 12px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.related a { font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }

/* Compartir: botones con icono; color de la marca al pasar el ratón */
.share .share-label { color: var(--muted); font-size: 14px; margin-right: 2px; }
.share .share-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink);
  font: 600 14px var(--sans); text-decoration: none; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.share .share-btn:hover, .share .share-btn:focus-visible { color: var(--brand, var(--ink)); border-color: var(--brand, var(--muted)); background: var(--surface); }
.share .share-btn:active { transform: scale(.96); }
.share-compact { gap: 8px; margin-top: 18px; }
.share-compact .share-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
.share-whatsapp { --brand: #25d366; }
.share-facebook { --brand: #1877f2; }
.share-instagram { --brand: #e4405f; }
.share-linkedin { --brand: #0a66c2; }
.share-telegram { --brand: #26a5e4; }
.share-correo { --brand: var(--link); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 40;
  background: var(--ink); color: var(--bg); font: 600 14px var(--sans); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Traducir: botón junto al de tema y menú de idiomas */
.translate { position: absolute !important; z-index: 4 !important; top: 14px; left: 14px; width: 40px; height: 40px; margin: 0; padding: 0; }
.translate-btn {
  display: grid; place-items: center; width: 40px; height: 40px; list-style: none; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.translate-btn::-webkit-details-marker { display: none; }
.translate-btn:hover, .translate[open] .translate-btn { color: var(--ink); border-color: var(--muted); }
.translate-btn:active { transform: scale(.94); }
.translate-menu {
  position: absolute; left: 0; top: calc(100% + 8px); width: 220px; padding: 10px; text-align: left;
  background: var(--raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.translate-menu p { margin: 2px 6px 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.translate-menu p.small { margin: 8px 6px 2px; font-weight: 400; color: var(--muted); font-size: 12px; }
.translate-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.translate-menu a { display: block; padding: 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.translate-menu a:hover, .translate-menu a:focus-visible { background: var(--surface); color: var(--ink); }
@media (max-width: 900px) {
  .sidebar { grid-template-columns: 40px 1fr auto auto; grid-template-areas: "avatar name translate toggle" "nav nav nav nav"; }
  .translate { position: relative !important; top: auto; right: auto; left: auto; grid-area: translate; width: 40px; height: 40px; }
  .translate-btn { width: 40px; height: 40px; border-color: transparent; }
  .translate-menu { left: auto; right: -52px; }
}

/* Aviso de traducción (solo si el navegador está en otro idioma) */
.translate-offer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 24px; padding: 12px 16px;
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: 14px; font-size: 15px;
}
.translate-offer p { margin: 0; flex: 1 1 200px; color: var(--ink); font-weight: 600; }
.translate-offer .btn { min-height: 40px; padding: 8px 16px; }
.translate-offer-no { background: none; border: 0; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; padding: 8px; min-height: 40px; }
.translate-offer-no:hover { color: var(--ink); }

/* ---------- Movimiento y morphicons (todos los iconos son morph-icon) ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* Portadas: la imagen de la tarjeta viaja y crece hasta la portada del post (transición entre páginas) */
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--ease-out); }
::view-transition-old(*):only-child, ::view-transition-new(*):only-child { animation-duration: .25s; }

/* Capturas: distintivo de lupa con morph-icon (sustituye al icono fijo de CSS) */
.shot a.has-morph::after { display: none; }
.shot-zoom {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; opacity: .85; transition: opacity .2s var(--ease), transform .25s var(--ease-out);
}
.shot a:hover .shot-zoom, .shot a:focus-visible .shot-zoom { opacity: 1; transform: scale(1.08); }

/* «Leer el caso»: flecha morph alineada con el texto */
.welcome-link { display: inline-flex; align-items: center; gap: 4px; }
.welcome-arrow { flex: none; }

/* «Lo que te llevas»: casilla y checks morph; se marcan al entrar en pantalla */
.box-leccion.has-ticks .box-title::before { display: none; }
.box-check { flex: none; color: color-mix(in srgb, var(--amber) 72%, var(--ink)); }
.box-leccion.has-ticks > ul { list-style: none; padding-left: 0; }
.box-leccion.has-ticks > ul > li { position: relative; padding-left: 28px; }
.box-tick { position: absolute; left: 0; top: .28em; display: grid; place-items: center; width: 18px; height: 18px; color: var(--muted); transition: color .3s var(--ease); }
.box-leccion > ul > li.is-ticked .box-tick, .box-leccion.is-still > ul > li .box-tick { color: color-mix(in srgb, var(--amber) 72%, var(--ink)); }

/* ---------- Transiciones entre páginas: 10 variantes con temática de hacking ----------
   Una al azar por navegación (tipo de View Transition elegido en <head>). Sin soporte de tipos queda el fundido base.
   Con movimiento reducido quedan en un fundido simple (regla de prefers-reduced-motion arriba). */
@property --vt-s { syntax: '<length>'; initial-value: 0px; inherits: false; }
html:active-view-transition-type(glitch, crt, decrypt, terminal, rain, blinds, radar, packet, signal, firewall)::view-transition-old(root),
html:active-view-transition-type(glitch, crt, decrypt, terminal, rain, blinds, radar, packet, signal, firewall)::view-transition-new(root) { mix-blend-mode: normal; }

/* 1 · Glitch: la página vieja se rompe en franjas con desfase RGB; la nueva entra enfocándose */
html:active-view-transition-type(glitch)::view-transition-old(root) { animation: vt-glitch-out .26s steps(1, end) both; }
html:active-view-transition-type(glitch)::view-transition-new(root) { animation: vt-focus-in .42s var(--ease-out) .12s both; }
@keyframes vt-glitch-out {
  0%   { clip-path: inset(0); filter: drop-shadow(4px 0 var(--dot)) drop-shadow(-4px 0 var(--link)); transform: translateX(-6px); }
  25%  { clip-path: inset(12% 0 52% 0); transform: translateX(10px); }
  50%  { clip-path: inset(58% 0 8% 0); transform: translateX(-8px); filter: drop-shadow(-5px 0 var(--dot)) drop-shadow(5px 0 var(--link)); }
  75%  { clip-path: inset(34% 0 40% 0); transform: translateX(4px); }
  100% { clip-path: inset(50% 0 50% 0); opacity: 0; }
}
@keyframes vt-focus-in { from { opacity: 0; filter: blur(8px); transform: translateY(8px); } }

/* 2 · CRT: la vieja se apaga como un monitor de tubo (línea → punto); la nueva se enciende desde la línea */
html:active-view-transition-type(crt)::view-transition-old(root) { animation: vt-crt-off .3s cubic-bezier(.7, 0, .84, 0) both; }
html:active-view-transition-type(crt)::view-transition-new(root) { animation: vt-crt-on .42s var(--ease-out) .26s both; }
@keyframes vt-crt-off {
  0%   { transform: scale(1, 1); filter: brightness(1); }
  60%  { transform: scale(1, .004); filter: brightness(3); }
  100% { transform: scale(0, .004); filter: brightness(5); opacity: 0; }
}
@keyframes vt-crt-on {
  0%   { transform: scale(1, .004); filter: brightness(4); opacity: 1; }
  45%  { transform: scale(1, .004); filter: brightness(3); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}

/* 3 · Descifrado: la vieja se emborrona y satura como texto cifrado; la nueva se vuelve nítida */
html:active-view-transition-type(decrypt)::view-transition-old(root) { animation: vt-cipher-out .24s ease-in both; }
html:active-view-transition-type(decrypt)::view-transition-new(root) { animation: vt-decrypt-in .5s var(--ease-out) .08s both; }
@keyframes vt-cipher-out { to { opacity: 0; filter: blur(10px) contrast(3) hue-rotate(80deg); } }
@keyframes vt-decrypt-in { from { opacity: 0; filter: blur(14px) contrast(2.4) hue-rotate(-80deg) saturate(0); } }

/* 4 · Terminal: la nueva se escribe de izquierda a derecha, como un barrido de cursor */
html:active-view-transition-type(terminal)::view-transition-old(root) { animation: vt-dim .45s ease-out both; }
html:active-view-transition-type(terminal)::view-transition-new(root) { animation: vt-type-in .45s steps(14, end) both; }
@keyframes vt-dim { to { opacity: 0; filter: brightness(.4); } }
@keyframes vt-type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* 5 · Lluvia: la vieja cae y se disuelve hacia abajo; la nueva baja desde arriba */
html:active-view-transition-type(rain)::view-transition-old(root) { animation: vt-fall-out .34s cubic-bezier(.5, 0, .75, 0) both; }
html:active-view-transition-type(rain)::view-transition-new(root) { animation: vt-drop-in .46s var(--ease-out) .1s both; }
@keyframes vt-fall-out { to { transform: translateY(60px); opacity: 0; filter: blur(3px); -webkit-mask-image: linear-gradient(transparent, #000 80%); mask-image: linear-gradient(transparent, #000 80%); } }
@keyframes vt-drop-in { from { transform: translateY(-40px); opacity: 0; } }

/* 6 · Persianas de escaneo: la nueva aparece en franjas horizontales que se abren */
html:active-view-transition-type(blinds)::view-transition-old(root) { animation: vt-dim .5s ease-out both; }
html:active-view-transition-type(blinds)::view-transition-new(root) {
  -webkit-mask-image: repeating-linear-gradient(#000 0 var(--vt-s), transparent var(--vt-s) 28px);
  mask-image: repeating-linear-gradient(#000 0 var(--vt-s), transparent var(--vt-s) 28px);
  animation: vt-blinds .5s var(--ease-out) both;
}
@keyframes vt-blinds { from { --vt-s: 0px; } to { --vt-s: 28px; } }

/* 7 · Radar: la nueva se revela en un círculo que crece desde el centro, como un barrido */
html:active-view-transition-type(radar)::view-transition-old(root) { animation: vt-dim .55s ease-out both; }
html:active-view-transition-type(radar)::view-transition-new(root) { animation: vt-radar .55s var(--ease-out) both; }
@keyframes vt-radar { from { clip-path: circle(0% at 50% 45%); filter: brightness(1.6); } to { clip-path: circle(150% at 50% 45%); filter: brightness(1); } }

/* 8 · Paquete: la vieja sale inclinada hacia la izquierda; la nueva llega desde la derecha */
html:active-view-transition-type(packet)::view-transition-old(root) { animation: vt-packet-out .28s cubic-bezier(.5, 0, .75, 0) both; }
html:active-view-transition-type(packet)::view-transition-new(root) { animation: vt-packet-in .44s var(--ease-out) .1s both; }
@keyframes vt-packet-out { to { transform: translateX(-80px) skewX(8deg); opacity: 0; } }
@keyframes vt-packet-in { from { transform: translateX(80px) skewX(-8deg); opacity: 0; } }

/* 9 · Señal: parpadeo de pérdida de señal al salir y al entrar */
html:active-view-transition-type(signal)::view-transition-old(root) { animation: vt-signal-out .3s steps(1, end) both; }
html:active-view-transition-type(signal)::view-transition-new(root) { animation: vt-signal-in .4s steps(1, end) .18s both; }
@keyframes vt-signal-out { 0% { opacity: 1; } 20% { opacity: .2; } 35% { opacity: .9; } 55% { opacity: .1; } 70% { opacity: .6; } 100% { opacity: 0; } }
@keyframes vt-signal-in { 0% { opacity: 0; } 15% { opacity: .7; filter: contrast(2); } 30% { opacity: .1; } 50% { opacity: .9; } 65% { opacity: .4; } 100% { opacity: 1; filter: none; } }

/* 10 · Cortafuegos: la vieja se cierra hacia el centro; la nueva se abre desde el centro */
html:active-view-transition-type(firewall)::view-transition-old(root) { animation: vt-wall-close .28s cubic-bezier(.7, 0, .84, 0) both; }
html:active-view-transition-type(firewall)::view-transition-new(root) { animation: vt-wall-open .44s var(--ease-out) .24s both; }
@keyframes vt-wall-close { to { clip-path: inset(0 50% 0 50%); filter: brightness(1.8); } }
@keyframes vt-wall-open { from { clip-path: inset(0 50% 0 50%); filter: brightness(1.8); } to { clip-path: inset(0); filter: none; } }

/* ================= Detalles hacker ================= */

/* Cursor de terminal tras el titular de bienvenida */
.welcome-h::after { content: ''; display: inline-block; width: .45ch; height: .82em; margin-left: .14em; vertical-align: -.06em; background: var(--dot); animation: caret-blink 1.06s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Línea de estado tipo tmux */
.status-line { flex-basis: 100%; margin: 6px 0 0; font: 500 10.5px/1.4 var(--mono); color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { flex-wrap: wrap; }
.st-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #22c55e; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: st-pulse 2.4s var(--ease-out) infinite; }
@keyframes st-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70%, 100% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }
@media (max-width: 900px) { .main-foot .status-line { display: none; } }

/* Matrix al máximo (comando «matrix») */
.matrix-boost .matrix { filter: brightness(2.4) saturate(1.4); }

/* Progreso de lectura tipo descarga */
.progress-tag { position: fixed; top: 10px; right: 14px; z-index: 21; padding: 4px 9px; border-radius: 7px; font: 500 11.5px var(--mono); color: #d6ffe4; background: color-mix(in srgb, #0b111d 88%, transparent); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5); white-space: pre; pointer-events: none; opacity: 0; transform: translateY(-6px); transition: opacity .25s var(--ease), transform .25s var(--ease-out); }
.progress-tag.on { opacity: 1; transform: none; }

/* Ventana común: los tres puntos */
.term-dots { display: inline-flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }

/* Bloques de código como ventana de terminal */
.code-win { margin: 0 0 1.5em; border-radius: 12px; overflow: hidden; background: var(--code-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 12px 28px -16px rgba(0, 0, 0, .45); }
.code-win pre { margin: 0 !important; border-radius: 0 !important; }
.code-bar { display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); font: 500 11.5px var(--mono); color: #8b95a8; }
.code-lang { text-transform: lowercase; }
.code-copy { margin-left: auto; padding: 3px 9px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 6px; background: transparent; color: #c5cddb; font: inherit; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.code-copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Terminal */
.term { width: min(760px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 48px)); padding: 0; border: 1px solid #253049; border-radius: 14px; background: #0b111d; color: #c5cddb; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); overflow: hidden; font: 13.5px/1.6 var(--mono); }
.term[open] { display: flex; flex-direction: column; animation: term-in .32s var(--ease-out); }
.term::backdrop { background: rgba(5, 9, 16, .55); backdrop-filter: blur(3px); }
@keyframes term-in { from { opacity: 0; transform: translateY(14px) scale(.98); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.term-bar { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 14px; border-bottom: 1px solid #1d2840; font-size: 12px; color: #8b95a8; }
.term-title { flex: 1; text-align: center; }
.term-x { padding: 2px 8px; border: 1px solid #253049; border-radius: 6px; background: transparent; color: #8b95a8; font: inherit; cursor: pointer; }
.term-x:hover { color: #fff; border-color: #3b5a96; }
.term-out { flex: 1; overflow-y: auto; padding: 14px 16px 4px; scrollbar-color: #253049 transparent; }
.tl { white-space: pre-wrap; word-break: break-word; margin-bottom: 6px; }
.tl a { color: #93b4f2; text-underline-offset: 3px; }
.tl b { color: #f1f4f9; font-weight: 500; }
.term-ps { color: #4ade80; }
.t-cmd { color: #f1f4f9; margin-top: 8px; }
.t-err { color: #fca5a5; }
.t-ok { color: #4ade80; }
.t-d { color: #8b95a8; }
.t-perm { color: #4ade80; opacity: .75; }
/* listado «ls -l» de juegos: columnas que se reacomodan en pantallas angostas */
.t-ls { display: grid; grid-template-columns: 10.5ch 8ch 42ch auto; gap: 0 1.4ch; }
.t-ls.t-err .t-perm, .t-ls.t-err b { color: #fca5a5; opacity: 1; }
@media (max-width: 720px) {
  .t-ls { grid-template-columns: 8ch minmax(0, 1fr); }
  .t-ls .t-perm { display: none; }
  .t-ls > .t-d { grid-column: 2; }
}
.t-n { color: #f2b33d; }
.t-logo { color: #f2b33d; }
.term-in { padding: 8px 16px 14px; }
.term-in label { display: flex; gap: 10px; align-items: baseline; }
.term-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #f1f4f9; font: inherit; caret-color: #4ade80; }
@media (max-width: 600px) { .term { font-size: 12.5px; } .term-in .term-ps { display: none; } .term-in label::before { content: '$'; color: #4ade80; } }

/* Modo root: fósforo verde y líneas de barrido */
/* Claro: verdes oscuros sobre fondos menta, para que el texto conserve el contraste */
:root.root-mode { --dot: #15803d; --amber: #16a34a; --link: #166534; --accent: #166534; --accent-hover: #15803d; --accent-soft: #dcfce7; --amber-bg: #ecfdf3; }
:root.root-mode[data-theme="dark"] { --dot: #4ade80; --amber: #4ade80; --link: #86efac; --accent: #166534; --accent-hover: #15803d; --accent-soft: #10241a; --amber-bg: #10241a; }
:root.root-mode body::after { content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .035) 2px 3px); }
:root.root-mode[data-theme="dark"] body::after { background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .14) 2px 3px); mix-blend-mode: multiply; }
:root.root-mode .author-name::after { content: ' #'; color: var(--dot); font-family: var(--mono); }

/* 404 como terminal */
.nf-code { margin: 0 0 10px; font: 600 12px var(--mono); letter-spacing: .12em; color: #ef4444; }
.nf-trace { margin: 18px 0 22px; padding: 16px 18px; border-radius: 12px; background: var(--code-bg); color: #c5cddb; font: 13px/1.7 var(--mono); white-space: pre-wrap; word-break: break-word; }
.nf-trace a { color: #93b4f2; }


/* ---------- Juegos de la terminal ---------- */
.game { position: relative; margin: 8px 0 12px; outline: 0; }
.game-screen { margin: 0; padding: 10px 12px; border: 1px solid #1d2840; border-radius: 10px; background: #070b14; color: #c5cddb; font: min(13px, calc((100vw - 80px) / 28))/1.3 var(--mono); white-space: pre; overflow-x: auto; }
.game:focus-within .game-screen, .game:focus .game-screen { border-color: #2f4a7a; }
.game.done { opacity: .5; }
.game.done .game-pad { display: none; }
.game-key { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.game-screen b { font-weight: 600; }
.g-me { color: #f2b33d; }
.g-conf { color: #c084fc; }
.g-mon { color: #f87171; }
.g-boss { color: #f0abfc; text-shadow: 0 0 8px rgba(240, 171, 252, .6); }
.g-item { color: #93b4f2; }
.g-stairs { color: #4ade80; }
.g-lit { color: #8b95a8; }
.g-dim { color: #3a4763; }
.g-ok { color: #4ade80; }
.g-bad { color: #f87171; }
.c-ok, .c-near, .c-no, .c-cur, .c-empty { display: inline-block; min-width: 1.6em; padding: 1px 0; border-radius: 4px; text-align: center; }
.c-ok { background: #166534; color: #fff; }
.c-near { background: #a16207; color: #fff; }
.c-no { background: #253049; color: #8b95a8; }
.c-cur { border: 1px solid #3b5a96; color: #f1f4f9; }
.c-empty { color: #3a4763; }
.k-ok { color: #4ade80; font-weight: 600; }
.k-near { color: #f2b33d; font-weight: 600; }
.k-no { color: #3a4763; }
.game-pad { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; }
.pad-dirs { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; }
.pad-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.game-pad button { min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid #253049; border-radius: 10px; background: #111a2b; color: #f1f4f9; font: 600 14px var(--mono); cursor: pointer; touch-action: manipulation; }
.game-pad button:active { background: #1d2840; transform: scale(.96); }

/* Juegos con sprites: lienzo pixelado, HUD con barras y terminal más ancha mientras se juega */
.term.term-game { width: min(840px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.game-cv { display: block; max-width: 100%; height: auto; margin: 6px auto; border: 1px solid #1d2840; border-radius: 8px; background: #05080f; image-rendering: pixelated; }
.game-log { padding: 6px 10px; min-height: 2.6em; white-space: pre-wrap; }
.game-hud { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 6px 4px 0; font: 12px/1.5 var(--mono); color: #8b95a8; }
.game-hud b { color: #f1f4f9; font-weight: 600; }
.game-hud i { display: inline-block; width: 64px; height: 6px; margin: 0 6px; border-radius: 3px; background: #1d2840; vertical-align: 1px; overflow: hidden; }
.game-hud s { display: block; height: 100%; background: #4ade80; transition: width .25s var(--ease-out); }
.hud-xp s { background: #f2b33d; }
.game-hud .is-low, .game-hud .is-low b { color: #f87171; }
.hud-hp.is-low s { background: #f87171; animation: hud-blink .8s steps(1) infinite; }
@keyframes hud-blink { 50% { opacity: .35; } }
.hud-turn { margin-left: auto; color: #3a4763; }
.game-cv[hidden], .game-hud[hidden] { display: none; }

/* ---------- Modo neón: noche violeta, rosa y cian, atardecer y cuadrícula retro (truco NEONCITY) ---------- */
:root.neon-mode {
  --bg: #12062b; --surface: #1c0b3d; --raised: #24104c; --line: #3d1d6e; --text: #e6d6ff; --ink: #ffffff; --muted: #b59ad9;
  --accent: #8b2cff; --accent-hover: #a24dff; --accent-soft: #2b1050; --dot: #ff3fc8; --amber: #ff3fc8; --amber-bg: #2b1050;
  --link: #3ee8ff; --code-bg: #0b0320;
}
:root.neon-mode body { background: radial-gradient(120% 60% at 50% 115%, rgba(255, 63, 200, .28), rgba(255, 140, 66, .1) 35%, transparent 60%) fixed, var(--bg); }
/* cuadrícula en perspectiva al pie de la pantalla, detrás de todo */
:root.neon-mode body::before {
  content: ''; position: fixed; left: -50%; right: -50%; bottom: 0; height: 38vh; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to right, rgba(62, 232, 255, .22) 0 1px, transparent 1px 64px), repeating-linear-gradient(to bottom, rgba(255, 63, 200, .25) 0 1px, transparent 1px 32px);
  transform: perspective(300px) rotateX(60deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 60%); mask-image: linear-gradient(transparent, #000 60%);
}
:root.neon-mode .sidebar { background: rgba(18, 6, 43, .82); }
:root.neon-mode :is(h1, h2, .welcome-h) { color: #fff; text-shadow: 0 0 6px rgba(255, 63, 200, .85), 0 0 22px rgba(255, 63, 200, .45), 2px 0 0 rgba(62, 232, 255, .55); }
:root.neon-mode .prose a, :root.neon-mode .welcome-link { text-shadow: 0 0 8px rgba(62, 232, 255, .6); }
:root.neon-mode .avatar img { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #ff3fc8, 0 0 22px 4px rgba(255, 63, 200, .55); }
:root.neon-mode .author-name::after { content: ' ★'; color: #3ee8ff; text-shadow: 0 0 8px #3ee8ff; }
:root.neon-mode .btn:not(.btn-ghost) { background: linear-gradient(90deg, #ff3fc8, #8b2cff); border-color: transparent; box-shadow: 0 0 18px -4px rgba(255, 63, 200, .8); }
:root.neon-mode .card-thumb, :root.neon-mode .post-cover img, :root.neon-mode .code-win { box-shadow: 0 0 0 1px rgba(255, 63, 200, .25), 0 10px 30px -12px rgba(139, 44, 255, .55); }
:root.neon-mode .matrix { filter: hue-rotate(170deg) saturate(2.2) brightness(1.2); }
:root.neon-mode .progress { background: linear-gradient(90deg, #3ee8ff, #ff3fc8); box-shadow: 0 0 10px #ff3fc8; }
:root.neon-mode ::selection { background: rgba(255, 63, 200, .45); color: #fff; }
/* Modo neón + tema claro: la ciudad de día. Arena, mar turquesa, rosa flamenco y sol de atardecer */
:root.neon-mode[data-theme="light"] {
  --bg: #fff6ea; --surface: #ffeedd; --raised: #fffaf3; --line: #f5cdb4; --text: #4a2f45; --ink: #2b1236; --muted: #8f6a7d;
  --accent: #ff3d8b; --accent-hover: #e42f7a; --accent-soft: #ffe0ec; --dot: #00b8c4; --amber: #ff7a3d; --amber-bg: #ffeede;
  --link: #008c99; --code-bg: #fff1e2;
}
/* cielo con sol abajo a la derecha y una franja de mar con olas al pie de la pantalla */
:root.neon-mode[data-theme="light"] body {
  background:
    radial-gradient(34vmax 30vmax at 88% 104%, rgba(255, 154, 77, .34), rgba(255, 79, 139, .14) 48%, transparent 72%) fixed,
    linear-gradient(180deg, #e6f8fb 0%, #fbf1e1 34%, #fbf1e1 82%, #ead6b8 100%) fixed;
}
/* la orilla: tres olas orgánicas en paralaje (hondo, laguna, espuma) y una marea que sube y baja */
:root.neon-mode[data-theme="light"] body::before {
  height: 15vh; left: 0; right: 0; transform: none; opacity: .72;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 50 C100 18 200 18 300 50 S500 82 600 50 S800 18 900 50 S1100 82 1200 50 V120 H0Z' fill='%237fdcd6' fill-opacity='.45'/%3E%3Cpath d='M0 50 C100 18 200 18 300 50 S500 82 600 50 S800 18 900 50 S1100 82 1200 50' fill='none' stroke='%23ffffff' stroke-width='3' stroke-opacity='.9'/%3E%3C/svg%3E") 0 100% / 960px 58% repeat-x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 50 C100 18 200 18 300 50 S500 82 600 50 S800 18 900 50 S1100 82 1200 50 V120 H0Z' fill='%231fb3b8' fill-opacity='.6'/%3E%3C/svg%3E") 0 100% / 640px 78% repeat-x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 50 C100 18 200 18 300 50 S500 82 600 50 S800 18 900 50 S1100 82 1200 50 V120 H0Z' fill='%230d8796' fill-opacity='.55'/%3E%3C/svg%3E") 0 100% / 1200px 100% repeat-x;
  -webkit-mask-image: none; mask-image: none;
  animation: shore-drift 40s linear infinite, shore-tide 7s ease-in-out infinite alternate;
}
@keyframes shore-drift { to { background-position: -960px 100%, 640px 100%, -1200px 100%; } }
@keyframes shore-tide { from { transform: translateY(6px); } to { transform: translateY(-4px); } }
/* sombra de palmera que se mece despacio sobre la arena, en la esquina superior derecha */
:root.neon-mode[data-theme="light"] body::after {
  content: ''; position: fixed; top: -2vmin; right: -3vmin; width: 44vmin; height: 42vmin; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 320' preserveAspectRatio='none'%3E%3Cg fill='%232b1236'%3E%3Cpath d='M20 300 C60 220 110 160 190 120 C130 170 90 230 70 300Z'/%3E%3Cpath d='M190 120 C150 80 90 70 30 90 C90 95 140 105 175 130Z'/%3E%3Cpath d='M190 120 C200 70 240 30 300 20 C255 45 225 80 205 125Z'/%3E%3Cpath d='M190 120 C240 100 290 110 330 150 C285 135 245 130 205 132Z'/%3E%3Cpath d='M190 120 C175 160 170 210 185 260 C160 215 160 165 178 125Z'/%3E%3Cpath d='M190 120 C140 120 95 145 65 185 C105 160 145 140 182 130Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; opacity: .07; filter: blur(1.5px);
  transform-origin: 20% 95%; animation: palm-sway 11s ease-in-out infinite alternate;
}
@keyframes palm-sway { from { transform: rotate(-2.5deg) scaleX(-1); } to { transform: rotate(2deg) scaleX(-1); } }
:root.neon-mode[data-theme="light"] .sidebar { background: rgba(255, 246, 234, .86); }
:root.neon-mode[data-theme="light"] :is(h1, h2, .welcome-h) { color: var(--ink); text-shadow: 2px 2px 0 rgba(255, 79, 139, .22), 4px 4px 0 rgba(31, 179, 184, .16); }
:root.neon-mode[data-theme="light"] .prose a, :root.neon-mode[data-theme="light"] .welcome-link { text-shadow: none; }
:root.neon-mode[data-theme="light"] .avatar img { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #ff3d8b, 0 0 0 8px #00b8c4; }
:root.neon-mode[data-theme="light"] .author-name::after { content: ' ☀'; color: #ff7a3d; text-shadow: none; }
:root.neon-mode[data-theme="light"] .btn:not(.btn-ghost) { background: linear-gradient(90deg, #ff3d8b, #ff7a3d); color: #fff; box-shadow: 0 8px 18px -8px rgba(255, 61, 139, .7); }
:root.neon-mode[data-theme="light"] .card-thumb, :root.neon-mode[data-theme="light"] .post-cover img, :root.neon-mode[data-theme="light"] .code-win { box-shadow: 0 0 0 1px rgba(255, 61, 139, .2), 0 12px 28px -14px rgba(0, 140, 153, .5); }
:root.neon-mode[data-theme="light"] .matrix { filter: hue-rotate(140deg) saturate(1.6); }
:root.neon-mode[data-theme="light"] .progress { background: linear-gradient(90deg, #00b8c4, #ff3d8b, #ff7a3d); box-shadow: none; }
:root.neon-mode[data-theme="light"] ::selection { background: rgba(0, 184, 196, .3); color: var(--ink); }
.hud-cpu s { background: #22d3ee; }
.hud-buff b, .hud-buff { color: #22d3ee; }
.hud-gear b { color: #c084fc; }
.hud-spell b { color: #93c5fd; }
.game-hud .hud-spell.is-low b { color: #f87171; }

/* Texto de terminal animado: barrido de cursor por línea, glitch en títulos, barra de descifrado y cursor parpadeante */
.rv { display: inline-block; max-width: 100%; vertical-align: top; animation: rv-in var(--dur, .26s) steps(var(--st, 16), end) var(--d, 0ms) both; }
.rv-fast { --dur: .18s; --st: 10; }
@keyframes rv-in { from { clip-path: inset(0 100% 0 0); filter: brightness(2.2); } 70% { filter: brightness(1.4); } to { clip-path: inset(0); filter: none; } }
.rv-glitch { display: inline-block; animation: rv-glitch 2.8s steps(1) 1.2s infinite; }
@keyframes rv-glitch { 0%, 92%, 100% { transform: none; text-shadow: none; } 93% { transform: translateX(2px); text-shadow: -2px 0 #22d3ee, 2px 0 #f0abfc; } 95% { transform: translateX(-2px); text-shadow: 2px 0 #22d3ee, -2px 0 #f0abfc; } 97% { transform: none; text-shadow: 1px 0 #f87171; } }
.rv-bar { display: inline-block; animation: rv-in 1.1s steps(24, end) var(--d, 0ms) both; }
.rv-blink { animation: hud-blink 1s steps(1) infinite; }
.rv-cur { display: inline-block; width: .6em; height: 1.05em; vertical-align: -.15em; background: currentColor; animation: hud-blink 1s steps(1) infinite; }

/* Ciudad Zero-Day: cuadro de diálogo de los personajes */
.city-dlg { display: grid; gap: 4px; margin: 6px 0; padding: 10px 12px; border: 1px solid #3b5a96; border-left: 3px solid #f2b33d; border-radius: 8px; background: #0b1324; color: #e5e7eb; font: 13px/1.5 var(--mono); cursor: pointer; }
.city-dlg[hidden] { display: none; }
.city-who { color: #f2b33d; font-weight: 700; }
.city-dlg small { color: #64748b; font-size: 11px; }
.city-shop { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 3px; max-height: 260px; overflow-y: auto; }
.city-shop li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 5px 8px; border: 1px solid #1d2840; border-radius: 6px; cursor: pointer; }
.city-shop li.on { border-color: #f2b33d; background: #1a2336; }
.city-shop li.off span, .city-shop li.off b { opacity: .45; }
.city-shop li b { color: #f2b33d; }
.city-shop li em { grid-column: 1 / -1; font-style: normal; font-size: 11px; color: #8b95a8; }
.hud-keys { flex-basis: 100%; color: #64748b; font-size: 11px; }
.casino-show { margin: 4px 0; padding: 8px 10px; border: 1px solid #facc15; border-radius: 6px; background: #1c1407; color: #fde68a; font: 600 13px/1.4 var(--mono); white-space: pre; overflow-x: auto; }

/* Juegos: botón «ayuda» translúcido, panel de controles y barra de «mantén R» */
.game-help-btn { position: absolute; top: 14px; right: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border: 0; border-radius: 8px; background: rgba(8, 12, 22, .42); color: #e9fbef; font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(4px); isolation: isolate; transition: background .25s, transform .25s var(--ease-out); }
/* borde de neón que recorre el botón como un escáner */
.game-help-btn::before { content: ''; position: absolute; inset: 0; z-index: -1; padding: 1.5px; border-radius: inherit; background: conic-gradient(from var(--ghb-ang), transparent 0 55%, #4ade80 72%, #22d3ee 84%, transparent 96%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ghb-spin 2.8s linear infinite; }
/* pulso de radar alrededor del icono */
.game-help-btn::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #4ade80, transparent); opacity: .7; pointer-events: none; animation: ghb-scan 2.4s ease-in-out infinite; }
.ghb-ico { display: grid; place-items: center; min-width: 22px; height: 20px; padding: 0 2px; border: 1px solid rgba(74, 222, 128, .55); border-radius: 5px; background: rgba(74, 222, 128, .12); color: #4ade80; font-size: 12px; text-shadow: 0 0 6px rgba(74, 222, 128, .8); transition: transform .45s var(--ease-out), background .25s; }
.ghb-cur { width: 6px; height: 12px; margin-left: -3px; background: #4ade80; animation: ghb-blink 1s steps(1) infinite; }
.ghb-txt { position: relative; text-shadow: 0 0 8px rgba(74, 222, 128, .55); }
/* fallo de señal cada pocos segundos: dos copias desplazadas en cian y rosa */
.ghb-txt::before, .ghb-txt::after { content: attr(data-t); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.ghb-txt::before { color: #22d3ee; animation: ghb-glitch 4.2s steps(1) infinite; }
.ghb-txt::after { color: #f472b6; animation: ghb-glitch 4.2s steps(1) .08s infinite reverse; }
.game-help-btn:hover, .game-help-btn:focus-visible, .game-help-btn[aria-expanded="true"] { background: rgba(8, 12, 22, .72); transform: translateY(-1px); }
.game-help-btn:hover .ghb-ico, .game-help-btn[aria-expanded="true"] .ghb-ico { background: #4ade80; color: #04120b; text-shadow: none; transform: rotate(-8deg) scale(1.08); }
.game-help-btn:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
@property --ghb-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ghb-spin { to { --ghb-ang: 360deg; } }
@keyframes ghb-scan { 0%, 100% { transform: scaleX(.2); opacity: .2; } 50% { transform: scaleX(1); opacity: .8; } }
@keyframes ghb-blink { 50% { opacity: 0; } }
@keyframes ghb-glitch { 0%, 90%, 100% { opacity: 0; transform: none; clip-path: none; } 91% { opacity: .9; transform: translate(-2px, -1px); clip-path: inset(0 0 58% 0); } 93% { opacity: .9; transform: translate(2px, 1px); clip-path: inset(42% 0 0 0); } 95% { opacity: .7; transform: translate(-1px, 0); clip-path: inset(20% 0 30% 0); } 96% { opacity: 0; } }
.game-help:not([hidden]) { animation: ghp-in .28s var(--ease-out); }
@keyframes ghp-in { from { opacity: 0; transform: translateY(-6px) scale(.97); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
/* mientras se juega, la consola solo muestra el juego activo: la ventana queda arriba y no hay que desplazarse */
.term.term-game .term-out > :not(.game), .term.term-game .term-out > .game.done { display: none; }
.game-help { position: absolute; top: 48px; right: 16px; z-index: 3; max-width: min(420px, calc(100% - 12px)); padding: 12px 14px; border: 1px solid rgba(241, 244, 249, .2); border-radius: 10px; background: rgba(10, 14, 24, .72); color: #e6eaf2; font: 12px/1.5 var(--mono); backdrop-filter: blur(6px); cursor: pointer; }
.game-help[hidden] { display: none; }
.game-help b { display: block; margin-bottom: 6px; color: #4ade80; letter-spacing: .08em; text-transform: uppercase; }
.game-help dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.game-help dt { color: #facc15; white-space: nowrap; }
.game-help dd { margin: 0; color: #c7cede; }
.game-help small { display: block; margin-top: 8px; color: #8b95a8; }
.game-hold { position: absolute; left: 50%; top: 40%; z-index: 4; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 10px; background: rgba(10, 14, 24, .8); color: #f1f4f9; font: 13px/1.4 var(--mono); text-align: center; pointer-events: none; }
.game-hold[hidden] { display: none; }
.game-hold i { display: block; height: 4px; margin-top: 8px; border-radius: 2px; background: #f87171; width: 0; }
.game-hold.on i { animation: hold-r 5s linear forwards; }
@keyframes hold-r { to { width: 100%; } }

/* Consejos: tarjeta sobria con icono, etiqueta y entrada suave */
.g-tip { position: relative; display: block; margin: 8px 0; padding: 8px 12px 8px 40px; border: 1px solid rgba(74, 222, 128, .22); border-left: 3px solid #4ade80; border-radius: 8px; background: rgba(74, 222, 128, .06); color: #e6eaf2; font: 13px/1.5 var(--mono); white-space: normal; animation: tip-in .35s var(--ease-out) both; }
.g-tip-ico { position: absolute; left: 11px; top: 9px; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(74, 222, 128, .6); border-radius: 5px; color: #4ade80; font-size: 11px; font-weight: 700; }
.g-tip-lbl { display: block; margin-bottom: 1px; color: #4ade80; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Juegos en pantallas pequeñas: el texto se ajusta al ancho, la ayuda no tapa el juego y los controles táctiles ocupan menos alto */
@media (max-width: 640px) {
  .game { padding-top: 38px; }
  .game-help-btn { top: 0; right: 0; }
  .game-help { top: 40px; right: 0; max-width: 100%; }
  .game-screen { white-space: pre-wrap; overflow-wrap: anywhere; }
  .game-pad { flex-wrap: nowrap; gap: 10px; align-items: center; }
  .pad-dirs { grid-template-columns: repeat(3, 40px); flex: none; }
  .game-pad button { min-width: 40px; height: 40px; padding: 0 8px; font-size: 13px; }
  .pad-acts { display: grid; flex: 1; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
}
/* celulares bajitos: el mapa se encoge para que los controles quepan sin desplazar */
@media (max-width: 640px) and (max-height: 760px) {
  .game-cv { max-height: 36vh; object-fit: contain; }
  .game-hud { font-size: 11px; gap: 2px 10px; }
  .game { padding-top: 34px; }
}
@media (max-width: 360px) {
  .pad-dirs { grid-template-columns: repeat(3, 36px); gap: 3px; }
  .game-pad button { min-width: 36px; height: 36px; padding: 0 4px; font-size: 12px; }
  .pad-acts { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .game-cv { max-height: 30vh; object-fit: contain; }
}

/* fila de tema recién descubierto: se «descifra» con un barrido de luz */
.skin-new { display: inline-block; animation: skin-reveal 1.1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes skin-reveal { from { clip-path: inset(0 100% 0 0); filter: brightness(2.2); background: rgba(74, 222, 128, .25); } 60% { filter: brightness(1.4); } to { clip-path: inset(0 0 0 0); filter: none; background: transparent; } }

/* ==========================================================================
   Temas ocultos v3. Cada tema es un mundo: paleta clara y oscura afinadas para lectura larga,
   tipografía propia (se descarga al activarlo), tratamiento de componentes y un único gesto memorable.
   ========================================================================== */
:root[data-skin="ambar"][data-theme="light"] { --bg: #fbfaf3; --surface: #f1f0e4; --raised: #fffef8; --line: #d9d4c3; --text: #33302a; --ink: #141210; --muted: #69665b; --accent: #3f6f3a; --accent-hover: #2f582b; --accent-soft: #e6f0dd; --dot: #3f6f3a; --amber: #b7791f; --amber-bg: #f6efd9; --link: #2f5d8a; --code-bg: #22201b; }
:root[data-skin="ambar"][data-theme="dark"] { --bg: #140c03; --surface: #1c1207; --raised: #22170b; --line: #3d2b13; --text: #e0cba8; --ink: #ffcf7a; --muted: #b8803a; --accent: #b35f00; --accent-hover: #cc7000; --accent-soft: #2a1a06; --dot: #ffb000; --amber: #ffb000; --amber-bg: #2a1a06; --link: #ffcf70; --code-bg: #0c0601; }
:root[data-skin="vapor"][data-theme="light"] { --bg: #fdf0f8; --surface: #f4e8ff; --raised: #fffaff; --line: #ead2ef; --text: #40314e; --ink: #2a1e3a; --muted: #6e5e7e; --accent: #b0329f; --accent-hover: #952888; --accent-soft: #fbe0f4; --dot: #1b9aaa; --amber: #e08d00; --amber-bg: #fff1dc; --link: #126b76; --code-bg: #2a1e3a; }
:root[data-skin="vapor"][data-theme="dark"] { --bg: #1a0f2e; --surface: #24153f; --raised: #2c1a4d; --line: #4a2c74; --text: #dcd0f2; --ink: #efeef0; --muted: #b39ddb; --accent: #c2187a; --accent-hover: #d6248a; --accent-soft: #3a1d55; --dot: #05ffa1; --amber: #ff71ce; --amber-bg: #3a1d55; --link: #01cdfe; --code-bg: #120a22; }
:root[data-skin="plano"][data-theme="light"] { --bg: #f7fbff; --surface: #eaf2fb; --raised: #ffffff; --line: #c9dcf2; --text: #1d3557; --ink: #0b2545; --muted: #536883; --accent: #1d5fa8; --accent-hover: #164b86; --accent-soft: #dceaf8; --dot: #c0392b; --amber: #c0392b; --amber-bg: #fdecea; --link: #b63629; --code-bg: #0b2545; }
:root[data-skin="plano"][data-theme="dark"] { --bg: #0f3d78; --surface: #134789; --raised: #165096; --line: #5d8ccc; --text: #fbfcff; --ink: #ffffff; --muted: #9fc0ea; --accent: #c0392b; --accent-hover: #d9473a; --accent-soft: #164f8c; --dot: #ffe08a; --amber: #ffe08a; --amber-bg: #164f8c; --link: #ffe08a; --code-bg: #072a52; }
:root[data-skin="noir"][data-theme="light"] { --bg: #f2ead9; --surface: #e9dec8; --raised: #f7f1e4; --line: #cdbd9f; --text: #372e23; --ink: #1d1710; --muted: #675a49; --accent: #7a1f1f; --accent-hover: #611818; --accent-soft: #ecd9c4; --dot: #7a1f1f; --amber: #7a1f1f; --amber-bg: #efdcc8; --link: #5a3b1a; --code-bg: #1d1710; }
:root[data-skin="noir"][data-theme="dark"] { --bg: #141312; --surface: #1c1b19; --raised: #22201e; --line: #3a3633; --text: #ddd7cc; --ink: #f3eee4; --muted: #a59d90; --accent: #8b0000; --accent-hover: #a50000; --accent-soft: #2a1414; --dot: #d01c1c; --amber: #d01c1c; --amber-bg: #2a1414; --link: #e6e6e6; --code-bg: #080808; }
:root[data-skin="bios"][data-theme="light"] { --bg: #d4d0c8; --surface: #c6c2b9; --raised: #e6e3dc; --line: #808080; --text: #111111; --ink: #000000; --muted: #3f3f3f; --accent: #000080; --accent-hover: #0000a8; --accent-soft: #b9c3e6; --dot: #008080; --amber: #000080; --amber-bg: #dfe4f5; --link: #0000ee; --code-bg: #000000; }
:root[data-skin="bios"][data-theme="dark"] { --bg: #0b1766; --surface: #111f7a; --raised: #16268a; --line: #4a58b8; --text: #dfe3f2; --ink: #f4f6ff; --muted: #9aa4e6; --accent: #007f7f; --accent-hover: #009999; --accent-soft: #16268a; --dot: #ffff55; --amber: #ffff55; --amber-bg: #16268a; --link: #ffff55; --code-bg: #000a5c; }
:root[data-skin="onion"][data-theme="light"] { --bg: #f6f1fb; --surface: #ece2f6; --raised: #fbf8fe; --line: #d9c8ea; --text: #3e2a52; --ink: #24133a; --muted: #69597c; --accent: #7d4698; --accent-hover: #66397e; --accent-soft: #eadcf5; --dot: #7d4698; --amber: #a0679f; --amber-bg: #f3e8f8; --link: #6a3d9a; --code-bg: #24133a; }
:root[data-skin="onion"][data-theme="dark"] { --bg: #170b24; --surface: #20102f; --raised: #28143a; --line: #40235a; --text: #d9c8ee; --ink: #f0e8fb; --muted: #9a86b5; --accent: #7d4698; --accent-hover: #9156ad; --accent-soft: #30184a; --dot: #c79bf0; --amber: #c79bf0; --amber-bg: #30184a; --link: #b48ee0; --code-bg: #0f0619; }
:root[data-skin="aurora"][data-theme="light"] { --bg: #f2f8fc; --surface: #e6f1f8; --raised: #fbfdff; --line: #c9dfec; --text: #203c51; --ink: #0f2a3d; --muted: #536977; --accent: #236fa3; --accent-hover: #216a9b; --accent-soft: #dcecf7; --dot: #2a7fb8; --amber: #6c63d9; --amber-bg: #e7ecfb; --link: #1d6996; --code-bg: #0f2a3d; }
:root[data-skin="aurora"][data-theme="dark"] { --bg: #06121f; --surface: #0b1c2d; --raised: #0f2438; --line: #1d3a52; --text: #bfd5e1; --ink: #e4edf2; --muted: #86a3b5; --accent: #1a7a63; --accent-hover: #249c7f; --accent-soft: #123345; --dot: #6ff3c5; --amber: #b18cff; --amber-bg: #1c2443; --link: #6ff3c5; --code-bg: #040b14; }
:root[data-skin="selva"][data-theme="light"] { --bg: #f3f8ee; --surface: #e6f0dc; --raised: #fafdf6; --line: #c8dbb8; --text: #2b3c29; --ink: #142414; --muted: #556950; --accent: #2e7d32; --accent-hover: #24672a; --accent-soft: #dcebd0; --dot: #d84315; --amber: #f5a623; --amber-bg: #fdf0d8; --link: #b13428; --code-bg: #142414; }
:root[data-skin="selva"][data-theme="dark"] { --bg: #07140d; --surface: #0d1f15; --raised: #11271b; --line: #1d3a29; --text: #bdd7c4; --ink: #e0efe4; --muted: #86a892; --accent: #2e7d4f; --accent-hover: #37925d; --accent-soft: #123321; --dot: #f2c94c; --amber: #f2c94c; --amber-bg: #2a2a12; --link: #f2c94c; --code-bg: #030b06; }
:root[data-skin="arenal"][data-theme="light"] { --bg: #f4f1ee; --surface: #e9e4df; --raised: #faf8f6; --line: #d4cbc3; --text: #3a312c; --ink: #1c1512; --muted: #685d55; --accent: #c2410c; --accent-hover: #a8380a; --accent-soft: #f6e1d6; --dot: #c2410c; --amber: #c2410c; --amber-bg: #f8e4d8; --link: #a63600; --code-bg: #1c1512; }
:root[data-skin="arenal"][data-theme="dark"] { --bg: #140806; --surface: #1f0d09; --raised: #28120d; --line: #47221a; --text: #e2c8ba; --ink: #f1e4dc; --muted: #b08a7a; --accent: #c2410c; --accent-hover: #d9480f; --accent-soft: #33140c; --dot: #ff5a1f; --amber: #ff8c42; --amber-bg: #33140c; --link: #ff8c42; --code-bg: #0b0403; }
:root[data-skin="pixel"][data-theme="light"] { --bg: #d6dfb8; --surface: #c9d4a6; --raised: #e0e7c7; --line: #97a76a; --text: #1c270c; --ink: #152008; --muted: #49572c; --accent: #306230; --accent-hover: #255025; --accent-soft: #bccb92; --dot: #0f380f; --amber: #306230; --amber-bg: #c6d29e; --link: #0f380f; --code-bg: #1d2a10; }
:root[data-skin="pixel"][data-theme="dark"] { --bg: #0f380f; --surface: #1b4a1b; --raised: #225422; --line: #3c6e3c; --text: #f3f8e8; --ink: #e8f5c8; --muted: #a9c58a; --accent: #306230; --accent-hover: #3b763b; --accent-soft: #1f4f1f; --dot: #c8e06a; --amber: #c8e06a; --amber-bg: #1f4f1f; --link: #e3f29a; --code-bg: #0a2a0a; }

/* base común: capas decorativas siempre detrás del contenido, superficies del navegador del tema */
:root[data-skin] body::before, :root[data-skin] body::after { content: none; position: fixed; pointer-events: none; z-index: -1; }
:root[data-skin] { scrollbar-color: color-mix(in srgb, var(--accent) 70%, var(--bg)) var(--surface); caret-color: var(--accent); accent-color: var(--accent); }
:root[data-skin] ::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
:root[data-skin] :focus-visible { outline-color: var(--accent); }
:root[data-skin] .prose a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:root[data-skin] .progress { background: var(--dot); }

/* 1 · FÓSFORO ÁMBAR. Noche: terminal de fósforo, letra VT323 enorme y tubo curvo. Día: papel continuo de impresora de línea */
:root[data-skin="ambar"] { --display: 'VT323', var(--mono); }
:root[data-skin="ambar"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .01em; line-height: 1.02; }
:root[data-skin="ambar"] .hero h1 { font-size: clamp(48px, 6.4vw, 80px); }
:root[data-skin="ambar"] .post-header h1 { font-size: clamp(42px, 5.4vw, 64px); }
:root[data-skin="ambar"] :is(.section-title, .prose h2) { font-size: 34px; }
:root[data-skin="ambar"] .card-title { font-size: 25px; line-height: 1.05; }
:root[data-skin="ambar"] .tag { border-radius: 2px; background: none; border: 1px solid var(--line); }
:root[data-skin="ambar"] .tag::before { content: '['; opacity: .55; } :root[data-skin="ambar"] .tag::after { content: ']'; opacity: .55; }
:root[data-skin="ambar"] :is(.card-thumb, .card-lesson, .box, .prose blockquote, .btn) { border-radius: 3px; }
:root[data-skin="ambar"][data-theme="dark"] body { background: radial-gradient(ellipse at 50% 40%, #24170a 0%, #140c03 70%) fixed; }
:root[data-skin="ambar"][data-theme="dark"] body::after { content: ''; inset: 0; z-index: 90; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .09) 2px 3px), radial-gradient(ellipse 125% 95% at 50% 50%, transparent 62%, rgba(0, 0, 0, .34) 100%); }
:root[data-skin="ambar"][data-theme="dark"] :is(h1, h2, .welcome-h, .card-title a) { color: #ffc768; text-shadow: 0 0 6px rgba(255, 170, 40, .38), 0 0 18px rgba(255, 140, 0, .16); }
:root[data-skin="ambar"][data-theme="dark"] .card-thumb, :root[data-skin="ambar"][data-theme="dark"] .post-cover img { filter: sepia(.35) saturate(1.1) brightness(.92); box-shadow: 0 0 0 1px var(--line); }
:root[data-skin="ambar"][data-theme="light"] body { background: repeating-linear-gradient(to bottom, #fbf9f0 0 2.6em, #eff5e8 2.6em 5.2em); }
@media (min-width: 900px) { :root[data-skin="ambar"][data-theme="light"] body::before { content: ''; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'%3E%3Ccircle cx='12' cy='12' r='5' fill='%23ddd7c4'/%3E%3C/svg%3E") 6px 0 / 24px 24px repeat-y, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'%3E%3Ccircle cx='12' cy='12' r='5' fill='%23ddd7c4'/%3E%3C/svg%3E") calc(100% - 6px) 0 / 24px 24px repeat-y; } }
:root[data-skin="ambar"][data-theme="light"] :is(h1, h2, .welcome-h) { color: #1f1d19; text-shadow: .6px .6px 0 rgba(31, 29, 25, .22); }
:root[data-skin="ambar"][data-theme="light"] .card-lesson, :root[data-skin="ambar"][data-theme="light"] .box { border-style: dashed; }

/* 2 · VAPORWAVE. Un sol rayado que se pone sin parar detrás de la portada; títulos con doble eco cromado */
:root[data-skin="vapor"] { --display: 'Righteous', var(--sans); }
:root[data-skin="vapor"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .004em; }
:root[data-skin="vapor"][data-theme="dark"] body { background: linear-gradient(180deg, #1a0f2e 0%, #2a0f45 60%, #3a0f4e 100%) fixed; }
:root[data-skin="vapor"][data-theme="light"] body { background: linear-gradient(180deg, #fdf0f8 0%, #f4e8ff 60%, #e3f7f4 100%) fixed; }
:root[data-skin="vapor"] body::before { content: ''; left: 50%; bottom: -16vmin; width: 54vmin; height: 54vmin; margin-left: -27vmin; border-radius: 50%;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(5% + 2px), var(--bg) calc(5% + 2px) 6%) 0 0 / 100% 60% repeat-y, linear-gradient(180deg, #ffd319 10%, #ff901f 45%, #ff2975 75%, #b20fa6);
  -webkit-mask-image: linear-gradient(#000 52%, transparent 52%), linear-gradient(transparent 52%, #000 52%); opacity: .32; animation: vapor-bands 6s linear infinite; }
:root[data-skin="vapor"][data-theme="light"] body::before { opacity: .24; }
:root[data-skin="vapor"] body:has(.post-header)::before { opacity: .12; }
@keyframes vapor-bands { to { background-position: 0 6%, 0 0; } }
:root[data-skin="vapor"][data-theme="dark"] :is(h1, .welcome-h) { color: #fff6ff; text-shadow: 2px 2px 0 rgba(1, 205, 254, .36), -2px -1px 0 rgba(255, 113, 206, .32); }
:root[data-skin="vapor"][data-theme="light"] :is(h1, .welcome-h) { text-shadow: 2px 2px 0 rgba(27, 154, 170, .22), -2px -1px 0 rgba(194, 57, 179, .2); }
:root[data-skin="vapor"] .card-thumb, :root[data-skin="vapor"] .post-cover img { border-radius: 14px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--dot) 40%, transparent), 0 14px 30px -18px color-mix(in srgb, var(--accent) 70%, transparent); }
:root[data-skin="vapor"] .tag { background: color-mix(in srgb, var(--dot) 16%, transparent); }

/* 3 · PLANO TÉCNICO. Cianotipo de noche, papel milimetrado de día; rotulación de dibujante y marcas de registro en cada portada */
:root[data-skin="plano"] { --display: 'Architects Daughter', var(--sans); }
:root[data-skin="plano"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .01em; }
:root[data-skin="plano"] .hero h1 { font-size: clamp(36px, 4.8vw, 58px); }
:root[data-skin="plano"][data-theme="dark"] body { background: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
:root[data-skin="plano"][data-theme="light"] body { background: linear-gradient(rgba(29,95,168,.11) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(90deg, rgba(29,95,168,.11) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(rgba(29,95,168,.045) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(29,95,168,.045) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
:root[data-skin="plano"] .welcome-h { position: relative; padding-bottom: 22px; }
:root[data-skin="plano"] .welcome-h::after { content: ''; position: absolute; left: 0; right: 14%; bottom: 0; height: 10px; width: auto; animation: none;
  background: linear-gradient(var(--dot), var(--dot)) 0 50% / 100% 1.5px no-repeat, linear-gradient(var(--dot), var(--dot)) 0 0 / 1.5px 100% no-repeat, linear-gradient(var(--dot), var(--dot)) 100% 0 / 1.5px 100% no-repeat; }
:root[data-skin="plano"] :is(.card-thumb, .post-cover) { position: relative; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); overflow: visible; }
:root[data-skin="plano"] .card-thumb::after { content: ''; position: absolute; top: -8px; right: -8px; width: 16px; height: 16px; color: var(--dot); background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'%3E%3Cg stroke='currentColor' stroke-width='1.5' fill='none'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Cpath d='M12 0V24M0 12H24'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' preserveAspectRatio='xMidYMid meet'%3E%3Cg stroke='currentColor' stroke-width='1.5' fill='none'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Cpath d='M12 0V24M0 12H24'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
:root[data-skin="plano"] :is(.card-lesson, .box, .prose blockquote) { border-radius: 2px; border-style: dashed; }
:root[data-skin="plano"] .tag { border-radius: 2px; background: none; border: 1px solid var(--line); }
:root[data-skin="plano"] body::after { content: 'TODOHACK · HOJA 1 DE 1 · ESCALA 1:1 · REV. C'; right: 18px; bottom: 16px; z-index: 1; padding: 8px 12px; border: 1.5px solid var(--muted); color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: .12em; background: var(--bg); }
@media (max-width: 900px) { :root[data-skin="plano"] body::after { display: none; } }

/* 4 · CINE NEGRO. Las portadas pasan a blanco y negro (de día, a sepia), persianas de luz, grano y una serifa de lectura */
:root[data-skin="noir"] { --display: 'Playfair Display', Georgia, serif; --sans: 'Source Serif 4', Georgia, serif; }
:root[data-skin="noir"] body { font-family: var(--sans); }
:root[data-skin="noir"] .prose { font-size: 1.06em; line-height: 1.72; }
:root[data-skin="noir"] :is(h1, h2, h3, .welcome-h) { font-weight: 900; font-style: italic; letter-spacing: -.012em; }
:root[data-skin="noir"] :is(.nav, .tag, .meta, .btn, .toc, .status-line) { font-family: Inter, system-ui, sans-serif; }
:root[data-skin="noir"] :is(.card-thumb, .post-cover img, .card-lesson, .box, .prose blockquote, .btn) { border-radius: 0; }
:root[data-skin="noir"][data-theme="dark"] .card-thumb img, :root[data-skin="noir"][data-theme="dark"] .post-cover img { filter: grayscale(1) contrast(1.12) brightness(.92); transition: filter .6s var(--ease); }
:root[data-skin="noir"][data-theme="light"] .card-thumb img, :root[data-skin="noir"][data-theme="light"] .post-cover img { filter: sepia(.75) contrast(1.05) brightness(.98); transition: filter .6s var(--ease); }
:root[data-skin="noir"] .card:hover .card-thumb img { filter: none; }
:root[data-skin="noir"][data-theme="dark"] body { background: radial-gradient(ellipse 90% 80% at 50% 35%, #1d1c1a 0%, #0b0b0a 100%) fixed; }
:root[data-skin="noir"][data-theme="dark"] body::before { content: ''; inset: 0; background: repeating-linear-gradient(168deg, rgba(255, 245, 220, .04) 0 22px, transparent 22px 56px); -webkit-mask-image: radial-gradient(70% 70% at 88% 6%, #000, transparent 72%); mask-image: radial-gradient(70% 70% at 88% 6%, #000, transparent 72%); }
:root[data-skin="noir"] body::after { content: ''; inset: -50%; z-index: 90; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160' preserveAspectRatio='xMidYMid meet'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E"); opacity: .04; animation: noir-grain .9s steps(5) infinite; }
:root[data-skin="noir"][data-theme="light"] body::after { opacity: .055; mix-blend-mode: multiply; }
@keyframes noir-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }
:root[data-skin="noir"] .prose blockquote { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; font-style: italic; font-size: 1.12em; }

/* 5 · BIOS. Noche: utilidad de configuración, marcos de doble línea y título en video inverso. Día: escritorio clásico en relieve */
:root[data-skin="bios"] { --display: 'Share Tech Mono', var(--mono); }
:root[data-skin="bios"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: 0; }
:root[data-skin="bios"] :is(.card-thumb, .card-lesson, .box, .prose blockquote, .btn, .tag, .prose pre) { border-radius: 0; }
:root[data-skin="bios"][data-theme="dark"] .welcome-h { display: inline; background: #d4d8e8; color: #0b1766; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .18em; line-height: 1.38; }
:root[data-skin="bios"][data-theme="dark"] body::after { content: ''; inset: 8px; z-index: 90; border: 4px double rgba(212, 216, 232, .42); }
:root[data-skin="bios"][data-theme="dark"] :is(.card-lesson, .box) { border: 3px double color-mix(in srgb, var(--text) 45%, transparent); background: transparent; }
:root[data-skin="bios"][data-theme="dark"] .nav a[aria-current="page"] { background: #d4d8e8; color: #0b1766; }
:root[data-skin="bios"][data-theme="dark"] .nav a[aria-current="page"] svg { color: #0b1766; }
:root[data-skin="bios"][data-theme="light"] .welcome-h { display: inline; background: #000080; color: #fff; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .18em; line-height: 1.38; }
:root[data-skin="bios"][data-theme="light"] body::before { content: ''; left: 0; right: 0; top: 0; height: 4px; z-index: 90; background: linear-gradient(90deg, #000080, #1084d0); }
:root[data-skin="bios"][data-theme="light"] :is(.btn, .btn-ghost, .tag, .card-lesson, .box) { border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff; box-shadow: none; }
:root[data-skin="bios"][data-theme="light"] .btn:active { border-color: #808080 #ffffff #ffffff #808080; }
:root[data-skin="bios"][data-theme="light"] .card-thumb { border: 2px solid; border-color: #808080 #ffffff #ffffff #808080; box-shadow: none; }

/* 6 · RED CEBOLLA. Todo tiene capas: las portadas y recuadros llevan pieles concéntricas, y los anillos crecen desde la esquina */
:root[data-skin="onion"] { --display: 'Major Mono Display', var(--mono); }
:root[data-skin="onion"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .015em; line-height: 1.12; }
:root[data-skin="onion"] body::before { content: ''; top: 0; right: 0; width: min(70vmin, 620px); height: min(70vmin, 620px); color: var(--accent); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' preserveAspectRatio='xMaxYMin meet'%3E%3Cg fill='none' stroke='%237d4698' stroke-width='1.2'%3E%3Ccircle cx='400' cy='0' r='40'/%3E%3Ccircle cx='400' cy='0' r='74'/%3E%3Ccircle cx='400' cy='0' r='108'/%3E%3Ccircle cx='400' cy='0' r='142'/%3E%3Ccircle cx='400' cy='0' r='176'/%3E%3Ccircle cx='400' cy='0' r='210'/%3E%3Ccircle cx='400' cy='0' r='244'/%3E%3Ccircle cx='400' cy='0' r='278'/%3E%3Ccircle cx='400' cy='0' r='312'/%3E%3Ccircle cx='400' cy='0' r='346'/%3E%3Ccircle cx='400' cy='0' r='380'/%3E%3Ccircle cx='400' cy='0' r='414'/%3E%3C/g%3E%3C/svg%3E") top right / contain no-repeat; opacity: .32; transform-origin: 100% 0; animation: onion-breathe 10s ease-in-out infinite alternate; }
:root[data-skin="onion"][data-theme="light"] body::before { opacity: .22; }
@keyframes onion-breathe { to { transform: scale(1.06); } }
:root[data-skin="onion"] :is(.card-thumb, .post-cover img) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 0 12px color-mix(in srgb, var(--accent) 6%, transparent); }
:root[data-skin="onion"] :is(.card-lesson, .box) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
:root[data-skin="onion"][data-theme="dark"] :is(h1, .welcome-h) { text-shadow: 0 0 22px rgba(199, 155, 240, .32); }

/* 7 · AURORA. Noche polar con cintas de luz que tiñen el cielo y los bordes; de día, nieve fina sobre azul hielo */
:root[data-skin="aurora"] { --display: 'Fraunces', Georgia, serif; }
:root[data-skin="aurora"] :is(h1, h2, h3, .welcome-h) { font-weight: 600; letter-spacing: -.018em; }
:root[data-skin="aurora"][data-theme="dark"] body::before { content: ''; left: -10%; right: -10%; top: -12vh; height: 70vh;
  background: radial-gradient(45% 35% at 30% 40%, rgba(111, 243, 197, .26), transparent 70%), radial-gradient(40% 30% at 65% 25%, rgba(177, 140, 255, .22), transparent 70%), radial-gradient(35% 25% at 85% 50%, rgba(80, 200, 255, .16), transparent 70%);
  filter: blur(28px); animation: aurora-drift 22s ease-in-out infinite alternate; }
@keyframes aurora-drift { from { transform: translateX(-4%) skewX(-6deg); } to { transform: translateX(4%) skewX(6deg); } }
:root[data-skin="aurora"][data-theme="dark"] :is(h1, .welcome-h) { text-shadow: 0 0 30px rgba(111, 243, 197, .28); }
:root[data-skin="aurora"][data-theme="light"] body::before { content: ''; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%238bb8d8'%3E%3Ccircle cx='20' cy='30' r='2'/%3E%3Ccircle cx='90' cy='10' r='1.5'/%3E%3Ccircle cx='150' cy='70' r='2.5'/%3E%3Ccircle cx='60' cy='120' r='1.8'/%3E%3Ccircle cx='180' cy='160' r='1.5'/%3E%3Ccircle cx='120' cy='190' r='2'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 200px 200px, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%238bb8d8'%3E%3Ccircle cx='20' cy='30' r='2'/%3E%3Ccircle cx='90' cy='10' r='1.5'/%3E%3Ccircle cx='150' cy='70' r='2.5'/%3E%3Ccircle cx='60' cy='120' r='1.8'/%3E%3Ccircle cx='180' cy='160' r='1.5'/%3E%3Ccircle cx='120' cy='190' r='2'/%3E%3C/g%3E%3C/svg%3E") 70px 40px / 280px 280px; opacity: .35; animation: aurora-snow 26s linear infinite; }
@keyframes aurora-snow { to { background-position: 30px 200px, 110px 320px; } }
:root[data-skin="aurora"] :is(.card-thumb, .post-cover img) { border-radius: 16px; box-shadow: 0 -2px 0 0 color-mix(in srgb, var(--dot) 70%, transparent), 0 16px 32px -20px color-mix(in srgb, var(--link) 60%, transparent); }

/* 8 · PURA VIDA. Esquinas en forma de hoja en todo, luciérnagas de noche y sombra de hoja de día */
:root[data-skin="selva"] { --display: 'Shrikhand', var(--sans); }
:root[data-skin="selva"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .004em; }
:root[data-skin="selva"] :is(.card-thumb, .post-cover img, .card-lesson, .box) { border-radius: 22px 4px 22px 4px; }
:root[data-skin="selva"] .btn { border-radius: 14px 3px 14px 3px; }
:root[data-skin="selva"] .tag { border-radius: 10px 2px 10px 2px; }
:root[data-skin="selva"][data-theme="dark"] body::before { content: ''; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%23f2c94c'%3E%3Ccircle cx='30' cy='60' r='2.2'/%3E%3Ccircle cx='140' cy='30' r='1.6'/%3E%3Ccircle cx='230' cy='150' r='2.4'/%3E%3Ccircle cx='90' cy='210' r='1.8'/%3E%3Ccircle cx='260' cy='260' r='1.6'/%3E%3Ccircle cx='180' cy='90' r='1.4'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 300px 300px, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%23f2c94c'%3E%3Ccircle cx='30' cy='60' r='2.2'/%3E%3Ccircle cx='140' cy='30' r='1.6'/%3E%3Ccircle cx='230' cy='150' r='2.4'/%3E%3Ccircle cx='90' cy='210' r='1.8'/%3E%3Ccircle cx='260' cy='260' r='1.6'/%3E%3Ccircle cx='180' cy='90' r='1.4'/%3E%3C/g%3E%3C/svg%3E") 120px 160px / 420px 420px; filter: drop-shadow(0 0 4px #f2c94c); animation: selva-flies 5s ease-in-out infinite alternate, selva-drift 44s linear infinite; }
@keyframes selva-flies { from { opacity: .2; } to { opacity: .75; } }
@keyframes selva-drift { to { background-position: 60px -300px, 60px -260px; } }
:root[data-skin="selva"][data-theme="dark"] :is(h1, .welcome-h) { text-shadow: 0 0 24px rgba(242, 201, 76, .24); }
:root[data-skin="selva"][data-theme="light"] body::before { content: ''; top: 0; right: 0; width: 40vmin; height: 40vmin; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' preserveAspectRatio='xMidYMid meet'%3E%3Cpath d='M300 0 C180 20 90 110 60 260 C150 210 250 150 300 40Z' fill='%23142414'/%3E%3Cg stroke='%23f3f8ee' stroke-width='5' fill='none'%3E%3Cpath d='M295 20 C220 80 150 160 80 245'/%3E%3Cpath d='M240 60 L285 110'/%3E%3Cpath d='M200 100 L265 150'/%3E%3Cpath d='M160 145 L230 190'/%3E%3Cpath d='M230 70 L215 25'/%3E%3Cpath d='M190 110 L160 55'/%3E%3C/g%3E%3C/svg%3E") top right / contain no-repeat; opacity: .07; transform-origin: 100% 0; animation: selva-sway 9s ease-in-out infinite alternate; }
@keyframes selva-sway { from { transform: rotate(-3deg); } to { transform: rotate(2deg); } }
:root[data-skin="selva"][data-theme="light"] :is(h1, .welcome-h) { color: #1d4d21; }

/* 9 · ARENAL. Roca y calor: letra Anton compacta, portadas tibias, brasas que suben de noche y fumarola de día */
:root[data-skin="arenal"] { --display: 'Anton', var(--sans); }
:root[data-skin="arenal"] :is(h1, h2, h3, .welcome-h) { font-weight: 400; letter-spacing: .006em; line-height: 1.06; }
:root[data-skin="arenal"] :is(.card-thumb, .post-cover img) { border-radius: 6px; }
:root[data-skin="arenal"][data-theme="dark"] body { background: radial-gradient(90% 45% at 50% 115%, rgba(255, 90, 31, .26), rgba(194, 65, 12, .1) 45%, transparent 70%) fixed, var(--bg); }
:root[data-skin="arenal"][data-theme="dark"] body::before { content: ''; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%23ff8c42'%3E%3Ccircle cx='40' cy='50' r='1.8'/%3E%3Ccircle cx='160' cy='120' r='1.4'/%3E%3Ccircle cx='100' cy='200' r='2'/%3E%3Ccircle cx='210' cy='40' r='1.2'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 240px 240px, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240' preserveAspectRatio='xMidYMid meet'%3E%3Cg fill='%23ff8c42'%3E%3Ccircle cx='40' cy='50' r='1.8'/%3E%3Ccircle cx='160' cy='120' r='1.4'/%3E%3Ccircle cx='100' cy='200' r='2'/%3E%3Ccircle cx='210' cy='40' r='1.2'/%3E%3C/g%3E%3C/svg%3E") 90px 60px / 340px 340px; -webkit-mask-image: linear-gradient(transparent, #000 70%); mask-image: linear-gradient(transparent, #000 70%); animation: arenal-embers 18s linear infinite; }
@keyframes arenal-embers { to { background-position: 20px -240px, 60px -340px; } }
:root[data-skin="arenal"][data-theme="dark"] :is(h1, .welcome-h) { color: #fff0e6; text-shadow: 0 0 22px rgba(255, 90, 31, .34); }
:root[data-skin="arenal"][data-theme="dark"] .card-thumb, :root[data-skin="arenal"][data-theme="dark"] .post-cover img { box-shadow: 0 10px 26px -14px rgba(255, 90, 31, .55); }
:root[data-skin="arenal"][data-theme="light"] body::before { content: ''; right: 0; bottom: 0; width: 46vmin; height: 34vmin; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' preserveAspectRatio='xMidYMid meet'%3E%3Cpath d='M0 300 L130 120 Q150 100 170 112 L190 108 Q205 100 220 118 L400 300Z' fill='%233a312c'/%3E%3Cpath d='M150 108 Q170 80 160 50 Q185 70 190 104Z' fill='%23c2410c' opacity='.6'/%3E%3C/svg%3E") bottom right / contain no-repeat; opacity: .05; }
:root[data-skin="arenal"][data-theme="light"] body::after { content: ''; right: 14vmin; bottom: 22vmin; width: 14vmin; height: 14vmin; border-radius: 50%; background: radial-gradient(circle, rgba(122, 109, 100, .22), transparent 70%); filter: blur(6px); animation: arenal-smoke 9s ease-out infinite; }
@keyframes arenal-smoke { from { transform: translate(0, 0) scale(.6); opacity: .9; } to { transform: translate(-6vmin, -14vmin) scale(1.8); opacity: 0; } }

/* 10 · PANTALLA 8-BIT. Esquinas escalonadas de píxel en portadas, botones y recuadros; letra Silkscreen y una rejilla LCD casi invisible */
:root[data-skin="pixel"] { --display: 'Silkscreen', var(--mono); }
:root[data-skin="pixel"] :is(h1, h2, h3, .welcome-h) { font-weight: 700; letter-spacing: 0; line-height: 1.22; }
:root[data-skin="pixel"] .hero h1 { font-size: clamp(24px, 3.3vw, 38px); }
:root[data-skin="pixel"] .post-header h1 { font-size: clamp(22px, 2.8vw, 32px); }
:root[data-skin="pixel"] :is(.section-title, .prose h2) { font-size: 21px; }
:root[data-skin="pixel"] .card-title { font-size: 16px; }
:root[data-skin="pixel"] :is(.card-thumb, .card-lesson, .box, .tag, .prose blockquote) { border-radius: 0; clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)); }
:root[data-skin="pixel"] .btn { border-radius: 0; }
:root[data-skin="pixel"] :is(.card-thumb img, .post-cover img, .avatar img) { image-rendering: pixelated; }
:root[data-skin="pixel"] body::after { content: ''; inset: 0; z-index: 90; background: linear-gradient(rgba(0, 0, 0, .03) 1px, transparent 1px) 0 0 / 3px 3px, linear-gradient(90deg, rgba(0, 0, 0, .03) 1px, transparent 1px) 0 0 / 3px 3px; }
:root[data-skin="pixel"][data-theme="dark"] body::after { background: linear-gradient(rgba(0, 0, 0, .09) 1px, transparent 1px) 0 0 / 3px 3px, linear-gradient(90deg, rgba(0, 0, 0, .09) 1px, transparent 1px) 0 0 / 3px 3px; }

/* ---------- Temas ocultos v3.1: consenso de tres jueces (lectura, oficio, prolijidad) ---------- */
/* 1) ninguna capa decorativa encima del texto */
:root[data-skin="ambar"] body::after, :root[data-skin="noir"] body::after, :root[data-skin="bios"] body::after, :root[data-skin="pixel"] body::after { z-index: -1; }
/* 2) portadas: en oscuro se atenúan para no deslumbrar */
:root[data-skin][data-theme="dark"] :is(.card-thumb img, .post-cover img) { filter: brightness(.82) saturate(.9); }
/* 3) la lluvia de caracteres de la barra lateral toma el color de cada mundo */
:root[data-skin] .matrix { filter: grayscale(1); opacity: .5; }
:root[data-skin="ambar"] .matrix { filter: grayscale(1) sepia(1) saturate(3); }
:root[data-skin="arenal"] .matrix { filter: grayscale(1) sepia(1) saturate(4) hue-rotate(-25deg); }
:root[data-skin="vapor"] .matrix { filter: grayscale(1) sepia(1) saturate(3) hue-rotate(280deg); }
:root[data-skin="onion"] .matrix { filter: grayscale(1) sepia(1) saturate(3) hue-rotate(230deg); }
:root[data-skin="plano"] .matrix, :root[data-skin="bios"] .matrix { filter: grayscale(1) sepia(1) saturate(3) hue-rotate(170deg); }
:root[data-skin="selva"] .matrix, :root[data-skin="pixel"] .matrix, :root[data-skin="aurora"] .matrix { filter: none; opacity: .7; }
/* 4) sin negritas falsas en las letras de un solo peso */
:root[data-skin="ambar"] :is(.author-name, .focus strong, .box-title), :root[data-skin="vapor"] :is(.author-name, .focus strong, .box-title), :root[data-skin="plano"] :is(.author-name, .focus strong, .box-title), :root[data-skin="bios"] :is(.author-name, .focus strong, .box-title), :root[data-skin="onion"] :is(.author-name, .focus strong, .box-title), :root[data-skin="selva"] :is(.author-name, .focus strong, .box-title), :root[data-skin="arenal"] :is(.author-name, .focus strong, .box-title) { font-weight: 400; letter-spacing: .01em; }
/* 5) la barra lateral comparte la forma de cada tema */
:root[data-skin="ambar"] :is(.nav a, .author-role li, .btn) { border-radius: 3px; }
:root[data-skin="plano"] :is(.nav a, .author-role li, .btn) { border-radius: 2px; }
:root[data-skin="noir"] :is(.tag, .nav a, .author-role li) { border-radius: 0; }
:root[data-skin="bios"] :is(.nav a, .author-role li, .toc li a) { border-radius: 0; }
:root[data-skin="selva"] :is(.nav a, .author-role li) { border-radius: 12px 3px 12px 3px; }
:root[data-skin="arenal"] :is(.card-lesson, .box, .prose blockquote, .btn, .tag, .nav a, .author-role li) { border-radius: 6px; }
:root[data-skin="pixel"] :is(.nav a, .author-role li) { border-radius: 0; }
:root[data-skin="aurora"] .btn { border-radius: 999px; }

/* ÁMBAR: el brillo solo en el título grande; botón de fósforo; etiquetas sin doble marco */
:root[data-skin="ambar"][data-theme="dark"] :is(h2, .card-title a) { text-shadow: none; }
:root[data-skin="ambar"] .tag { border-color: transparent; padding-inline: 4px; }
:root[data-skin="ambar"][data-theme="dark"] .btn:not(.btn-ghost) { background: transparent; border: 1px solid #ffb000; color: #ffcf7a; text-shadow: 0 0 6px rgba(255, 170, 40, .45); box-shadow: inset 0 0 14px -4px rgba(255, 176, 0, .5); }
:root[data-skin="ambar"][data-theme="dark"] .btn:not(.btn-ghost):hover { background: rgba(255, 176, 0, .12); color: #ffe2a8; }
:root[data-skin="ambar"][data-theme="light"] body:has(.post-header) { background: var(--bg); }
:root[data-skin="ambar"][data-theme="dark"] :is(.card-thumb img, .post-cover img) { filter: sepia(.35) saturate(1.1) brightness(.85); }

/* VAPORWAVE: el sol se sienta sobre un suelo de rejilla en perspectiva; en los artículos todo se retira */
:root[data-skin="vapor"] body::before { -webkit-mask-image: none; mask-image: none; bottom: calc(30vh - 26vmin); opacity: .5; }
:root[data-skin="vapor"][data-theme="light"] body::before { opacity: .38; }
:root[data-skin="vapor"] body::after { content: ''; left: -50%; right: -50%; bottom: 0; height: 30vh; background: linear-gradient(color-mix(in srgb, var(--amber) 55%, transparent) 1px, transparent 1px) 0 0 / 100% 34px, linear-gradient(90deg, color-mix(in srgb, var(--link) 45%, transparent) 1px, transparent 1px) 50% 0 / 64px 100%; transform: perspective(260px) rotateX(64deg); transform-origin: 50% 100%; -webkit-mask-image: linear-gradient(transparent, #000 55%); mask-image: linear-gradient(transparent, #000 55%); opacity: .38; }
:root[data-skin="vapor"] body:has(.post-header)::before { animation: none; opacity: .07; }
:root[data-skin="vapor"] body:has(.post-header)::after { content: none; }

/* PLANO: rotulación técnica en mayúsculas, tiza amarilla sobre cianotipo, rejilla fina más suave y cajetín detrás del texto */
:root[data-skin="plano"] :is(h1, h2, h3, .welcome-h) { text-transform: uppercase; letter-spacing: .05em; }
:root[data-skin="plano"] .hero h1 { font-size: clamp(30px, 4vw, 48px); }
:root[data-skin="plano"][data-theme="dark"] { --accent: #f4d35e; --accent-hover: #ffe08a; }
:root[data-skin="plano"][data-theme="dark"] .btn:not(.btn-ghost) { color: #0b2545; }
:root[data-skin="plano"][data-theme="dark"] .tag:hover { color: #0b2545; }
:root[data-skin="plano"][data-theme="dark"] body { background: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
:root[data-skin="plano"] body::after { z-index: -1; background: none; }

/* CINE NEGRO: persianas visibles de noche y como sombra sobre el papel de día; grano quieto en los artículos; menú con filo rojo */
:root[data-skin="noir"][data-theme="dark"] body::before { background: repeating-linear-gradient(168deg, rgba(255, 245, 220, .07) 0 22px, transparent 22px 56px); -webkit-mask-image: radial-gradient(85% 85% at 90% 4%, #000, transparent 75%); mask-image: radial-gradient(85% 85% at 90% 4%, #000, transparent 75%); }
:root[data-skin="noir"][data-theme="light"] body::before { content: ''; inset: 0; background: repeating-linear-gradient(168deg, rgba(60, 40, 20, .055) 0 22px, transparent 22px 56px); -webkit-mask-image: radial-gradient(80% 80% at 90% 4%, #000, transparent 74%); mask-image: radial-gradient(80% 80% at 90% 4%, #000, transparent 74%); }
:root[data-skin="noir"] body:has(.post-header)::after { animation: none; }
:root[data-skin="noir"] .nav a[aria-current="page"] { background: none; box-shadow: inset 2px 0 0 var(--accent); }
:root[data-skin="noir"][data-theme="dark"] :is(.card-thumb img, .post-cover img) { filter: grayscale(1) contrast(1.12) brightness(.88); }

/* BIOS: enlace amarillo menos vibrante, marco fuera en móvil, barra de título de escritorio clásico de día */
:root[data-skin="bios"][data-theme="dark"] { --link: #fff27a; }
@media (max-width: 900px) { :root[data-skin="bios"][data-theme="dark"] body::after { display: none; } }
:root[data-skin="bios"][data-theme="light"] body::before { z-index: 19; }
:root[data-skin="bios"][data-theme="light"] .welcome-h { background: linear-gradient(90deg, #000080, #1084d0); }

/* RED CEBOLLA: minúsculas uniformes de la fuente de cifrado; anillos con nodos y ruta, visibles en oscuro; quietos al leer */
:root[data-skin="onion"] :is(h1, h2, h3, .welcome-h, .author-name, .focus strong, .box-title) { text-transform: lowercase; }
:root[data-skin="onion"][data-theme="light"] body::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' preserveAspectRatio='xMaxYMin meet'%3E%3Cg fill='none' stroke='%237d4698' stroke-width='1.2'%3E%3Ccircle cx='400' cy='0' r='40'/%3E%3Ccircle cx='400' cy='0' r='74'/%3E%3Ccircle cx='400' cy='0' r='108'/%3E%3Ccircle cx='400' cy='0' r='142'/%3E%3Ccircle cx='400' cy='0' r='176'/%3E%3Ccircle cx='400' cy='0' r='210'/%3E%3Ccircle cx='400' cy='0' r='244'/%3E%3Ccircle cx='400' cy='0' r='278'/%3E%3Ccircle cx='400' cy='0' r='312'/%3E%3Ccircle cx='400' cy='0' r='346'/%3E%3Ccircle cx='400' cy='0' r='380'/%3E%3Ccircle cx='400' cy='0' r='414'/%3E%3C/g%3E%3Cpath d='M300 100L170 81L220 295' stroke='%237d4698' stroke-width='1.3' stroke-dasharray='4 5' fill='none'/%3E%3Cg fill='%237d4698'%3E%3Ccircle cx='300' cy='100' r='5'/%3E%3Ccircle cx='170' cy='81' r='5'/%3E%3Ccircle cx='220' cy='295' r='5'/%3E%3C/g%3E%3C/svg%3E") top right / contain no-repeat; }
:root[data-skin="onion"][data-theme="dark"] body::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' preserveAspectRatio='xMaxYMin meet'%3E%3Cg fill='none' stroke='%23c79bf0' stroke-width='1.2'%3E%3Ccircle cx='400' cy='0' r='40'/%3E%3Ccircle cx='400' cy='0' r='74'/%3E%3Ccircle cx='400' cy='0' r='108'/%3E%3Ccircle cx='400' cy='0' r='142'/%3E%3Ccircle cx='400' cy='0' r='176'/%3E%3Ccircle cx='400' cy='0' r='210'/%3E%3Ccircle cx='400' cy='0' r='244'/%3E%3Ccircle cx='400' cy='0' r='278'/%3E%3Ccircle cx='400' cy='0' r='312'/%3E%3Ccircle cx='400' cy='0' r='346'/%3E%3Ccircle cx='400' cy='0' r='380'/%3E%3Ccircle cx='400' cy='0' r='414'/%3E%3C/g%3E%3Cpath d='M300 100L170 81L220 295' stroke='%23c79bf0' stroke-width='1.3' stroke-dasharray='4 5' fill='none'/%3E%3Cg fill='%23c79bf0'%3E%3Ccircle cx='300' cy='100' r='5'/%3E%3Ccircle cx='170' cy='81' r='5'/%3E%3Ccircle cx='220' cy='295' r='5'/%3E%3C/g%3E%3C/svg%3E") top right / contain no-repeat; opacity: .26; }
:root[data-skin="onion"] body:has(.post-header)::before { animation: none; opacity: .1; }

/* AURORA: cortina con rayos verticales de noche y un resplandor de aurora también de día; nieve quieta al leer */
:root[data-skin="aurora"][data-theme="dark"] body::before { background: repeating-linear-gradient(90deg, rgba(111, 243, 197, .06) 0 2px, transparent 2px 10px), radial-gradient(45% 35% at 30% 40%, rgba(111, 243, 197, .28), transparent 70%), radial-gradient(40% 30% at 65% 25%, rgba(177, 140, 255, .22), transparent 70%), radial-gradient(35% 25% at 85% 50%, rgba(80, 200, 255, .16), transparent 70%); -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); filter: blur(14px); }
:root[data-skin="aurora"][data-theme="light"] body { background: radial-gradient(60% 38% at 28% 0%, rgba(42, 200, 160, .14), transparent 70%) fixed, radial-gradient(50% 32% at 74% 0%, rgba(108, 99, 217, .11), transparent 70%) fixed, var(--bg); }
:root[data-skin="aurora"][data-theme="light"] body:has(.post-header)::before { animation: none; }

/* PURA VIDA: Shrikhand solo en títulos grandes, hoja verde de día, luciérnagas sin filtro y quietas al leer */
:root[data-skin="selva"] h3 { font-family: var(--sans); font-weight: 700; font-style: normal; letter-spacing: -.005em; }
:root[data-skin="selva"][data-theme="dark"] body::before { filter: none; }
:root[data-skin="selva"][data-theme="dark"] body:has(.post-header)::before { animation: none; opacity: .18; }
:root[data-skin="selva"][data-theme="light"] body::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' preserveAspectRatio='xMidYMid meet'%3E%3Cpath d='M300 0 C180 20 90 110 60 260 C150 210 250 150 300 40Z' fill='%232e7d32'/%3E%3Cg stroke='%23f3f8ee' stroke-width='5' fill='none'%3E%3Cpath d='M295 20 C220 80 150 160 80 245'/%3E%3Cpath d='M240 60 L285 110'/%3E%3Cpath d='M200 100 L265 150'/%3E%3Cpath d='M160 145 L230 190'/%3E%3Cpath d='M230 70 L215 25'/%3E%3Cpath d='M190 110 L160 55'/%3E%3C/g%3E%3C/svg%3E") top right / contain no-repeat; opacity: .12; }

/* ARENAL: resplandor más contenido, brasas fuera de los artículos, volcán de terracota y títulos pequeños con aire */
:root[data-skin="arenal"][data-theme="dark"] body { background: radial-gradient(90% 45% at 50% 115%, rgba(255, 90, 31, .14), rgba(194, 65, 12, .06) 45%, transparent 70%) fixed, var(--bg); }
:root[data-skin="arenal"][data-theme="dark"] body:has(.post-header)::before { content: none; }
:root[data-skin="arenal"] h3 { letter-spacing: .03em; }
:root[data-skin="arenal"][data-theme="light"] body::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' preserveAspectRatio='xMidYMid meet'%3E%3Cpath d='M0 300 L130 120 Q150 100 170 112 L190 108 Q205 100 220 118 L400 300Z' fill='%23a8380a'/%3E%3Cpath d='M150 108 Q170 80 160 50 Q185 70 190 104Z' fill='%23c2410c' opacity='.6'/%3E%3C/svg%3E") bottom right / contain no-repeat; opacity: .06; }

/* 8-BIT: portadas en verde de pantalla portátil, botones con borde de píxel, títulos con aire y sin cortes en el foco */
:root[data-skin="pixel"] :is(.card-thumb img, .post-cover img) { image-rendering: auto; filter: grayscale(1) sepia(1) hue-rotate(40deg) saturate(1.6) contrast(1.1) brightness(.92); }
:root[data-skin="pixel"] .tag { clip-path: none; }
:root[data-skin="pixel"] .btn { border: 0; box-shadow: 0 -3px 0 var(--accent), 0 3px 0 var(--accent), -3px 0 0 var(--accent), 3px 0 0 var(--accent); }
:root[data-skin="pixel"] .btn-ghost { box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
:root[data-skin="pixel"] :is(.section-title, .prose h2) { letter-spacing: .02em; line-height: 1.35; }
/* v3.2: segunda ronda de jueces */
:root[data-skin="vapor"] body::before { left: auto; right: -8vmin; margin-left: 0; width: 44vmin; height: 44vmin; opacity: .34; }
:root[data-skin="vapor"][data-theme="light"] body::before { opacity: .26; }
@media (max-width: 900px) { :root[data-skin="vapor"] body::before { opacity: .18; } }
:root[data-skin="vapor"] body:has(.post-header)::before { opacity: .07; }
:root[data-skin="plano"] :is(.prose h2, .prose h3) { text-transform: none; letter-spacing: .01em; }
:root[data-skin="selva"][data-theme="light"] body:has(.post-header)::before { opacity: .05; animation: none; }
:root[data-skin].matrix-boost .matrix { filter: brightness(2.4) saturate(1.4); opacity: 1; }

/* ---------- Anatomía de un virus: ficha técnica, cadena de infección y mapa conceptual (usan las variables del tema, así que también se visten con los temas ocultos) ---------- */
.ficha { display: flex; flex-wrap: wrap; gap: 1px; margin: 1.6em 0 2em; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ficha li { flex: 1 1 150px; margin: 0; padding: 14px 16px; background: var(--raised); }
.ficha b { display: block; margin-bottom: 4px; color: var(--muted); font: 600 12px/1.3 var(--sans); letter-spacing: .02em; }
.ficha span { color: var(--ink); font: 650 16px/1.35 var(--display); }

.cadena { counter-reset: paso; display: grid; gap: 0; margin: 1.6em 0 2em; padding: 0; list-style: none; }
.cadena li { position: relative; margin: 0; padding: 0 0 22px 52px; counter-increment: paso; }
.cadena li::before { content: counter(paso); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 15px var(--sans); }
.cadena li:not(:last-child)::after { content: ''; position: absolute; left: 16px; top: 36px; bottom: 2px; width: 2px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 20%, transparent)); }
.cadena b { display: block; color: var(--ink); font: 650 17px/1.35 var(--display); margin-bottom: 2px; }

.mapa { --mapa-c: var(--accent); position: relative; display: grid; grid-template-columns: 1fr minmax(170px, 220px) 1fr; grid-template-rows: repeat(3, auto); gap: 14px 34px; align-items: center; margin: 2em 0; padding: 26px 22px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--mapa-c) 9%, transparent), transparent 70%), var(--surface); }
.mapa-centro { grid-column: 2; grid-row: 1 / 4; position: relative; z-index: 1; padding: 20px 16px; border-radius: 50%; aspect-ratio: 1; display: grid; place-content: center; text-align: center; background: var(--mapa-c); color: #fff; box-shadow: 0 0 0 8px color-mix(in srgb, var(--mapa-c) 18%, transparent), 0 14px 30px -14px color-mix(in srgb, var(--mapa-c) 80%, transparent); }
.mapa-centro b { display: block; font: 700 20px/1.1 var(--display); color: #fff; }
.mapa-centro span { display: block; margin-top: 6px; font: 500 13px/1.3 var(--sans); opacity: .92; }
.mapa-rama { position: relative; margin: 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--mapa-c) 35%, var(--line)); border-radius: 12px; background: var(--raised); font-size: 14.5px; line-height: 1.45; color: var(--text); }
.mapa-rama b { display: block; margin-bottom: 2px; color: var(--ink); font: 700 15px/1.3 var(--sans); }
.mapa-rama:nth-of-type(odd) { grid-column: 1; }
.mapa-rama:nth-of-type(even) { grid-column: 3; }
/* conector: una línea fina desde cada rama hasta el centro */
.mapa-rama::after { content: ''; position: absolute; top: 50%; width: 34px; height: 2px; background: color-mix(in srgb, var(--mapa-c) 55%, transparent); }
.mapa-rama:nth-of-type(odd)::after { right: -35px; }
.mapa-rama:nth-of-type(even)::after { left: -35px; }
.mapa figcaption { grid-column: 1 / -1; margin-top: 6px; color: var(--muted); font-size: 13.5px; text-align: center; }
@media (max-width: 720px) {
  .mapa { grid-template-columns: 1fr; gap: 12px; padding: 20px 16px 20px 30px; }
  .mapa-centro { grid-column: 1; grid-row: auto; aspect-ratio: auto; border-radius: 14px; margin-left: -14px; }
  .mapa-rama:nth-of-type(n) { grid-column: 1; }
  .mapa-rama::after, .mapa-rama:nth-of-type(odd)::after, .mapa-rama:nth-of-type(even)::after { left: -16px; right: auto; width: 14px; }
  .mapa::before { content: ''; position: absolute; left: 14px; top: 70px; bottom: 50px; width: 2px; background: color-mix(in srgb, var(--mapa-c) 45%, transparent); }
}

/* «Y después:» bajo el mensaje del inicio: el siguiente caso relacionado para seguir leyendo */
.welcome-next { margin: -6px 0 22px; font-size: 14.5px; color: var(--muted); animation: welcome-next-in .6s .9s var(--ease) both; }
.welcome-next span { margin-right: 4px; }
.welcome-next a { color: var(--ink); font-weight: 600; text-decoration: none; background: linear-gradient(var(--dot), var(--dot)) 0 100% / 100% 1.5px no-repeat; padding-bottom: 1px; transition: background-size .3s var(--ease), color .2s; }
.welcome-next a:hover { color: var(--link); background-size: 0 1.5px; background-position: 100% 100%; }
.welcome-next a::after { content: ' →'; color: var(--dot); }
@keyframes welcome-next-in { from { opacity: 0; transform: translateY(4px); } }

/* Inicio: consejos, datos y mitos con su propia etiqueta e icono (colores del tema activo) */
/* Tipo del mensaje: un pictograma que actúa lo que significa al aparecer (y otra vez al pasar el ratón); sin caja */
.welcome-kind { --wk: var(--link); display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; vertical-align: -6px; color: color-mix(in srgb, var(--wk) 55%, var(--ink)); font: 650 14px/1 var(--sans); white-space: nowrap; cursor: default; }
.welcome-kind[hidden] { display: none; }
.wk-badge { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--wk) 16%, transparent); }
.wk-badge svg { width: 16px; height: 16px; fill: none; stroke: var(--wk); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wk-label { opacity: 0; transform: translateX(-4px); }
.welcome.is-ready .wk-label { animation: wk-label .4s .55s var(--ease) both; }
@keyframes wk-label { to { opacity: 1; transform: none; } }
/* un color por tipo (claro / oscuro), para distinguirlos de un vistazo */
.welcome-kind--caso { --wk: #dc2626; }
.welcome-kind--dato { --wk: #0891b2; }
.welcome-kind--consejo { --wk: #c2410c; }
.welcome-kind--mito { --wk: #7c3aed; }
.welcome-kind--reto { --wk: #059669; }
.welcome-kind--cifra { --wk: #2563eb; }
:root[data-theme="dark"] .welcome-kind--caso { --wk: #f87171; }
:root[data-theme="dark"] .welcome-kind--dato { --wk: #22d3ee; }
:root[data-theme="dark"] .welcome-kind--consejo { --wk: #fbbf24; }
:root[data-theme="dark"] .welcome-kind--mito { --wk: #a78bfa; }
:root[data-theme="dark"] .welcome-kind--reto { --wk: #4ade80; }
:root[data-theme="dark"] .welcome-kind--cifra { --wk: #60a5fa; }
/* las cifras se leen como un número grande: el titular gana peso tipográfico */
.welcome:has(.welcome-kind--cifra) .welcome-h { font-size: clamp(42px, 6vw, 72px); letter-spacing: -.045em; }

/* cada actuación corre al aparecer el mensaje (.is-ready) y se repite con .wk-play (ratón encima) */
.wk-badge svg * { transform-box: fill-box; }
/* Caso real: alerta que late y una onda de radar que sale del escudo */
.welcome-kind--caso .wk-badge::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--wk); opacity: 0; }
.welcome.is-ready .welcome-kind--caso .wk-badge::after { animation: wk-ping 1.6s .4s ease-out 2; }
.welcome .welcome-kind--caso.wk-play .wk-badge::after { animation: wk-ping2 1.6s ease-out 1; }
.welcome.is-ready .welcome-kind--caso .wk-mark { animation: wk-beat .5s .4s ease-out 3; transform-origin: center; }
.welcome .welcome-kind--caso.wk-play .wk-mark { animation: wk-beat2 .5s ease-out 2; }
@keyframes wk-ping { from { opacity: .7; transform: scale(.9); } to { opacity: 0; transform: scale(1.9); } }
@keyframes wk-ping2 { from { opacity: .7; transform: scale(.9); } to { opacity: 0; transform: scale(1.9); } }
@keyframes wk-beat { 40% { transform: scale(1.35); } }
@keyframes wk-beat2 { 40% { transform: scale(1.35); } }
/* ¿Sabías que?: la «i» se escribe y el punto cae */
.welcome-kind--dato .wk-stem { stroke-dasharray: 7; stroke-dashoffset: 7; }
.welcome-kind--dato .wk-dot { opacity: 0; }
.welcome.is-ready .welcome-kind--dato .wk-stem { animation: wk-draw .45s .45s ease-out both; }
.welcome.is-ready .welcome-kind--dato .wk-dot { animation: wk-drop .4s .85s cubic-bezier(.3, 1.6, .5, 1) both; }
.welcome .welcome-kind--dato.wk-play .wk-stem { animation: wk-draw2 .45s ease-out both; }
.welcome .welcome-kind--dato.wk-play .wk-dot { animation: wk-drop2 .4s .4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes wk-draw { to { stroke-dashoffset: 0; } }
@keyframes wk-draw2 { from { stroke-dashoffset: 7; } to { stroke-dashoffset: 0; } }
@keyframes wk-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes wk-drop2 { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* Consejo: la bombilla se enciende con un parpadeo de filamento */
.welcome.is-ready .welcome-kind--consejo .wk-bulb { animation: wk-light 1.1s .45s steps(1, end) both; }
.welcome .welcome-kind--consejo.wk-play .wk-bulb { animation: wk-light2 1.1s steps(1, end) both; }
@keyframes wk-light { 0% { fill: transparent; } 20% { fill: color-mix(in srgb, var(--wk) 70%, transparent); } 30% { fill: transparent; } 45%, 100% { fill: color-mix(in srgb, var(--wk) 55%, transparent); filter: drop-shadow(0 0 4px var(--wk)); } }
@keyframes wk-light2 { 0% { fill: transparent; } 20% { fill: color-mix(in srgb, var(--wk) 70%, transparent); } 30% { fill: transparent; } 45%, 100% { fill: color-mix(in srgb, var(--wk) 55%, transparent); filter: drop-shadow(0 0 4px var(--wk)); } }
/* Mito o realidad: la balanza duda y se asienta */
.welcome-kind--mito .wk-beam { transform-box: view-box; transform-origin: 12px 5px; }
.welcome.is-ready .welcome-kind--mito .wk-beam { animation: wk-weigh 1.4s .4s cubic-bezier(.3, .7, .3, 1) both; }
.welcome .welcome-kind--mito.wk-play .wk-beam { animation: wk-weigh2 1.4s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes wk-weigh { 0% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 70% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
@keyframes wk-weigh2 { 0% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 70% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
/* Reto: los anillos se cierran sobre el centro, como un dardo que acierta */
.welcome-kind--reto :is(.wk-r1, .wk-r2, .wk-r3) { transform-origin: center; }
.welcome.is-ready .welcome-kind--reto .wk-r3 { animation: wk-aim .5s .4s ease-out both; }
.welcome.is-ready .welcome-kind--reto .wk-r2 { animation: wk-aim .5s .55s ease-out both; }
.welcome.is-ready .welcome-kind--reto .wk-r1 { animation: wk-hit .4s .8s cubic-bezier(.3, 1.8, .5, 1) both; }
.welcome .welcome-kind--reto.wk-play .wk-r3 { animation: wk-aim2 .5s ease-out both; }
.welcome .welcome-kind--reto.wk-play .wk-r2 { animation: wk-aim2 .5s .15s ease-out both; }
.welcome .welcome-kind--reto.wk-play .wk-r1 { animation: wk-hit2 .4s .4s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes wk-aim { from { transform: scale(1.6); opacity: 0; } }
@keyframes wk-aim2 { from { transform: scale(1.6); opacity: 0; } }
@keyframes wk-hit { from { transform: scale(0); fill: var(--wk); } to { fill: var(--wk); } }
@keyframes wk-hit2 { from { transform: scale(0); fill: var(--wk); } to { fill: var(--wk); } }
/* En cifras: las barras crecen desde cero, una tras otra */
.welcome-kind--cifra .wk-bar { transform-origin: bottom; }
.welcome.is-ready .welcome-kind--cifra .wk-bar { animation: wk-grow .45s ease-out both; }
.welcome .welcome-kind--cifra.wk-play .wk-bar { animation: wk-grow2 .45s ease-out both; }
.welcome.is-ready .welcome-kind--cifra .wk-bar:nth-of-type(2) { animation-delay: .45s; }
.welcome.is-ready .welcome-kind--cifra .wk-bar:nth-of-type(3) { animation-delay: .6s; }
.welcome.is-ready .welcome-kind--cifra .wk-bar:nth-of-type(4) { animation-delay: .75s; }
.welcome .welcome-kind--cifra.wk-play .wk-bar:nth-of-type(2) { animation-delay: 0s; }
.welcome .welcome-kind--cifra.wk-play .wk-bar:nth-of-type(3) { animation-delay: .12s; }
.welcome .welcome-kind--cifra.wk-play .wk-bar:nth-of-type(4) { animation-delay: .24s; }
@keyframes wk-grow { from { transform: scaleY(0); } }
@keyframes wk-grow2 { from { transform: scaleY(0); } }

/* Blog: enlaces a las páginas por tema (indexables) */
.tema-links { margin-top: 14px; font-size: 14px; color: var(--muted); line-height: 1.9; }
.tema-links a { color: var(--text); }

/* Caja de autor al final de cada post y criterios editoriales en Sobre mí */
.author-box { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box p { margin: 0; }
.author-box-name { font-weight: 700; color: var(--ink); }
.author-box-cred { font-size: 13.5px; color: var(--muted); margin: 2px 0 6px !important; }
.author-box-text { font-size: 15px; line-height: 1.55; }
.editorial { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; line-height: 1.6; }
@media (max-width: 560px) { .author-box { flex-direction: column; } }

/* Cifras de experiencia (inicio y Sobre mí) */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0 0 36px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.proof > div { background: var(--surface, var(--bg)); padding: 16px 18px; }
.proof dt { font: 700 26px/1.1 var(--mono); color: var(--ink); letter-spacing: -.02em; }
.proof dd { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
