/* ==========================================================================
   Escenas de scroll y piezas de la versión 2.
   Cada escena recibe --p (0–1) desde js/main.js; el CSS hace el resto.
   ========================================================================== */

/* ---------- manifiesto: el texto se ilumina palabra a palabra ---------- */
.manifesto { position: relative; height: 250vh; }
.manifesto__pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-content: center; overflow: hidden; padding-top: var(--header-h); }
.manifesto__big { font-family: var(--display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: clamp(38px, 7.6vw, 128px); line-height: 0.88; letter-spacing: -0.012em; max-width: none; }
.manifesto__p { margin: clamp(24px, 4vh, 48px) 0 0; max-width: none; font-size: clamp(17px, 1.75vw, 27px); line-height: 1.32; font-weight: 500; }
.sw { opacity: 0.13; transition: opacity 0.3s linear; }
.sw.on { opacity: 1; }
.manifesto.manifesto--static { height: auto; }
.manifesto--static .manifesto__big { max-width: 16ch; }
@media (min-width: 900px) {
  .manifesto--static .manifesto__pin .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 96px); align-items: end; }
  .manifesto--static .label { grid-column: 1 / -1; }
  .manifesto--static .manifesto__p { margin-top: 0; }
}
.manifesto--static .manifesto__pin { position: static; height: auto; padding-block: clamp(84px, 11vw, 190px) 0; }
.manifesto--static .sw { opacity: 1; }

/* de → a */
.shift { margin-top: 0; }
.shift__from q { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: currentColor; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.shift__to q { font-stretch: 78%; font-weight: 800; text-transform: uppercase; font-size: clamp(26px, 3.6vw, 56px); line-height: 0.96; }

/* ---------- pilares: desplazamiento horizontal ---------- */
.hpanels { position: relative; height: 340vh; background: var(--bg-deep); }
.hpanels__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; padding-top: var(--header-h); }
.hpanels__track { display: flex; gap: clamp(14px, 1.8vw, 28px); padding-inline: var(--pad); transform: translate3d(calc(var(--shift, 0) * -1px), 0, 0); will-change: transform; }
.hpanel {
  flex: none; width: min(60vw, 880px); height: min(66vh, 620px); position: relative; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px;
  padding: clamp(22px, 3vw, 48px); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface);
}
.hpanel.inv { background: var(--bg); border-color: var(--bg); }
.hpanel h3 { align-self: end; font-family: var(--display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: clamp(40px, 6.4vw, 104px); line-height: 0.88; letter-spacing: -0.012em; position: relative; }
.hpanel > p:last-child { max-width: 34ch; font-size: clamp(16px, 1.4vw, 21px); line-height: 1.4; color: var(--fg-soft); position: relative; }
.hpanel__n { position: absolute; right: clamp(12px, 2vw, 32px); top: clamp(4px, 1vw, 16px); font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: clamp(120px, 30vh, 320px); line-height: 0.82; color: transparent; -webkit-text-stroke: 1.5px var(--border); }
.hpanel--intro { overflow: visible; width: min(44vw, 620px); border: 0; background: none; padding-left: 0; grid-template-rows: auto auto auto; align-content: center; gap: 0; }
.hpanel--intro .h2 { font-size: clamp(36px, 5.4vw, 88px); }
.hpanel__go { display: flex; align-items: center; gap: 12px; margin-top: 32px; color: var(--fg-soft); }
.hpanel__go i { width: 54px; height: 1px; transform-origin: left; animation-name: hintx; }
@keyframes hintx { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
.hpanels__bar { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(18px, 4vh, 40px); height: 1px; background: var(--border); }
.hpanels__bar i { display: block; height: 100%; background: var(--fg); transform: scaleX(var(--p, 0)); transform-origin: left; }

.hpanels.hpanels--static { height: auto; padding-block: clamp(72px, 9vw, 140px); }
.hpanels--static .hpanels__pin { position: static; height: auto; overflow: visible; padding-top: 0; }
.hpanels--static .hpanels__track { flex-direction: column; transform: none; width: 100%; max-width: none; margin-inline: auto; }
.hpanels--static .hpanel { width: 100%; height: auto; min-height: 260px; }
.hpanels--static .hpanel--intro { min-height: 0; padding: 0 0 24px; }
.hpanels--static .hpanel__n { font-size: clamp(110px, 30vw, 220px); }
.hpanels--static .hpanels__bar, .hpanels--static .hpanel__go { display: none; }

/* ---------- marquesina de clases de activo ---------- */
.mq { overflow: hidden; margin-top: clamp(48px, 7vw, 110px); display: grid; gap: clamp(6px, 1vw, 14px); }
.mq__row { display: flex; width: max-content; white-space: nowrap; font-family: var(--display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: clamp(46px, 9.6vw, 160px); line-height: 0.92; will-change: transform; transform: translate3d(calc(var(--p, 0) * -4%), 0, 0); }
.mq__row span { display: inline-flex; align-items: center; }
.mq__row span::after { content: ""; width: 0.16em; height: 0.16em; border-radius: 50%; background: var(--accent); margin-inline: 0.3em; }
.mq__row--out { color: transparent; -webkit-text-stroke: 1.5px var(--fg); transform: translate3d(calc(-8% + var(--p, 0) * 4%), 0, 0); }
.mq__row--out span::after { background: var(--fg); }

.classes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(20px, 5vw, 96px); align-items: start; margin-top: clamp(56px, 7vw, 104px); padding-top: clamp(24px, 3vw, 40px); border-top: 1px solid var(--fg); }
.classes p { font-size: clamp(17px, 1.4vw, 22px); line-height: 1.45; color: var(--fg-soft); max-width: none; }

/* ---------- seguimiento ---------- */
.track { align-items: center; }
.track__h { margin: 0 0 10px; }

/* ---------- sobre el profesional ---------- */
.about { align-items: start; }
.about__photo { position: sticky; top: calc(var(--header-h) + 24px); max-width: 520px; }
.about__frame { overflow: hidden; border-radius: var(--r-card); aspect-ratio: 1086 / 1448; background: var(--surface); }
.about__frame img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0;
  transform: scale(1.14) translateY(calc((var(--p, 0.5) - 0.5) * -10%));
  filter: grayscale(calc(1 - clamp(0, (var(--p, 1) - 0.34) * 4, 1))) contrast(1.06);
}
.stat { display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 28px); margin-bottom: clamp(24px, 3vw, 44px); padding-bottom: clamp(20px, 2.4vw, 32px); border-bottom: 1px solid var(--border); }
.stat b { font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: clamp(110px, 17vw, 280px); line-height: 0.76; letter-spacing: -0.03em; }
.stat .micro { max-width: 15ch; padding-bottom: 0.6em; color: var(--fg-soft); font-size: 12.5px; }
.about__text > p:not(.label):not(.stat) { margin-top: 20px; }
.about__text > .lead { margin-top: 0; }

/* ---------- proceso: tarjetas que se apilan ---------- */
.stack { display: grid; }
.stack li {
  position: sticky; top: calc(var(--header-h) + 18px + var(--i) * 16px);
  display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(16px, 4vw, 72px); align-items: start;
  min-height: clamp(170px, 26vh, 250px); margin-bottom: 18px; padding: clamp(22px, 3vw, 44px);
  background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r-card);
}
.stack li:nth-child(even) { background: var(--fg); color: var(--bg); }
.stack li:nth-child(even) p, .stack li:nth-child(even) b { color: var(--bg); }
.stack b { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.12em; color: var(--muted); padding-top: 0.5em; }
.stack h3 { font-family: var(--display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: clamp(34px, 5vw, 84px); line-height: 0.88; }
.stack p { font-size: clamp(16px, 1.4vw, 21px); line-height: 1.4; color: var(--fg-soft); max-width: 36ch; padding-top: 0.3em; }

/* ---------- ajustes de piezas heredadas al nuevo tono ---------- */
.sec--main { background: var(--bg); border-top: 0; padding-top: clamp(84px, 11vw, 190px); }
.flow__track span, .who__intro .h3 { font-stretch: 78%; font-weight: 800; }
.who__list li { font-size: clamp(16px, 1.25vw, 19px); padding: 20px 0; }
.who__list li { transition: padding-left 0.35s var(--ease), color 0.25s; }
.who__list li:hover { padding-left: 10px; color: var(--fg); }
.factors h3 { font-family: var(--display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; font-size: clamp(20px, 1.9vw, 28px); line-height: 1; }
.factors li { border-top-color: var(--fg); }
.contact { background: var(--bg-deep); border-top: 1px solid var(--border-soft); }
.contact__grid { align-items: start; }
/* el titular se dimensiona por el ancho de su columna para no invadir la lista de la derecha */
.contact__grid > div:first-child { container-type: inline-size; min-width: 0; }
.contact .h1 { font-size: clamp(40px, 14.5cqi, 164px); }
.goals li { font-stretch: 84%; font-weight: 600; }
.markets__stage .head { margin-bottom: clamp(36px, 5vw, 72px); }
.sec--panel .head, .analyzer .head, .learn .head { margin-bottom: clamp(32px, 4vw, 56px); }
#trading { border-top: 0; }
.inv .cols-list li { border-top-color: var(--fg); color: var(--fg); }
.inv .ticks li { border-top-color: var(--border); }
.inv .cycle__prog { stroke: var(--fg); }
.footer { border-top: 1px solid var(--border-soft); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .classes { grid-template-columns: 1fr; }
  .about__photo { position: static; max-width: 440px; }
  .stack li { grid-template-columns: 1fr; gap: 10px; min-height: 0; top: calc(var(--header-h) + 12px + var(--i) * 12px); }
  .stack b { padding-top: 0; }
  .manifesto__p { margin-left: 0; }
  .shift__arrow { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sw { opacity: 1; }
  .mq__row, .mq__row--out { transform: none; }
  .mq__row--out { margin-left: -18%; }
  .about__frame img { transform: none; filter: grayscale(1) contrast(1.06); }
  .stack li { position: static; }
}
