/* ============================================================
   HOOK ENGINE - Martín Rey
   Herramienta gratuita. Mobile first. Tema dark único.

   De la marca de Martín se toman solo colores y tipografías.
   Todo lo demás (radios, espaciados, componentes y motion) es
   propio de esta herramienta.

   Radios: bloques 16-20px, tarjetas 14px, controles 10px,
   chips y botones principales en píldora.
   Un solo acento: el turquesa. #ff8080 solo para errores de
   formulario, igual que en el formulario de martin-rey.com.
============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-wght.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Marca */
  --bg:     #0a1a1f;
  --bg-2:   #0d2127;
  --bg-3:   #0f2a32;
  --teal:   #00b8aa;
  --teal-2: #00d4c4;
  --teal-3: #00eedd;
  --white:  #ffffff;
  --text:   #e0edf0;
  --muted:  #7a9ba5;
  --dim:    #4a6b75;

  /* Derivados */
  --ink:      #04211f;                   /* texto sobre turquesa */
  --line:     rgba(122, 155, 165, 0.14);
  --line-2:   rgba(122, 155, 165, 0.26);
  --teal-a06: rgba(0, 184, 170, 0.06);
  --teal-a12: rgba(0, 184, 170, 0.12);
  --teal-a24: rgba(0, 184, 170, 0.24);
  --teal-a40: rgba(0, 184, 170, 0.40);
  --error:    #ff8080;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font:         'Inter', system-ui, -apple-system, sans-serif;

  --r-xl:   20px;
  --r-lg:   16px;
  --r:      14px;
  --r-md:   10px;
  --r-sm:   8px;
  --r-pill: 999px;

  --ease:     cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --sec: 88px;
  --pad: 20px;

  /* Capas */
  --z-filters: 20;
  --z-sticky:  30;
  --z-skip:    100;
}
@media (min-width: 768px)  { :root { --sec: 112px; --pad: 32px; } }
@media (min-width: 1100px) { :root { --sec: 136px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
strong { color: var(--white); font-weight: 600; }
::selection { background: var(--teal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal-3); outline-offset: 2px; border-radius: var(--r-sm); }

.i { width: 18px; height: 18px; flex: none; display: inline-block; }

.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: 12px; top: -60px; z-index: var(--z-skip);
  background: var(--teal); color: var(--ink); font-weight: 600;
  padding: 10px 16px; border-radius: var(--r-md);
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- Contenedores ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: 760px; }
.sec { padding: var(--sec) 0; position: relative; }

/* ---------- Tipografía ---------- */
.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-2);
  margin-bottom: 18px;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--white); text-wrap: balance; }
.h2 {
  font-size: clamp(1.8rem, 5.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.big {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.6vw, 1.8rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-top: 22px;
  max-width: 30ch;
}
.big em { font-style: normal; color: var(--teal-3); }
.lead { font-size: 17px; color: var(--muted); line-height: 1.65; margin-top: 14px; max-width: 56ch; }
.prose { margin-top: 28px; max-width: 58ch; }
.prose p { color: var(--muted); font-size: 16.5px; line-height: 1.7; }
.prose p + p { margin-top: 10px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn-primary { background: var(--teal); color: var(--ink); box-shadow: 0 12px 32px -12px rgba(0, 184, 170, 0.55); }
.btn-primary:hover { background: var(--teal-2); }
.btn-primary:active { transform: scale(0.98); }
.btn-block { width: 100%; }

.btn-s {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 14px;
  border-radius: var(--r-md);
  background: rgba(224, 237, 240, 0.04);
  border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn-s:hover { background: rgba(224, 237, 240, 0.07); border-color: rgba(122, 155, 165, 0.4); }
.btn-s:active { transform: scale(0.97); }
.btn-s .i { width: 16px; height: 16px; }
.btn-s--solid { background: var(--teal-a12); border-color: var(--teal-a40); color: var(--teal-3); }
.btn-s--solid:hover { background: var(--teal-a24); border-color: var(--teal); }
.btn-s--danger { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn-s--danger:hover { background: var(--white); }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 2px;
  font-size: 14px; font-weight: 500; color: var(--teal-3);
  text-underline-offset: 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link .i { width: 15px; height: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 38px; padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 500; color: var(--muted);
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--teal-a40); }
.chip[aria-pressed='true'] { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.chip .i { width: 15px; height: 15px; }

/* Variables de plantilla y datos del usuario dentro de un hook */
.v {
  color: var(--teal-3);
  background: var(--teal-a12);
  border-radius: 5px;
  padding: 0.02em 0.32em;
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
mark.u {
  background: none;
  color: inherit;
  box-shadow: inset 0 -0.14em 0 var(--teal-a40);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ============================================================
   1. HERO
============================================================ */
.hero { position: relative; padding: 64px 0 72px; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute; top: -220px; right: -260px;
  width: 780px; height: 680px;
  background: radial-gradient(closest-side, rgba(0, 184, 170, 0.14), transparent);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; }
.hero-title {
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 12ch;
}
.hero-sub { margin-top: 22px; font-size: clamp(1.05rem, 2.4vw, 1.2rem); color: var(--text); line-height: 1.6; max-width: 42ch; }
.hero-note { margin-top: 14px; font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 46ch; }
.hero-cta { margin-top: 30px; }
.micro { margin-top: 14px; font-size: 13px; color: var(--muted); letter-spacing: 0.01em; }

@media (min-width: 960px) {
  .hero { padding: 96px 0 104px; }
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 64px; }
  /* Medido: "68 hooks adaptados" entra en una línea hasta ~56px con la
     columna de 1280. Este rango garantiza 2 líneas en todo desktop. */
  .hero-title { font-size: clamp(2.8rem, 4.3vw, 3.3rem); max-width: none; }
}

/* Tarjeta demo (también la usa la vista previa) */
.demo-card, .preview-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--teal-a24);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
.demo-top { display: flex; align-items: center; gap: 10px; }
.demo-switch {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin-top: 16px; padding: 4px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.demo-switch button {
  min-height: 36px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.demo-switch button:hover { color: var(--text); }
.demo-switch button[aria-pressed='true'] { background: var(--bg-3); color: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); }
.demo-text {
  margin-top: 22px;
  min-height: calc(1.42em * 5);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.4rem);
  font-weight: 500; line-height: 1.42; letter-spacing: -0.012em;
  color: var(--white);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.demo-text.is-out { opacity: 0; transform: translateY(6px); }
.demo-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
@media (min-width: 768px) { .demo-card { padding: 28px; } }

/* ============================================================
   2. EXPLICACIÓN
============================================================ */
.t3 { margin: 40px 0 8px; max-width: 520px; }
.t3-track { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.t3-fill {
  display: block; height: 100%; width: 100%;
  background: var(--teal);
  transform: scaleX(0); transform-origin: left;
}
.t3.on .t3-fill { transform: scaleX(1); transition: transform 3s linear 0.3s; }
.t3-ticks {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   3. PERSONALIZADOR
============================================================ */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
@media (min-width: 768px) { .panel { padding: 40px; } }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 960px) {
  .panel-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; }
  .side { position: sticky; top: 24px; align-self: start; }
}

.examples { margin-top: 22px; }
.example-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.example-note { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 26px; }
.fld label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text);
  margin-bottom: 8px;
}
.fld textarea, .fld input {
  display: block; width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 16px; line-height: 1.45; color: var(--white);
  resize: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.fld input { min-height: 48px; }
.fld textarea::placeholder, .fld input::placeholder { color: var(--muted); opacity: 1; }
.fld textarea:focus, .fld input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-a24); }
.fld.is-invalid textarea, .fld.is-invalid input { border-color: var(--error); }
.fld.is-invalid textarea:focus, .fld.is-invalid input:focus { box-shadow: 0 0 0 3px rgba(255, 128, 128, 0.2); }
.fld-help { margin-top: 7px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.fld-help.is-warn { color: var(--teal-3); }
.fld-err { margin-top: 7px; font-size: 13px; color: var(--error); }

.more { margin-top: 28px; border-top: 1px solid var(--line); }
.more-btn {
  width: 100%; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text); text-align: left;
}
.more-btn .i { color: var(--teal-3); transition: transform 0.3s var(--ease); }
.more.is-open .more-btn .i { transform: rotate(45deg); }
.more-body { display: grid; grid-template-rows: 1fr; }
.js .more-body { grid-template-rows: 0fr; transition: grid-template-rows 0.34s var(--ease); }
.js .more.is-open .more-body { grid-template-rows: 1fr; }
.more-inner { overflow: hidden; }
.more-inner .fields { margin-top: 4px; padding-bottom: 6px; }

.preview-label, .side-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.preview-card { padding: 20px; border-color: var(--line-2); }
.preview-text {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 17.5px; font-weight: 500; line-height: 1.45;
  color: var(--white);
  min-height: calc(1.45em * 4);
}
.actions { margin-top: 20px; }
.trust { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.clear { margin-top: 6px; text-align: center; }
.clear-confirm {
  margin-top: 8px; text-align: left;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 14px; font-size: 14px;
}
.clear-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Botón Generar mientras "procesa" */
#generate { position: relative; overflow: hidden; }
#generate .gen-busy { display: none; }
#generate.is-busy .gen-label { display: none; }
#generate.is-busy .gen-busy { display: inline; font-size: 13px; }
#generate.is-busy::after {
  content: '';
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--ink); opacity: 0.35;
  transform-origin: left;
  animation: gen-progress var(--gen-ms, 800ms) linear forwards;
}
@keyframes gen-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================================================
   4. BIBLIOTECA
============================================================ */
.lib-head { max-width: 640px; }
.restored { margin-top: 10px; font-size: 14px; color: var(--teal-3); }

.lib-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 30px; }
@media (min-width: 768px) { .lib-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.search { position: relative; }
.search > .i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 50px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 0 48px 0 44px;
  font-size: 16px; color: var(--white);
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-a24); }
.search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--muted); border-radius: var(--r-md);
}
.search-clear:hover { color: var(--text); }
.lib-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.ig-note {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: 16px; padding: 14px 52px 14px 16px;
  background: var(--teal-a06); border: 1px solid var(--teal-a24); border-radius: 12px;
  font-size: 14px; color: var(--text);
}
.ig-note p { flex: 1 1 240px; }
.ig-close { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }

.filters {
  position: sticky; top: 0; z-index: var(--z-filters);
  display: flex; align-items: center; gap: 12px;
  margin: 18px calc(var(--pad) * -1) 0;
  padding: 10px var(--pad);
  background: rgba(10, 26, 31, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.chips {
  flex: 1; min-width: 0;
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  padding-right: 28px;
}
.chips::-webkit-scrollbar { display: none; }
.count {
  flex: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.count span { color: var(--white); }
@media (min-width: 1100px) {
  .filters { margin: 18px 0 0; border-radius: 0 0 12px 12px; }
  .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
}

.uso { margin-top: 16px; font-size: 14.5px; color: var(--muted); max-width: 70ch; }
.uso b { color: var(--teal-3); font-weight: 600; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
@media (min-width: 880px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }

.hk {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 16px 12px;
  scroll-margin-top: 80px;
  transition: border-color 0.2s var(--ease);
}
.hk:hover { border-color: var(--line-2); }
.hk:target { border-color: var(--teal); }
@media (min-width: 768px) { .hk { padding: 20px 20px 14px; } }

.hk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 40px; }
/* En pantallas angostas el badge baja de línea; el marcador queda arriba a la derecha. */
.hk-head .hk-badge { order: 10; }
.hk-num {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal-2); font-variant-numeric: tabular-nums;
}
.hk-cat { font-size: 12.5px; color: var(--muted); }
.hk-badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal-3); border: 1px solid var(--teal-a40); border-radius: var(--r-pill);
  padding: 3px 9px; white-space: nowrap;
}
.hk-fav {
  margin-left: auto; width: 44px; height: 44px; margin-right: -8px;
  display: grid; place-items: center; color: var(--muted);
  border-radius: var(--r-md);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hk-fav:hover { color: var(--text); }
.hk-fav .i-on { display: none; }
.hk-fav[aria-pressed='true'] { color: var(--teal-3); }
.hk-fav[aria-pressed='true'] .i-on { display: inline-block; }
.hk-fav[aria-pressed='true'] .i-off { display: none; }
.hk-fav.pop { animation: pop 0.32s var(--ease-out); }
@keyframes pop { 40% { transform: scale(0.82); } 100% { transform: scale(1); } }

.hk-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500; line-height: 1.45; letter-spacing: -0.01em;
  color: var(--white);
  text-wrap: pretty;
}
.hk-tpl { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.hk-tpl .v { background: rgba(0, 184, 170, 0.08); color: var(--teal-2); }
.hk-tpl-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-right: 4px;
}

.hk-real { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.hk-real-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.hk-real-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.fld-s span {
  display: block; margin-bottom: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.fld-s input {
  width: 100%; min-height: 44px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 0 12px; font-size: 16px; color: var(--white);
}
.fld-s input::placeholder { color: var(--muted); }
.fld-s input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-a24); }
.hk.is-complete .hk-real-note { color: var(--teal-3); }

.hk-editor textarea {
  width: 100%;
  background: var(--bg); border: 1px solid var(--teal); border-radius: var(--r-md);
  padding: 12px; font-size: 16px; line-height: 1.5; color: var(--white);
  resize: vertical; min-height: 96px;
}
.hk-editor textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--teal-a24); }
.hk-editor-actions { display: flex; gap: 8px; margin-top: 10px; }

.hk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; }
.btn-copy {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--teal); color: var(--ink);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s var(--ease);
}
.btn-copy:hover { background: var(--teal-2); }
.btn-copy:active { transform: scale(0.97); }
.btn-copy .i { width: 16px; height: 16px; }
.btn-copy .i-done { display: none; }
.btn-copy.is-done .i-copy { display: none; }
.btn-copy.is-done .i-done { display: inline-block; animation: pop 0.32s var(--ease-out); }
.btn-copy:disabled { opacity: 0.4; cursor: not-allowed; }
.hk-edited {
  margin-left: auto;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-3);
}

/* Generando: skeleton breve sobre el texto de cada tarjeta */
.grid.is-generating .hk-text { position: relative; color: transparent; }
.grid.is-generating .hk-text .v, .grid.is-generating .hk-text mark { color: transparent; background: none; box-shadow: none; }
.grid.is-generating .hk-text::after {
  content: '';
  position: absolute; inset: 0.25em 0;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent, rgba(224, 237, 240, 0.08), transparent) 0 0 / 50% 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(224, 237, 240, 0.06) 0 0.9em, transparent 0.9em 1.45em);
  animation: shimmer 1s linear infinite;
}
@keyframes shimmer { from { background-position: -50% 0, 0 0; } to { background-position: 150% 0, 0 0; } }
.hk.is-fresh .hk-text { animation: fresh 0.42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes fresh { from { opacity: 0; transform: translateY(6px); } }

.empty {
  margin-top: 20px; padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r);
}
.empty-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--white); }
.empty-text { margin: 8px auto 18px; font-size: 15px; color: var(--muted); max-width: 42ch; }
.lib-end { display: flex; justify-content: center; margin-top: 32px; }

/* ============================================================
   5. REGLAS
============================================================ */
.bento { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 32px; }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .r1 { grid-column: span 2; }
  .r2 { grid-column: span 4; }
  .r3 { grid-column: span 3; }
  .r4 { grid-column: span 3; }
  .r5 { grid-column: span 6; }
}
.rule {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 22px;
}
.rule h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 8px 0 12px; }
.rule p { font-size: 15px; color: var(--muted); line-height: 1.6; }
.rule p + p { margin-top: 8px; }
.rule-n { font-size: 11.5px !important; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-2) !important; }
.r1 { background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); }

.saydont { display: grid; gap: 8px; margin: 14px 0; }
@media (min-width: 560px) { .saydont { grid-template-columns: 1fr 1fr; } }
.say, .dont {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 15px !important; line-height: 1.45 !important;
}
.say { background: var(--teal-a06); border: 1px solid var(--teal-a24); color: var(--white) !important; }
.say .i { color: var(--teal-3); margin-top: 2px; }
.dont { background: rgba(224, 237, 240, 0.03); border: 1px solid var(--line); }
.dont .i { color: var(--muted); margin-top: 2px; }

.checks { display: grid; gap: 8px; margin: 12px 0; }
.checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text); line-height: 1.45; }
.checks .i { color: var(--teal-3); width: 17px; height: 17px; margin-top: 2px; }

.layers { counter-reset: layer; display: grid; gap: 6px; margin: 14px 0; }
.layers li {
  counter-increment: layer;
  display: flex; align-items: center; gap: 12px;
  margin-left: calc(var(--k, 0) * 14px);
  padding: 10px 14px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-md);
  font-size: 14.5px; color: var(--text);
}
.layers li::before {
  content: counter(layer);
  font-size: 11px; font-weight: 600; color: var(--teal-3);
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--teal-a40); flex: none;
}
.layers li:nth-child(2) { --k: 1; }
.layers li:nth-child(3) { --k: 2; }
.layers li:nth-child(4) { --k: 3; }

.r5 {
  display: grid; gap: 18px; align-items: center;
  background: linear-gradient(120deg, var(--teal-a06), transparent 70%), var(--bg-2);
  border-color: var(--teal-a24);
}
@media (min-width: 900px) { .r5 { grid-template-columns: 1fr auto; padding: 28px 32px; } }

/* ============================================================
   6. TESTEADOR
============================================================ */
.test-head { max-width: 640px; }
.test {
  margin-top: 32px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px 16px;
}
@media (min-width: 768px) { .test { padding: 28px; } }
.test-idea label, .tcol-label {
  display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); margin-bottom: 8px;
}
.test-idea input {
  width: 100%; min-height: 50px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 0 14px; font-size: 16px; color: var(--white);
}
.test-idea input::placeholder { color: var(--muted); }
.test-idea input:focus, .tsel:focus, .tm input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-a24); }

.test-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 880px) { .test-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tcol {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px;
  transition: border-color 0.2s var(--ease);
}
.tcol.is-winner { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset; }
.tcol-label { color: var(--teal-2); }
.tsel {
  width: 100%; min-height: 46px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 0 12px; font-size: 15px; color: var(--white);
}
.tcol-text { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.tmetrics { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tm { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-name { font-size: 13.5px; color: var(--muted); }
.tm-in { display: inline-flex; align-items: center; gap: 6px; }
.tm input {
  width: 104px; min-height: 40px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 0 10px; text-align: right; font-size: 16px; color: var(--white);
  font-variant-numeric: tabular-nums;
}
.tm input::placeholder { color: var(--muted); }
.tm-unit { font-size: 13px; color: var(--muted); width: 12px; }
.tm.is-best input { border-color: var(--teal); color: var(--teal-3); }
.twin { margin-top: 14px; width: 100%; justify-content: center; }
.twin[aria-pressed='true'] { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 600; }
.test-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.test-hint { font-size: 13px; color: var(--muted); }

/* ============================================================
   7. PUENTE
============================================================ */
.sec-bridge { background: linear-gradient(180deg, var(--bg), var(--bg-2) 60%, var(--bg)); }
.bridge-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 960px) {
  .bridge-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 72px; align-items: start; }
  .bridge-close { grid-column: 1 / -1; }
}
.path { position: relative; padding-left: 34px; }
.path::before, .path::after {
  content: '';
  position: absolute; left: 8px; top: 22px; bottom: 22px; width: 2px; border-radius: 2px;
}
.path::before { background: var(--line-2); }
.path::after {
  background: var(--teal);
  transform: scaleY(var(--p, 0)); transform-origin: top;
  transition: transform 0.6s var(--ease-out);
}
.path-node { position: relative; padding: 11px 0; }
.path-dot {
  position: absolute; left: -32px; top: 17px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.path-label {
  display: block;
  font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.path-note {
  display: block; margin-top: 2px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-2);
}
.path-node.is-on .path-dot { border-color: var(--teal); background: var(--teal); }
.path-node.is-on .path-label { color: var(--white); }
.path-node.is-hook .path-label { color: var(--teal-3); }
.path-node.is-hook .path-dot { border-color: var(--teal-3); background: var(--teal-3); box-shadow: 0 0 0 5px var(--teal-a24); }
.bridge-close {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.3rem); font-weight: 700; line-height: 1.18; letter-spacing: -0.03em;
  color: var(--white); max-width: 24ch;
}
.bridge-close em { font-style: normal; color: var(--teal-3); }

/* ============================================================
   8. SIGUIENTE RECURSO
============================================================ */
.next {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 100% at 0% 0%, rgba(0, 184, 170, 0.16), transparent 60%), var(--bg-2);
  border: 1px solid var(--teal-a24);
  border-radius: 24px;
  padding: 32px 22px;
}
@media (min-width: 768px) { .next { padding: 52px; } }
.next .btn { margin-top: 28px; }
.next .btn .i { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.next .btn:hover .i { transform: translateX(3px); }
.next-note { margin-top: 22px; font-size: 15px; color: var(--muted); line-height: 1.65; }

/* ============================================================
   FOOTER
============================================================ */
.foot { padding: 56px 0 120px; border-top: 1px solid var(--line); }
@media (min-width: 960px) { .foot { padding-bottom: 72px; } }
.foot-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--white); letter-spacing: -0.02em; }
.foot-bio { margin: 14px 0 24px; display: grid; gap: 4px; }
.foot-bio li { font-size: 14.5px; color: var(--muted); }
.foot-ig {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--teal-a24); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; color: var(--teal-3);
  transition: background-color 0.2s var(--ease);
}
.foot-ig:hover { background: var(--teal-a06); }

/* ============================================================
   Botón Generar fijo (solo mobile, mientras se completa el formulario)
============================================================ */
.sticky-gen {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 26, 31, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.3s var(--ease-out);
}
.sticky-gen.is-shown { transform: none; }
@media (min-width: 960px) { .sticky-gen { display: none !important; } }

/* ============================================================
   Entradas al hacer scroll
============================================================ */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.js .rv.on { opacity: 1; transform: none; }
.js .rv.d1 { transition-delay: 0.07s; }
.js .rv.d2 { transition-delay: 0.14s; }
.js .rv.d3 { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .t3.on .t3-fill { transition: none; }
}
