/* ==========================================================================
   Erwan 3D Studios · herramientas (28-sep-2026)
   Lo cargan la home, el índice /herramientas/ y las tres páginas de presentación
   (calculadora, generador de QR y texturizador), detrás de style.css. Mismos tokens
   (--surface, --line, --blue-ink...) para que no parezca otra web, y las mismas
   reglas que la home (repaso con la skill impeccable del 27-sep): sin cejas en
   mayúsculas encima de cada sección, sin cifras gigantes, sin iconos encima de los
   títulos y sin cajas con raya de color a un lado. Lo único que se mueve en bucle
   son los vídeos, y solo mientras se ven (assets/js/herramientas.js).
   Si tocas este archivo, sube el ?v= de su <link> en esas páginas.
   ========================================================================== */

/* --- Tinte de cada herramienta (solo el halo del hero y detalles) --------- */
.hx { --hx-tinte: 77, 184, 205; }
.hx--qr { --hx-tinte: 77, 184, 205; }
.hx--textura { --hx-tinte: 87, 177, 132; }

/* --- Migas ---------------------------------------------------------------- */
.hx-migas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--ink-faint);
}
.hx-migas a { color: var(--blue-ink); font-weight: 500; }
.hx-migas a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hx-migas span[aria-hidden] { color: var(--ink-faint); }

/* --- Hero: texto a la izquierda, película a la derecha ----------------------
   No usa .hero de style.css porque ahí todo va centrado con !important. */
.hx-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 104px);
  background: var(--grad-hero);
  isolation: isolate;
}
.hx-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30%;
  right: -10%;
  width: min(1000px, 90vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(var(--hx-tinte), 0.13), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}
.hx-hero__grid {
  display: grid;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
@media (min-width: 960px) {
  .hx-hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}
.hx-hero h1 {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hx-tono { display: block; color: var(--blue-ink); }
.hx--textura .hx-tono { color: var(--green-ink); }
.hx-hero__sub {
  max-width: 600px;
  margin: 0 0 30px;
  font-size: clamp(17px, 1.7vw, 19.5px);
  line-height: 1.6;
  color: var(--ink-soft);
}
.hx-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hx-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 600px;
  font-size: 14.5px;
  color: var(--ink-muted);
}
.hx-datos > span { white-space: nowrap; }
/* Viñeta delante de cada dato (no un punto entre ellos: al partirse la línea no queda suelto) */
.hx-datos > span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.2em;
  opacity: 0.85;
}
.hx--textura .hx-datos > span::before { background: var(--green-deep); }
.hx-hero__media {
  width: 100%;
  max-width: 520px;
  justify-self: center;
}
@media (min-width: 960px) {
  .hx-hero__media { justify-self: end; }
}
@media (max-width: 959px) {
  .hx-hero__media { max-width: 440px; }
}

/* --- La película en bucle (4:5) ------------------------------------------- */
.bucle {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #07090b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.bucle video,
.bucle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bucle::after {                   /* el filo, por encima del vídeo */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.bucle__boton {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 15, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.bucle__boton svg { width: 16px; height: 16px; }
.bucle__boton[hidden] { display: none; }
.bucle__nota {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-faint);
  text-align: center;
}

/* --- Cabecera de sección, a la izquierda ------------------------------------ */
.hx-cab {
  max-width: 760px;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.hx-cab h2 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 0 0 16px;
  text-wrap: balance;
}
.hx-cab p {
  font-size: clamp(16.5px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--ink-muted);
}
.hx-cab p + p { margin-top: 12px; }
.hx-cab a,
.hx-texto a,
.uso p a,
.hx-bloque p a,
.hx-preguntas .faq-item a,
.hx-nota a {
  color: var(--blue-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.hx-cab a:hover,
.hx-texto a:hover,
.uso p a:hover,
.hx-bloque p a:hover,
.hx-preguntas .faq-item a:hover,
.hx-nota a:hover { color: var(--accent-hover); }
.hx-cab--fila {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  flex-wrap: wrap;
}
.hx-cab--fila > div { max-width: 700px; }
.hx-cab--fila > .btn { flex: none; }

/* --- Cómo funciona: pasos a la izquierda, grabación real a la derecha ------- */
.pasos {
  display: grid;
  gap: 20px clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 1000px) {
  .pasos { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); }
  .pasos .clips__pantalla { order: 2; position: sticky; top: calc(var(--nav-h, 84px) + 24px); }
  .pasos__lista { order: 1; }
}
.pasos__lista {
  display: flex;
  flex-direction: column;
  counter-reset: paso;
}
.pasos__lista li { display: flex; }
.pasos .clips__pestana {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 14px;
  width: 100%;
  min-height: 0;
  padding: 18px 4px 18px 0;
  border-top: 1px solid var(--line);
  font-weight: 400;
}
.pasos__lista li:last-child .clips__pestana { border-bottom: 1px solid var(--line); }
.pasos__n {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pasos__titulo {
  font-size: clamp(17px, 1.5vw, 19.5px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.pasos__texto {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-faint);
  transition: color 0.2s var(--ease);
}
.pasos .clips__pestana.is-activa .pasos__n,
.pasos .clips__pestana:hover .pasos__n {
  border-color: var(--accent);
  color: var(--ink);
}
.pasos .clips__pestana.is-activa .pasos__n { background: rgba(77, 184, 205, 0.16); }
.pasos .clips__pestana.is-activa .pasos__titulo { color: var(--ink); }
.pasos .clips__pestana.is-activa .pasos__texto { color: var(--ink-muted); }
.pasos .clips__progreso { top: -1px; }

/* Reproductor de clips (también en la home hasta el 28-sep: estaba en home.css) */
.clips__pantalla {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0c0f13;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.clips__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.clips__video.is-activo { opacity: 1; }
.clips__pestana {
  position: relative;
  text-align: left !important;   /* style.css centra todos los botones */
  color: var(--ink-faint);
  transition: color 0.2s var(--ease);
}
.clips__progreso {
  position: absolute;
  left: 0;
  top: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--avance, 0));
}
.clips__pestana:not(.is-activa) .clips__progreso { transform: scaleX(0); }
.clips__pie {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
@media (prefers-reduced-motion: reduce) {
  .clips__video { transition: none; }
}

/* --- Para qué sirve: tarjetas con foto ------------------------------------ */
.usos {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
/* Tableta: dos columnas, que con cuatro tarjetas ninguna se queda sola */
@media (min-width: 640px) and (max-width: 1099px) {
  .usos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.uso {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.uso__foto {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0b0d10;
  overflow: hidden;
}
.uso__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uso__origen {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 15, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.uso__cuerpo { padding: 22px 24px 24px; }
.uso h3 {
  font-size: clamp(19px, 1.7vw, 22px);
  margin: 0 0 8px;
}
.uso p {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* --- Bloques de detalle: título y texto, separados por un filete ------------ */
.hx-bloques {
  display: grid;
  gap: 8px clamp(28px, 4vw, 56px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.hx-bloque {
  padding: 22px 0 18px;
  border-top: 1px solid var(--line);
}
.hx-bloque h3 {
  font-size: clamp(18px, 1.6vw, 21px);
  margin: 0 0 8px;
}
.hx-bloque p {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-muted);
}

/* --- Ficha: lo que lleva, en dos columnas -------------------------------- */
.hx-ficha {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.hx-ficha > div {
  display: grid;
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 700px) {
  .hx-ficha > div { grid-template-columns: 210px minmax(0, 1fr); }
}
.hx-ficha dt {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.hx-ficha dd {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* --- Texto corrido (historia, notas) --------------------------------------- */
.hx-texto { max-width: 720px; }
.hx-texto p {
  font-size: clamp(16.5px, 1.5vw, 18px);
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.hx-texto p strong { color: var(--ink); font-weight: 600; }
.hx-nota {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* --- Dos columnas: texto y figura -------------------------------------------- */
.hx-par {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (min-width: 960px) {
  .hx-par { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hx-par--invertido > :first-child { order: 2; }
}
.hx-figura img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.hx-figura figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-faint);
  text-align: left !important;
}

/* --- Vídeo del canal relacionado ------------------------------------------ */
.hx-video .video-hero { margin: 0; max-width: none; }
.hx-video__pie {
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--ink-muted);
}

/* --- Preguntas frecuentes (como las de la home) ----------------------------- */
.hx-preguntas {
  display: grid;
  gap: 32px clamp(32px, 6vw, 88px);
  align-items: start;
}
@media (min-width: 960px) {
  .hx-preguntas { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .hx-preguntas .hx-cab { position: sticky; top: calc(var(--nav-h, 84px) + 32px); margin-bottom: 0; }
}
.hx-preguntas .faq-item { margin-bottom: 10px; }
.hx-preguntas .faq-item summary {
  padding: 18px 22px;
  font-size: 16.5px;
  line-height: 1.35;
}
.hx-preguntas .faq-item summary:hover { color: var(--blue-ink); }
.hx-preguntas .faq-item p {
  padding: 0 22px 20px;
  font-size: 15.5px;
  line-height: 1.65;
}

/* --- Cierre: abrir la herramienta y suscribirse ------------------------------ */
.hx-final .cta-banner { margin: 0; }
.hx-final .cta-banner p { max-width: 620px; }

/* --- Las otras herramientas (y las tarjetas de la home) --------------------- */
.hx-tarjetas {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.hx-tarjeta {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hx-tarjeta .bucle {
  border-radius: 0;
  box-shadow: none;
}
.hx-tarjeta .bucle::after { box-shadow: none; }
.hx-tarjeta__cuerpo {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
  border-top: 1px solid var(--line-soft);
}
.hx-tarjeta h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: clamp(20px, 1.8vw, 24px);
  margin: 0 0 10px;
}
.hx-tarjeta h3 a::after {        /* toda la tarjeta lleva a la página de presentación */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hx-tarjeta p {
  flex: 1;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.hx-tarjeta__enlaces {
  position: relative;
  z-index: 2;                    /* por encima del enlace que cubre la tarjeta */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.hx-tarjeta__enlaces a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue-ink);
}
.hx-tarjeta__enlaces a::after { content: "→"; transition: transform 0.25s var(--ease); }
.hx-tarjeta__enlaces a:hover { color: var(--accent-hover); }
.hx-tarjeta__enlaces a:hover::after { transform: translateX(4px); }
.hx-tarjeta__enlaces a.hx-tarjeta__abrir { color: var(--ink); }
.hx-nueva {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: rgba(87, 177, 132, 0.16);
  box-shadow: inset 0 0 0 1px rgba(147, 216, 182, 0.35);
  color: var(--green-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
@media (hover: hover) and (pointer: fine) {
  .hx-tarjeta:hover { border-color: var(--line); box-shadow: var(--shadow-md); }
  .hx-tarjeta:hover h3 a { color: var(--blue-ink); }
}
/* Tableta: tres tarjetas en dos columnas, la tercera ocupa la fila en horizontal */
@media (min-width: 640px) and (max-width: 999px) {
  .hx-tarjetas--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-tarjetas--3 > .hx-tarjeta:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .hx-tarjetas--3 > .hx-tarjeta:last-child:nth-child(odd) .bucle { width: 46%; flex: none; }
  .hx-tarjetas--3 > .hx-tarjeta:last-child:nth-child(odd) .hx-tarjeta__cuerpo { border-top: 0; border-left: 1px solid var(--line-soft); justify-content: center; }
}
/* Móvil: vídeo cuadrado para que las tres no ocupen tres pantallas */
@media (max-width: 639px) {
  .hx-tarjeta .bucle { aspect-ratio: 1 / 1; }
}

/* Versión pequeña, sin vídeo, para «Otras herramientas» */
.hx-tarjeta--mini { flex-direction: row; align-items: stretch; }
.hx-tarjeta--mini .hx-tarjeta__img {
  width: 120px;
  flex: none;
  object-fit: cover;
  background: #0b0d10;
}
.hx-tarjeta--mini .hx-tarjeta__cuerpo { border-top: 0; padding: 18px 20px; }
.hx-tarjeta--mini h3 { font-size: 18.5px; margin-bottom: 6px; }
.hx-tarjeta--mini p { font-size: 14.5px; }

/* --- Índice /herramientas/: una fila por herramienta ---------------------- */
.hx-filas { display: grid; gap: clamp(56px, 8vw, 112px); }
.hx-fila {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
@media (min-width: 900px) {
  .hx-fila { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .hx-fila:nth-child(even) .hx-fila__media { order: 2; }
}
.hx-fila__media { width: 100%; max-width: 440px; justify-self: center; }
.hx-fila h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.hx-fila__texto > p {
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 600px;
}
.hx-lista {
  margin: 20px 0 28px;
  display: grid;
  gap: 10px;
  max-width: 600px;
}
.hx-lista li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.hx-lista li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}
.hx--textura .hx-lista li::before,
.hx-fila--textura .hx-lista li::before { background: var(--green-deep); }

.hx-fila h2 a { color: inherit; transition: color 0.2s var(--ease); }
.hx-fila h2 a:hover { color: var(--blue-ink); }
.hx-hero--indice { padding-bottom: clamp(40px, 5vw, 72px); }
/* Índice: los tres carteles de las películas, escalonados, a la derecha del titular */
.hx-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  max-width: 520px;
  width: 100%;
  justify-self: end;
}
.hx-trio a {
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #07090b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.4s var(--ease-out-fuerte);
}
.hx-trio a:nth-child(2) { transform: translateY(-28px); }
.hx-trio img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (hover: hover) and (pointer: fine) {
  .hx-trio a:hover { transform: translateY(-6px); }
  .hx-trio a:nth-child(2):hover { transform: translateY(-34px); }
}
@media (max-width: 959px) {
  .hx-trio { justify-self: center; max-width: 420px; margin-top: 12px; }
  .hx-trio a:nth-child(2) { transform: translateY(-14px); }
}

/* Iconos (GPTs) en las tarjetas pequeñas: sin recortar, sobre su fondo */
.hx-tarjeta--mini .hx-tarjeta__img--icono {
  width: 96px;
  padding: 20px;
  object-fit: contain;
  background: var(--surface-tint);
  border-right: 1px solid var(--line-soft);
}

.bucle__nota a {
  color: var(--blue-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.hx-hero__sub a {
  color: var(--blue-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* --- Móvil ----------------------------------------------------------------- */
@media (max-width: 760px) {
  .hx-acciones .btn { flex: 1 1 220px; }
  .hx-datos { font-size: 14px; }
}
@media (max-width: 480px) {
  .hx-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .hx-datos > span { white-space: normal; }
  .hx-tarjeta--mini .hx-tarjeta__img { width: 92px; }
}
