/* ============================================================
   IMPULSA·IA — Hoja de estilos principal
   Estética: editorial-tech. Papel cálido, tinta verde, acento lima.
   Tipografías: Fraunces (titulares) · Instrument Sans (texto)
   Fuentes autohospedadas (sin Google CDN): subconjuntos latin + latin-ext.
   ============================================================ */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-italic-latin.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;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-normal-latin.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;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/instrument-sans-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/instrument-sans-normal-latin.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;
}
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/spline-sans-mono-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/spline-sans-mono-normal-latin.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;
}

:root {
  /* Color */
  --paper: #faf7ef;
  --paper-deep: #f3eedf;
  --ink: #15211b;
  --ink-soft: #46544c;
  --ink-faint: #586459;
  --emerald: #0e5f45;
  --emerald-deep: #0a4734;
  --lime: #d6f25f;
  --lime-soft: #ecf9b8;
  --coral: #e2542c;
  --line: #e2dbc8;
  --white: #fffdf8;

  /* Tipografía */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-mono: "Spline Sans Mono", "Courier New", monospace;

  /* Escala */
  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-md: 1.05rem;
  --text-lg: 1.3rem;

  /* Layout */
  --max-w: 1180px;
  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 2px 6px rgba(21, 33, 27, 0.06), 0 16px 40px -16px rgba(21, 33, 27, 0.18);
  --shadow-lift: 0 4px 10px rgba(21, 33, 27, 0.08), 0 28px 56px -20px rgba(21, 33, 27, 0.28);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 500px at 85% -5%, rgba(214, 242, 95, 0.25), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(14, 95, 69, 0.05), transparent 55%),
    repeating-linear-gradient(0deg, transparent, transparent 47px, rgba(21, 33, 27, 0.035) 48px),
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(21, 33, 27, 0.035) 48px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--emerald); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--emerald-deep); }
button { font: inherit; cursor: pointer; }
::selection { background: var(--lime); color: var(--ink); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; line-height: 1.3; }

.wrap { max-width: var(--max-w); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }

/* Etiqueta editorial numerada */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 2.2em; height: 1px; background: var(--emerald); }

/* Subrayado tipo rotulador */
.marker {
  background-image: linear-gradient(120deg, var(--lime) 0%, var(--lime) 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.38em;
  background-position: 0 88%;
  padding-inline: 0.06em;
}

.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--ink-soft); max-width: 38em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  font-size: var(--text-md);
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.btn-primary { background: var(--ink); color: var(--lime); }
.btn-primary:hover { background: var(--emerald-deep); border-color: var(--emerald-deep); color: var(--lime); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn-lime:hover { background: var(--white); border-color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn .arrow { transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-sm { padding: 0.55em 1.2em; font-size: var(--text-sm); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 239, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.logo .dot { color: var(--emerald); }
.logo .ia {
  background: var(--lime);
  border-radius: 6px;
  padding: 0 0.18em;
  margin-left: 0.08em;
  font-style: italic;
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; padding: 0; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--lime); }
.nav-cta { white-space: nowrap; }

.burger {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  width: 44px; height: 44px;
  position: relative;
}
.burger span, .burger span::before, .burger span::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger span { top: 50%; translate: 0 -50%; }
.burger span::before { top: -7px; }
.burger span::after { top: 7px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 em { font-style: italic; font-weight: 480; }
.hero .lead { margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }
.hero-proof {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  margin-top: 2.6rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.hero-proof strong { display: block; font-size: 1.35rem; color: var(--ink); font-family: var(--font-display); letter-spacing: 0; }

/* Tarjeta decorativa del hero */
.hero-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: 8px 8px 0 var(--lime), var(--shadow);
  rotate: 1.5deg;
}
.hero-card .hc-head {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  display: flex; justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.8rem; margin-bottom: 1rem;
}
.hero-card ul { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.hero-card li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: var(--text-sm); color: var(--ink-soft); }
.hero-card li b { color: var(--ink); }
.hero-card .tick {
  flex: none;
  width: 1.25em; height: 1.25em; margin-top: 0.15em;
  border-radius: 50%;
  background: var(--lime);
  display: grid; place-items: center;
  font-size: 0.7em; font-weight: 700; color: var(--ink);
}
.hero-card .hc-foot { margin-top: 1.2rem; }

/* ---------- Cinta marquesina ---------- */
.ticker {
  border-block: 1.5px solid var(--ink);
  background: var(--lime);
  overflow: hidden;
  white-space: nowrap;
  padding-block: 0.55rem;
}
.ticker-track { display: inline-block; animation: ticker 28s linear infinite; }
.ticker span {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 2.5rem;
}
.ticker span::after { content: "✳"; margin-left: 2.5rem; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Selector de estrellas (valoración, igual que el portal) ---------- */
.star-rating { display: inline-flex; flex-direction: row-reverse; gap: 0.15rem; }
.star-rating input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-rating label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; transition: color .12s ease, transform .12s ease; }
.star-rating label::before { content: "★"; }
.star-rating input:checked ~ label,
.star-rating label:hover, .star-rating label:hover ~ label { color: #e8a300; }
.star-rating label:hover, .star-rating label:hover ~ label { transform: scale(1.06); }
.star-rating input:focus-visible + label { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-head { max-width: 44em; margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section-head .lead { margin-top: 0.9rem; }
.section-alt { background: var(--paper-deep); border-block: 1px solid var(--line); }

/* ---------- Tarjetas de herramientas ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tool-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.tool-rank {
  position: absolute;
  top: -0.55em; right: 0.6rem;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 640;
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  opacity: 0.5;
  pointer-events: none;
}
.tool-card.featured { box-shadow: 6px 6px 0 var(--emerald); }
.tool-badge {
  position: absolute;
  top: -0.85rem; left: 1.4rem;
  background: #b83d1c; /* coral oscurecido: blanco encima pasa 5.6:1 (WCAG AA) */
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.32em 0.9em;
  border-radius: 999px;
}
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emerald);
  background: var(--lime-soft);
  border: 1px solid rgba(14, 95, 69, 0.25);
  border-radius: 999px;
  padding: 0.28em 0.85em;
  margin-bottom: 0.9rem;
  width: fit-content;
}
.tool-card h3 { margin-bottom: 0.35rem; }
.tool-for { font-size: var(--text-sm); color: var(--ink-faint); margin-bottom: 0.9rem; }
.tool-points { list-style: none; padding: 0; display: grid; gap: 0.45rem; margin-bottom: 1.2rem; font-size: var(--text-sm); color: var(--ink-soft); }
.tool-points li { padding-left: 1.3em; position: relative; }
.tool-points li::before { content: "→"; position: absolute; left: 0; color: var(--emerald); font-weight: 700; }
.tool-meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  border-top: 1px dashed var(--line);
  padding-top: 1.1rem;
}
.tool-price { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); }
.tool-price b { display: block; font-size: 1rem; color: var(--ink); font-family: var(--font-body); }

/* ---------- Pasos / metodología ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: paso; }
.step {
  counter-increment: paso;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  background: var(--white);
}
.step::before {
  content: "0" counter(paso);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--emerald);
  display: block;
  margin-bottom: 0.9rem;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { font-size: var(--text-sm); color: var(--ink-soft); }

/* ---------- Banda oscura: lead magnet ---------- */
.band {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.band::after {
  content: "✳";
  position: absolute;
  right: -0.2em; bottom: -0.45em;
  font-size: 14rem;
  line-height: 1;
  color: var(--emerald);
  opacity: 0.55;
  pointer-events: none;
}
.band h2 { color: var(--white); }
/* En bandas oscuras el subrayado fino dejaba el texto tinta-sobre-tinta (ilegible):
   se convierte en resaltado completo lima con texto tinta */
.band .marker {
  color: var(--ink);
  background-size: 100% 92%;
  background-position: 0 55%;
  padding-inline: 0.18em;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.band p { color: rgba(250, 247, 239, 0.75); max-width: 36em; }
.band-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2.5rem; align-items: center; position: relative; z-index: 1; }
.band .kicker { color: var(--lime); }
.band .kicker::before { background: var(--lime); }

/* Formulario de captación */
.capture { display: flex; gap: 0.6rem; margin-top: 1.6rem; max-width: 30em; }
.capture input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.85em 1.2em;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
}
.capture input[type="email"]:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: var(--emerald); }
.capture .btn { white-space: nowrap; }
.form-note { font-size: var(--text-xs); color: var(--ink-faint); margin-top: 0.7rem; }
.band .form-note { color: rgba(250, 247, 239, 0.5); }
.form-ok {
  display: none;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--emerald);
  background: var(--lime-soft);
  border-radius: var(--radius);
  padding: 0.8em 1.2em;
}
.band .form-ok { color: var(--lime); background: rgba(214, 242, 95, 0.12); }
form.sent .capture { display: none; }
form.sent .form-ok { display: block; }

/* Mockup del lead magnet */
.magnet-mock {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  rotate: -2deg;
  box-shadow: 10px 10px 0 rgba(214, 242, 95, 0.35);
  border: 1.5px solid var(--ink);
}
.magnet-mock .mm-tag { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral); }
.magnet-mock h3 { font-size: 1.45rem; margin-block: 0.5rem 0.8rem; }
.magnet-mock p { color: var(--ink-soft) !important; font-size: var(--text-sm); }

/* ---------- Blog ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.post-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--ink); }
.post-thumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.2rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-deep) 70%);
  position: relative;
}
.post-thumb.alt { background: linear-gradient(135deg, #b5562a 0%, var(--coral) 100%); }
.post-thumb.alt2 { background: linear-gradient(135deg, #2c3e36 0%, var(--ink) 100%); }
.post-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.04) 10px, rgba(255,255,255,0.04) 20px);
}
.post-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-tag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--emerald); margin-bottom: 0.6rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; }
.post-excerpt { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 0.5rem; }
.post-foot { margin-top: auto; padding-top: 1rem; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); display: flex; justify-content: space-between; }
.post-card.soon { opacity: 0.75; }
.post-card.soon .post-thumb { filter: grayscale(0.5); }

/* ---------- FAQ ---------- */
.faq { max-width: 46em; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding-block: 1.1rem;
}
.faq summary {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 560;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--emerald);
  transition: rotate 0.2s ease;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding-top: 0.7rem; color: var(--ink-soft); font-size: var(--text-sm); max-width: 60ch; }

/* ---------- Espacio publicitario ---------- */
.ad-slot {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  min-height: 110px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: rgba(255, 253, 248, 0.6);
}
/* A2: un hueco publicitario SIN código real (vacío) no se muestra al visitante. En cuanto el dueño
   pega el código en Ajustes (web generada) o dentro del propio .ad-slot (páginas a mano), reaparece. */
.ad-slot:empty { display: none; }

/* ---------- Aviso de afiliados ---------- */
.disclosure {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9em 1.2em;
  margin-block: 1.5rem;
}

/* ---------- Pie ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(250, 247, 239, 0.7);
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.site-footer .logo { color: var(--paper); font-size: 1.6rem; }
.site-footer p { font-size: var(--text-sm); max-width: 30em; }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 1rem;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.site-footer ul a { color: rgba(250, 247, 239, 0.7); text-decoration: none; font-size: var(--text-sm); }
.site-footer ul a:hover { color: var(--lime); }
.footer-bottom {
  border-top: 1px solid rgba(250, 247, 239, 0.15);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(250, 247, 239, 0.62); /* ~6.4:1 sobre tinta (WCAG AA) */
}

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 1100;
  max-width: 520px;
  margin-inline: auto;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 1.3rem 1.5rem;
  display: none;
}
.cookie-banner.visible { display: block; animation: rise 0.4s ease both; }
.cookie-banner p { font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: 1rem; }
.cookie-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Página de artículo ---------- */
.article-header { padding-block: clamp(3rem, 7vw, 5rem) 2rem; max-width: 760px; margin-inline: auto; }
.article-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); letter-spacing: 0.06em; margin-top: 1.2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.article-body { max-width: 720px; margin-inline: auto; padding-bottom: 3rem; }
.article-body h2 { margin-block: 2.2em 0.6em; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.article-body h3 { margin-block: 1.8em 0.5em; }
.article-body p { margin-block: 1em; color: var(--ink-soft); }
.article-body p strong, .article-body li strong { color: var(--ink); }
.article-body ul, .article-body ol { padding-left: 1.4em; color: var(--ink-soft); }
.article-body li { margin-block: 0.4em; }
.article-body blockquote {
  border-left: 3px solid var(--lime);
  padding-left: 1.2em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  margin-block: 1.6em;
}
.article-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin-block: 1.5em; background: var(--white); }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 0.7em 0.9em; text-align: left; }
.article-body th { background: var(--paper-deep); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; }
.toc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.6rem;
  margin-block: 2rem;
  font-size: var(--text-sm);
}
.toc strong { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--emerald); }
.toc ol { margin-top: 0.7rem; }

/* Caja CTA dentro de artículos */
.cta-box {
  background: var(--lime-soft);
  border: 1.5px solid var(--emerald);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-block: 2rem;
}
.cta-box h3 { margin-top: 0 !important; }
.cta-box p { color: var(--ink-soft); }

/* ---------- Página legal ---------- */
.legal-body { max-width: 720px; margin-inline: auto; padding-block: 3rem 4rem; }
.legal-body h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.5rem; }
.legal-body h2 { font-size: 1.3rem; margin-block: 1.8em 0.5em; }
.legal-body p, .legal-body li { color: var(--ink-soft); font-size: var(--text-sm); }
.legal-body ul { padding-left: 1.3em; }

/* ---------- Directorio: filtros, estrellas, comparador, archivo NL ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem;
  background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem; margin-bottom: 1.6rem;
}
.filter-bar input[type="search"] {
  flex: 2; min-width: 220px; font: inherit; padding: 0.6em 1em;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
}
.filter-bar select { flex: 1; min-width: 170px; font: inherit; padding: 0.6em 1em; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); }
.filter-bar input:focus, .filter-bar select:focus { outline: 2px solid var(--lime); border-color: var(--emerald); }
.filter-check { display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.filter-count { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); margin-left: auto; white-space: nowrap; }

.stars { font-size: 0.62em; font-family: var(--font-mono); color: var(--emerald); background: var(--lime-soft); border-radius: 999px; padding: 0.25em 0.7em; vertical-align: middle; white-space: nowrap; }

.compare-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.compare-controls select { flex: 1; min-width: 200px; font: inherit; padding: 0.7em 1em; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--white); }
.compare-controls .vs { font-family: var(--font-display); font-style: italic; font-weight: 700; color: var(--coral); font-size: 1.2rem; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: var(--text-sm); }
.compare-table th, .compare-table td { border: 1px solid var(--line); padding: 0.8em 1em; text-align: left; vertical-align: top; width: 38%; }
.compare-table th { width: 24%; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); background: var(--paper-deep); }
.compare-table ul { margin: 0; padding-left: 1.1em; }

.nl-item summary { font-size: 1.05rem; }
.nl-item .nl-date { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); margin-left: auto; padding-right: 1rem; }
.nl-content { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin-top: 0.8rem; font-size: var(--text-sm); color: var(--ink-soft); }
.nl-content h2 { font-size: 1.1rem; margin: 1em 0 0.4em; }

/* ---------- Animación de aparición ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; animation: reveal-fallback 0.6s ease 1.4s forwards; }
.reveal.in { opacity: 1; transform: none; animation: none; }
/* Robustez sin JS: si el observador no llega a añadir .in (JS desactivado/fallo), el contenido
   aparece igualmente a los 1.4s en vez de quedar invisible para siempre. */
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; animation: none; }
  .ticker-track { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   Experiencia 3D (página de tecnología)
   Tres piezas WebGL con Three.js cargado bajo demanda. Estos
   estilos solo se usan en tecnologia.html. El lienzo está oculto
   por defecto y solo se muestra cuando la escena 3D arranca con
   éxito (.escena-3d-activa); si no, se ve el fallback estático.
   ============================================================ */
.escena-3d-seccion { overflow: hidden; }
.escena-3d-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}
/* En las secciones impares invertimos el orden para alternar el ritmo visual */
.escena-3d-seccion.section-alt .escena-3d-texto { order: 2; }
.escena-3d-seccion.section-alt .escena-3d-visual { order: 1; }

.escena-3d-puntos {
  list-style: none;
  padding: 0;
  margin-top: 1.6rem;
  display: grid;
  gap: 0.8rem;
}
.escena-3d-puntos li {
  position: relative;
  padding-left: 1.7em;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.escena-3d-puntos li::before {
  content: "✳";
  position: absolute;
  left: 0;
  color: var(--emerald);
  font-size: 0.9em;
  top: 0.1em;
}

/* Contenedor del lienzo: cuadrado-panorámico con la estética de marca */
.escena-3d-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 70% 10%, rgba(214, 242, 95, 0.12), transparent 55%),
    var(--white);
  box-shadow: 8px 8px 0 var(--lime), var(--shadow);
  overflow: hidden;
}
.escena-3d-seccion.section-alt .escena-3d-visual { box-shadow: -8px 8px 0 var(--emerald), var(--shadow); }

.lienzo-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none; /* solo se muestra cuando la escena arranca con éxito */
}
.escena-3d-activa .lienzo-3d { display: block; }
.escena-3d-activa .escena-3d-fallback { display: none; }

/* Fallback estático elegante (SVG) visible si no hay WebGL o falla la carga */
.escena-3d-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}
.escena-3d-fallback svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  opacity: 0.92;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { rotate: 0deg; max-width: 480px; }
  .tools-grid, .steps, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .band-grid { grid-template-columns: 1fr; }
  .magnet-mock { max-width: 420px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .escena-3d-grid { grid-template-columns: 1fr; }
  /* En móvil, el texto siempre va primero (legible antes que decorativo) */
  .escena-3d-seccion.section-alt .escena-3d-texto { order: 1; }
  .escena-3d-seccion.section-alt .escena-3d-visual { order: 2; }
  .escena-3d-visual { max-width: 520px; }
}
@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1.5px solid var(--ink);
    padding: 0.5rem 1.2rem 1.2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding-block: 0.7rem; font-size: var(--text-md); }
  .burger { display: block; }
  .nav-cta { display: none; }
  .tools-grid, .steps, .posts-grid { grid-template-columns: 1fr; }
  .capture { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero-proof { gap: 1.1rem; }
  .t-grid { grid-template-columns: 1fr; }
  /* Tablas anchas (tablas del contenido IA de los artículos y el comparador de herramientas): que hagan
     scroll DENTRO de su propia caja en vez de ensanchar toda la página. Mismo patrón que portal.css. */
  .article-body table, .compare-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .compare-table th, .compare-table td { width: auto; white-space: normal; }
}

/* ===== Testimonios / opiniones de clientes ===== */
.t-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}
.t-card {
  background: var(--white);
  border: 1.5px solid var(--line, #e7e3d8);
  border-radius: 20px;
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.t-card .t-stars { color: #8a6200; letter-spacing: 0.1em; font-size: 1.05rem; }
.t-card blockquote {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink, #15211b);
}
.t-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: auto;
  font-size: 0.92rem;
}
.t-card figcaption strong { color: var(--ink, #15211b); }
.t-card .t-meta { color: var(--ink-faint, #6e7a72); font-size: 0.85rem; }

/* ===== Asistente conversacional (chat) ===== */
.ia-chat-btn { position: fixed; bottom: 20px; right: 20px; z-index: 1000; width: 58px; height: 58px; border-radius: 50%; border: none; background: var(--ink, #15211b); color: var(--lime, #d6f25f); font-size: 1.6rem; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.ia-chat-btn:hover { transform: translateY(-2px); }
.ia-chat-panel { position: fixed; bottom: 88px; right: 20px; z-index: 1000; width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 120px)); background: #fff; border: 1px solid var(--line, #e7e3d8); border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,0.22); display: none; flex-direction: column; overflow: hidden; }
.ia-chat-panel.open { display: flex; }
.ia-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; background: var(--ink, #15211b); color: #fff; font-weight: 600; }
.ia-chat-x { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.ia-chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; background: #faf9f5; }
.ia-chat-msg { display: flex; }
.ia-chat-user { justify-content: flex-end; }
.ia-chat-msg .ia-bubble { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; }
.ia-chat-bot .ia-bubble { background: #ece9df; color: var(--ink, #15211b); border-bottom-left-radius: 4px; }
.ia-chat-user .ia-bubble { background: var(--ink, #15211b); color: #fff; border-bottom-right-radius: 4px; }
.ia-chat-actions, .ia-chat-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.2rem; }
.ia-chat-action, .ia-chat-chip { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.8rem; padding: 0.35em 0.9em; border-radius: 999px; border: 1px solid var(--ink, #15211b); background: #fff; color: var(--ink, #15211b); cursor: pointer; text-decoration: none; }
.ia-chat-action:hover, .ia-chat-chip:hover { background: var(--lime, #d6f25f); }
.ia-chat-form { display: flex; flex-direction: column; gap: 0.4rem; background: #fff; border: 1px solid var(--line, #e7e3d8); border-radius: 12px; padding: 0.7rem; position: relative; }
.ia-chat-form input:not([type=checkbox]), .ia-chat-form select { font: inherit; font-size: 16px; padding: 0.5em 0.7em; border: 1px solid var(--line, #e7e3d8); border-radius: 8px; }
.ia-chat-form button { font: inherit; padding: 0.5em; border: none; border-radius: 8px; background: var(--ink, #15211b); color: var(--lime, #d6f25f); cursor: pointer; }
.ia-chat-terms { font-size: 0.78rem; display: flex; gap: 0.4em; align-items: flex-start; }
.ia-chat-foot { display: flex; gap: 0.4rem; padding: 0.6rem; border-top: 1px solid var(--line, #e7e3d8); }
.ia-chat-in { flex: 1; font: inherit; font-size: 16px; padding: 0.55em 0.8em; border: 1px solid var(--line, #e7e3d8); border-radius: 999px; }
.ia-chat-send { flex: none; border: none; background: var(--ink, #15211b); color: var(--lime, #d6f25f); width: 44px; min-height: 44px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .ia-chat-btn:hover { transform: none; } }

/* ============================================================
   Accesibilidad (WCAG 2.1 AA)
   ============================================================ */
/* Foco visible para teclado (2.4.7) */
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }
/* Sobre fondos oscuros (bandas, footer, botón primario) el verde no contrasta: lima */
.band :focus-visible,
.site-footer :focus-visible,
.btn-primary:focus-visible { outline-color: var(--lime); }
/* Quitar el outline por defecto solo cuando NO es navegación por teclado */
:focus:not(:focus-visible) { outline: none; }

/* Salto al contenido (2.4.1) */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--lime);
  padding: 0.7em 1.2em; border-radius: 0 0 10px 10px;
  font-weight: 600; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: var(--lime); }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }
