/* ─────────────────────────────────────────────────────────────
   Piezas de cristal añadidas al final: tarjetas "Mito / Realidad" del hero, aviso tipo
   notificación (móvil), razones del estancamiento, comparativa y preguntas frecuentes.
   Los carruseles y el aviso los maneja js/extras.js.
   ───────────────────────────────────────────────────────────── */

/* Cristal reutilizable para elementos que no pueden llevar la clase .glass (css/glass.css) */
:root {
  --glass-bg: linear-gradient(145deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.28) 45%, rgb(255 255 255 / 0.45));
  --glass-border: rgb(255 255 255 / 0.85);
  --glass-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.95), 0 0 0 1px rgb(10 10 10 / 0.06), 0 24px 60px -30px rgb(10 10 10 / 0.3);
}
:root[data-theme="dark"] {
  --glass-bg: linear-gradient(145deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.03) 45%, rgb(255 255 255 / 0.06));
  --glass-border: rgb(255 255 255 / 0.1);
  --glass-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 24px 60px -30px rgb(0 0 0 / 0.8);
}

/* ══ Hero: Mito / Realidad ══ */
.hero-facts {
  display: grid;
  gap: 3rem;
  width: 100%;
  max-width: 60rem;
  margin-top: 4.5rem;
}
.hero-pair {
  display: grid;
  gap: 2.25rem;
}
@media (min-width: 48rem) {
  .hero-facts {
    margin-top: 5.5rem;
  }
  .hero-pair {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
  }
}
/* Pantallas anchas: dos pares salen de la lista y flanquean el titular */
@media (min-width: 100rem) {
  main .cm-hero__inner {
    position: relative;
  }
  .hero-pair--left,
  .hero-pair--right {
    position: absolute;
    top: 13rem;
    left: 1.5rem;
    grid-template-columns: 1fr;
    gap: 2rem;
    /* lo que queda libre a cada lado del titular (≈60rem de ancho), con aire */
    width: min(21rem, (min(100vw, 112rem) - 60rem) / 2 - 3.5rem);
  }
  .hero-pair--right {
    top: 19rem;
    left: auto;
    right: 1.5rem;
  }
  .hero-pair--left .hero-fact--fact,
  .hero-pair--right .hero-fact--fact {
    margin-top: 0;
  }
  #inicio .hero-pair--left p,
  #inicio .hero-pair--right p {
    font-size: 1.0625rem;
  }
  .hero-pair--left .hero-fact__card,
  .hero-pair--right .hero-fact__card {
    padding: 1.875rem 1.375rem 1.375rem;
  }
}
.hero-fact {
  position: relative;
  animation: fact-in 800ms var(--ease-out) backwards;
  animation-delay: calc(500ms + var(--n, 0) * 120ms);
}
.hero-fact--myth {
  rotate: -2deg;
}
.hero-fact--fact {
  rotate: 2deg;
  animation-delay: calc(620ms + var(--n, 0) * 120ms);
}
@media (min-width: 48rem) {
  .hero-fact--fact {
    margin-top: 3rem;
  }
}
@keyframes fact-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
}
/* Flotación suave, desfasada entre las dos */
.hero-fact__float {
  position: relative;
  animation: fact-float 6s var(--ease-in-out-sine) infinite alternate;
}
.hero-fact--fact .hero-fact__float {
  animation-delay: -3s;
}
@keyframes fact-float {
  from {
    transform: translateY(5px);
  }
  to {
    transform: translateY(-5px);
  }
}
.hero-fact__tag {
  position: absolute;
  z-index: 2;
  top: -0.9rem;
  left: 50%;
  translate: -50% 0;
  padding: 0.3rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--cm-ink);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--cm-paper);
  rotate: -4deg;
}
.hero-fact--fact .hero-fact__tag {
  background: var(--cm-gradient-strong);
  color: #0a0a0a;
  rotate: 4deg;
}
.hero-fact__card {
  padding: 2.25rem 1.75rem 1.75rem;
  text-align: center;
}
#inicio .hero-fact p {
  margin: 0;
  font-size: clamp(1.125rem, 1.7vw, 1.4375rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  animation: none;
}
.hero-fact--myth p {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--cm-red);
  text-decoration-thickness: 2px;
}
.hero-fact .btn-brand {
  margin-top: 1.25rem;
}

/* ══ Aviso tipo notificación (solo móvil, al entrar) ══ */
.notif {
  position: fixed;
  z-index: 50;
  top: 4.5rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem 0.75rem 0.875rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transform: translateY(-140%) scale(0.96);
  /* salida: rápida */
  transition:
    opacity 250ms var(--ease-out),
    transform 250ms var(--ease-out);
}
.notif[hidden] {
  display: none;
}
/* Escritorio: tarjeta en la esquina superior derecha */
@media (min-width: 40rem) {
  .notif {
    top: 5rem;
    left: auto;
    right: 1.5rem;
    width: 24rem;
  }
}
.notif.is-in {
  opacity: 1;
  transform: none;
  transition-duration: 500ms;
}
.notif__body {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: var(--fg);
}
.notif__body img {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.4rem;
  border-radius: 0.75rem;
  background: #0a0a0a;
  object-fit: contain;
}
.notif__text {
  display: grid;
  gap: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.35;
}
.notif__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.notif__top strong {
  font-weight: 700;
  color: var(--fg);
}
.notif__text b {
  font-weight: 700;
  background-image: var(--cm-gradient-strong);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notif__close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.notif__close svg {
  width: 1rem;
  height: 1rem;
}

/* ══ Carruseles (móvil): puntos de posición ══ */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
}
.carousel-dots[hidden] {
  display: none;
}
.carousel-dots span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--fg) 22%, transparent);
  transition:
    transform 300ms var(--ease-out),
    background-color 300ms ease;
}
.carousel-dots span.is-active {
  background: var(--cm-orange);
  transform: scale(1.5);
}

/* ══ Razones del estancamiento: tarjetas de cristal ══ */
.pains-wrap {
  position: relative;
  isolation: isolate;
  margin-top: 3.5rem;
}
/* Manchas de marca detrás de las tarjetas */
.pains-wrap::before,
.pains-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(30rem, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.45;
  pointer-events: none;
}
.pains-wrap::before {
  left: 4%;
  top: -4rem;
  background: radial-gradient(closest-side, #ff8c00, transparent);
}
.pains-wrap::after {
  right: 4%;
  bottom: -4rem;
  background: radial-gradient(closest-side, #ff2d2d, transparent);
}
.pains {
  position: relative;
  display: flex;
  gap: 1rem;
  margin: 0 calc(-1 * clamp(1.25rem, 4vw, 4.5rem));
  padding: 1rem clamp(1.25rem, 4vw, 4.5rem) 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pains::-webkit-scrollbar {
  display: none;
}
.pain {
  display: flex;
  flex: 0 0 min(78%, 20rem);
  flex-direction: column;
  gap: 1.5rem;
  min-height: 13rem;
  padding: 1.5rem;
  scroll-snap-align: center;
}
.pain__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgb(255 45 45 / 0.16), rgb(255 140 0 / 0.2));
  color: var(--cm-red);
  transition: transform 300ms var(--ease-out);
}
.pain__icon svg {
  width: 1.375rem;
  height: 1.375rem;
}
.pain p {
  margin-top: auto;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
/* La razón central: borde con el color de la marca */
.pain--key {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.5),
    0 0 0 1.5px rgb(255 140 0 / 0.6),
    0 30px 80px -30px rgb(255 140 0 / 0.55);
}
.pain--key .pain__icon {
  background: var(--cm-gradient-strong);
  color: #0a0a0a;
}
@media (hover: hover) and (pointer: fine) {
  .pain {
    transition: translate 300ms var(--ease-out);
  }
  .pain:hover .pain__icon {
    transform: scale(1.1) rotate(-6deg);
  }
}

/* Escritorio: tres columnas con la del centro desplazada hacia abajo */
@media (min-width: 48rem) {
  .pains {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 0 3rem;
    overflow: visible;
  }
  .pain {
    min-height: 15rem;
    padding: 2rem;
  }
  .pain:nth-child(3n + 2) {
    translate: 0 3rem;
  }
  .pain:hover {
    translate: 0 -4px;
  }
  .pain:nth-child(3n + 2):hover {
    translate: 0 calc(3rem - 4px);
  }
}

/* ══ Comparativa ══ */
.versus {
  position: relative;
  padding-block: 5rem;
}
@media (min-width: 40rem) {
  .versus {
    padding-block: 7rem;
  }
}
.versus__head {
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
}
.versus__head .cm-lead {
  max-width: 38rem;
  margin: 1.25rem auto 0;
}
.versus__grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 3.5rem;
}
@media (min-width: 64rem) {
  .versus__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3.5rem;
    align-items: center;
    max-width: 76rem;
    margin-inline: auto;
  }
}

/* Barras: lo habitual frente a Club_motiFX */
.versus__chart {
  --other: 21%; /* 1 recurso frente a 7: un séptimo de la altura visible (el horizonte tapa la base) */
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 0.75rem;
  width: 100%;
  max-width: 30rem;
  height: clamp(24rem, 100vw, 31rem);
  margin-inline: auto;
  padding-top: 1px;
}
.versus__bar {
  position: relative;
  height: 100%;
  color: #0a0a0a;
}
.versus__bar--other {
  height: var(--other);
  color: var(--fg);
}
/* La barra corta no tiene sitio para el texto: va encima */
.versus__bar--other .versus__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  padding: 0 0.5rem 0.75rem;
}
.versus__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 1.75rem 1.75rem 0 0;
  background: linear-gradient(180deg, #ffd700 0%, #ff8c00 38%, #ff2d2d 100%);
  transform-origin: bottom;
  transition: transform 1100ms var(--ease-out) 250ms;
}
.versus__bar--other .versus__fill {
  background: #262625;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
  transition-duration: 700ms;
  transition-delay: 0ms;
}
.versus__label {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.5rem 0.5rem 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  transition:
    opacity 400ms var(--ease-out) 700ms,
    transform 400ms var(--ease-out) 700ms;
}
.versus__bar--other .versus__label {
  transition-delay: 350ms;
}
.versus__label strong {
  font-size: clamp(3rem, 12vw, 4.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Líneas punteadas a la altura de cada barra y la diferencia entre ambas */
.versus__guide {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1px dashed color-mix(in srgb, var(--fg) 35%, transparent);
  transition: opacity 400ms ease 900ms;
}
.versus__guide--other {
  top: calc(100% - var(--other));
}
.versus__delta {
  position: absolute;
  z-index: 2;
  left: 25%;
  top: 20%;
  translate: -50% -50%;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  background: var(--cm-paper);
  box-shadow: 0 10px 30px -12px rgb(10 10 10 / 0.35);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--fg);
  transition:
    opacity 400ms var(--ease-out) 1100ms,
    transform 400ms var(--ease-out) 1100ms;
}
/* Flecha punteada vertical que mide la diferencia */
.versus__delta::before,
.versus__delta::after {
  content: "";
  position: absolute;
  left: 50%;
  height: 3.5rem;
  border-left: 1px dashed color-mix(in srgb, var(--fg) 35%, transparent);
}
.versus__delta::before {
  bottom: 100%;
}
.versus__delta::after {
  top: 100%;
}
/* Horizonte: las barras nacen detrás de un arco con el brillo de la marca */
.versus__horizon {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 92%;
  width: 190%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--cm-mist);
  box-shadow:
    0 -1px 0 0 rgb(255 140 0 / 0.55),
    0 -3px 14px 0 rgb(255 140 0 / 0.4),
    0 -20px 70px -10px rgb(255 45 45 / 0.35);
  pointer-events: none;
}
/* Antes de entrar en pantalla (solo con JS) */
.js .versus__chart:not(.is-in) .versus__fill {
  transform: scaleY(0);
}
.js .versus__chart:not(.is-in) .versus__label,
.js .versus__chart:not(.is-in) .versus__delta {
  opacity: 0;
  transform: translateY(10px);
}
.js .versus__chart:not(.is-in) .versus__guide {
  opacity: 0;
}

/* Tabla: qué trae cada uno */
.versus__card {
  padding: 1.5rem 1.25rem;
}
@media (min-width: 40rem) {
  .versus__card {
    padding: 2.25rem;
  }
}
.versus__table {
  width: 100%;
  border-collapse: collapse;
}
.versus__table th,
.versus__table td {
  padding: 0.875rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}
.versus__table thead th {
  width: 4.25rem;
  padding-top: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
}
.versus__table thead th:last-child {
  color: var(--cm-red);
}
.versus__table thead th:first-child {
  width: auto;
}
.versus__table tbody th {
  padding-right: 0.75rem;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}
@media (min-width: 40rem) {
  .versus__table thead th {
    width: 7.5rem;
    font-size: 0.8125rem;
  }
  .versus__table tbody th {
    font-size: 1.0625rem;
  }
}
.versus__table .check {
  background: var(--cm-gradient-strong);
  border-color: transparent;
  color: #0a0a0a;
}
.versus__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: color-mix(in srgb, var(--fg) 35%, transparent);
}
.versus__no svg {
  width: 0.875rem;
  height: 0.875rem;
}
.versus__card .btn-brand {
  width: 100%;
  margin-top: 1.75rem;
}
.versus__note {
  max-width: 40rem;
  margin: 2rem auto 0;
  text-align: center;
  font-size: 0.8125rem;
}

/* ══ Preguntas frecuentes: cada pregunta es una tarjeta de cristal ══ */
#faq {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
#faq::before,
#faq::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(90vw, 44rem);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
}
#faq::before {
  left: -4%;
  top: 8%;
  background: radial-gradient(closest-side, #ff8c00, transparent);
}
#faq::after {
  right: -4%;
  bottom: 0;
  background: radial-gradient(closest-side, #ff2d2d, transparent);
}
#faq details {
  margin-bottom: 0.75rem;
  padding-inline: 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: var(--glass-shadow);
  transition: box-shadow 300ms ease;
}
@media (min-width: 40rem) {
  #faq details {
    padding-inline: 1.75rem;
  }
}
#faq details[open] {
  box-shadow:
    var(--glass-shadow),
    0 0 0 1px rgb(255 140 0 / 0.45);
}
#faq details p {
  padding-right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-fact__float {
    animation: none;
  }
  .hero-fact {
    animation: fade 200ms ease backwards;
  }
  .notif {
    transform: none;
    transition: opacity 200ms ease;
  }
  .pain,
  .pain__icon {
    transition: none;
  }
  .pain:hover .pain__icon {
    transform: none;
  }
  .versus__fill,
  .versus__label,
  .versus__delta,
  .versus__guide {
    transition: opacity 200ms ease;
    transform: none !important;
  }
  .carousel-dots span {
    transition: none;
  }
}

/* ══ Paso entre secciones: degradado en lugar de un corte de color ══
   Las secciones grises nacen del blanco y vuelven a él. No se degrada el borde que ya
   continúa el color de la sección vecina (tras la gráfica, tras las métricas o entre dos grises). */
:root {
  --fade: clamp(5rem, 12vw, 10rem);
  --section-ink: var(--cm-ink);
}
:root[data-theme="dark"] {
  --section-ink: #171716;
}
main section.cm-bg-mist {
  --from: var(--cm-paper);
  --to: var(--cm-paper);
  background: linear-gradient(
    var(--from),
    var(--cm-mist) var(--fade),
    var(--cm-mist) calc(100% - var(--fade)),
    var(--to)
  );
}
main .stats + section.cm-bg-mist,
main .ruta + section.cm-bg-mist,
main section.cm-bg-mist + section.cm-bg-mist {
  --from: var(--cm-mist);
}
main section.cm-bg-mist:has(+ section.cm-bg-mist) {
  --to: var(--cm-mist);
}

/* ══ Capítulos del ebook (10) y tarjetas de la comunidad (3) ══ */
@media (min-width: 64rem) {
  .glass-grid--chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .glass-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 80rem) {
  .glass-grid--chapters {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.comunidad__card .ruta__tag {
  margin-top: 0.625rem;
}
.comunidad .ruta__more {
  padding-block: 1rem;
}

/* "Todo lo que recibes hoy": nota bajo los botones */
.ruta__note {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
@media (min-width: 64rem) {
  .ruta__cta {
    flex-wrap: wrap;
    justify-content: center;
  }
  /* Algunos entregables tienen descripción larga: tarjeta de detalle más ancha */
  .ruta__desc {
    width: 18rem;
  }
}
/* Subtítulo bajo un título centrado (tema-claro.css le quita el margen a .cm-lead) */
.section-head .cm-lead {
  margin: 1.25rem auto 0;
  text-align: center;
}
