/* Vive Postgrado UPSE · recorrido de 6 maestrías */
:root {
  --navy: #122C45;
  --abyss: #021226;
  --abyss-2: #061E37;
  --panel: rgba(3, 20, 38, 0.9);
  --gold: #F9B435;
  --gold-hi: #FFC657;
  --gold-soft: #FFD27A;
  --text: #F4F7FB;
  --muted: #AEBBCB;
  --line: rgba(255, 255, 255, 0.14);
  --line-gold: rgba(249, 180, 53, 0.32);
  --radius: 16px;
  --head: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --pad-x: clamp(18px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.is-loading, html.is-loading body { overflow: hidden; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.4em;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 1.0625rem/1.1 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-hi); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-gold); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn--sm { min-height: 44px; padding: .55em 1.05em; font-size: .975rem; }
.btn--lg { min-height: 56px; padding: .8em 1.8em; font-size: 1.15rem; }
.ico { width: 1.2em; height: 1.2em; flex: none; }

/* ---------- Cargador ---------- */
.loader {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--abyss);
  transition: opacity .7s ease, visibility 0s linear .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__vive { width: min(560px, 78vw); height: auto; }
.loader__pct { font: 800 clamp(2.2rem, 5vw, 3rem)/1 var(--head); letter-spacing: -.01em; }
.loader__pct small { font-size: .45em; color: var(--gold); margin-left: 2px; }
.loader__label { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
html:not(.js) .loader { display: none; }

/* ---------- Encabezado ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 76px;
  display: flex; align-items: center; gap: 28px; padding: 0 var(--pad-x);
  background: linear-gradient(to bottom, rgba(2, 18, 38, .9), rgba(2, 18, 38, 0));
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-solid { background: rgba(2, 18, 38, .96); box-shadow: 0 1px 0 var(--line); }
.brand { display: block; transition: opacity .4s; }
.brand img { height: 44px; width: auto; }
.at-intro .brand { opacity: 0; pointer-events: none; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .98rem; padding: 12px 0; }
.nav a:hover { color: var(--text); }

/* ---------- Recorrido ---------- */
.journey { position: relative; height: 920vh; }
.journey__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--abyss) url(../assets/poster.webp) center / cover no-repeat; }
.js .journey__sticky { background-image: none; }
#journeyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.journey__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(2, 18, 38, 0) 55%, rgba(2, 18, 38, .7) 100%),
    linear-gradient(to top, rgba(2, 18, 38, .95) 0%, rgba(2, 18, 38, .55) 22%, rgba(2, 18, 38, 0) 42%);
}
.journey__stages { position: absolute; inset: 0; }

.stage {
  position: absolute; inset: 0;
  display: flex;
  padding: 104px var(--pad-x) clamp(24px, 5vh, 56px);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .4s ease, transform .4s ease, visibility 0s linear .4s;
}
.stage.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .55s ease .05s, transform .55s ease .05s, visibility 0s;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 .8rem/1.2 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}
.eyebrow__num { color: var(--text); letter-spacing: .1em; }
.eyebrow__num::after { content: ''; display: inline-block; width: 36px; height: 1px; background: var(--line-gold); margin-left: 12px; vertical-align: middle; }

/* Escena 1 y 5 */
.stage--intro, .stage--close { align-items: center; }
.stage--intro::before, .stage--close::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 18, 38, .94) 0%, rgba(2, 18, 38, .7) 34%, rgba(2, 18, 38, 0) 58%);
}
.intro { position: relative; max-width: 520px; }
.intro__logo { width: clamp(210px, 20vw, 290px); height: auto; margin-bottom: 26px; }
.intro__title { font-weight: 800; font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.06; letter-spacing: -.015em; }
.intro__data { margin-top: 14px; color: var(--muted); font-size: 1.02rem; }
.intro__actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

.ilist { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.ilist__label { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.ilist ul { list-style: none; padding: 0; margin: 0; }
.ilist a {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600;
}
.ilist a b { color: var(--gold-soft); font-weight: 600; }
.ilist a:hover span { color: var(--gold-soft); }

.close__title { font-weight: 800; font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.08; letter-spacing: -.015em; margin-top: 14px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; color: var(--muted); }
.steps li::before {
  content: counter(s); width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-gold); color: var(--gold); font-weight: 600;
}
.steps b { color: var(--text); font-weight: 600; }

/* Escenas de pareja */
.stage--pair { flex-direction: column; justify-content: space-between; }
.stage__head { text-align: center; max-width: 760px; margin: 0 auto; text-shadow: 0 2px 18px rgba(2, 18, 38, .9), 0 1px 3px rgba(2, 18, 38, .8); }
.stage__title { font-weight: 800; font-size: clamp(1.9rem, 3.1vw, 2.9rem); line-height: 1.08; letter-spacing: -.015em; margin-top: 10px; }
.stage__text { color: var(--muted); margin-top: 10px; }
.stage__cards { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }

.jcard {
  width: min(400px, 31vw);
  background: var(--panel); border: 1px solid var(--line-gold); border-radius: var(--radius);
  padding: 18px 20px 20px;
}
.jcard__name { font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.jcard__mencion { color: var(--muted); margin: 4px 0 12px; }
.jcard__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .86rem; line-height: 1; padding: .45em .8em; border-radius: 999px; border: 1px solid var(--line); }
.chip--price { color: var(--gold-soft); border-color: var(--line-gold); background: rgba(249, 180, 53, .12); font-weight: 600; }

/* Puntos y pista */
.journey__dots { position: absolute; right: clamp(8px, 1.6vw, 24px); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.journey__dots button { width: 44px; height: 32px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; padding: 0; }
.journey__dots button::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .55); transition: background-color .3s, border-color .3s, transform .3s; }
.journey__dots button[aria-current]::before { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }

.journey__hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
  transition: opacity .4s;
}
.journey__hint span { width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); }
.journey:not([data-stage="0"]) .journey__hint { opacity: 0; }

/* ---------- Bloques ---------- */
.block { padding: clamp(80px, 12vh, 140px) var(--pad-x); }
.block__head { max-width: 760px; margin-bottom: 44px; }
.block__title { font-weight: 800; font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.08; letter-spacing: -.015em; margin-top: 12px; }
.block__text { color: var(--muted); margin-top: 14px; font-size: 1.1rem; }

.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pcard {
  display: flex; flex-direction: column;
  background: var(--abyss-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 24px; scroll-margin-top: 96px;
  transition: border-color .25s;
}
.pcard:hover { border-color: var(--line-gold); }
.pcard__name { font-weight: 800; font-size: 1.3rem; line-height: 1.2; margin-top: 12px; }
.pcard__mencion { color: var(--muted); margin: 4px 0 14px; }
.pcard__text { color: var(--muted); margin-top: 16px; flex: 1; }
.pcard__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.block--cta {
  text-align: center; border-top: 1px solid var(--line);
  background: radial-gradient(80% 120% at 50% 0%, rgba(18, 44, 69, .9), rgba(2, 18, 38, 0) 70%);
  display: flex; flex-direction: column; align-items: center;
}
.block--cta .block__text { max-width: 560px; }
.cta__number { margin: 26px 0 22px; font: 800 clamp(1.8rem, 4vw, 2.8rem)/1 var(--head); letter-spacing: .01em; }
.cta__number a { text-decoration: none; color: var(--gold); }
.cta__number a:hover { color: var(--gold-hi); }

/* ---------- Pie ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 28px var(--pad-x); border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem;
}
.footer__brand { display: flex; align-items: center; gap: 18px; }
.footer__brand img { height: 44px; width: auto; }
.footer__credit a { color: var(--gold-soft); text-decoration: none; font-weight: 600; }
.footer__credit a:hover { text-decoration: underline; }

/* ---------- Diálogo ---------- */
.dlg {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line-gold); border-radius: 18px;
  background: #071F38; color: var(--text);
}
.dlg::backdrop { background: rgba(1, 10, 20, .75); }
.dlg__inner { position: relative; padding: 32px clamp(20px, 4vw, 40px) 32px; }
.dlg__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.dlg__close:hover { border-color: var(--gold); color: var(--gold); }
.dlg__title { font-weight: 800; font-size: clamp(1.45rem, 2.6vw, 1.9rem); line-height: 1.15; margin: 10px 48px 20px 0; }
.dlg__sub { font: 600 .8rem/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 24px 0 8px; }
.dlg p { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.malla { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.malla__pao { font-weight: 600; color: var(--text) !important; margin-bottom: 6px; }
.malla ol { margin: 0; padding-left: 1.2em; color: var(--muted); display: grid; gap: 6px; }
.dlg__actions { margin-top: 28px; }

/* ---------- Sin JavaScript ---------- */
html:not(.js) .journey { height: auto; }
html:not(.js) .journey__sticky { position: relative; height: auto; }
html:not(.js) .journey__stages, html:not(.js) .stage { position: relative; }
html:not(.js) .stage { opacity: 1; visibility: visible; transform: none; min-height: 100vh; }
html:not(.js) .journey__dots, html:not(.js) .journey__hint, html:not(.js) #journeyCanvas { display: none; }

/* ---------- Tableta ---------- */
@media (max-width: 1100px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jcard { width: min(360px, 40vw); }
}

/* ---------- Móvil ---------- */
@media (max-width: 899px) {
  .site-header { height: 64px; gap: 12px; }
  .brand img { height: 36px; }
  .nav { display: none; }
  .header__cta { margin-left: auto; }
  .journey { height: 780vh; }
  .journey__dots { display: none; }
  .journey__shade {
    background:
      linear-gradient(to bottom, rgba(2, 18, 38, .85) 0%, rgba(2, 18, 38, 0) 18%),
      linear-gradient(to top, rgba(2, 18, 38, .98) 0%, rgba(2, 18, 38, .9) 44%, rgba(2, 18, 38, 0) 62%);
  }
  .stage { padding: 78px 16px 18px; }
  .stage--intro, .stage--close { align-items: flex-end; }
  .stage--intro::before, .stage--close::before { display: none; }
  .intro { max-width: none; width: 100%; }
  .intro__logo { display: none; }
  .intro__title { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .intro__data { font-size: .92rem; margin-top: 8px; }
  .ilist { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .ilist__label { font-size: .66rem; margin-bottom: 0; }
  .ilist a { padding: 5px 0; font-size: .95rem; min-height: 0; }
  .intro__actions { margin-top: 16px; }
  .intro__actions .btn { width: 100%; }
  .close__title { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .steps { margin-top: 14px; gap: 8px; font-size: .95rem; }

  .stage--pair { justify-content: space-between; }
  .stage__title { font-size: clamp(1.5rem, 6.4vw, 2rem); margin-top: 6px; }
  .stage__text { display: none; }
  .stage__cards { flex-direction: column; align-items: stretch; gap: 10px; }
  .jcard { width: auto; padding: 12px 14px 14px; }
  .jcard__name { font-size: 1.02rem; }
  .jcard__mencion { font-size: .9rem; margin: 2px 0 8px; }
  .jcard__actions { margin-top: 10px; }
  .jcard__actions .btn { flex: 1 1 auto; white-space: nowrap; }
  .at-intro .brand { opacity: 1; pointer-events: auto; }
  .chip { font-size: .8rem; }

  .pgrid { grid-template-columns: 1fr; }
  .facts, .malla { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 899px) and (max-height: 740px) {
  .intro__data, .jcard__mencion { display: none; }
  .ilist__label { display: none; }
  .ilist { grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .ilist a { font-size: .85rem; }
  .ilist a b { display: none; }
}
@media (max-width: 380px) {
  .header__cta span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage, .stage.is-active, .loader, .btn { transition: none; }
}
