/* ==========================================================================
   Princess — Un cuento para una princesa
   CSS mobile-first. Breakpoints: 768px (tablet) · 1024px (laptop) · 1440px
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --night-900: #05070f;
  --night-800: #0b1026;
  --night-700: #141a3e;
  --night-600: #1f2656;
  --lavender: #b9a7e0;
  --lavender-soft: #ddd3f3;
  --rose: #f2c4d0;
  --rose-deep: #d98ca3;
  --gold: #e2c27a;
  --gold-light: #f6e4b0;
  --gold-deep: #a97f36;
  --ivory: #fbf6ec;
  --ink-soft: rgba(251, 246, 236, 0.78);

  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-title: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;

  --gold-gradient: linear-gradient(115deg, #b4883a 0%, #f6e4b0 28%, #c99a45 50%, #fff3cc 70%, #b98d3c 100%);
  --panel: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
  --panel-border: rgba(226, 194, 122, 0.32);
  --radius: 18px;
  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.7);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --pad: clamp(1.1rem, 4vw, 2.5rem);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--night-800);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
blockquote { margin: 0; }
figure { margin: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
  border-radius: 6px;
}

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- 3. Fondo, cielo y escenario ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.backdrop__layer { position: absolute; inset: 0; opacity: 0; }

.backdrop__layer--night {
  opacity: 1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(185, 167, 224, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(242, 196, 208, 0.08), transparent 70%),
    radial-gradient(ellipse at 50% 30%, #1d2257 0%, #10143a 45%, #070a1c 100%);
}

.backdrop__layer--warm {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(242, 196, 208, 0.32), transparent 70%),
    radial-gradient(ellipse 50% 40% at 15% 90%, rgba(226, 194, 122, 0.14), transparent 70%),
    radial-gradient(ellipse at 50% 35%, #5a2f55 0%, #331c45 45%, #150c22 100%);
}

.backdrop__layer--reveal {
  background:
    radial-gradient(ellipse 45% 40% at 50% 40%, rgba(226, 194, 122, 0.16), transparent 75%),
    radial-gradient(ellipse at 50% 40%, #1a1330 0%, #0a0815 55%, #030308 100%);
}

.backdrop__castle {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: clamp(110px, 24vh, 260px);
  fill: rgba(4, 6, 18, 0.78);
  filter: drop-shadow(0 -6px 24px rgba(185, 167, 224, 0.12));
}
body[data-theme='warm'] .backdrop__castle { fill: rgba(22, 10, 30, 0.72); }
body[data-theme='reveal'] .backdrop__castle { opacity: 0.35; transition: opacity 2s; }

.sky { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.stage { position: fixed; inset: 0; z-index: 2; }

.act {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  opacity: 0;
  /* espacio inferior extra para que el control de audio nunca tape un botón */
  padding: calc(var(--pad) + var(--safe-top)) var(--pad) calc(var(--pad) + 64px + var(--safe-bottom));
}
.act.is-active { visibility: visible; opacity: 1; }
.act:focus { outline: none; }

/* ---------- 4. Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.85rem 1.8rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 0.78rem + 0.25vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.btn--primary {
  color: var(--night-800);
  background: var(--gold-gradient);
  background-size: 200% 100%;
  box-shadow: 0 0 0 1px rgba(255, 243, 204, 0.6) inset, 0 10px 30px -10px rgba(226, 194, 122, 0.6);
}

.btn--ghost {
  color: var(--gold-light);
  background: rgba(11, 16, 38, 0.35);
  box-shadow: 0 0 0 1px var(--panel-border) inset;
}

.btn:disabled { cursor: default; filter: saturate(0.7); }

@media (hover: hover) {
  .btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(255, 243, 204, 0.8) inset, 0 16px 40px -10px rgba(226, 194, 122, 0.8);
    animation: shimmer 2.4s linear infinite;
  }
  .btn--ghost:hover { box-shadow: 0 0 0 1px var(--gold) inset; }
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 5. Espejo mágico ---------- */
.mirror {
  position: relative;
  flex: none;
  aspect-ratio: 300 / 420;
  height: var(--mirror-h);
  margin-inline: auto;
  opacity: 0;
}
.mirror--lg { --mirror-h: min(50dvh, 105vw); }
.mirror--md { --mirror-h: min(36dvh, 82vw); }
.mirror--sm { --mirror-h: min(20dvh, 150px); }

.mirror__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}
.mirror__bead { fill: #fff1c4; opacity: 0.85; }

.mirror__glass {
  position: absolute;
  left: 12%;
  top: 13.4%;
  width: 76%;
  height: 75.7%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 38% 30%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 40%, #6c66b0 0%, #343a7a 40%, #12173d 100%);
  box-shadow: inset 0 0 40px rgba(5, 7, 20, 0.85), inset 0 0 6px rgba(255, 255, 255, 0.3);
  isolation: isolate;
}

.mirror__mist {
  position: absolute;
  inset: -30%;
  z-index: 2;
  background: conic-gradient(from 0deg, rgba(221, 211, 243, 0.0), rgba(221, 211, 243, 0.35), rgba(242, 196, 208, 0.18), rgba(221, 211, 243, 0.0), rgba(226, 194, 122, 0.2), rgba(221, 211, 243, 0.0));
  filter: blur(22px);
  animation: mist 14s linear infinite;
  pointer-events: none;
}
@keyframes mist { to { transform: rotate(360deg); } }

.mirror__content { position: absolute; inset: 0; z-index: 1; }

.mirror__shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, transparent 58%);
  transform: translateX(-120%);
  animation: shine 7s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes shine {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

.mirror__glow {
  position: absolute;
  inset: -18% -28%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(226, 194, 122, 0.32), rgba(185, 167, 224, 0.16) 45%, transparent 70%);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: transform 1.6s ease, background 1.6s ease;
}

.mirror.is-speaking .mirror__glow { animation: breathe 2.6s ease-in-out infinite; }
.mirror.is-lit .mirror__glow {
  transform: scale(1.18);
  background: radial-gradient(ellipse at center, rgba(255, 228, 160, 0.5), rgba(242, 196, 208, 0.22) 45%, transparent 72%);
}
@keyframes breathe {
  0%, 100% { transform: scale(1); filter: blur(18px) brightness(1); }
  50% { transform: scale(1.08); filter: blur(22px) brightness(1.35); }
}

.mirror__content .mirror__photo { position: absolute; inset: 0; }
.mirror__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }

/* Destellos DOM */
.sparkle {
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  background: radial-gradient(circle, #fff8e1 0%, var(--gold) 55%, transparent 70%);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

/* ---------- 6. Narración ---------- */
.narration {
  position: relative;
  min-height: 8.5em;
  max-width: 38ch;
  margin-inline: auto;
  font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.3rem);
  line-height: 1.75;
  color: var(--ivory);
  text-align: center;
  text-wrap: pretty;
}
.narration--lg { font-size: clamp(1.12rem, 1rem + 0.6vw, 1.45rem); }
.narration--answer { min-height: 0; margin-top: 1.25rem; }
.narration__line + .narration__line { margin-top: 1rem; }
.typed-ghost { color: transparent; }
.typed { text-shadow: 0 0 18px rgba(185, 167, 224, 0.35); }

.question {
  position: relative;
  margin: 0.5rem auto 0;
  max-width: 26ch;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.55rem, 1.25rem + 1.5vw, 2.4rem);
  line-height: 1.3;
  text-align: center;
  color: var(--gold-light);
  text-shadow: 0 0 24px rgba(226, 194, 122, 0.45);
}

.hint {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(0.9rem + var(--safe-bottom));
  font-family: var(--font-title);
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
  color: rgba(251, 246, 236, 0.5);
  opacity: 0;
  pointer-events: none;
}

/* ---------- 7. Escenas genéricas ---------- */
.scene {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3dvh, 2.25rem);
  padding-bottom: 2.5rem;
}
.scene__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

/* ---------- 8. Acto 0: invitación ---------- */
.invitation {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.2dvh, 1.6rem);
  text-align: center;
  padding-bottom: 6vh;
}
.invitation > *:not(.mirror) { opacity: 0; }

.invitation__epigraph {
  max-width: 34ch;
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--lavender-soft);
}

.invitation__title,
.reveal__name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1;
  filter: drop-shadow(0 0 22px rgba(226, 194, 122, 0.35));
}
.invitation__title { font-size: clamp(3rem, 2rem + 6vw, 6.2rem); margin-right: -0.16em; }

.letter {
  display: inline-block;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  will-change: transform, filter;
}

.invitation__subtitle {
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.6rem);
  color: var(--rose);
}
.invitation__cta { margin-top: 0.75rem; }

/* ---------- 9. Acto 2: línea del tiempo ---------- */
.act--timeline { padding: 0; scroll-padding-top: 80px; }

.tl-progress {
  position: fixed;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: calc(0.6rem + var(--safe-top)) var(--pad) 0.6rem;
  background: linear-gradient(to bottom, rgba(7, 10, 28, 0.92), rgba(7, 10, 28, 0.6));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 194, 122, 0.15);
  opacity: 0;
}
.tl-progress__track {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.tl-progress__fill {
  height: 100%;
  background: var(--gold-gradient);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 0.6s ease;
  box-shadow: 0 0 10px rgba(226, 194, 122, 0.7);
}
.tl-progress__dots {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-progress__dot {
  display: grid;
  place-items: center;
  width: 44px; height: 36px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.tl-progress__dot::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: background 0.4s, transform 0.4s, box-shadow 0.4s;
}
.tl-progress__dot.is-done::before { background: var(--gold); }
.tl-progress__dot.is-current::before { transform: scale(1.35); box-shadow: 0 0 12px rgba(226, 194, 122, 0.9); }
.tl-progress__dot span { display: none; }
.tl-progress__count {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  min-width: 2.6rem;
  text-align: right;
}

.tl-header {
  min-height: 92dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 5.5rem var(--pad) 2rem;
  text-align: center;
}
.tl-header > * { opacity: 0; }
.tl-header__title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3.4rem);
  line-height: 1.15;
  color: var(--gold-light);
}
.tl-header__intro {
  max-width: 32ch;
  font-style: italic;
  color: var(--ink-soft);
}
.tl-header__scroll {
  margin-top: 1rem;
  font-size: 1.6rem;
  color: var(--gold);
}
.tl-header__scroll .icon { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

.timeline {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem var(--pad) 2rem;
}
.timeline__line {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--pad) + 17px);
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(226, 194, 122, 0.28) 4%, rgba(226, 194, 122, 0.28) 96%, transparent);
}
.timeline__line-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--gold-light), var(--gold) 60%, var(--rose));
  box-shadow: 0 0 12px rgba(226, 194, 122, 0.8);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.25s linear;
}
.timeline__line-fill::after {
  /* destello en la punta de la línea */
  content: '';
  position: absolute;
  left: 50%; bottom: -6px;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--gold) 50%, transparent 72%);
}

.timeline__stations { list-style: none; margin: 0; padding: 0; }

.station {
  position: relative;
  padding-left: 52px;
  margin-bottom: clamp(3.5rem, 10dvh, 7rem);
}
.station__node {
  position: absolute;
  top: 1.4rem; left: 0;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
}
.station__dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--night-700) 55%, transparent 56%), var(--gold-gradient);
  box-shadow: 0 0 0 4px rgba(226, 194, 122, 0.12), 0 0 22px rgba(226, 194, 122, 0.55);
}
.station__roman {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--gold-light);
}

.station__card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform-style: preserve-3d;
}
.station__card::before {
  content: '';
  position: absolute;
  inset: 8px;
  z-index: 2;
  border: 1px solid rgba(226, 194, 122, 0.16);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.station__media {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 64dvh;
  width: 100%;
}
.station__media .media { position: absolute; inset: 0; }
.station__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(to top, rgba(11, 16, 38, 0.9), transparent);
  pointer-events: none;
}

.station__body {
  position: relative;
  padding: 1.4rem 1.4rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.station__chapter {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.station__name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem);
  line-height: 1.05;
  color: var(--ivory);
}
.station__film { font-family: var(--font-title); font-style: italic; font-size: 1.15rem; color: var(--lavender-soft); }
.station__quality {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(226, 194, 122, 0.08);
  font-size: 0.88rem;
  color: var(--gold-light);
  line-height: 1.4;
}
.station__narration { margin-top: 0.6rem; }
.station__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lavender);
}
.station__text { color: var(--ink-soft); line-height: 1.75; }
.station__quote {
  position: relative;
  margin-top: 0.9rem;
  padding: 1rem 0 0.2rem;
  border-top: 1px solid rgba(226, 194, 122, 0.25);
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  line-height: 1.35;
  color: var(--gold-light);
}
.station__quote::before {
  content: '❦';
  position: absolute;
  top: -0.75rem; left: 50%;
  transform: translateX(-50%);
  padding: 0 0.6rem;
  font-style: normal;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--gold);
  background: #171c45;
  border-radius: 999px;
}

.tl-footer {
  display: flex;
  justify-content: center;
  padding: 1rem var(--pad) calc(5rem + var(--safe-bottom));
}

/* ---------- 10. Imágenes y fallbacks ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(185, 167, 224, 0.18), rgba(20, 26, 62, 0.6));
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.media.is-loaded img { opacity: 1; }

.media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(226, 194, 122, 0.22), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(242, 196, 208, 0.18), transparent 60%),
    linear-gradient(160deg, #2a2c66, #141a3e);
  color: var(--gold-light);
  text-align: center;
}
.media-fallback::before {
  content: '';
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(226, 194, 122, 0.35);
  border-radius: 50% / 40%;
}
.media-fallback__ornament { font-size: 1.4rem; color: var(--gold); opacity: 0.85; }
.media-fallback__initial {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.media-fallback__label {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--lavender-soft);
}

/* ---------- 11. Acto 4: Zaira ---------- */
.zaira-stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2rem;
}

.zaira-step {
  width: 100%;
  max-width: 1080px;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: clamp(1.5rem, 4dvh, 2.5rem);
}
.zaira-step__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}
.zaira-step__kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: 0;
}
.zaira-step__num {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--rose-deep);
  font-size: 0.7rem;
  letter-spacing: 0;
}
.zaira-step .narration { min-height: 7em; }

/* Foto 1 · marco antiguo ovalado (eco del espejo) */
.photo--antique .photo__frame {
  position: relative;
  width: min(68vw, 34dvh, 340px);
  aspect-ratio: 4 / 5;
  padding: 12px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #8a6528, #f6e4b0, #b98d3c, #fff3cc, #9a7230, #e7c77a, #8a6528);
  box-shadow: 0 0 0 3px rgba(11, 16, 38, 0.6), 0 0 0 5px rgba(226, 194, 122, 0.4), 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 0 60px rgba(242, 196, 208, 0.2);
}
.photo--antique .media {
  width: 100%; height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}
.photo--antique .media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 50px rgba(30, 10, 30, 0.55);
  pointer-events: none;
}

/* Foto 2 · polaroid en un álbum de cuentos */
.photo--polaroid .album-page {
  position: relative;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border-radius: 6px 14px 14px 6px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(169, 127, 54, 0.12) 31px 32px),
    linear-gradient(135deg, #fbf3e4, #f1e2c8);
  box-shadow: inset 14px 0 18px -12px rgba(120, 80, 40, 0.45), 0 30px 70px -20px rgba(0, 0, 0, 0.8);
  transform: rotate(1deg);
}
.photo--polaroid .album-page::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(169, 127, 54, 0.3);
  border-radius: 4px 10px 10px 4px;
  pointer-events: none;
}
.polaroid {
  position: relative;
  width: min(62vw, 30dvh, 300px);
  padding: 12px 12px 0;
  background: #fffdf8;
  box-shadow: 0 12px 30px -10px rgba(60, 30, 20, 0.5);
  transform: rotate(-3deg);
}
.polaroid .media { aspect-ratio: 1 / 1; width: 100%; }
.polaroid__caption {
  padding: 0.7rem 0 0.9rem;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.25rem;
  text-align: center;
  color: #6a4c63;
}
.tape {
  position: absolute;
  top: -12px;
  width: 78px; height: 24px;
  background: rgba(242, 196, 208, 0.7);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  z-index: 2;
}
.tape--left { left: -18px; transform: rotate(-32deg); }
.tape--right { right: -18px; transform: rotate(32deg); }

/* Foto 3 · marco ornamental dorado */
.photo__ornate {
  position: relative;
  width: min(70vw, 34dvh, 340px);
  padding: 22px;
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(226, 194, 122, 0.12), rgba(242, 196, 208, 0.06));
  box-shadow:
    inset 0 0 0 2px var(--gold),
    inset 0 0 0 7px rgba(11, 16, 38, 0.4),
    inset 0 0 0 8px rgba(226, 194, 122, 0.5),
    0 0 50px rgba(226, 194, 122, 0.25),
    0 30px 70px -20px rgba(0, 0, 0, 0.8);
}
.photo__ornate .media { aspect-ratio: 4 / 5; width: 100%; border-radius: 3px; }
.corner {
  position: absolute;
  z-index: 2;
  width: 58px; height: 58px;
  color: var(--gold-light);
  filter: drop-shadow(0 0 6px rgba(226, 194, 122, 0.6));
  pointer-events: none;
}
.corner svg { width: 100%; height: 100%; }
.corner--tl { top: -10px; left: -10px; }
.corner--tr { top: -10px; right: -10px; transform: scaleX(-1); }
.corner--bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.corner--br { bottom: -10px; right: -10px; transform: scale(-1, -1); }

.zaira-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 40ch;
}
.zaira-bridge .narration { min-height: 0; }
.zaira-bridge .narration__line:not(:last-child) { color: var(--ink-soft); }
.zaira-bridge .narration__line:last-child {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.3em;
  color: var(--gold-light);
}

/* ---------- 12. Acto 5: la revelación ---------- */
.reveal__veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 40%, rgba(5, 4, 12, 0.35), rgba(2, 2, 8, 0.94) 75%);
  opacity: 0;
  pointer-events: none;
}
.reveal {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3dvh, 2rem);
  padding-bottom: 3rem;
  text-align: center;
}
.reveal__mirror-col { display: flex; justify-content: center; }
.reveal__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
}
.reveal .mirror.is-lit .mirror__frame {
  filter: drop-shadow(0 0 14px rgba(255, 228, 160, 0.55)) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}
.reveal__final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  scroll-margin: 1.5rem;
}
.reveal__crown {
  font-size: 2.6rem;
  color: var(--gold-light);
  filter: drop-shadow(0 0 14px rgba(226, 194, 122, 0.8));
}
.reveal__name {
  font-size: clamp(3.2rem, 2rem + 7vw, 6.6rem);
  letter-spacing: 0.2em;
  margin-right: -0.2em;
}
.reveal__statement {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.3rem);
  line-height: 1.25;
  color: var(--ivory);
  text-shadow: 0 0 26px rgba(242, 196, 208, 0.45);
}
.reveal__closing { display: flex; flex-direction: column; gap: 0.8rem; max-width: 40ch; }
.reveal__closing-line { color: var(--ink-soft); font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem); }
.reveal__end {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem);
  letter-spacing: 0.2em;
  color: var(--rose);
  text-shadow: 0 0 18px rgba(242, 196, 208, 0.6);
}
.reveal__final .btn { margin-top: 1rem; }

/* ---------- 13. Controles de audio ---------- */
.audio-ctrl {
  position: fixed;
  z-index: 20;
  right: calc(0.8rem + env(safe-area-inset-right, 0px));
  bottom: calc(0.8rem + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(11, 16, 38, 0.72);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}
.audio-ctrl__btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gold-light);
  cursor: pointer;
  touch-action: manipulation;
}
.audio-ctrl__btn .icon { width: 20px; height: 20px; }
@media (hover: hover) { .audio-ctrl__btn:hover { background: rgba(226, 194, 122, 0.12); } }
.audio-ctrl__volume { display: flex; align-items: center; padding: 0 0.7rem 0 0.2rem; }
.audio-ctrl__volume input {
  width: 72px;
  height: 28px;
  accent-color: var(--gold);
  cursor: pointer;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--night-800);
  font-family: var(--font-title);
  font-size: 1.4rem;
  text-align: center;
}

/* ==========================================================================
   Tablet ≥ 768px — línea vertical con tarjetas a la derecha
   ========================================================================== */
@media (min-width: 768px) {
  .mirror--sm { --mirror-h: min(22dvh, 170px); }

  .station { padding-left: 84px; }
  .timeline__line { left: calc(var(--pad) + 25px); }
  .station__node { width: 52px; height: 52px; top: 2rem; }
  .station__roman { font-size: 0.85rem; }

  .station__card {
    display: grid;
    grid-template-columns: minmax(220px, 42%) 1fr;
  }
  .station__media { aspect-ratio: auto; max-height: none; min-height: 100%; }
  .station__media::after {
    inset: 0 0 0 auto;
    width: 30%; height: 100%;
    background: linear-gradient(to left, rgba(20, 26, 62, 0.6), transparent);
  }
  .station__body { padding: 1.8rem 2rem 2rem; }

  .audio-ctrl__volume input { width: 96px; }
}

/* ==========================================================================
   Laptop ≥ 1024px — línea centrada y tarjetas alternadas
   ========================================================================== */
@media (min-width: 1024px) {
  .mirror--lg { --mirror-h: min(68dvh, 560px); }
  .mirror--md { --mirror-h: min(42dvh, 400px); }

  /* Progreso vertical a la izquierda */
  .tl-progress {
    top: 50%; right: auto; left: 1.5rem;
    flex-direction: column;
    padding: 1rem 0.4rem;
    border: 1px solid rgba(226, 194, 122, 0.18);
    border-radius: 999px;
    transform: translateY(-50%);
  }
  .tl-progress__track { inset: 1.2rem auto 3.2rem 50%; width: 2px; height: auto; margin-left: -1px; background: rgba(226, 194, 122, 0.15); }
  .tl-progress__fill { transform-origin: top center; transform: scaleY(var(--p, 0)); }
  .tl-progress__dots { flex-direction: column; gap: 0.6rem; }
  .tl-progress__dot { position: relative; width: 36px; height: 36px; }
  .tl-progress__dot span {
    display: block;
    position: absolute;
    left: calc(100% + 0.6rem);
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-title);
    font-style: italic;
    font-size: 1rem;
    white-space: nowrap;
    color: var(--gold-light);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }
  .tl-progress__dot:hover span,
  .tl-progress__dot:focus-visible span,
  .tl-progress__dot.is-current span { opacity: 0.9; }
  .tl-progress__count { min-width: 0; text-align: center; font-size: 0.72rem; }

  .tl-header { padding-top: 3rem; }

  .timeline { padding-inline: 5.5rem; }
  .timeline__line { left: 50%; margin-left: -1px; }

  .station {
    display: grid;
    grid-template-columns: 1fr 96px 1fr;
    align-items: start;
    padding-left: 0;
  }
  .station__node {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    top: 3rem;
    width: 60px; height: 60px;
  }
  .station--left .station__card { grid-column: 1; grid-row: 1; }
  .station--right .station__card { grid-column: 3; grid-row: 1; }

  /* Tarjeta vertical con imagen amplia */
  .station__card { display: block; }
  .station__media { aspect-ratio: 4 / 3.4; min-height: 0; }
  .station__media::after {
    inset: auto 0 0 0;
    width: 100%; height: 35%;
    background: linear-gradient(to top, rgba(11, 16, 38, 0.9), transparent);
  }

  /* Zaira: foto y texto en dos columnas */
  .zaira-step { grid-template-columns: 1.05fr 1fr; justify-items: stretch; }
  .zaira-step > .photo { justify-self: center; }
  .zaira-step__text { align-items: flex-start; text-align: left; }
  .zaira-step .narration { text-align: left; margin-inline: 0; }
  .photo--antique .photo__frame { width: min(30vw, 56dvh, 420px); }
  .polaroid { width: min(26vw, 46dvh, 360px); }
  .photo__ornate { width: min(30vw, 56dvh, 420px); }

  /* Revelación: espejo a la izquierda, palabras a la derecha */
  .reveal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-inline: 2rem;
  }
  .reveal__mirror-col { justify-content: center; }

  /* Intro: espejo y diálogo lado a lado para que todo quepa en pantalla */
  .act--intro .scene { flex-direction: row; gap: clamp(3rem, 7vw, 7rem); max-width: 1200px; margin: 0 auto; }
  .act--intro .scene__text { flex: 0 1 560px; }
  .act--intro .mirror--md { --mirror-h: min(62dvh, 520px); }
}

@media (min-width: 1440px) {
  .station { grid-template-columns: 1fr 120px 1fr; }
  .timeline { max-width: 1280px; }
}

/* Pantallas bajas en horizontal (móvil acostado) */
@media (max-height: 520px) and (orientation: landscape) {
  .mirror--md { --mirror-h: 58dvh; }
  .mirror--lg { --mirror-h: 70dvh; }
  .scene { flex-direction: row; gap: 2rem; }
  .scene__text { max-width: 55%; }
  .narration { min-height: 6em; }
  .invitation { padding-top: 1rem; }
  .invitation .mirror { --mirror-h: 40dvh; }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .mirror__shine { display: none; }
}

/* ==========================================================================
   Invitación: todo cabe en la altura real de la pantalla (dvh), sin scroll
   ========================================================================== */
.act--invitation {
  padding-top: calc(clamp(0.5rem, 2dvh, 1.5rem) + var(--safe-top));
  padding-bottom: calc(clamp(0.5rem, 2dvh, 1.5rem) + var(--safe-bottom));
}
.invitation {
  padding-bottom: 0;
  gap: clamp(0.4rem, 1.8dvh, 1.4rem);
}
.invitation .mirror--md,
.invitation .mirror { --mirror-h: min(36dvh, 82vw, 400px); }
.invitation__epigraph { font-size: clamp(0.95rem, 0.6rem + 1.4dvh, 1.45rem); line-height: 1.4; }
.invitation__title { font-size: clamp(2.2rem, min(2rem + 6vw, 9dvh), 6.2rem); }
.invitation__subtitle { font-size: clamp(1rem, 0.6rem + 1.6dvh, 1.6rem); }
.invitation__cta { margin-top: clamp(0.2rem, 1dvh, 0.75rem); }

/* ==========================================================================
   Revelación: el final cabe en la altura real de la pantalla (dvh)
   ========================================================================== */
.act--reveal {
  padding-top: calc(clamp(0.5rem, 2dvh, 1.5rem) + var(--safe-top));
  padding-bottom: calc(clamp(0.5rem, 2dvh, 1.5rem) + var(--safe-bottom));
}
.reveal { padding-bottom: 0; gap: clamp(0.6rem, 2dvh, 2rem); }
.reveal__final { gap: clamp(0.3rem, 1.3dvh, 1rem); }
.reveal__crown { font-size: clamp(1.6rem, 4.5dvh, 2.6rem); line-height: 1; }
.reveal__name { font-size: clamp(2.4rem, min(2rem + 7vw, 11dvh), 6.6rem); }
.reveal__statement { font-size: clamp(1.2rem, min(1.2rem + 1.4vw, 4dvh), 2.3rem); }
.reveal__closing { gap: clamp(0.3rem, 1dvh, 0.8rem); }
.reveal__closing-line { font-size: clamp(0.95rem, min(0.98rem + 0.3vw, 2.4dvh), 1.18rem); line-height: 1.4; }
.reveal__end { margin-top: clamp(0.2rem, 1dvh, 0.8rem); font-size: clamp(1.1rem, min(1.1rem + 1vw, 3.6dvh), 1.9rem); }
.reveal__final .btn { margin-top: clamp(0.2rem, 1dvh, 1rem); }

/* En columna (móvil/tablet), el espejo se encoge cuando aparece el final */
@media (max-width: 1023px) {
  .reveal:has(.reveal__final:not([hidden])) .mirror--lg { --mirror-h: min(22dvh, 60vw); }
}

/* Intro e interludio: menos relleno fijo, espaciado relativo a la altura */
.act--intro,
.act--interlude {
  padding-top: calc(clamp(0.75rem, 3dvh, 2.5rem) + var(--safe-top));
  padding-bottom: calc(clamp(2.5rem, 7dvh, 4rem) + var(--safe-bottom));
}
.act--intro .scene,
.act--interlude .scene { padding-bottom: 0; gap: clamp(0.75rem, 2.5dvh, 2.25rem); }
@media (max-width: 1023px) {
  .act--intro .mirror--md { --mirror-h: min(32dvh, 82vw); }
}
@media (max-width: 1023px) and (max-height: 720px) {
  .reveal:has(.reveal__final:not([hidden])) .mirror--lg { --mirror-h: 15dvh; }
  .reveal__crown { display: none; }
}
