/* =========================================================
   Jos.IA · Marketing digital
   Solo lo propio de esta página. La base vive en _shared/css/josia.css
   ========================================================= */

/* ---------- Hero: collage ----------
   .stage es el contenedor de consulta. Desde 520 px usa el lienzo completo de 640 x 328
   con las fichas encima; por debajo usa un lienzo compacto (teléfono + fotos) y las
   fichas pasan a una lista debajo para que el texto siga siendo legible. */
.hero__stage { position: relative; margin-inline: calc(-1 * var(--gutter)); }
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); }
  .hero__stage { margin-left: 0; margin-right: calc(-1 * var(--gutter) / 2); }
}
.stage { container-type: inline-size; position: relative; }
.stage__art { --cw: 388; --ch: 346; --ox: 44; --oy: -14; --u: calc(100cqw / var(--cw)); position: relative; display: grid; }
.canvas { position: relative; width: 100%; aspect-ratio: var(--cw) / var(--ch); }

/* Las piezas se colocan por su centro. translate/rotate son propiedades independientes
   y no chocan con el transform del revelado. */
.phone, .note, .note-arrow, .photo, .chip {
  position: absolute;
  left: calc((var(--x) - var(--ox)) * var(--u));
  top: calc((var(--y) - var(--oy)) * var(--u));
  translate: -50% -50%;
  rotate: var(--r, 0deg);
  z-index: var(--z, 4);
  margin: 0;
}
.phone { width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); z-index: 5; }
.phone__img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 calc(14 * var(--u)) calc(22 * var(--u)) rgba(15, 23, 42, 0.3)); }
.note {
  z-index: 6;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: max(15px, calc(18.5 * var(--u)));
  line-height: 0.92;
  white-space: nowrap;
  color: var(--ink);
  pointer-events: none;
}
.note-arrow { z-index: 6; width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.photo {
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  padding: calc(3 * var(--u));
  border-radius: calc(7 * var(--u));
  background: var(--white);
  box-shadow: 0 calc(10 * var(--u)) calc(22 * var(--u)) calc(-8 * var(--u)) rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(10, 12, 16, 0.06);
  scale: 1;
  transition: scale var(--t-slow) var(--ease-out);
}
.photo > img { width: 100%; height: 100%; border-radius: calc(5 * var(--u)); object-fit: cover; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .photo:hover { scale: 1.035; } }
.chip {
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  height: calc(27 * var(--u));
  padding: 0 calc(10 * var(--u));
  border-radius: calc(9 * var(--u));
  background: var(--white);
  font-size: max(12px, calc(10.8 * var(--u)));
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  box-shadow: 0 calc(8 * var(--u)) calc(16 * var(--u)) calc(-6 * var(--u)) rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(10, 12, 16, 0.06);
  z-index: 7;
}
.chip .icon { width: max(12px, calc(13.5 * var(--u))); height: max(12px, calc(13.5 * var(--u))); stroke-width: 1.9; }

/* Fichas de resultados (monocromo: los logos heredan el color del texto) */
.floaters { --u: 1.4px; display: grid; gap: 10px; justify-items: center; padding: 14px var(--gutter) 0; }
.fcard {
  position: relative;
  display: grid;
  grid-template-columns: calc(44 * var(--u)) minmax(0, 1fr);
  align-items: center;
  column-gap: calc(11 * var(--u));
  width: min(100%, 25rem);
  padding: calc(13 * var(--u)) calc(12 * var(--u)) calc(13 * var(--u)) calc(11 * var(--u));
  border-radius: calc(11 * var(--u));
  background: var(--white);
  box-shadow: 0 calc(14 * var(--u)) calc(28 * var(--u)) calc(-16 * var(--u)) rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(10, 12, 16, 0.06);
  scale: 1;
}
.fcard__logo { display: grid; place-items: center; width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: 50%; background: var(--ink); color: var(--white); }
.fcard__logo .icon { width: 52%; height: 52%; stroke-width: 1.9; }
.fcard__body { display: grid; gap: calc(3 * var(--u)); min-width: 0; padding-right: calc(8 * var(--u)); line-height: 1.15; text-align: left; }
.fcard__name { font-size: max(11px, calc(8.2 * var(--u))); font-weight: 600; color: var(--text-2); }
.fcard__num { margin-top: calc(3 * var(--u)); font-size: max(18px, calc(17.5 * var(--u))); font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.fcard__lbl { font-size: max(12px, calc(9.2 * var(--u))); color: var(--text-3); }
.badge {
  position: absolute;
  top: calc(9 * var(--u));
  right: calc(10 * var(--u));
  padding: calc(3.5 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  background: var(--mist);
  color: var(--text-2);
  font-size: max(11px, calc(7.4 * var(--u)));
  font-weight: 500;
  line-height: 1;
}
@container (min-width: 520px) {
  .stage__art { --cw: 640; --ch: 328; --ox: 0; --oy: 0; display: block; aspect-ratio: 640 / 328; }
  .canvas { display: contents; }
  .floaters { --u: calc(100cqw / var(--cw)); display: block; padding: 0; }
  .fcard {
    position: absolute;
    left: calc(var(--x) * var(--u));
    top: calc(var(--y) * var(--u));
    translate: -50% -50%;
    rotate: var(--r, 0deg);
    z-index: 4;
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
    padding: 0 calc(12 * var(--u));
    transition: scale var(--t-slow) var(--ease-out);
  }
  .fcard__body { gap: calc(2 * var(--u)); padding: calc(6 * var(--u)) calc(16 * var(--u)) 0 0; text-align: center; }
  .fcard__num { margin-top: calc(4 * var(--u)); }
}
@container (min-width: 520px) and (max-width: 639px) { .badge { display: none; } .fcard__body { padding-right: 0; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { @container (min-width: 520px) { .fcard:hover { scale: 1.03; } } }
.js .fcard[data-reveal], .js .photo[data-reveal] {
  transition:
    opacity var(--t-slow) var(--ease-out) var(--d, 0ms),
    transform 0.95s var(--ease-out) var(--d, 0ms),
    scale var(--t-slow) var(--ease-out);
}

/* ---------- Plataformas ---------- */
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.plat { display: grid; gap: 22px; align-content: start; min-width: 0; }
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 4.4;
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 24px 40px -30px rgba(10, 12, 16, 0.5), 0 0 0 1px var(--line);
  transition: transform var(--t-slow) var(--ease-out), box-shadow var(--t-slow) var(--ease-out);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .plat:hover .media { transform: translateY(-4px); box-shadow: 0 34px 46px -30px rgba(10, 12, 16, 0.55), 0 0 0 1px var(--line); }
}
.app { position: absolute; z-index: 2; left: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--white); }
.app .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.media--tiktok { background: #14110c; }
.media--tiktok > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media--tiktok::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.66) 100%); }
.media__cap, .media__views { position: absolute; z-index: 2; left: 16px; color: var(--white); }
.media__cap { bottom: 56px; font-size: 1.0625rem; font-weight: 650; line-height: 1.22; letter-spacing: -0.01em; }
.media__views { bottom: 18px; display: flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.media__views .icon { width: 16px; height: 16px; }
.media--insta { display: grid; grid-template-rows: 1fr auto auto; padding: 14px; gap: 10px; }
.media__photo { width: 100%; height: 100%; min-height: 0; border-radius: 12px; object-fit: cover; }
.media__title { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.media__bar { display: flex; align-items: center; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); }
.media__bar .icon { width: 20px; height: 20px; stroke-width: 1.7; }
.media__save { margin-left: auto; display: grid; }
.media--ads { padding: 14px; display: grid; }
/* El anuncio es la propia tarjeta: sin caja dentro de otra caja */
.ad { position: relative; overflow: hidden; margin-top: 44px; }
.ad__title { position: absolute; z-index: 1; left: 14px; top: 14px; width: 66%; font-size: 1rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.ad > img { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; object-fit: cover; border-radius: 14px; }
.ad__btn { position: absolute; z-index: 1; left: 14px; bottom: 14px; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 0.8125rem; font-weight: 500; line-height: 1; white-space: nowrap; }
.plat__txt h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.plat__txt > p { margin-top: 6px; max-width: 18em; color: var(--text-2); text-wrap: pretty; }
.mini { display: grid; margin-top: 16px; }
.mini li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--text-2); }
.mini li:last-child { border-bottom: 1px solid var(--line); }
.mini .icon { width: 18px; height: 18px; stroke-width: 1.7; color: var(--ink); }
@media (max-width: 960px) {
  .platforms { grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 520px; }
  .media { aspect-ratio: 4 / 3.6; }
}

/* ---------- Resultados con gráfica ---------- */
.results--chart { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); grid-template-areas: "copy chart" "quote chart" "stats stats" "fine fine"; row-gap: clamp(24px, 3vw, 40px); }
.results--chart .results__copy { grid-area: copy; }
.results--chart .chart { grid-area: chart; }
.results--chart .quote { grid-area: quote; }
.results--chart .stats { grid-area: stats; }
.results--chart > .fine { grid-area: fine; }
.results .quote blockquote p { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.5; font-weight: 450; }
@media (max-width: 900px) {
  .results--chart { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "chart" "quote" "stats" "fine"; }
}

.chart { display: grid; align-content: start; gap: 18px; min-width: 0; padding: clamp(18px, 2vw, 28px); border: 1px solid var(--d-line); border-radius: var(--r-card); background: rgba(255, 255, 255, 0.03); }
.chart__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.chart__title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.range { position: relative; display: inline-flex; align-items: center; }
.range select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 2.6em 0 1.1em;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--d-text-2);
  font-size: 0.875rem;
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.range select option { background: var(--white); color: var(--ink); }
@media (hover: hover) { .range select:hover { border-color: rgba(255, 255, 255, 0.6); color: var(--white); } }
.range .icon { position: absolute; right: 0.9em; width: 1em; height: 1em; pointer-events: none; color: var(--d-text-2); }
html:not(.js) .range select { pointer-events: none; }
.chart__body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; padding-bottom: 30px; }
.chart__y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 0.75rem; color: var(--d-text-2); font-variant-numeric: tabular-nums; }
.chart__y li { display: flex; align-items: center; justify-content: flex-end; height: 0; white-space: nowrap; }
.chart__plot { position: relative; min-width: 0; }
.plot { width: 100%; height: auto; overflow: visible; }
.plot__grid path { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.5; }
.plot__area { fill: url(#plot-fill); }
.plot__line { fill: none; stroke: #fff; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.plot__dots circle { fill: #fff; }
.chart__x { position: absolute; left: 0; right: 0; top: 100%; height: 1.5em; margin-top: 10px; font-size: 0.75rem; color: var(--d-text-2); }
.chart__x li { position: absolute; left: var(--p); transform: translateX(-50%); white-space: nowrap; }
.chart__x li:last-child { transform: translateX(-72%); }
.chart .fine { color: var(--d-text-3); }
.js .chart:not(.is-visible) .plot__line { stroke-dashoffset: 1; }
.js .chart:not(.is-visible) .plot__area, .js .chart:not(.is-visible) .plot__dots { opacity: 0; }
.plot__line { transition: stroke-dashoffset 1.8s var(--ease-out) 0.3s; }
.plot__area, .plot__dots { transition: opacity 0.9s var(--ease) 1s; }
.chart.is-swapping .plot, .chart.is-swapping .chart__x { opacity: 0; }
.plot, .chart__x { transition: opacity 0.2s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .js .chart:not(.is-visible) .plot__line { stroke-dashoffset: 0; }
  .js .chart:not(.is-visible) .plot__area, .js .chart:not(.is-visible) .plot__dots { opacity: 1; }
}
