/*
  VOICE   Plataforma de inversión profesional: sobria, precisa, cifras por delante.
  IDEA    Un terminal de ranking de estrategias, como el de una gestora: tabla, curvas y fichas.
  PICTURE La curva de la cartera conjunta dibujándose a todo ancho en la primera pantalla.
  COLOUR  Blanco + azul marino profundo + azul eléctrico de acento; verde/rojo solo para rentabilidad.
  TYPE    Manrope para titulares, texto y cifras tabulares.
*/
:root {
  --navy: #0a1a33;
  --navy-2: #0f2547;
  --navy-3: #16325e;
  --blue: #1f6bff;
  --blue-2: #5b95ff;
  --bg: #ffffff;
  --bg-2: #f4f6fa;
  --line: #e3e8f0;
  --ink: #0a1a33;
  --ink-2: #4b5a72;
  --muted: #7d8aa0;
  --pos: #0fa36b;
  --neg: #e0484f;
  --r: 16px;
  --shadow: 0 1px 2px rgba(10, 26, 51, .04), 0 8px 30px rgba(10, 26, 51, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.num, td, .kpi b, .big { font-variant-numeric: tabular-nums; }
.wrap { width: min(1240px, 100% - 2 * max(4vw, 16px)); margin: 0 auto; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ---------- navegación ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.nav.scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(10, 26, 51, .05); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo svg { width: 40px; height: 40px; flex: none; transition: transform .5s var(--ease); }
.logo:hover svg { transform: rotate(-6deg) scale(1.06); }
.logo .fx { color: var(--blue); }
.links { display: flex; align-items: center; gap: 30px; font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.links a:not(.btn) { position: relative; transition: color .2s; }
.links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--blue); transform: scaleX(0); transition: transform .35s var(--ease); }
.links a:not(.btn):hover { color: var(--ink); }
.links a:not(.btn):hover::after { transform: scaleX(1); }
.burger { display: none; background: none; border: 0; width: 44px; height: 44px; font-size: 1.4rem; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: .95rem; border: 1px solid transparent; transition: transform .3s var(--ease), background .2s, box-shadow .3s; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 6px 20px rgba(31, 107, 255, .3); }
.btn-blue:hover { background: #1559e0; box-shadow: 0 10px 28px rgba(31, 107, 255, .38); }
.btn-line { border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn-line:hover { border-color: #fff; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 600px at 50% -10%, var(--navy-3), var(--navy) 60%); color: #fff; padding: clamp(64px, 9vw, 120px) 0 0; overflow: hidden; }
.hero-text { text-align: center; max-width: 860px; margin: 0 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: #b9c8e6; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); padding: 6px 14px; border-radius: 999px; margin-bottom: 26px; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 0 4px rgba(62, 224, 143, .2); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.hero h1 span { background: linear-gradient(90deg, #fff, #8fb4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: #b9c8e6; font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 640px; margin: 22px auto 34px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-card { margin: 60px auto 0; background: #fff; color: var(--ink); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 80px rgba(0, 0, 0, .35); padding: clamp(20px, 3vw, 34px); }
.hero-card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hero-card-head small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.hero-card-head .big { display: block; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.mini-kpis { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; }
.mini-kpis div small { display: block; }
.mini-kpis b { font-size: 1.25rem; font-weight: 800; }

/* ---------- cifras ---------- */
.figures { padding: clamp(50px, 7vw, 90px) 0; border-bottom: 1px solid var(--line); }
.figures .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.figure b { display: block; font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.figure span { color: var(--ink-2); font-weight: 600; }

/* ---------- secciones ---------- */
.band { padding: clamp(64px, 9vw, 120px) 0; }
.band.grey { background: var(--bg-2); }
.band.dark { background: var(--navy); color: #fff; }
.head { max-width: 720px; margin-bottom: 40px; }
.head h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; margin-bottom: 14px; }
.head p { color: var(--ink-2); font-size: 1.08rem; }
.dark .head p { color: #b9c8e6; }

/* ---------- ranking ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 700; font-size: .9rem; transition: all .25s var(--ease); }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.hint { color: var(--muted); font-size: .88rem; }
.table-box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 900px; }
.rank th { text-align: right; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 16px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.rank th[data-k] { cursor: pointer; }
.rank th[data-k]:hover { color: var(--ink); }
.rank th.sorted { color: var(--blue); }
.rank th.sorted::after { content: " ↓"; }
.rank th.sorted.asc::after { content: " ↑"; }
.rank th:first-child, .rank td:first-child, .rank th:nth-child(2), .rank td:nth-child(2) { text-align: left; }
.rank td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-weight: 600; }
.rank tbody tr { cursor: pointer; transition: background .2s; }
.rank tbody tr:hover { background: #f7f9fd; }
.rank tbody tr:last-child td { border-bottom: 0; }
.rank .pos-n { color: var(--muted); width: 40px; }
.sname { display: flex; align-items: center; gap: 12px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; }
.avatar.L { background: linear-gradient(135deg, #1f6bff, #4aa3ff); }
.avatar.C { background: linear-gradient(135deg, #0a1a33, #2c4f86); }
.avatar.P { background: linear-gradient(135deg, #0fa36b, #3ee08f); }
.sname b { display: block; font-weight: 800; }
.sname small { color: var(--muted); font-weight: 600; }
.spark { width: 120px; height: 36px; display: inline-block; vertical-align: middle; }

/* ---------- historia (scroll tipo Apple) ---------- */
.story { height: 320vh; position: relative; background: var(--navy); color: #fff; }
.story-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.story-step { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 6vw; opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .7s var(--ease), transform .9s var(--ease); pointer-events: none; }
.story-step.on { opacity: 1; transform: none; }
.story-step.past { opacity: 0; transform: translateY(-40px) scale(1.04); }
.story-step b { display: block; font-size: clamp(3.4rem, 12vw, 9rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, #fff 30%, #8fb4ff); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.story-step p { font-size: clamp(1.2rem, 2.6vw, 2rem); font-weight: 700; margin-top: 16px; letter-spacing: -.02em; }
.story-step span { display: block; color: #b9c8e6; font-size: clamp(1rem, 1.4vw, 1.15rem); max-width: 560px; margin: 14px auto 0; font-weight: 500; }
.story-bar { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.story-bar i { width: 28px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); transition: background .4s; }
.story-bar i.on { background: #fff; }

/* ---------- cartera ---------- */
.pf-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 2.5vw, 28px); box-shadow: var(--shadow); }
.panel h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; }
.panel .sub { color: var(--muted); font-weight: 600; font-size: .85rem; }
.legend { display: flex; gap: 18px; font-size: .85rem; color: var(--ink-2); font-weight: 600; margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* ---------- gráficos ---------- */
.fig { position: relative; min-height: 320px; margin-top: 16px; }
.fig.sm { min-height: 140px; }
.fig.hero-fig { min-height: clamp(240px, 32vw, 380px); margin-top: 20px; }
.fig > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fig text { font: 600 11px var(--font); fill: var(--muted); }
.tip { position: absolute; z-index: 2; pointer-events: none; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700; padding: 7px 11px; border-radius: 9px; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .15s; box-shadow: 0 6px 20px rgba(10, 26, 51, .25); }
.tip small { display: block; color: #b9c8e6; font-weight: 600; }
.draw path.line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.draw.drawn path.line { stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s var(--ease); }
.draw path.area { opacity: 0; }
.draw.drawn path.area { opacity: 1; transition: opacity 1.2s .9s; }

/* barras por año */
.bars { display: grid; gap: 4px; margin-top: 18px; align-items: end; }
.bar { text-align: center; }
.bar .col { height: 140px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.bar .col span { width: 70%; border-radius: 6px 6px 0 0; background: var(--blue); transform-origin: bottom; transform: scaleY(0); transition: transform 1s var(--ease); transition-delay: var(--d, 0s); }
.bar .col span.down { background: var(--neg); }
.in .bar .col span { transform: scaleY(1); }
.bar b { display: block; font-size: .74rem; margin-top: 8px; white-space: nowrap; letter-spacing: -.02em; }
.bar small { color: var(--muted); font-size: .78rem; font-weight: 600; }

/* ---------- método ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 26px; transition: transform .4s var(--ease), box-shadow .4s, opacity .9s var(--ease); }
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.step .ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(31, 107, 255, .1); color: var(--blue); display: grid; place-items: center; margin-bottom: 18px; }
.step h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: .95rem; }

/* ---------- lista de espera ---------- */
.join { text-align: center; }
.join .head { margin: 0 auto 30px; }
.join form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); padding: 6px; border-radius: 999px; }
.join input { flex: 1; background: transparent; border: 0; color: #fff; font: inherit; font-size: 16px; padding: 0 18px; min-height: 44px; }
.join input::placeholder { color: #8ea2c4; }
.join input:focus-visible { outline: none; }
.join form:focus-within { border-color: var(--blue-2); }
.form-msg { margin-top: 16px; color: #b9c8e6; min-height: 1.5em; }

/* ---------- ficha ---------- */
.d-hero { background: radial-gradient(900px 400px at 80% -20%, var(--navy-3), var(--navy) 65%); color: #fff; padding: 30px 0 120px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: #b9c8e6; font-weight: 600; font-size: .92rem; min-height: 44px; }
.back:hover { color: #fff; }
.d-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; margin-top: 10px; }
.d-title .avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 1.1rem; }
.d-title h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.03em; line-height: 1.05; font-weight: 800; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #d5e0f5; }
.d-ret small { color: #b9c8e6; font-weight: 600; display: block; text-align: right; }
.d-ret b { display: block; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #3ee08f; }
.d-body { margin-top: -80px; padding-bottom: 90px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.kpi { background: #fff; padding: 20px 22px; }
.kpi small { color: var(--muted); font-weight: 700; font-size: .8rem; }
.kpi b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.d-section { margin-top: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ranges { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 999px; }
.ranges button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--ink-2); transition: all .25s var(--ease); }
.ranges button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(10, 26, 51, .1); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.side { display: grid; gap: 24px; }
.risk { list-style: none; margin-top: 8px; }
.risk li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.risk li:last-child { border: 0; }
.risk li b { color: var(--ink); white-space: nowrap; }
.private { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-2); border-radius: 12px; padding: 16px 18px; margin-top: 18px; color: var(--ink-2); font-size: .93rem; }
.private svg { flex: none; color: var(--blue); margin-top: 2px; }
.side-cta { background: var(--navy); color: #fff; border: 0; }
.side-cta p { color: #b9c8e6; font-size: .93rem; margin: 8px 0 18px; }

/* tabla mensual */
.scroll { overflow-x: auto; margin-top: 14px; }
.months { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .8rem; min-width: 760px; }
.months th { color: var(--muted); font-weight: 700; padding: 6px; text-align: center; }
.months td { text-align: center; padding: 9px 4px; border-radius: 6px; font-weight: 700; }
.months td.y { text-align: left; color: var(--ink); font-weight: 800; }
.months td.tot { background: var(--navy) !important; color: #fff !important; }

/* legal */
.legal { max-width: 780px; padding: 50px 0 90px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.03em; margin-bottom: 20px; }
.legal h2 { font-size: 1.2rem; margin: 30px 0 10px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; }

/* ---------- pie ---------- */
footer { background: var(--navy); color: #8ea2c4; padding: 50px 0 40px; font-size: .88rem; border-top: 1px solid rgba(255, 255, 255, .06); }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; }
footer .logo { color: #fff; margin-bottom: 14px; }
footer nav { display: flex; gap: 22px; font-weight: 600; flex-wrap: wrap; }
footer nav a:hover { color: #fff; }
footer p { max-width: 720px; }

/* ---------- vistas y apariciones ---------- */
.view { animation: viewIn .6s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
[data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .draw path.line { stroke-dashoffset: 0; }
  .draw path.area { opacity: 1; }
  .bar .col span { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .pf-grid, .cols { grid-template-columns: minmax(0, 1fr); }
  .steps, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .burger { display: block; }
  .links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); padding: 12px max(4vw, 16px) 20px; }
  .links.open { display: flex; }
  .links a:not(.btn) { padding: 10px 0; }
  .links a::after { display: none; }
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .d-ret small { text-align: left; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .join form { flex-direction: column; border-radius: 18px; }
  .story { height: 280vh; }
  .kpi { padding: 16px; }
  .kpi b { font-size: 1.25rem; }
}

footer .logo .fx { color: var(--blue-2); }
