/* =========================================================
   HERO DE PANELES EXPANDIBLES — Luis José Alarcón
   Escritorio: el panel bajo el cursor se expande y los demás se atenúan.
   Celular: acordeón vertical, se toca para abrir.
   ========================================================= */
.hp{
  --hp-bg:#0b1f3a; --hp-ink:#fff; --hp-muted:#b9c5da; --hp-teal:#5dcaa5; --hp-sky:#8fb4ff;
  --hp-ease:cubic-bezier(.22,.8,.24,1); --hp-dur:.7s;
  background:var(--hp-bg); color:var(--hp-ink);
  padding:clamp(20px,3vw,40px) clamp(16px,2.4vw,40px) 22px;
  font-family:'Inter',system-ui,sans-serif;
}
.hp *{box-sizing:border-box}
.hp-track{
  display:flex; gap:10px; align-items:center;
  height:clamp(600px,82vh,780px);
}
/* ---------- panel ---------- */
.hp-panel{
  position:relative; flex:1 1 0; min-width:0;
  height:82%;                                   /* paneles cerrados más bajos */
  border-radius:20px; overflow:hidden; cursor:pointer;
  background:var(--p-bg,#13305a); color:inherit; text-decoration:none;
  border:0; padding:0; text-align:left; font:inherit;
  transition:flex var(--hp-dur) var(--hp-ease), height var(--hp-dur) var(--hp-ease), filter .4s;
  outline:none;
}
.hp-panel.is-active{ flex:4.2 1 0; height:100%; }
.hp-panel{ display:flex; flex-direction:column; justify-content:space-between; gap:18px; }
.hp-panel:focus-visible{ box-shadow:0 0 0 3px var(--hp-sky); }
/* foto opcional (data-img) */
.hp-photo{
  position:absolute; inset:0; background-size:cover; background-position:center top;
  filter:grayscale(1) brightness(.55); transform:scale(1.04);
  transition:filter .7s, transform 1.2s var(--hp-ease);
}
.hp-panel.is-active .hp-photo{ filter:none; transform:scale(1); }
/* ilustración lineal: se dibuja al abrir el panel */
.hp-art{
  position:absolute; right:4%; top:5%; width:min(46%,340px); height:auto;
  opacity:.16; pointer-events:none; transition:opacity .7s, transform 1s var(--hp-ease);
}
.hp-panel.is-active .hp-art{ opacity:.3; transform:translateY(-6px); }
.hp-panel[data-img] .hp-art{ display:none; }
/* velo: oscurece cerrados, degradado inferior en el activo */
.hp-panel::after{
  content:""; position:absolute; inset:0;
  background:rgba(6,16,32,.55);
  transition:background .6s;
}
.hp-panel.is-active::after{
  background:linear-gradient(180deg,rgba(6,16,32,0) 30%,rgba(6,16,32,.88) 100%);
}
/* ---------- etiqueta del panel cerrado ---------- */
.hp-label{
  position:absolute; left:50%; bottom:26px; z-index:2;
  display:flex; align-items:center; gap:10px;
  writing-mode:vertical-rl; transform:translateX(-50%) rotate(180deg);
  font-size:12.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:#dfe7f5; white-space:nowrap; transition:opacity .35s;
}
.hp-label i{
  width:30px; height:30px; border-radius:50%; border:1.5px solid var(--hp-teal);
  display:grid; place-items:center; font-style:normal; color:var(--hp-teal);
  transform:rotate(90deg); font-size:13px;
}
.hp-panel.is-active .hp-label{ opacity:0; }
/* ---------- contenido del activo ---------- */
.hp-body{
  position:relative; z-index:2; flex:none;
  padding:0 clamp(22px,2.6vw,40px) clamp(22px,2.6vw,36px);
  width:100%; max-width:640px;
  opacity:0; transform:translateY(16px); pointer-events:none;
  transition:opacity .35s, transform .5s var(--hp-ease);
}
.hp-panel.is-active .hp-body{
  opacity:1; transform:none; pointer-events:auto; transition-delay:.25s;
}
.hp-kicker{
  display:flex; align-items:center; gap:10px;
  font-family:'Fraunces',Georgia,serif; font-style:italic; font-size:15px; color:#fff;
}
.hp-kicker::before{ content:""; width:3px; height:20px; background:var(--hp-teal); }
.hp-panel[data-name="desgravamen"] .hp-kicker strong,
.hp-panel[data-name="universitario"] .hp-kicker{
  color:#ffe199; font-size:clamp(18px,1.6vw,22px); font-weight:700;
}
.hp-title{
  font-family:'Fraunces',Georgia,serif; font-weight:600;
  font-size:clamp(28px,3vw,46px); line-height:1.06; letter-spacing:-.01em;
  margin:14px 0 12px; text-wrap:balance; color:#fff;
}
.hp-title span{
  background:linear-gradient(90deg,var(--hp-sky),var(--hp-teal));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hp-sub{ color:var(--hp-muted); font-size:16.5px; line-height:1.5; max-width:480px; margin:0; }
.hp-sub strong{ color:#fff; font-weight:700; }
.hp-panel:is([data-name="padres"],[data-name="desgravamen"]) .hp-sub strong{ color:#ffe199; }
.hp-ctas{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:22px; }
.hp-cta{
  display:inline-flex; align-items:center; gap:8px; min-height:52px; padding:0 26px;
  border-radius:99px; background:#fff; color:#0f2747; font-weight:600; font-size:15.5px;
  text-decoration:none; box-shadow:0 14px 30px -14px rgba(0,0,0,.7);
  transition:transform .15s;
}
.hp-cta:hover{ transform:translateY(-2px); }
.hp-micro{ color:#9fb0cc; font-size:13px; }
/* ---------- navegación inferior ---------- */
.hp-foot{
  display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap;
  margin-top:18px; padding-top:16px; border-top:1px solid rgba(255,255,255,.1);
}
.hp-dots{ display:flex; gap:8px; align-items:center; }
.hp-dots button{
  width:8px; height:8px; border-radius:99px; border:0; padding:0; cursor:pointer;
  background:rgba(255,255,255,.3); transition:width .4s var(--hp-ease), background .3s;
}
.hp-dots button.is-active{ width:28px; background:#fff; }
.hp-hint{ color:#9fb0cc; font-size:12.5px; margin-right:10px; }
.hp-hint .m{ display:none; }

/* ---------- CELULAR: acordeón vertical ---------- */
@media (max-width:767px){
  .hp{ padding:14px 14px 18px; }
  .hp-track{ flex-direction:column; height:auto; gap:8px; align-items:stretch; }
  .hp-panel, .hp-panel.is-active{ flex:none; height:64px; width:100%; transition:height var(--hp-dur) var(--hp-ease); }
  .hp-label{
    writing-mode:horizontal-tb; transform:translateY(-50%);
    left:16px; top:50%; bottom:auto; letter-spacing:.12em; font-size:12px;
  }
  .hp-label i{ transform:none; }
  .hp-panel:not(.is-active)::before{
    content:"+"; position:absolute; right:18px; top:50%; transform:translateY(-50%);
    z-index:2; color:var(--hp-teal); font-size:22px; font-weight:300;
  }
  .hp-art{ width:44%; right:-6%; top:20%; }
  .hp-panel.is-active .hp-art{ opacity:.18; }
  .hp-panel:not(.is-active) .hp-art{ opacity:0; }
  .hp-cta{ padding:0 16px; font-size:15px; white-space:nowrap; }
  .hp-body{ padding:0 18px 22px; }
  .hp-title{ font-size:clamp(28px,8vw,34px); }
  .hp-sub{ font-size:15.5px; }
  .hp-cta{ width:100%; justify-content:center; }
  .hp-micro{ width:100%; text-align:center; margin-top:-6px; }
  .hp-foot{ justify-content:flex-start; }
  .hp-dots{ display:none; }
  .hp-hint .d{ display:none; } .hp-hint .m{ display:inline; }
}
/* trazo animado */
.hp-art [pathLength]{ stroke-dasharray:1; stroke-dashoffset:0; }
@media (prefers-reduced-motion:no-preference){
  .hp-panel.is-active .hp-art :where([pathLength]:not(.a-write,.a-pulse,.a-step)){
    animation:hpDrawLine 1.6s cubic-bezier(.45,.05,.2,1) both;
  }
  @keyframes hpDrawLine{ from{ stroke-dashoffset:1 } to{ stroke-dashoffset:0 } }
}

/* ---------- escena animada de cada banner (gancho de retención) ---------- */
.hp-stat{
  position:relative; z-index:2; flex:none;
  margin:clamp(20px,2.4vw,32px) clamp(22px,2.6vw,40px) 12px;
  width:min(360px,56%); opacity:0; transform:translateY(-8px); pointer-events:none;
  transition:opacity .4s, transform .5s var(--hp-ease);
}
.hp-panel.is-active .hp-stat{ opacity:1; transform:none; transition-delay:.2s; }
.hp-stat-l{ display:block; font-size:11.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:#9fb0cc; transition:color .4s; }
.hp-num{
  display:block; font-family:'Fraunces',Georgia,serif; font-weight:600; line-height:1;
  font-size:clamp(34px,3.6vw,56px); color:var(--hp-teal); margin:6px 0 4px;
  font-variant-numeric:tabular-nums; white-space:nowrap; transition:color .4s;
}
.hp-step{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#dfe7f5; font-variant-numeric:tabular-nums; }
.hp-live{ width:8px; height:8px; border-radius:50%; background:#ff6b5a; box-shadow:0 0 0 0 rgba(255,107,90,.6); animation:hpLive 1.4s infinite; }
@keyframes hpLive{ 70%{ box-shadow:0 0 0 8px rgba(255,107,90,0) } 100%{ box-shadow:0 0 0 0 rgba(255,107,90,0) } }
.hp-bars{ display:flex; gap:4px; align-items:flex-end; height:46px; margin:12px 0 10px; }
.hp-bars span{ flex:1; max-width:22px; border-radius:3px 3px 0 0; background:var(--hp-teal); height:0; transition:height .45s var(--hp-ease), background .5s; }
.hp-bars.is-blue span{ background:#6f97ff; }
.hp-ticks{ display:flex; gap:3px; margin:14px 0 12px; }
.hp-ticks span{ flex:1; height:16px; border-radius:2px; background:rgba(255,255,255,.12); transition:background .3s; }
.hp-ticks span.on{ background:var(--hp-teal); }
.hp-punch{
  display:block; font-family:'Fraunces',Georgia,serif; font-style:italic; font-size:clamp(16px,1.4vw,20px);
  color:#fff; opacity:0; transform:translateY(6px); transition:opacity .5s, transform .5s var(--hp-ease); min-height:1.3em;
}
.hp-punch.is-on{ opacity:1; transform:none; }
.hp-punch--highlight{ color:#ffe199; font-size:clamp(19px,1.85vw,24px); font-weight:700; }
[data-scene="desgravamen"] .hp-punch--highlight{ width:max-content; max-width:100%; }
.hp-note{ display:block; color:#8597b5; font-size:11px; line-height:1.35; margin-top:8px; max-width:320px; }

/* Reparto del descuento de AFP y opciones de jubilación. */
.hp-stat--retirement{ width:min(390px,calc(100% - 2 * clamp(22px,2.6vw,40px))); }
.hp-afp-chart{ margin:8px 0 12px; }
.hp-afp-meter{ height:12px; overflow:hidden; border-radius:6px; background:rgba(255,255,255,.12); }
.hp-afp-segments{
  display:grid; grid-template-columns:10fr 1.69fr 1.37fr; height:100%;
  transform-origin:left;
}
.hp-afp-segments span:nth-child(1),.hp-afp-legend li:nth-child(1)::before{ background:var(--hp-teal); }
.hp-afp-segments span:nth-child(2),.hp-afp-legend li:nth-child(2)::before{ background:#ff9b85; }
.hp-afp-segments span:nth-child(3),.hp-afp-legend li:nth-child(3)::before{ background:var(--hp-sky); }
.hp-afp-legend{
  display:flex; flex-wrap:wrap; gap:4px 12px; list-style:none;
  margin:6px 0 0; padding:0; font-size:11px; color:#dfe7f5;
}
.hp-afp-legend li{ display:flex; align-items:center; gap:4px; }
.hp-afp-legend li::before{ content:""; width:7px; height:7px; border-radius:50%; }
.hp-afp-legend b{ color:#fff; }
.hp-afp-legend li:first-child{ flex-basis:100%; font-size:clamp(15px,1.4vw,18px); }
.hp-afp-legend li:first-child b{ color:#a2edcf; }
.hp-retirement-line{
  display:grid; grid-template-columns:22px minmax(0,1fr); align-items:start; gap:8px;
  margin-top:7px; font-size:12.5px; line-height:1.38; color:#e5edf9;
}
.hp-retirement-line b{ color:#fff; }
.hp-retirement-line strong{ color:#ffe199; }
.hp-onp-bars,.hp-return-icon{ display:grid; place-content:center; min-height:18px; }
.hp-onp-bars{ align-items:end; grid-auto-flow:column; gap:3px; }
.hp-onp-bars::before,.hp-onp-bars::after{ content:""; width:5px; border-radius:2px 2px 0 0; }
.hp-onp-bars::before{ height:12px; background:#ff9b85; }
.hp-onp-bars::after{ height:5px; background:#ff9b85; }
.hp-return-icon{ font-size:18px; line-height:1; color:var(--hp-teal); }
.hp-stat--retirement .hp-note{ max-width:none; color:#c1cfe4; }

@media (min-width:768px){
  .hp-track{
    container-type:inline-size;
    --hp-panel-height:clamp(600px,82vh,780px);
    /* El ancho final se mantiene mientras el panel se expande de lado. */
    --hp-open-width:calc((100cqw - 40px) * 4.2 / 8.2);
    height:auto;
    min-height:var(--hp-panel-height);
  }
  .hp-panel{ height:calc(var(--hp-panel-height) * .82); }
  .hp-panel.is-active{ height:auto; min-height:var(--hp-panel-height); }
  .hp-body{ width:var(--hp-open-width); }
  .hp-stat{ width:min(360px,calc(var(--hp-open-width) * .56)); }
  .hp-stat--retirement{ width:min(390px,calc(var(--hp-open-width) - 2 * clamp(22px,2.6vw,40px))); }
}
/* subtítulo distinto en celular */
.hp-sub .hp-m{ display:none; }

/* ---------- ilustraciones en movimiento (solo panel abierto) ---------- */
.hp-panel.is-active .a-write{ animation:hpWrite 2.4s ease-in-out infinite; }
.hp-panel.is-active .a-w2{ animation-delay:.4s } .hp-panel.is-active .a-w3{ animation-delay:.8s }
@keyframes hpWrite{ 0%{stroke-dashoffset:1} 45%,80%{stroke-dashoffset:0} 100%{stroke-dashoffset:-1} }
.hp-panel.is-active .a-spin{ animation:hpSpin 6s linear infinite; }
@keyframes hpSpin{ to{ transform:rotate(-360deg) } }
.hp-panel.is-active .a-float{ animation:hpFloat 3.5s ease-in-out infinite alternate; }
@keyframes hpFloat{ to{ transform:translateY(-5px) } }
.hp-panel.is-active .a-step{ animation:hpStep 3s ease-in-out infinite; }
.hp-panel.is-active .a-s2{ animation-delay:.3s } .hp-panel.is-active .a-s3{ animation-delay:.6s }
@keyframes hpStep{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-3px) } }
.hp-art .a-pulse{ stroke-dasharray:.25 .75; stroke-dashoffset:1; }
.hp-panel.is-active .hp-art .a-pulse{ animation:hpPulse 2.2s linear infinite; stroke-dasharray:.25 .75; transition:none; }
@keyframes hpPulse{ from{ stroke-dashoffset:1 } to{ stroke-dashoffset:0 } }
.hp-panel.is-active .a-beat{ animation:hpBeat 1.3s ease-in-out infinite; }
@keyframes hpBeat{ 0%,100%{ transform:scale(1) } 15%{ transform:scale(1.18) } 30%{ transform:scale(1) } 45%{ transform:scale(1.1) } }
.hp-panel.is-active .a-sun{ animation:hpSun 7s ease-in-out infinite; }
@keyframes hpSun{ 0%{ transform:translateY(-6px) } 80%,100%{ transform:translateY(16px) } }
.hp-panel.is-active .a-wave{ animation:hpWave 6s linear infinite; }
@keyframes hpWave{ to{ transform:translateX(46px) } }

@media (max-width:767px){
  .hp-stat{ margin:16px 18px 8px; width:auto; }
  .hp-num{ font-size:clamp(34px,10vw,44px); margin:6px 0 4px; }
  .hp-bars{ height:34px; margin:8px 0 6px; }
  .hp-ticks{ margin:8px 0 8px; }
  .hp-note{ font-size:10.5px; }
  .hp-sub .hp-d{ display:none; } .hp-sub .hp-m{ display:inline; }
  .hp-panel.is-active .hp-art{ opacity:.14; }
}

/* ---------- Tu familia: ahorros que se acaban ---------- */
.hp-drain{ height:10px; border-radius:99px; background:rgba(255,255,255,.08); overflow:hidden; margin:10px 0 10px; }
.hp-drain em{ display:block; height:100%; width:100%; border-radius:99px; background:var(--hp-teal); transition:background .5s; }
.hp-drain.is-low em{ background:#ff9b85; }
.hp-punchs{ display:grid; }
.hp-punchs > .hp-punch{ grid-area:1/1; }
.hp-punch--q{ font-size:clamp(18px,1.7vw,24px); color:#ffb3a3; }
.hp-mini{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:10px; opacity:0; transform:translateY(6px); transition:opacity .5s, transform .5s var(--hp-ease); }
.hp-mini.is-on{ opacity:1; transform:none; }
.hp-mini div{ display:grid; gap:3px; font-size:10.5px; color:#9fb0cc; }
.hp-mini i{ display:block; height:22px; border-radius:4px; background:rgba(255,255,255,.14); }
.hp-mini b{ font-weight:600; color:#c6d0e0; font-size:10.5px; }
.hp-mini .is-life i{ background:var(--hp-teal); }
.hp-mini .is-life b{ color:var(--hp-teal); }
.hp-panel[data-name="proteccion"].is-low .hp-art .a-pulse{ animation-duration:4.8s; opacity:.35; }
@media (max-width:767px){
  .hp-drain{ margin:6px 0 6px; }
  .hp-mini{ margin-top:6px; gap:6px; }
  .hp-mini i{ height:14px; }
}
.hp-panel[data-name="proteccion"] .hp-num.is-down{ color:#ff9b85; }
.hp-punchs > .hp-punch:not(.is-on),.hp-mini:not(.is-on){ visibility:hidden; }
.hp-panel[data-name="proteccion"]:not(.is-active) :is(.hp-punch,.hp-mini){ visibility:hidden; }

@media (prefers-reduced-motion:reduce){
  .hp *{ transition:none !important; animation:none !important; }
}

/* Separación del encabezado fijo en la portada. */
.hp{position:relative;padding-top:calc(var(--mobile-header-height,94px) + clamp(20px,3vw,40px))}
.hp-panel:not(.is-active) .hp-body{visibility:hidden}
.hp-cta:focus-visible,.hp-dots button:focus-visible{outline:2px solid var(--hp-sky);outline-offset:4px}
@media(max-width:767px){
  html{overflow-x:clip}
  .hp{padding-top:calc(var(--mobile-header-height,94px) + 14px)}
  .hp-panel.is-active{height:auto;min-height:min(570px,78svh)}
  .hp-cta{white-space:normal;text-align:center;line-height:1.3;padding-block:10px}
}

/* Una sola foto alineada en ambas capas del conjunto de paneles. */
.hp-track{
  position:relative;
  isolation:isolate;
  --hp-watermark:url("../imagenes/luis-jose-alarcon.jpg");
}
.hp-track::before,.hp-track::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  border-radius:20px;
  background:var(--hp-watermark) center 38% / cover no-repeat;
  pointer-events:none;
}
.hp-track::before{
  filter:grayscale(1);
  opacity:.26;
}
.hp-track::after{
  opacity:.56;
  clip-path:var(--hp-color-window,inset(100%));
}
.hp-panel{background:#1737563d}
.hp-panel.is-active{background:#17375614}
.hp-panel.is-active::after{
  background:linear-gradient(180deg,#06102008 10%,#0610207d 48%,#061020f0 100%);
}
@media(max-width:767px){
  .hp-track::before,.hp-track::after{background-position:center 30%}
  .hp-track::before{opacity:.20}
  .hp-track::after{opacity:.48}
}

.hp-panel:not(.is-active) .hp-stat{visibility:hidden}
