/* Sektor — estilos compartidos del blog, /demo/, /gracias/, /privacidad/ y 404.
   Mismo sistema que la portada (index.html): papel, tinta noche y un solo azul, Inter,
   banda oscura arriba, tarjetas redondeadas y barra que se aclara al bajar. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/assets/fonts/archivo-latin-var.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

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

:root {
  --paper: #F3F5F9;
  --paper-2: #E4E9F2;
  --white: #FFFFFF;
  --night: #05070C;
  --night-2: #0B0F17;
  --ink: #05070C;
  --soft: #4A5266;
  --on-night: #F3F5F9;
  --on-night-soft: #A3ACBF;
  --line: rgba(5, 7, 12, .09);
  --line-night: rgba(243, 245, 249, .09);
  --accent: #2457E6;
  --accent-press: #1B45BD;
  --accent-glow: #4F7BFF;

  --display: clamp(40px, 5.2vw, 80px);
  --heading: clamp(30px, 3.2vw, 48px);
  --lead: clamp(19px, 1.5vw, 22px);
  --body: 17px;
  --small: 15px;

  --pad: clamp(20px, 5vw, 80px);
  --max: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-stretch: 115%; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: inherit; }
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font: 600 var(--small)/1 'Inter', sans-serif; letter-spacing: -0.01em;
  text-decoration: none; border: 0; cursor: pointer;
  transition: background .25s, transform .25s var(--ease);
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn:hover { background: var(--accent-press); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(.97); }
.link {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 5px; text-decoration-color: var(--accent); transition: color .2s;
}
.link:hover { color: var(--accent); }
.mail-link, a[href^="mailto:"] { font-weight: 600; text-decoration: none; transition: color .2s; }
.mail-link:hover, a[href^="mailto:"]:hover { color: var(--accent); }

/* ---------- Barra superior: igual que la portada ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .35s, box-shadow .35s; }
.top .wrap { width: calc(100% - 2 * var(--pad)); display: flex; align-items: center; justify-content: space-between; height: 72px; }
.top.light { background: rgba(243, 245, 249, .82); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.word { font-size: 28px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; text-decoration: none; color: var(--on-night); transition: color .35s; }
.top.light .word { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 32px; font-size: var(--small); font-weight: 500; color: var(--on-night-soft); transition: color .35s; }
.nav > a { text-decoration: none; transition: color .2s; }
.nav > a:hover { color: var(--on-night); }
.top.light .nav { color: var(--soft); }
.top.light .nav > a:hover { color: var(--ink); }

/* Asistencia: ícono que abre la demo y el mail (solo celular y tableta) */
.help { position: relative; display: none; }
.help-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--on-night); cursor: pointer; transition: color .35s, opacity .2s; }
.help-btn:hover { opacity: .75; }
.help-btn[aria-expanded="true"] { color: #9DB6FF; }
.top.light .help-btn { color: var(--ink); }
.top.light .help-btn[aria-expanded="true"] { color: var(--accent); }
.help-pop {
  position: absolute; right: 0; top: calc(100% + 12px); width: min(320px, calc(100vw - 32px));
  background: var(--white); color: var(--ink); border-radius: 18px; padding: 22px;
  box-shadow: 0 0 0 1px var(--line), 0 30px 70px -20px rgba(5, 7, 12, .45);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top right;
  transition: opacity .25s, transform .35s var(--ease), visibility 0s .35s;
}
.help-pop.open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .35s var(--ease); }
.help-pop h2 { font-size: 20px; letter-spacing: -0.03em; }
.help-pop > p { font-size: 15px; color: var(--soft); margin-top: 6px; }
.help-pop .btn { width: 100%; margin-top: 18px; }
.help-mail { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 10px; text-decoration: none; background: var(--paper); transition: background .2s; }
.help-mail:hover { background: var(--paper-2); color: inherit; }
.help-mail svg { flex: none; color: var(--accent); }
.help-mail span { display: grid; font-size: 14px; font-weight: 600; min-width: 0; }
.help-mail small { font-size: 13px; font-weight: 400; color: var(--soft); }
.help-mail b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Banda oscura del título (como el inicio de la portada) ---------- */
.page-head {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--night); color: var(--on-night);
  padding: clamp(150px, 22vh, 220px) 0 clamp(72px, 10vh, 120px);
}
.page-head::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  /* superficie lisa, apenas más clara arriba */
  background: linear-gradient(to bottom, rgba(243,245,249,.05), transparent 55%);
}
.page-head h1 { font-size: var(--display); max-width: 18ch; letter-spacing: -0.03em; }
.page-head .lead { font-size: var(--lead); line-height: 1.5; margin-top: 24px; max-width: 52ch; color: #C9D0DE; }
.page-head .meta { margin-top: 24px; font-size: var(--small); color: var(--on-night-soft); }
.page-head .row { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-top: 36px; font-size: var(--small); }
.page-head .link { color: var(--on-night); }
.page-head.full { min-height: 100svh; display: grid; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: var(--small); font-weight: 500; color: var(--on-night-soft); text-decoration: none; transition: color .2s; }
.crumb:hover { color: var(--on-night); }
.crumb svg { transition: transform .3s var(--ease); }
.crumb:hover svg { transform: translateX(-3px); }

/* ---------- Índice del blog: tarjetas ---------- */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: clamp(56px, 7vw, 96px) 0 clamp(96px, 12vw, 160px); }
.post-card {
  --x: 50%; --y: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--white); border-radius: 18px; padding: clamp(28px, 3vw, 40px);
  box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none; color: inherit;
  transition: transform .5s var(--ease), box-shadow .5s;
}
.post-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--x) var(--y), rgba(36, 87, 230, .10), transparent 55%);
}
.post-card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(36, 87, 230, .35), 0 24px 60px -30px rgba(36, 87, 230, .35); }
.post-card:hover::before { opacity: 1; }
.post-card .meta { font-size: 14px; color: var(--soft); }
.post-card h2 { font-size: clamp(22px, 1.9vw, 28px); letter-spacing: -0.03em; line-height: 1.15; transition: color .2s; }
.post-card p { margin-top: 12px; color: var(--soft); font-size: 16px; }
.post-card:hover h2 { color: var(--accent); }
.post-card .body::after {
  content: 'Leer la guía →'; display: block; margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--accent);
  transition: transform .3s var(--ease);
}
.post-card:hover .body::after { transform: translateX(4px); }

/* ---------- Artículo ---------- */
article { padding: 0; }
.article-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(40px, 6vw, 96px); margin-top: clamp(56px, 7vw, 96px); align-items: start; }
.toc { position: sticky; top: 104px; font-size: var(--small); background: var(--white); border-radius: 18px; padding: 24px; box-shadow: inset 0 0 0 1px var(--line); }
.toc p { font-weight: 700; margin-bottom: 14px; }
.toc ol { list-style: none; display: grid; gap: 10px; }
.toc a { text-decoration: none; color: var(--soft); transition: color .2s; display: block; padding-left: 12px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }
.prose { font-size: var(--body); line-height: 1.7; max-width: 70ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(24px, 2vw, 30px); margin: 64px 0 18px; line-height: 1.15; letter-spacing: -0.03em; scroll-margin-top: 100px; }
.prose h3 { font-size: 21px; letter-spacing: -0.02em; margin: 40px 0 12px; line-height: 1.25; }
.prose p { margin-bottom: 22px; }
.prose a { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { margin: 0 0 22px 22px; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  background: var(--white); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line), inset 4px 0 0 var(--accent);
  padding: 28px 32px; margin: 40px 0;
  font-size: var(--lead); line-height: 1.45; letter-spacing: -0.01em;
}
.prose code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.prose strong { font-weight: 650; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 28px; font-size: var(--small); background: var(--white); border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.prose th, .prose td { text-align: left; padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font-weight: 650; background: var(--paper-2); }

.back { display: inline-block; margin-top: 32px; font-size: var(--small); font-weight: 600; text-decoration: none; }
.back:hover { color: var(--accent); }

/* Cierre: caja oscura con luz, como en la portada */
.article-cta {
  position: relative; isolation: isolate; overflow: hidden;
  width: min(100% - 2 * var(--pad), var(--max)); margin: clamp(96px, 12vw, 160px) auto;
  border-radius: 28px; background: var(--night); color: var(--on-night);
  display: grid; justify-items: center; text-align: center;
  padding: clamp(64px, 9vw, 120px) var(--pad);
}
.article-cta::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  /* superficie lisa, apenas más clara abajo */
  background: linear-gradient(to top, rgba(243,245,249,.05), transparent 55%);
}
.article-cta h3 { font-size: var(--heading); max-width: 18ch; }
.article-cta p { font-size: var(--lead); line-height: 1.5; color: var(--on-night-soft); margin-top: 18px; max-width: 46ch; }
.article-cta .btn { margin-top: 32px; }

/* ---------- Pie: igual que la portada ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: var(--small); }
.foot .wrap { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.foot .word { color: var(--ink); }
.foot nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.foot nav a { text-decoration: none; color: var(--soft); transition: color .2s; }
.foot nav a:hover { color: var(--accent); }
.foot .legal { grid-column: 1 / -1; font-size: 13px; color: var(--soft); }
.foot .legal a { color: var(--soft); font-weight: 500; }

/* ---------- Entradas ---------- */
.anim .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.anim .rv.in { opacity: 1; transform: none; }

@media (max-width: 1000px) {
  .nav > a { display: none; }
  .help { display: block; }
  .posts { grid-template-columns: 1fr; }
  .article-body { grid-template-columns: 1fr; gap: 40px; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 32px; display: block; }
  .toc li { margin-bottom: 10px; break-inside: avoid; }
}
@media (max-width: 640px) {
  :root { --display: clamp(34px, 9.5vw, 48px); --heading: clamp(28px, 7.5vw, 36px); --body: 16px; }
  .top .wrap { height: 64px; }
  .page-head { padding: 120px 0 56px; }
  .toc ol { columns: 1; }
  .prose h2 { font-size: 22px; }
  .article-cta { border-radius: 20px; }
  .article-cta .btn { width: 100%; }
  .foot .wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .anim .rv { opacity: 1; transform: none; transition: none; }
  .post-card, .btn::after { transition: none; }
}
