@font-face {
  font-family: 'Montserrat';
  font-weight: 100 900;
  font-display: block;
  src: url('fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB;
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 100 900;
  font-display: block;
  src: url('fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212;
}

/*
 * Paleta neutra: fondo gris claro, tarjetas blancas, gris pizarra y un azul apagado. Los únicos colores vivos son los del
 * logo. Para cambiar el aspecto, basta con estas variables (y los colores de nivel, que están en content.js).
 */
:root {
  --bg: #e8eaed;
  --card: #ffffff;
  --line: #dde0e5;
  --ink: #1f2733;
  --soft: #5d6776;
  --blue: #3a6890;
  --navy: #2b4561;
  --dark: #222b37;
  --muted: #b4bcc7;
  --green: #3f7c62;
  --red: #b25a51;
  --shadow: 0 1px 3px rgba(31, 39, 51, 0.09);
  --radius: 10px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Los gestos los maneja el showroom: sin «atrás» del navegador al deslizar (queda el zoom con dos dedos). */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: pinch-zoom; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- fondo ------------------------------------------------------------------------------------------------------- */

/* Las líneas del campo, muy suaves. */
#background { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
#pitch {
  position: absolute; left: 5%; top: 5%; width: 90%; height: 90%;
  fill: none; stroke: #dcdfe4; stroke-width: 2.5;
  transition: transform 1.4s var(--ease);
}
/* Portada y cierre: panel lateral con el área. Va fuera del lienzo para llegar siempre hasta el borde de la ventana. */
#side { position: fixed; top: 0; right: 0; bottom: 0; width: 32vw; background: var(--dark); transform: translateX(100%); transition: transform 0.8s var(--ease); }
body[data-slide='portada'] #side, body[data-slide='cierre'] #side { transform: none; }
#side svg { width: 100%; height: 100%; fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 3; }
#side circle { fill: #fff; stroke: none; }

/* ---- lienzo y transiciones -------------------------------------------------------------------------------------- */

#stage { position: fixed; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: center; }
.slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transform: translateX(70px);
  transition: opacity 0.3s, transform 0.6s var(--ease), visibility 0s 0.6s;
}
.slide.past { transform: translateX(-70px); }
.slide.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.45s 0.1s, transform 0.7s var(--ease) 0.05s, visibility 0s;
}
.slide .in {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease), background-color 0.2s, border-color 0.2s;
}
.slide.active .in { opacity: 1; transform: none; transition-delay: calc(var(--d, 0) * 80ms + 140ms); }

/* ---- tipografía y piezas comunes -------------------------------------------------------------------------------- */

.head { position: absolute; left: 90px; top: 66px; right: 330px; }
.kicker { font-size: 18px; font-weight: 700; color: var(--blue); }
.head h1 { margin-top: 10px; font-size: 44px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.lead { position: absolute; left: 90px; right: 330px; top: 192px; font-size: 21px; line-height: 1.55; color: var(--soft); }
.tag { position: absolute; right: 90px; top: 70px; font-size: 15px; font-weight: 500; color: var(--soft); }
.mega { font-size: 144px; font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.mega-label { margin-top: 10px; font-size: 21px; font-weight: 500; color: var(--soft); }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.mini b { display: block; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini div > span { display: block; font-size: 15px; line-height: 1.35; color: var(--soft); }
.note { margin-top: 22px; font-size: 15px; line-height: 1.5; color: var(--soft); }
.empty { margin-top: 30px; font-size: 18px; line-height: 1.5; color: var(--soft); }
.nodata { display: inline-block; font-size: 22px; font-weight: 500; letter-spacing: 0; color: var(--soft); }
.mega .nodata { font-size: 40px; }

/* Las tarjetas blancas sobre el fondo gris. */
.panel, .toc, .census-card, .census-side, .level-can, .level-needs, .exam-card, .exam-chip, .flow li, .radar-wrap, .improve, .jump-side, .weights {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---- portada y cierre ------------------------------------------------------------------------------------------- */

.cover { position: absolute; left: 90px; top: 0; bottom: 0; width: 940px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.cover .logo { width: 500px; margin-bottom: 60px; }
.cover h1 { font-size: 76px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.cover .sub { margin-top: 28px; font-size: 25px; font-weight: 500; color: var(--soft); }
.hint { position: absolute; left: 0; bottom: 86px; font-size: 15px; color: var(--soft); }

/* ---- índice ----------------------------------------------------------------------------------------------------- */

.toc { position: absolute; left: 90px; right: 90px; top: 206px; display: flex; flex-direction: column; padding: 8px 28px; }
.toc button { display: grid; grid-template-columns: 70px 560px 1fr; align-items: center; height: 86px; text-align: left; }
.toc button + button { border-top: 1px solid var(--line); }
.toc em { font-style: normal; font-size: 24px; font-weight: 700; color: var(--blue); padding-left: 8px; }
.toc strong { font-size: 28px; font-weight: 700; }
.toc span { font-size: 18px; color: var(--soft); }
.slide.active .toc button:hover { background: #f4f5f7; transition-delay: 0s; }

/* ---- árbitros: un punto por persona ------------------------------------------------------------------------------ */

.slide-censo .head .s0, .slide-censo .head .s1 { display: inline-block; transition: opacity 0.35s, transform 0.5s var(--ease); }
.slide-censo .head .s1 { position: absolute; left: 0; opacity: 0; transform: translateY(18px); white-space: nowrap; }
.slide-censo[data-step='1'] .head .s0 { opacity: 0; transform: translateY(-18px); }
.slide-censo[data-step='1'] .head .s1 { opacity: 1; transform: none; }
.census-side { position: absolute; left: 90px; top: 206px; width: 520px; height: 618px; padding: 44px 40px; }
.census-side .mega { font-size: 168px; }
.census-card { position: absolute; left: 634px; top: 206px; width: 876px; height: 618px; }
.dots i {
  position: absolute; left: 0; top: 0; border-radius: 50%; opacity: 0;
  transform: translate(calc(var(--x) * 1.5 - 550px), calc(var(--y) * 1.6 - 270px)) translate(-50%, -50%) scale(0.3);
  transition: transform 1s var(--ease), opacity 0.5s;
  transition-delay: calc(var(--i) * 3ms);
}
.slide.active .dots i { opacity: 1; transform: translate(var(--x), var(--y)) translate(-50%, -50%); transition-delay: calc(var(--i) * 5ms + 150ms); }
.slide.active[data-step='1'] .dots i { transform: translate(var(--x2), var(--y2)) translate(-50%, -50%); transition-delay: calc(var(--i) * 3ms); }
.dot-labels div { position: absolute; text-align: center; opacity: 0; transform: translateY(14px); border-top: 2px solid var(--line); padding-top: 8px; transition: opacity 0.35s, transform 0.5s var(--ease); }
.dot-labels b { display: block; font-size: 30px; font-weight: 700; }
.dot-labels span { font-size: 15px; color: var(--soft); }
.slide.active[data-step='1'] .dot-labels div { opacity: 1; transform: none; transition-delay: calc(var(--d) * 80ms + 450ms); }

/* ---- categorías -------------------------------------------------------------------------------------------------- */

.stairs { position: absolute; left: 90px; right: 90px; top: 186px; height: 128px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; }
.stair {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 0 20px; text-align: left;
  background: var(--card); border-radius: var(--radius) var(--radius) 4px 4px; box-shadow: var(--shadow); border-top: 5px solid var(--c);
}
.stair span { font-size: 21px; font-weight: 700; }
.stair small { font-size: 14px; color: var(--soft); }
.stair.on { background: var(--c); color: #fff; }
.stair.on small { color: #fff; opacity: 0.85; }
.level { position: absolute; left: 90px; right: 90px; top: 334px; bottom: 56px; display: grid; grid-template-columns: 400px 1fr; gap: 24px; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s; }
.level.on { opacity: 1; visibility: visible; transition: opacity 0.35s 0.05s; }
.level-can, .level-needs { padding: 24px 30px; min-height: 0; }
.level h2 { font-size: 46px; font-weight: 800; letter-spacing: -0.02em; color: var(--c); }
.level h3 { font-size: 16px; font-weight: 700; color: var(--soft); padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.level-can h3 { margin-top: 20px; }
.level-can ul { list-style: none; }
.level-can li { position: relative; padding: 15px 0 15px 26px; font-size: 22px; font-weight: 500; }
.level-can li + li { border-top: 1px solid var(--line); }
.level-can li::before { content: ''; position: absolute; left: 0; top: 50%; width: 11px; height: 11px; margin-top: -5px; border-radius: 3px; background: var(--c); }
.level-needs dl > div { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.level-needs dl > div:last-child { border-bottom: 0; }
.level-needs dt { font-size: 15px; font-weight: 700; color: var(--c); }
.level-needs dd { font-size: 17px; line-height: 1.4; }
.level-needs .note { margin-top: 12px; }
.level li, .level-needs dl > div { opacity: 0; transform: translateX(-14px); transition: opacity 0.3s, transform 0.4s var(--ease); }
.level.on li, .level.on .level-needs dl > div { opacity: 1; transform: none; transition-delay: calc(var(--k) * 55ms + 100ms); }

/* ---- exámenes ---------------------------------------------------------------------------------------------------- */

.exam-cards { position: absolute; left: 90px; right: 90px; top: 244px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.exam-card { padding: 16px 16px 20px; }
.exam-card h3 { font-size: 23px; font-weight: 700; margin: 16px 8px 0; }
.exam-card p { margin: 6px 8px 0; font-size: 15px; line-height: 1.45; color: var(--soft); min-height: 44px; }
.mock { height: 184px; background: #eff1f4; border-radius: 6px; padding: 18px; overflow: hidden; }
.line { display: block; height: 10px; border-radius: 3px; background: #c9cfd8; margin-bottom: 10px; }
.w45 { width: 45%; } .w55 { width: 55%; } .w70 { width: 70%; } .w80 { width: 80%; }
.option { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; }
.option b { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--soft); flex: none; }
.option .line { margin: 0; flex: none; }
.slide.active .option.o2 { animation: choose 4s 1.4s infinite; }
.slide.active .option.o2 b { animation: tick 4s 1.4s infinite; }
@keyframes choose { 0%, 20% { border-color: var(--line); background: var(--card); } 28%, 85% { border-color: var(--green); background: #e6efea; } 100% { border-color: var(--line); } }
@keyframes tick { 0%, 20% { background: none; } 28%, 85% { background: var(--green); border-color: var(--green); } 100% { background: none; } }
.answer { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 14px; }
.type { display: block; height: 7px; border-radius: 3px; background: var(--navy); margin-bottom: 9px; width: 0; }
.slide.active .type { animation: type 5s calc(var(--k) * 0.7s + 0.8s) infinite both; }
@keyframes type { 0% { width: 0; } 20%, 90% { width: var(--w); } 100% { width: 0; } }
.screen { position: relative; height: 122px; border-radius: 4px; background: var(--navy); overflow: hidden; }
.screen::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid rgba(255, 255, 255, 0.4); }
.screen::after { content: ''; position: absolute; width: 124px; height: 124px; right: -62px; top: -1px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); }
.vball { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; left: 8%; top: 70%; }
.slide.active .vball { animation: rally 4s ease-in-out infinite alternate; }
@keyframes rally { 30% { left: 36%; top: 24%; } 60% { left: 58%; top: 66%; } 100% { left: 88%; top: 42%; } }
.play { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px; border-radius: 50%; background: #fff; }
.play::after { content: ''; position: absolute; left: 16px; top: 11px; border-left: 15px solid var(--navy); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.track { margin-top: 12px; height: 5px; background: #d3d8df; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--blue); }
.slide.active .track i { animation: progress 8s linear infinite; }
@keyframes progress { to { width: 100%; } }
.exam-path { position: absolute; left: 90px; right: 90px; top: 592px; display: flex; gap: 12px; }
.exam-chip { flex: 1; min-width: 0; padding: 18px 16px 20px; }
.exam-chip b { display: block; font-size: 28px; font-weight: 800; color: var(--navy); }
.exam-chip span { display: block; margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.3; min-height: 54px; }
.exam-chip small { display: block; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; color: var(--soft); }

/* ---- cifras y gráficos ------------------------------------------------------------------------------------------- */

.grid3 { position: absolute; left: 90px; right: 90px; top: 206px; bottom: 76px; display: grid; grid-template-columns: 1.05fr 1fr 1.15fr; gap: 24px; }
.panel { padding: 40px 36px; min-width: 0; }
.panel.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.panel h3 { font-size: 17px; font-weight: 700; color: var(--soft); margin-bottom: 22px; }
.donut { position: relative; }
.ring circle { fill: none; }
.ring-bg { stroke: #e9ebee; }
.arc { stroke-dasharray: 0 var(--c); transition: stroke-dasharray 1.4s var(--ease); }
.slide.active .arc { stroke-dasharray: var(--len) var(--c); transition-delay: 0.4s; }
.donut-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-in b { font-size: 54px; font-weight: 800; font-variant-numeric: tabular-nums; }
.donut-in > span { font-size: 15px; line-height: 1.35; color: var(--soft); max-width: 170px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 24px; font-size: 14px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 3px; background: var(--c); }
.big-line { margin-top: 24px; font-size: 17px; color: var(--soft); }
.big-line b { color: var(--ink); font-size: 27px; font-weight: 700; margin: 0 3px; }
.big-line + .big-line { margin-top: 14px; }
.columns { display: flex; gap: 12px; align-items: flex-end; }
.col { flex: 1; min-width: 0; text-align: center; }
.col b { display: block; font-size: 17px; margin-bottom: 8px; }
.col-track { display: flex; align-items: flex-end; border-bottom: 2px solid var(--line); }
.col-track i { display: block; width: 100%; height: 100%; border-radius: 4px 4px 0 0; transform-origin: bottom; transform: scaleY(0); transition: transform 1.1s var(--ease); }
.slide.active .col-track i { transform: scaleY(var(--v)); transition-delay: calc(var(--d) * 80ms + 400ms); }
.col span { display: block; margin-top: 10px; font-size: 13px; color: var(--soft); white-space: nowrap; }
.columns.dense { gap: 4px; }
.dense .col b { font-size: 12px; }
.dense .col span { font-size: 11px; letter-spacing: -0.03em; }
.bars { display: flex; flex-direction: column; gap: 22px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: end; }
.bar-label { font-size: 15px; font-weight: 500; }
.bar-row b { font-size: 16px; font-weight: 700; }
.bar-row .bar { grid-column: 1 / -1; }
.bar { display: block; position: relative; height: 8px; border-radius: 4px; background: #e9ebee; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.slide.active .bar-row .bar i { transform: scaleX(var(--v)); transition-delay: calc(var(--d) * 90ms + 450ms); }
/* dos valores: en claro quienes han hecho la teoría y, encima, quienes además tienen la práctica */
.bar.two u { position: absolute; left: 0; top: 0; bottom: 0; background: var(--muted); }
.bar.two i { position: relative; width: 100%; background: var(--green); }

/* ---- pasos numerados --------------------------------------------------------------------------------------------- */

.flow { position: absolute; left: 90px; right: 90px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 36px; list-style: none; }
/* La línea pasa por detrás de las tarjetas: se ve en los huecos, uniéndolas. */
.flow-line { position: absolute; left: 30px; right: 30px; top: 55px; height: 2px; background: #cfd3da; }
.flow-line i { display: block; height: 100%; background: var(--navy); transform-origin: left; transform: scaleX(0); transition: transform 2s cubic-bezier(0.5, 0, 0.3, 1); }
.slide.active .flow-line i { transform: scaleX(1); transition-delay: 0.4s; }
.flow li { position: relative; padding: 28px 28px 32px; min-height: 270px; }
.flow .num { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 22px; font-weight: 700; }
.flow h3 { margin-top: 28px; font-size: 23px; font-weight: 700; }
.flow p { margin-top: 10px; font-size: 16px; line-height: 1.6; color: var(--soft); }

/* ---- radar ------------------------------------------------------------------------------------------------------- */

.radar-wrap { position: absolute; left: 90px; top: 206px; width: 850px; height: 618px; padding: 8px 45px; }
.radar-grid { fill: none; stroke: #d6dae0; stroke-width: 1.2; }
.radar-data { transform: scale(0); transition: transform 1.1s var(--ease); }
.slide.active .radar-data { transform: scale(1); transition-delay: 0.4s; }
.radar-area { fill: rgba(58, 104, 144, 0.18); stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; }
.radar-dot { fill: var(--navy); }
.radar-label { fill: var(--soft); font-size: 15px; font-weight: 500; }
.radar-value { fill: var(--ink); font-size: 18px; font-weight: 700; }
.improve { position: absolute; right: 90px; top: 206px; width: 546px; height: 618px; padding: 40px 36px; }
.improve h3 { font-size: 20px; font-weight: 700; margin-bottom: 30px; }

/* ---- criterios de cada categoría --------------------------------------------------------------------------------- */

.jump-tabs { position: absolute; left: 90px; right: 90px; top: 188px; display: flex; gap: 10px; }
.jump-tabs button { padding: 12px 20px; font-size: 16px; font-weight: 700; color: var(--soft); background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
.jump-tabs button.on { background: var(--c); color: #fff; }
.jump { position: absolute; left: 90px; right: 90px; top: 260px; bottom: 56px; display: grid; grid-template-columns: 450px 1fr; gap: 24px; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s; }
.jump.on { opacity: 1; visibility: visible; transition: opacity 0.35s 0.05s; }
.jump-side { padding: 34px 32px; min-height: 0; }
.focus { font-size: 26px; font-weight: 700; line-height: 1.3; }
.where { margin-top: 18px; font-size: 16px; line-height: 1.5; color: var(--soft); }
.threshold { display: flex; align-items: center; gap: 18px; margin-top: 34px; }
.threshold b { font-size: 80px; font-weight: 800; line-height: 1; color: var(--c); letter-spacing: -0.035em; }
.threshold span { font-size: 16px; line-height: 1.4; color: var(--soft); }
.legend-key { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 700; }
.legend-key::before { content: ''; width: 22px; height: 8px; border-radius: 4px; background: var(--navy); }
.weights { display: flex; flex-direction: column; justify-content: space-between; padding: 30px 32px; min-height: 0; }
.weight { display: grid; grid-template-columns: 430px 1fr 58px; gap: 18px; align-items: center; font-size: 15px; color: var(--soft); }
.weight b { color: var(--ink); text-align: right; }
.weight.key > span:first-child { color: var(--ink); font-weight: 700; }
.weight .bar i { background: var(--muted); }
.weight.key .bar i { background: var(--navy); }
.slide.active .jump.on .weight .bar i { transform: scaleX(var(--v)); transition-delay: calc(var(--k) * 50ms + 120ms); }

/* ---- lo más destacado de la temporada: aparecen de uno en uno y la línea de abajo los va guardando --------------- */

.story { position: absolute; left: 90px; right: 90px; top: 188px; height: 530px; display: flex; align-items: center; justify-content: center; gap: 72px; visibility: hidden; transition: visibility 0s 0.5s; }
.story.flip { flex-direction: row-reverse; }
.slide.active .story.on { visibility: visible; transition: visibility 0s; }
/* El tamaño lo pone la foto al cargar (ShowroomPhoto.fit); este es el que tiene la fecha cuando no hay foto. */
.story-photo { position: relative; flex: none; width: 510px; height: 510px; border-radius: 14px; overflow: hidden; opacity: 0; transform: translateX(-90px); transition: opacity 0.35s, transform 0.5s var(--ease); }
.story.flip .story-photo { transform: translateX(90px); }
.story-photo.has-photo { box-shadow: 0 18px 44px rgba(31, 39, 51, 0.2); }
.story-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.09); transition: transform 7s cubic-bezier(0.2, 0.5, 0.3, 1); }
.slide.active .story.on .story-photo { opacity: 1; transform: none; transition: opacity 0.6s 0.2s, transform 0.9s var(--ease) 0.2s; }
.slide.active .story.on .story-photo img { transform: none; }
.story-day { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.story-day b { font-size: 260px; font-weight: 800; line-height: 1; letter-spacing: -0.05em; color: var(--navy); }
.story-day span { font-size: 40px; font-weight: 500; color: var(--soft); }
.has-photo .story-day { display: none; }
.story-text { flex: 0 1 600px; min-width: 0; overflow-wrap: anywhere; }
.story-text > * { opacity: 0; transform: translateY(34px); transition: opacity 0.25s, transform 0.4s var(--ease); }
.slide.active .story.on .story-text > * { opacity: 1; transform: none; transition: opacity 0.6s, transform 0.8s var(--ease); }
.slide.active .story.on .story-text time { transition-delay: 0.45s; }
.slide.active .story.on .story-text h2 { transition-delay: 0.6s; }
.slide.active .story.on .story-text p { transition-delay: 0.8s; }
.story time { display: block; font-size: 22px; font-weight: 700; color: var(--blue); }
.story h2, .story p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.story h2 { margin-top: 14px; font-size: 50px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.14; -webkit-line-clamp: 3; }
.story p { margin-top: 24px; font-size: 25px; line-height: 1.55; color: var(--soft); white-space: pre-line; -webkit-line-clamp: 7; }

.timeline { position: absolute; left: 90px; right: 90px; top: 742px; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.node { --size: 64px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* El tramo hasta el siguiente: gris debajo y, encima, el que se va llenando. */
.node::before, .node::after { content: ''; position: absolute; left: 50%; width: 100%; top: calc(var(--size) / 2 - 1px); height: 3px; background: #cfd3da; }
.node::after { background: var(--navy); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
.node:last-child::before, .node:last-child::after { display: none; }
.node.seen:not(.current)::after { transform: scaleX(1); }
.slide.active.playing .node.current::after { animation: segment var(--autoplay) linear forwards; }
@keyframes segment { to { transform: scaleX(1); } }
/* Lo que aún no ha salido es solo un punto. */
.node-photo { position: relative; z-index: 1; width: var(--size); height: var(--size); display: flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: #bcc3cd; transform: scale(0.26); transition: transform 0.6s var(--ease), background-color 0.3s, box-shadow 0.3s; }
.node-photo b { font-size: calc(var(--size) / 3); font-weight: 800; color: var(--navy); }
.node-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.node-photo > *, .node small { opacity: 0; transition: opacity 0.4s; }
.node.seen .node-photo { transform: none; background: var(--card); box-shadow: var(--shadow); }
.node.seen .node-photo > *, .node.seen small { opacity: 1; }
.node.current .node-photo { transform: scale(1.14); box-shadow: 0 0 0 3px var(--navy); }
.node small { font-size: 13px; color: var(--soft); white-space: nowrap; }
.node.current small { color: var(--ink); font-weight: 700; }
/* Con muchos eventos, marcas más pequeñas y solo la fecha del que se está viendo. */
.crowded .node { --size: 38px; }
.crowded .node:not(.current) small { visibility: hidden; }

/* ---- barra de mandos --------------------------------------------------------------------------------------------- */

.hud { position: fixed; z-index: 5; font-size: 13px; color: var(--soft); }
#progress-track { left: 0; right: 0; top: 0; height: 4px; }
#progress { display: block; height: 100%; background: var(--blue); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
#brand { left: 18px; top: 14px; display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
#brand img { width: 26px; }
body[data-slide='portada'] #brand, body[data-slide='cierre'] #brand { opacity: 0; }
#seasons { right: 18px; top: 14px; display: flex; gap: 2px; padding: 3px; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
#seasons:empty { display: none; }
#seasons button { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
#seasons button.on { background: var(--dark); color: #fff; font-weight: 700; }
#bottom { left: 18px; right: 18px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#bottom > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
#section { font-weight: 700; white-space: nowrap; }
#dots button { width: 7px; height: 7px; border-radius: 7px; background: #bcc3cd; transition: width 0.3s var(--ease), background 0.3s; }
#dots button.on { width: 24px; background: var(--dark); }
#controls { background: var(--card); padding: 4px; border-radius: 8px; box-shadow: var(--shadow); }
#badge, .tool { height: 28px; padding: 0 10px; font-size: 12px; color: var(--soft); border-radius: 6px; }
.tool { display: inline-flex; align-items: center; justify-content: center; width: 30px; padding: 0; }
.tool:hover, #badge:hover { background: var(--bg); }
.tool svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#badge.demo { color: #fff; background: var(--red); font-weight: 700; }
#number { min-width: 52px; text-align: center; }
#watermark { left: 50%; top: 15px; transform: translateX(-50%); white-space: nowrap; font-weight: 700; color: var(--red); pointer-events: none; }
#watermark[hidden] { display: none; }

dialog { margin: auto; width: min(430px, 92vw); padding: 30px; border-radius: 12px; border: 0; background: var(--card); color: var(--ink); font-family: inherit; user-select: text; box-shadow: 0 20px 60px rgba(31, 39, 51, 0.25); }
dialog::backdrop { background: rgba(34, 43, 55, 0.5); }
dialog h2 { font-size: 21px; }
dialog p { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--soft); }
dialog label { display: block; margin-top: 16px; font-size: 12px; font-weight: 700; color: var(--soft); }
dialog input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 6px; border: 1px solid var(--muted); font: inherit; font-size: 14px; color: var(--ink); }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
dialog .actions button { padding: 10px 18px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
dialog .actions button[type='submit'] { background: var(--dark); border-color: var(--dark); color: #fff; }
dialog button:disabled { opacity: 0.55; cursor: wait; }
#data-message.error { color: var(--red); }

@media (max-width: 700px) {
  #section, #dots { display: none !important; }
}
/* En ventanas muy altas o estrechas el panel taparía el texto de la portada. */
@media (max-aspect-ratio: 13/10) {
  #side { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .type { width: var(--w); }
}
