/* Tecno Atajo · estilos del sitio
   Concepto: la tecnología como un atajo de teclado. Teclas, bloques de color lima y tinta. */

@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-condensed-800.woff2') format('woff2');
  font-weight: 800;
  font-stretch: 75%;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-700.woff2') format('woff2');
  font-weight: 700;
  font-stretch: 100%;
  /* La del menú, la marca y «Buscar»: si llegara tarde, el menú cambiaría de filas y empujaría la página (CLS).
     Con optional (y precargada en layout.js) se usa si llega a tiempo y nunca cambia después de pintar. */
  font-display: optional;
}
@font-face {
  font-family: 'Atkinson Next';
  src: url('/fonts/atkinson-next-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Next';
  src: url('/fonts/atkinson-next-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f4f1e8;
  --surface: #ffffff;
  --surface-2: #ebe7da;
  --text: #121317;
  --text-2: #3d414c;
  --muted: #5b606c;
  --line: #d8d3c4;
  --edge: #121317;
  --edge-shadow: #121317;
  --lime: #d4ff3a;
  --ink: #121317;
  --link: #2341d8;
  --key-face: #ffffff;
  --ok-bg: #f0fbd0;
  --warn-bg: #fff0d6;
  --warn-ink: #7a4300;
  --accent: #121317;
  --wrap: 1180px;
  --post: 720px;
  --f-display: 'Bricolage', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-body: 'Atkinson Next', 'Segoe UI', system-ui, sans-serif;
  --ease-spring: cubic-bezier(.3, .7, .4, 1.35);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --surface: #171a21;
    --surface-2: #1d2129;
    --text: #eeede7;
    --text-2: #c9c9c4;
    --muted: #a0a2a9;
    --line: #2c313b;
    --edge: #3a404c;
    --edge-shadow: #000000;
    --link: #d4ff3a;
    --key-face: #262a34;
    --ok-bg: #1b2410;
    --warn-bg: #2b200f;
    --warn-ink: #ffc978;
    /* Las páginas sin sección (fijas, buscar, 404) usan este acento: la tinta no se vería sobre el fondo oscuro. */
    --accent: #d4ff3a;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding-top = alto de la cabecera fija + un poco de aire (los títulos no suman scroll-margin).
   layout.js copia en --header-h el alto real de la cabecera; sin JS valen estos cálculos aproximados.
   Los cortes van en em porque el menú salta de fila según el ancho de su texto, que crece con la letra del navegador. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; --header-h: 7rem; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (max-width: 31.1875em) { html { --header-h: 9.5rem; } } /* menú de secciones en dos filas */
@media (max-width: 19.3125em) { html { --header-h: 12.5rem; } } /* en tres filas (pantallas de ~300 px o letra grande) */
@media (min-width: 56.25em) { html { --header-h: 4.25rem; } } /* cabecera de una sola fila */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1rem; }
button, input { font: inherit; }
/* --focus: color del anillo según la zona (el lima o el azul no se ven sobre el héroe, las secciones o el pie). */
:focus-visible { outline: 3px solid var(--focus, var(--link)); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap--post { width: min(100% - 2rem, var(--post)); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--lime); color: var(--ink); padding: .6rem 1rem; border-radius: 10px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 1rem; }

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: .08em .45em;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: .82em;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  color: var(--text);
  background: var(--key-face);
  border: 2px solid var(--edge);
  border-radius: .42em;
  box-shadow: 0 .17em 0 var(--edge-shadow);
  vertical-align: .1em;
}
.plus { margin: 0 .22em; font-weight: 700; color: var(--muted); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 2px solid var(--edge);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.6rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark kbd {
  font-size: 1rem; min-width: 1.75rem; color: var(--ink); background: var(--lime);
  border-color: var(--ink); box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.brand-mark i { font-style: normal; font-weight: 700; margin: 0 .18rem; color: var(--muted); }
.brand:hover .brand-mark kbd:last-child { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.brand-word { font-family: var(--f-display); font-weight: 700; font-size: 1.28rem; letter-spacing: -.015em; }
.brand-word b { font-weight: 700; padding-left: .08em; }
.header-search {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem;
  border: 2px solid var(--edge); border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: .95rem; background: var(--surface);
  box-shadow: 0 3px 0 var(--edge-shadow);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.header-search:hover { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge-shadow); }
/* Sin scroll propio: si las cinco secciones no caben (celulares de menos de ~490 px) pasan a dos filas, o a tres
   por debajo de ~305 px; así la sección activa siempre se ve y el anillo de foco no queda recortado. */
.section-nav ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0 auto; padding: 0 0 .7rem; }
.section-nav a {
  display: inline-block; padding: .32rem .85rem; border: 2px solid var(--edge); border-radius: 999px;
  font-family: var(--f-display); font-weight: 700; font-size: .9rem; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.section-nav a:hover, .section-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (min-width: 56.25em) { /* 900 px con la letra de 16 px */
  /* .header-row pasa a display: contents (no genera caja): el alto y el aire van en la grilla. */
  .site-header {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 4.2rem;
    padding-block: .6rem; padding-inline: max(1rem, calc((100% - var(--wrap)) / 2));
  }
  .site-header .header-row { display: contents; }
  .header-row .brand { grid-column: 1; }
  .header-row .header-search { grid-column: 3; justify-self: end; }
  .section-nav { grid-column: 2; grid-row: 1; }
  .section-nav ul { width: auto; padding: 0; }
}

/* ---------- Portada ---------- */
.hero { --focus: var(--ink); position: relative; isolation: isolate; overflow: hidden; background: var(--lime); color: var(--ink); border-bottom: 3px solid var(--ink); }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(18, 19, 23, .16) 1.3px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(170deg, #000 30%, transparent 85%);
  mask-image: linear-gradient(170deg, #000 30%, transparent 85%);
}
.hero-grid { display: grid; gap: 1.75rem; padding-block: 2.25rem 2.5rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0;
  font-family: var(--f-display); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(18, 19, 23, .14); }
.hero-title {
  margin: .35em 0 .3em;
  font-family: var(--f-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3.6rem, 17vw, 8.6rem); line-height: .86; letter-spacing: -.025em;
}
.hero-hl {
  display: inline-block; margin-top: .06em; padding: .02em .14em .08em;
  background: var(--ink); color: var(--lime); border-radius: .1em; rotate: -2.5deg;
  box-shadow: .08em .08em 0 rgba(18, 19, 23, .25);
}
.hero-lead { max-width: 30ch; font-size: clamp(1.1rem, 4.2vw, 1.3rem); line-height: 1.45; margin-bottom: 1.4rem; }
.hero-search, .search-form {
  display: flex; gap: .4rem; max-width: 34rem; padding: .35rem;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink);
}
.search-form { border-color: var(--edge); box-shadow: 0 6px 0 var(--edge-shadow); background: var(--surface); margin-block: 1.5rem 1rem; }
.hero-search input, .search-form input {
  flex: 1; min-width: 0; border: 0; padding: .7rem .75rem; font-size: 1.05rem;
  background: transparent; color: var(--ink); outline: none;
}
.search-form input { color: var(--text); }
.hero-search input::placeholder { color: #5b606c; }
.search-form input::placeholder { color: var(--muted); }
.hero-search:focus-within, .search-form:focus-within { outline: 3px solid var(--focus, var(--link)); outline-offset: 3px; }
.hero-search button, .search-form button {
  display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 11px; cursor: pointer;
  padding: 0 1rem; background: var(--ink); color: var(--lime);
  font-family: var(--f-display); font-weight: 700; font-size: 1rem;
  transition: transform .12s var(--ease-out);
}
.search-form button { background: var(--text); color: var(--bg); }
.hero-search button:active, .search-form button:active { transform: scale(.96); }

.hero-art { display: grid; gap: 1.25rem; justify-items: start; }
.hero-keys { display: flex; gap: clamp(.35rem, 1.6vw, .75rem); }
.hero-keys kbd {
  display: grid; place-items: center; width: 1.55em; height: 1.55em; min-width: 0; padding: 0;
  font-family: var(--f-display); font-weight: 800; font-stretch: 75%; font-size: clamp(1.8rem, 9vw, 3.4rem);
  color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: .26em;
  box-shadow: 0 .2em 0 var(--ink);
}
.route { width: 100%; max-width: 30rem; height: auto; overflow: visible; }
.route-long { fill: none; stroke: var(--ink); stroke-opacity: .4; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 9; }
.route-short { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linecap: round; }
.route-end { fill: #fff; stroke: var(--ink); stroke-width: 4; }
.route-runner { fill: var(--ink); }
.route-label { font-family: var(--f-display); font-weight: 700; font-size: 15px; fill: var(--ink); opacity: .6; }
.route-label--short { opacity: 1; font-size: 17px; }

.ticker { overflow: hidden; background: var(--ink); color: #fff; border-top: 3px solid var(--ink); }
.ticker-track { display: flex; width: max-content; }
.ticker-set { display: flex; gap: 2.4rem; padding: .85rem 2.4rem .95rem 0; }
.ticker-item { display: inline-flex; align-items: center; white-space: nowrap; font-size: .95rem; }
.ticker kbd { color: #fff; background: #20232c; border-color: #4a505e; box-shadow: 0 .17em 0 #4a505e; }
.ticker .plus { color: #8a8f9c; }
.ticker-label { margin-left: .7rem; font-family: var(--f-display); font-weight: 700; color: var(--lime); }

/* Tecla «Pausar»: un checkbox (role="switch") encima del borde derecho de la cinta. Pulsada = animaciones quietas. */
.ticker-bar { --focus: var(--lime); position: relative; }
.motion-toggle {
  position: absolute; top: 3px; right: 0; bottom: 0; display: flex; align-items: center; gap: .5rem;
  padding: 0 1rem 0 2.4rem; cursor: pointer; color: #fff;
  font-family: var(--f-display); font-weight: 700; font-size: .9rem;
  background: linear-gradient(to right, transparent, var(--ink) 1.8rem);
  -webkit-tap-highlight-color: transparent;
}
.motion-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.motion-toggle kbd {
  display: grid; place-items: center; width: 2rem; height: 2rem; min-width: 0; padding: 0;
  color: #fff; background: #20232c; border-color: #4a505e; box-shadow: 0 .2em 0 #4a505e;
  transition: translate .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .12s;
}
.motion-toggle input:checked ~ kbd { translate: 0 .14em; color: var(--ink); background: var(--lime); border-color: var(--lime); box-shadow: 0 .06em 0 #4a505e; }
.motion-toggle input:focus-visible ~ kbd { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; padding-block: 3.5rem 3.75rem; }
  .hero-art { justify-items: end; }
}

/* ---------- Bloques ---------- */
.block { padding-block: 3rem .5rem; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: 1.3rem; }
.block-title {
  margin: 0 0 1.25rem; font-family: var(--f-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(2.2rem, 8vw, 3.4rem); line-height: .95; letter-spacing: -.015em;
}
.block-head .block-title { margin: 0; }
.block-note { margin: 0; color: var(--muted); font-weight: 700; }
.block-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.block-link svg { width: 1.1em; height: 1.1em; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.tiles li:first-child { grid-column: span 2; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: .4rem; height: 100%; min-height: 10rem;
  padding: 1rem 1rem 2.6rem; overflow: hidden; text-decoration: none; color: #fff;
  background: var(--accent); border: 3px solid var(--edge); border-radius: 20px; box-shadow: 0 6px 0 var(--edge-shadow);
  transition: transform .22s var(--ease-spring), box-shadow .22s var(--ease-out);
}
.tile::after {
  content: ''; position: absolute; right: -2.2rem; top: -2.2rem; width: 7rem; height: 7rem;
  border: 3px solid rgba(255, 255, 255, .28); border-radius: 22px; rotate: 18deg;
  transition: rotate .4s var(--ease-out);
}
.tile:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 11px 0 var(--edge-shadow); }
.tile:hover::after { rotate: 40deg; }
.tile-count {
  align-self: flex-start; padding: .14rem .6rem; border-radius: 999px; background: rgba(0, 0, 0, .24);
  font-family: var(--f-display); font-weight: 700; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase;
}
.tile-name { font-family: var(--f-display); font-weight: 800; font-stretch: 75%; font-size: clamp(2.1rem, 9vw, 3rem); line-height: .92; }
.tile-desc { font-size: .93rem; line-height: 1.4; }
.tile-go {
  position: absolute; right: .85rem; bottom: .75rem; display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #fff; color: var(--accent);
  transition: transform .22s var(--ease-spring);
}
.tile:hover .tile-go { transform: translateX(4px) rotate(-45deg); }
@media (max-width: 520px) {
  .tiles li:not(:first-child) .tile-desc { display: none; }
}
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles li { grid-column: span 2; }
  .tiles li:first-child, .tiles li:nth-child(2) { grid-column: span 3; }
  .tile { min-height: 12rem; }
}

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 1.3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards--home .card--featured { grid-column: span 2; grid-row: span 2; }
  .cards--home .card--featured .card-title { font-size: 2rem; }
  /* La portada sigue en 16:9 (lleva el título impreso); el alto que sobra lo toma el cuerpo. */
  .cards--home .card--featured .card-body { flex: 1; }
  .cards--home .card--featured .card-desc { font-size: 1.12rem; }
  .cards--home .card--featured .card-meta { margin-top: auto; }
}
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge-shadow);
  transition: transform .2s var(--ease-spring), box-shadow .2s var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--accent); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent); border-bottom: 2px solid var(--edge); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s var(--ease-out); }
.card:hover .card-media img { scale: 1.045; }
.card-fallback {
  display: grid; place-items: center; height: 100%; padding: 1rem; color: #fff; text-align: center;
  font-family: var(--f-display); font-weight: 800; font-stretch: 75%; font-size: 2.4rem;
}
.card-body { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; padding: 1rem 1.1rem 1.15rem; }
.card-title { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.22rem; line-height: 1.18; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.card-desc { margin: 0; color: var(--text-2); font-size: 1rem; line-height: 1.45; }
.card-title a { text-decoration: none; }
.card-title a::after { content: ''; position: absolute; inset: 0; }
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 3px solid var(--focus, var(--link)); outline-offset: 3px; }
.card .chip { position: relative; z-index: 1; }
.card-meta { display: inline-flex; align-items: center; gap: .35rem; margin: 0; color: var(--muted); font-size: .88rem; }

.chip {
  display: inline-flex; align-items: center; padding: .24rem .7rem; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: .85rem; line-height: 1.3;
}
.chip--sm { font-size: .76rem; padding: .16rem .6rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0; }

.index-band { margin-top: 3.5rem; padding-block: 3rem 3.25rem; background: var(--surface-2); border-block: 2px solid var(--edge); }
.index-grid { display: grid; gap: 2rem 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.index-col h3 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .7rem; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }
.index-col h3::before { content: ''; width: .85rem; height: .85rem; border-radius: 4px; background: var(--accent); rotate: 10deg; }
.index-col h3 a { text-decoration: none; }
.index-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.index-col li a { text-decoration: none; line-height: 1.35; overflow-wrap: anywhere; }
.index-col li a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Sección ---------- */
.section-hero { --focus: #fff; position: relative; overflow: hidden; isolation: isolate; padding-block: 1.75rem 2.4rem; background: var(--accent); color: #fff; border-bottom: 3px solid var(--edge); }
.section-hero::after {
  content: ''; position: absolute; z-index: -1; right: -3rem; bottom: -4rem; width: 16rem; height: 16rem;
  border: 4px solid rgba(255, 255, 255, .22); border-radius: 40px; rotate: 16deg;
  box-shadow: 0 1.4rem 0 rgba(0, 0, 0, .14);
}
.section-hero .crumbs, .section-hero .crumbs a { color: #fff; }
.section-title { margin: .25em 0 .2em; font-family: var(--f-display); font-weight: 800; font-stretch: 75%; font-size: clamp(3.4rem, 16vw, 7rem); line-height: .9; letter-spacing: -.02em; }
.section-desc { max-width: 38ch; font-size: 1.15rem; line-height: 1.45; }
.section-count { display: inline-block; margin: 0; padding: .2rem .75rem; border-radius: 999px; background: rgba(0, 0, 0, .25); font-weight: 700; font-size: .9rem; }

/* ---------- Guía ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 5px;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}
.post-head {
  padding-block: 1.4rem 1.6rem;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 16%, var(--bg)), var(--bg));
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .9rem; color: var(--muted); font-weight: 700; }
.crumbs a { text-underline-offset: 3px; }
/* Sobre el degradado teñido con el acento, --muted no llega a 4,5:1 (Seguridad, Apps). */
.post-head .crumbs { color: var(--text-2); }
.post-title {
  margin: .45rem 0 .7rem; font-family: var(--f-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(2.4rem, 10vw, 4.1rem); line-height: .97; letter-spacing: -.015em;
  overflow-wrap: break-word; text-wrap: balance;
}
.post-dek { max-width: 42ch; margin-bottom: 1.1rem; color: var(--text-2); font-size: 1.18rem; line-height: 1.45; text-wrap: pretty; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; margin: 0; color: var(--muted); font-size: .9rem; }
.post-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.post-meta a { color: var(--text); font-weight: 700; text-underline-offset: 3px; }
.meta-author kbd { font-size: .78rem; min-width: 1.6rem; color: var(--ink); background: var(--lime); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.post-cover { margin: .25rem 0 1.5rem; }
.post-cover img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px;
  border: 2px solid var(--edge); box-shadow: 0 7px 0 var(--accent);
}

.toc { margin: 0 0 2rem; background: var(--surface); border: 2px solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--edge-shadow); }
.toc summary {
  display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none;
  font-family: var(--f-display); font-weight: 700; font-size: 1.06rem;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after {
  content: '+'; margin-left: auto; display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border: 2px solid var(--edge); border-radius: 8px; font-size: 1.1rem; line-height: 1; transition: rotate .2s var(--ease-out);
}
.toc[open] summary::after { rotate: 45deg; }
.toc-count { color: var(--muted); font-size: .85rem; }
.toc ol { margin: 0; padding: 0 1.2rem 1.1rem 2.6rem; }
.toc li { margin: .4rem 0; padding-left: .2rem; }
.toc li::marker { font-family: var(--f-display); font-weight: 700; color: var(--accent); }
@media (prefers-color-scheme: dark) {
  /* Los acentos de sección son oscuros: aclarados con el texto, los números se leen sobre la superficie oscura. */
  .toc li::marker { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
}
/* overflow-wrap: anywhere (no break-word): es lo único que baja el ancho mínimo de una palabra larguísima. */
.toc a { text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.prose { font-size: 1.125rem; line-height: 1.72; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2 {
  display: flex; align-items: baseline; gap: .55rem; margin: 2.3em 0 .65em;
  font-family: var(--f-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(2rem, 7vw, 2.55rem); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance;
}
.prose h2::before { content: ''; flex: none; width: .5em; height: .5em; border-radius: .14em; background: var(--accent); rotate: 10deg; translate: 0 -.08em; }
/* markdown.js envuelve el texto del H2 en un <span>: un solo ítem flex que se parte en líneas y no se sale. */
.prose h2 > span { min-width: 0; overflow-wrap: anywhere; }
.prose h3 { margin: 1.9em 0 .5em; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; line-height: 1.25; overflow-wrap: anywhere; }
.prose a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 3px; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.35rem; }
.prose li + li { margin-top: .5em; }
.prose ul > li::marker { color: var(--accent); font-size: 1.15em; }
.prose ol { list-style: none; padding-left: 0; counter-reset: paso; }
.prose ol > li { position: relative; padding-left: 2.7rem; counter-increment: paso; }
.prose ol > li::before {
  content: counter(paso); position: absolute; left: 0; top: .05em; display: grid; place-items: center;
  width: 1.85rem; height: 1.85rem; font-family: var(--f-display); font-weight: 700; font-size: .95rem; line-height: 1;
  background: var(--key-face); border: 2px solid var(--edge); border-radius: .45rem; box-shadow: 0 3px 0 var(--edge-shadow);
}
.prose img { border-radius: 14px; border: 2px solid var(--edge); margin-block: 1.5em; }
.prose code { padding: .1em .35em; font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--surface-2); border-radius: 6px; }
.prose blockquote { position: relative; margin: 1.8em 0; padding: .1em 0 0 2.7rem; color: var(--text-2); font-style: italic; }
.prose blockquote::before {
  content: '“'; position: absolute; left: 0; top: -.12em;
  font-family: var(--f-display); font-weight: 800; font-style: normal; font-size: 3.8rem; line-height: 1; color: var(--accent);
}
.prose hr { margin: 2.5em 0; border: 0; border-top: 2px dashed var(--line); }
.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 2px solid var(--edge); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
.prose th, .prose td { padding: .7rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--surface-2); font-family: var(--f-display); font-weight: 700; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* Tarjeta de Contacto: el correo grande y dos botones (Gmail y copiar) */
.contact-card {
  margin: 1.4em 0 2.2em; padding: 1.2rem 1.2rem 1.1rem;
  background: var(--surface); border: 2px solid var(--edge); border-radius: 18px;
  box-shadow: 0 6px 0 var(--edge-shadow);
}
.prose .contact-card p { margin: 0; }
.contact-card__label { font-family: var(--f-display); font-weight: 700; font-size: .95rem; color: var(--muted); }
.prose .contact-card__email {
  margin: .15rem 0 1rem; font-family: var(--f-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(1.55rem, 7vw, 2.3rem); line-height: 1.05; color: var(--text); overflow-wrap: anywhere;
}
.contact-card__actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.prose .contact-btn {
  flex: 1 1 13rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .55rem 1.1rem; border: 2px solid var(--edge); border-radius: 12px;
  background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer;
  font: 700 1.05rem/1.1 var(--f-display);
  box-shadow: 0 4px 0 var(--edge-shadow);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.prose .contact-btn--main { background: var(--lime); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.prose .contact-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge-shadow); }
.prose .contact-btn[hidden] { display: none; }
.prose .contact-card__alt { margin-top: .95rem; font-size: .98rem; color: var(--text-2); }

.callout { margin: 1.7em 0; padding: 1rem 1.15rem 1.05rem; border: 2px solid var(--edge); border-radius: 16px; box-shadow: 0 5px 0 var(--edge-shadow); }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin-bottom: .6em; }
.callout__title {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .45rem !important;
  font-family: var(--f-display); font-weight: 800; font-stretch: 75%; font-size: 1.45rem; line-height: 1; letter-spacing: .02em; text-transform: uppercase;
}
.callout__title::before {
  content: ''; flex: none; width: 1.55rem; height: 1.55rem; border: 2px solid var(--ink); border-radius: .4rem;
  box-shadow: 0 2px 0 var(--ink); background-position: center; background-repeat: no-repeat; background-size: 70%;
}
.callout--atajo { background: var(--ok-bg); }
.callout--atajo .callout__title::before {
  background-color: var(--lime);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z' fill='%23121317'/%3E%3C/svg%3E");
}
.callout--ojo { background: var(--warn-bg); }
.callout--ojo .callout__title { color: var(--warn-ink); }
.callout--ojo .callout__title::before {
  background-color: #ffb020;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v10' stroke='%23121317' stroke-width='3.4' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='19.5' r='2' fill='%23121317'/%3E%3C/svg%3E");
}

.ad-slot { display: flex; flex-direction: column; justify-content: center; min-height: 280px; margin: 2.2em 0; }
/* AdSense solo permite etiquetar sus anuncios como «Anuncios» o «Enlaces patrocinados». */
.ad-slot::before { content: 'Anuncios'; margin-bottom: .4rem; text-align: center; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

.author-box {
  display: flex; align-items: flex-start; gap: 1rem; margin: 3rem 0 1rem; padding: 1.2rem 1.25rem;
  background: var(--surface-2); border: 2px solid var(--edge); border-radius: 18px;
}
.author-box p { margin: 0; font-size: 1rem; line-height: 1.5; }
.author-box a { color: var(--link); text-underline-offset: 3px; }
.author-avatar kbd {
  display: grid; place-items: center; width: 3.2rem; height: 3.2rem; padding: 0;
  font-weight: 800; font-stretch: 75%; font-size: 1.7rem; color: var(--ink); background: var(--lime);
  border-color: var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.author-name { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; margin-bottom: .2rem !important; }
.related { padding-bottom: 1rem; }

/* ---------- Buscar y 404 ---------- */
.search-page, .nf { padding-block: 2.5rem 1rem; }
/* Reserva el alto de los resultados: así el pie no está en la primera pantalla y no salta cuando llegan (CLS). */
.search-page { min-height: calc(100svh - 7rem); }
.search-status { color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.search-results li a {
  display: block; padding: 1rem 1.15rem; text-decoration: none; background: var(--surface);
  border: 2px solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--edge-shadow);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.search-results li a:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--accent, var(--edge-shadow)); }
.search-results .r-section { display: inline-block; margin-bottom: .3rem; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.search-results .r-title { display: block; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.search-results .r-desc { display: block; margin-top: .35rem; color: var(--text-2); font-size: .98rem; line-height: 1.45; }
.nf-keys { display: flex; gap: .6rem; margin-bottom: 1rem; }
.nf-keys kbd {
  display: grid; place-items: center; width: 1.5em; height: 1.5em; padding: 0; font-size: clamp(2.6rem, 14vw, 4.5rem);
  font-weight: 800; font-stretch: 75%; color: var(--ink); background: var(--lime); border: 3px solid var(--ink); box-shadow: 0 .18em 0 var(--ink);
}
.nf-keys kbd:nth-child(2) { rotate: -6deg; translate: 0 .12em; }

/* ---------- Pie ---------- */
.site-footer { --focus: var(--lime); margin-top: 4rem; padding-block: 3rem 1.6rem; background: #0b0c10; color: #e9e8e2; border-top: 5px solid var(--lime); }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { color: #e9e8e2; text-decoration: none; }
.site-footer a:hover { color: var(--lime); }
.site-footer .brand-word { color: #fff; }
.site-footer .brand-mark kbd { box-shadow: 0 3px 0 #000; }
.footer-brand p { max-width: 36ch; margin-top: 1rem; color: #b9bac0; }
.footer-title { margin: 0 0 .75rem; color: var(--lime); font-family: var(--f-display); font-weight: 700; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-copy { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #262a33; color: #a7a9b0; font-size: .88rem; }
.footer-copy a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  .eyebrow, .hero-lead, .hero-search { animation: rise .8s var(--ease-out) both; }
  .eyebrow { animation-delay: .05s; }
  .hero-lead { animation-delay: .22s; }
  .hero-search { animation-delay: .32s; }
  .hero-title { animation: slide .9s var(--ease-out) both .08s; }
  .hero-hl { animation: stamp .7s cubic-bezier(.3, 1.6, .5, 1) both .55s; }
  .hero-keys kbd { animation: press 5s var(--ease-out) infinite; animation-delay: calc(1.2s + var(--i) * .13s); }
  .route-short { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 1.2s cubic-bezier(.65, 0, .25, 1) .9s forwards; }
  .route-long { animation: dash 14s linear infinite; }
  .route-runner { animation: run 2.8s linear 2s infinite both; }
  .ticker-track { animation: marquee 42s linear infinite; }
  /* Las animaciones en bucle se detienen con la tecla «Pausar», al pasar el ratón y mientras se escribe en el buscador. */
  .hero:has(.motion-toggle input:checked) :is(.hero-keys kbd, .route-long, .route-runner, .ticker-track),
  .hero:has(.hero-copy :focus-within) :is(.hero-keys kbd, .route-long, .route-runner, .ticker-track) { animation-play-state: paused; }
  /* La pausa con hover es solo para el ratón: en pantallas táctiles el hover se queda «pegado» tras el toque. Ni el
     hover sobre la tecla ni su foco pausan nada, así la tecla hace lo que muestra: un segundo toque, clic o Espacio
     vuelve a mover todo. */
  @media (hover: hover) {
    .hero-art:hover :is(.hero-keys kbd, .route-long, .route-runner),
    .ticker:hover .ticker-track { animation-play-state: paused; }
  }
  .section-title { animation: slide .8s var(--ease-out) both; }
  .section-hero::after { animation: spin-in 1.2s var(--ease-out) both; }

  @supports (animation-timeline: view()) {
    .card, .tile, .index-col, .callout {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
  }
  @supports (animation-timeline: scroll()) {
    .progress { animation: grow linear both; animation-timeline: scroll(root); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .route-runner, .motion-toggle { display: none; }
}

@keyframes rise { from { opacity: 0; translate: 0 18px; } }
@keyframes slide { from { translate: 0 .35em; } }
@keyframes stamp { from { opacity: 0; scale: 1.7; rotate: 8deg; } }
@keyframes press {
  0%, 12%, 100% { translate: 0 0; box-shadow: 0 .2em 0 var(--ink); background: #fff; }
  4% { translate: 0 .16em; box-shadow: 0 .04em 0 var(--ink); background: var(--lime); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dash { to { stroke-dashoffset: -200; } }
/* El punto recorre «el atajo» (de 24,124 a 296,32 en el viewBox) y espera al final antes de repetir. */
@keyframes run { 55%, 100% { translate: 272px -92px; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin-in { from { rotate: -30deg; scale: .6; opacity: 0; } }
@keyframes reveal { from { opacity: 0; translate: 0 26px; } }
@keyframes grow { to { transform: scaleX(1); } }
