/* =====================================================================
   NUESTRO MUNDO · estilos base
   ===================================================================== */

:root {
  --black: #080A10;
  --night: #0B1424;
  --slate: #18263A;
  --violet: #8B72D9;
  --gold: #D8B77A;
  --white: #F3F0EA;
  --muted: #A9B0BF;

  --line: rgba(243, 240, 234, .12);
  --glass: rgba(11, 20, 36, .72);

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "La Belle Aurore", "Segoe Script", cursive;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --slow: 1.2s;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-h: 0px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(64px + var(--safe-top));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--black);
  color: var(--white);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--dock-h) + var(--safe-bottom));
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

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

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

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

.noscript { padding: 2rem; text-align: center; }

/* ---------- Cielo / partículas ---------- */
.sky {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(139, 114, 217, .16), transparent 60%),
    linear-gradient(180deg, var(--black) 0%, var(--night) 100%);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.5rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 1rem/1.2 var(--sans); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn--primary { background: var(--gold); color: var(--black); }
.btn--primary:hover { background: #e6c98f; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--white); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* =====================================================================
   VISTA A · Bienvenida
   ===================================================================== */
.welcome {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: calc(2rem + var(--safe-top)) var(--gutter) calc(2rem + var(--safe-bottom) + var(--dock-h));
  overflow-y: auto;
  background:
    radial-gradient(80% 50% at 50% 100%, rgba(216, 183, 122, .10), transparent 70%),
    radial-gradient(60% 40% at 50% 0%, rgba(139, 114, 217, .14), transparent 70%);
  transition: opacity 1s var(--ease), visibility 1s;
}
.welcome.is-leaving { opacity: 0; visibility: hidden; }

.welcome__beams { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.welcome__beams i {
  position: absolute; bottom: -10%; left: 50%;
  width: 18vmax; height: 120vh;
  transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(139, 114, 217, .22), transparent 75%);
  filter: blur(18px);
  animation: sway 14s ease-in-out infinite alternate;
}
.welcome__beams i:nth-child(1) { --r: -24deg; margin-left: -30vmax; }
.welcome__beams i:nth-child(2) { --r: 4deg; margin-left: -9vmax; animation-duration: 18s; background: linear-gradient(to top, rgba(216, 183, 122, .14), transparent 70%); }
.welcome__beams i:nth-child(3) { --r: 26deg; margin-left: 12vmax; animation-duration: 16s; }

@keyframes sway {
  from { transform: rotate(calc(var(--r) - 5deg)); }
  to   { transform: rotate(calc(var(--r) + 5deg)); }
}

.welcome__inner {
  position: relative;
  max-width: 44rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.welcome__gift {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--muted); font-size: .9rem;
}
.welcome__gift::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--gold);
  -webkit-mask: url("../icons/note.svg") center / contain no-repeat;
          mask: url("../icons/note.svg") center / contain no-repeat;
}
/* Título principal: Bodoni Moda alojada en el proyecto (no depende de
   Google Fonts). Si no carga, cae a otras Bodoni/Didot del sistema y
   finalmente a Georgia / Times, que mantienen el carácter serif. */
@font-face {
  font-family: "Nuestro Mundo Display";
  src: url("../fonts/bodoni-moda-opsz.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
.welcome__title {
  font-family: "Nuestro Mundo Display", "Bodoni Moda", "Bodoni 72", "Didot", "Bodoni MT",
               "Libre Bodoni", Georgia, "Times New Roman", serif;
  font-weight: 400;
  /* Tamaño óptico automático: en escritorio usa la óptica de titular
     (máximo contraste); en móvil engrosa un poco los trazos finos para
     que no desaparezcan. */
  font-optical-sizing: auto;
  font-kerning: normal;
  font-size: clamp(2.75rem, min(14vw, 13vh), 8.25rem);
  line-height: .9; letter-spacing: .035em;
  max-width: 100%;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(100deg, var(--white) 30%, var(--gold) 50%, var(--white) 70%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.welcome__title .char { display: inline-block; }
.welcome__title-line {
  display: block; white-space: nowrap;
  margin-right: -.035em;               /* compensa el tracking final para centrar ópticamente */
  padding-bottom: .04em;               /* evita que el recorte del degradado corte remates */
}
.welcome__subtitle {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  color: var(--white); max-width: 30rem;
}
.welcome__dedication {
  font-family: var(--hand);
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  color: var(--gold); line-height: 1.4;
}
.welcome__message {
  max-width: 34rem; color: var(--muted);
  font-size: 1rem; line-height: 1.75;
}
.welcome .btn { margin-top: .75rem; }

/* Botón único de entrada: «Dale play para comenzar este viaje» */
.btn--enter {
  gap: .75rem; min-height: 56px;
  padding: .6rem 1.6rem .6rem .6rem;
  max-width: 100%; text-align: left;
  font-weight: 600;
  box-shadow: 0 12px 40px -14px rgba(216, 183, 122, .7);
}
.btn__disc {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--black);
  display: grid; place-items: center;
}
.btn__disc::after {
  content: ""; width: 0; height: 0; margin-left: 3px;
  border-style: solid; border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--gold);
}

/* Entrada orquestada (única animación de carga) */
.js .welcome__inner > * { opacity: 0; transform: translateY(10px); }
.welcome.is-ready .welcome__inner > * {
  opacity: 1; transform: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.welcome.is-ready .welcome__inner > *:nth-child(1) { transition-delay: .1s; }
.welcome.is-ready .welcome__inner > *:nth-child(2) { transition-delay: .3s; }
.welcome.is-ready .welcome__inner > *:nth-child(3) { transition-delay: 1.1s; }
.welcome.is-ready .welcome__inner > *:nth-child(4) { transition-delay: 1.5s; }
.welcome.is-ready .welcome__inner > *:nth-child(5) { transition-delay: 1.9s; }
.welcome.is-ready .welcome__inner > *:nth-child(6) { transition-delay: 2.3s; }
.welcome.is-ready .welcome__title { animation: shine 3.2s var(--ease) .5s both; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* =====================================================================
   Barra superior
   ===================================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(.75rem + var(--safe-top)) var(--gutter) .75rem;
  background: linear-gradient(to bottom, rgba(8, 10, 16, .9), rgba(8, 10, 16, 0));
  transition: background .4s var(--ease);
}
.topbar.is-solid {
  background: rgba(8, 10, 16, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand {
  font-family: var(--serif); font-size: 1rem; letter-spacing: .08em;
  text-decoration: none; white-space: nowrap;
}
.topbar__nav { display: flex; gap: .25rem; }
.topbar__nav a {
  padding: .55rem .8rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .92rem;
  white-space: nowrap;
  transition: color .3s, background .3s;
}
.topbar__nav a:hover { color: var(--white); }
.topbar__nav a[aria-current="true"] { color: var(--white); background: rgba(243, 240, 234, .08); }

/* =====================================================================
   Secciones genéricas
   ===================================================================== */
main { position: relative; z-index: 1; }

.section {
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
  max-width: 76rem; margin: 0 auto;
}
.section:focus { outline: none; }
.section__head { max-width: var(--measure); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__head h2 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.05;
}
.section__lede { margin-top: .9rem; color: var(--muted); max-width: 34rem; }

/* =====================================================================
   VISTA B · Espacio musical
   ===================================================================== */
.featured {
  display: grid; max-width: 64rem; gap: clamp(1rem, 2.5vw, 2rem);
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
.featured:empty { display: none; }
.featured__label {
  grid-column: 1 / -1;
  font-family: var(--serif); font-style: italic;
  font-size: 1.35rem; color: var(--gold);
}

.library__tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 44px; padding: .5rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  cursor: pointer; font-size: .95rem;
  transition: color .25s, border-color .25s, background .25s;
}
.chip:hover { color: var(--white); border-color: rgba(243, 240, 234, .3); }
.chip[aria-pressed="true"] { background: var(--white); color: var(--black); border-color: var(--white); }

.library {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* Tarjeta de canción */
.song { position: relative; display: flex; flex-direction: column; gap: .7rem; }
.song[hidden] { display: none; }

.song__cover {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(70% 70% at 30% 25%, rgba(139, 114, 217, .35), transparent 70%),
    radial-gradient(60% 60% at 80% 90%, rgba(216, 183, 122, .18), transparent 70%),
    var(--slate);
}
.song__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
  transition: opacity .8s var(--ease);
}
.song__cover img.is-loaded { opacity: 1; }
.song__num {
  position: absolute; left: .8rem; bottom: .55rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1;
  color: rgba(243, 240, 234, .78);
  transition: opacity .6s;
}
.song.has-cover .song__num { opacity: 0; }
.song__play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.song__play::after {
  content: ""; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(8, 10, 16, .6) url("../icons/play.svg") 55% 50% / 20px no-repeat;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(243, 240, 234, .25);
  opacity: 0; transform: scale(.9);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.song__play:hover::after, .song__play:focus-visible::after { opacity: 1; transform: none; }
@media (hover: none) { .song__play::after { opacity: .9; transform: none; width: 44px; height: 44px; background-size: 16px; } }

.song__meta { min-height: 3.2em; }
.song__title {
  font-size: 1rem; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.song__artist { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.song__pending { color: var(--muted); font-size: .86rem; font-style: italic; }
.song.is-loading .song__title {
  width: 70%; height: .9em; border-radius: 3px; color: transparent;
  background: linear-gradient(90deg, rgba(243,240,234,.06), rgba(243,240,234,.14), rgba(243,240,234,.06));
  background-size: 200% 100%; animation: pulse 1.6s linear infinite;
}
@keyframes pulse { to { background-position: -200% 0; } }

.song__links { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .86rem; }
.song__links a {
  color: var(--muted); text-decoration: none;
  padding: .3rem 0; min-height: 32px; display: inline-flex; align-items: center;
  border-bottom: 1px solid transparent;
}
.song__links a:hover { color: var(--gold); border-bottom-color: currentColor; }

/* Canción sonando */
.song.is-current .song__cover { box-shadow: 0 0 0 2px var(--gold); }
.song.is-current .song__num { opacity: 0; }
.song__eq {
  position: absolute; right: .7rem; top: .7rem;
  display: none; gap: 3px; align-items: flex-end; height: 16px;
}
.song.is-current .song__eq { display: flex; }
.song__eq i { width: 3px; background: var(--gold); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.song__eq i:nth-child(2) { animation-delay: -.4s; }
.song__eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* Destacadas: más grandes */
.featured .song__title { font-family: var(--serif); font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 400; }
.featured .song__num { font-size: clamp(3rem, 8vw, 5rem); }

/* =====================================================================
   VISTA C · Cuando suene esta canción
   ===================================================================== */
.notes__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.note {
  display: grid; align-items: center;
  grid-template-columns: 72px 1fr auto; gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
}
.note__cover {
  width: 72px; aspect-ratio: 1; border-radius: 4px; overflow: hidden; position: relative;
  background: var(--slate);
}
.note__cover img { width: 100%; height: 100%; object-fit: cover; }
.note__cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.note__phrase {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem); line-height: 1.3;
  max-width: 34rem;
}
.note__song { margin-top: .45rem; color: var(--muted); font-size: .9rem; }

/* =====================================================================
   VISTA D · El recuerdo del concierto
   ===================================================================== */
.concert { position: relative; }
.concert:focus { outline: none; }

.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh; overflow: hidden;
  --beam: 139, 114, 217;
  --beam-o: .15;
  --glow-o: .1;
  --floor: calc(14% + var(--dock-h));
}
.stage__sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--black) 0%, var(--night) 55%, #0f1a2e 100%);
}
.stage__glow {
  position: absolute; left: 50%; bottom: 18%;
  width: 120vmax; height: 60vmax; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--beam), .55), transparent);
  opacity: var(--glow-o);
  transition: opacity 1.6s var(--ease), background 1.6s var(--ease);
}
.stage__beams { position: absolute; inset: 0; }
.stage__beams i {
  position: absolute; bottom: calc(var(--floor) + 14%); left: 50%;
  width: 10vmax; height: 90vh;
  transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(var(--beam), .55), transparent 80%);
  filter: blur(14px);
  opacity: var(--beam-o);
  transition: opacity 1.6s var(--ease), background 1.6s var(--ease);
  animation: sway 9s ease-in-out infinite alternate;
}
.stage__beams i:nth-child(1) { --r: -38deg; margin-left: -18vmax; }
.stage__beams i:nth-child(2) { --r: -16deg; margin-left: -10vmax; animation-duration: 11s; }
.stage__beams i:nth-child(3) { --r: 0deg;   margin-left: -5vmax;  animation-duration: 13s; }
.stage__beams i:nth-child(4) { --r: 17deg;  margin-left: 0;       animation-duration: 10s; }
.stage__beams i:nth-child(5) { --r: 36deg;  margin-left: 8vmax;   animation-duration: 12s; }

.stage__arena { position: absolute; left: 0; right: 0; bottom: var(--floor); width: 100%; height: 42%; }
.stage__arena path:nth-child(2) { opacity: calc(var(--beam-o) + .2); transition: opacity 1.6s; }

.stage__ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--floor) + 2px);
  background: linear-gradient(180deg, #070910, var(--black));
}

/* Ondas de sonido saliendo del estadio */
.stage__waves { position: absolute; left: 50%; bottom: calc(var(--floor) + 24%); opacity: 0; transition: opacity 1.4s var(--ease); }
.stage__waves i {
  position: absolute; left: 0; top: 0;
  width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin;
  border-radius: 50%; border: 1px solid rgba(var(--beam), .5);
  animation: wave 4.5s linear infinite; opacity: 0;
}
.stage__waves i:nth-child(2) { animation-delay: 1.5s; }
.stage__waves i:nth-child(3) { animation-delay: 3s; }
@keyframes wave { from { transform: scale(.2); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* Dos luces: ustedes, afuera */
.stage__pair {
  position: absolute; left: 50%; bottom: calc(var(--floor) * .55);
  width: 0; height: 0;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.stage__pair i {
  position: absolute; top: 0; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 18px 6px rgba(216, 183, 122, .45), 0 0 60px 18px rgba(216, 183, 122, .15);
  transition: transform 1.6s var(--ease);
}
.stage__pair i:nth-child(1) { left: -6px; transform: translateX(-46px); }
.stage__pair i:nth-child(2) { left: -6px; transform: translateX(46px); background: #f1e3c7; }

/* Entrada agotada */
.stage__ticket {
  position: absolute; left: 50%; top: 42%;
  width: min(68vw, 320px); aspect-ratio: 2.3 / 1;
  transform: translate(-50%, -50%) rotate(-6deg);
  border-radius: 8px;
  background:
    radial-gradient(circle at 0 50%, transparent 14px, rgba(24, 38, 58, .92) 15px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 14px, rgba(24, 38, 58, .92) 15px) right / 51% 100% no-repeat;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.stage__ticket::before {
  content: ""; position: absolute; inset: 14px 30px;
  border: 1px dashed rgba(243, 240, 234, .2); border-radius: 4px;
}
.stage__ticket span {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--gold);
  border: 2px solid var(--gold); padding: .05em .5em; border-radius: 6px;
  transform: rotate(-8deg);
}

/* Estados por momento */
.stage[data-moment="1"] { --beam: 169, 176, 191; --beam-o: .05; --glow-o: .05; }
.stage[data-moment="1"] .stage__ticket { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg); }

.stage[data-moment="2"] { --beam: 139, 114, 217; --beam-o: .25; --glow-o: .25; }
.stage[data-moment="2"] .stage__pair { opacity: 1; }

.stage[data-moment="3"] { --beam: 139, 114, 217; --beam-o: .7; --glow-o: .45; }
.stage[data-moment="3"] .stage__waves { opacity: 1; }
.stage[data-moment="3"] .stage__pair { opacity: 1; }
.stage[data-moment="3"] .stage__pair i:nth-child(1) { transform: translateX(-30px); }
.stage[data-moment="3"] .stage__pair i:nth-child(2) { transform: translateX(30px); }

.stage[data-moment="4"] { --beam: 216, 183, 122; --beam-o: .9; --glow-o: .55; }
.stage[data-moment="4"] .stage__waves { opacity: .6; }
.stage[data-moment="4"] .stage__pair { opacity: 1; }
.stage[data-moment="4"] .stage__pair i:nth-child(1) { animation: dance-a 2.4s ease-in-out infinite; }
.stage[data-moment="4"] .stage__pair i:nth-child(2) { animation: dance-b 2.4s ease-in-out infinite; }
@keyframes dance-a { 0%, 100% { transform: translate(-22px, 0); } 50% { transform: translate(-12px, -10px); } }
@keyframes dance-b { 0%, 100% { transform: translate(22px, 0); } 50% { transform: translate(12px, -10px); } }

.stage[data-moment="5"] { --beam: 216, 183, 122; --beam-o: .4; --glow-o: .55; }
.stage[data-moment="5"] .stage__pair { opacity: 1; }
.stage[data-moment="5"] .stage__pair i:nth-child(1) { transform: translateX(-5px); }
.stage[data-moment="5"] .stage__pair i:nth-child(2) { transform: translateX(5px); }

.stage[data-moment="6"] { --beam: 139, 114, 217; --beam-o: .12; --glow-o: .3; }
.stage[data-moment="6"] .stage__pair { opacity: .8; }
.stage[data-moment="6"] .stage__pair i:nth-child(1) { transform: translateX(-5px); }
.stage[data-moment="6"] .stage__pair i:nth-child(2) { transform: translateX(5px); }

/* Historia que se desplaza sobre el escenario */
.concert__story {
  position: relative; z-index: 2;
  margin-top: -100vh; margin-top: -100svh;
}
.concert__intro {
  min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center;
  padding: 6rem var(--gutter);
  max-width: 60rem; margin: 0 auto; text-align: center;
}
.concert__intro h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 3.6rem); line-height: 1.15;
  text-shadow: 0 2px 30px rgba(8, 10, 16, .9);
}

.moments { list-style: none; margin: 0; padding: 0; }
.moment {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 5rem var(--gutter) clamp(6rem, 20vh, 12rem);
  max-width: 76rem; margin: 0 auto;
}
/* Fotografía real en cada uno de los cinco momentos del concierto */
.moment__photo {
  width: min(30rem, 43vw);
  margin: 0 0 1.25rem;
  padding: .65rem .65rem .85rem;
  border: 1px solid rgba(243, 240, 234, .24);
  border-radius: 3px;
  background: #f0eadc;
  color: #25212a;
  box-shadow: 0 22px 65px rgba(0, 0, 0, .42);
  opacity: .15;
  transform: translateY(24px) rotate(-2deg);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.moment:nth-child(even) .moment__photo { transform: translateY(24px) rotate(2deg); }
.moment__photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  background: #d8d1c3;
}
.moment__photo-caption {
  padding: .65rem .25rem 0;
  font: italic 1rem/1.35 var(--serif);
  text-align: center;
}
.moment.is-visible .moment__photo { opacity: 1; transform: translateY(0) rotate(-1deg); }
.moment:nth-child(even).is-visible .moment__photo { transform: translateY(0) rotate(1deg); }

.moment__card {
  max-width: 26rem;
  padding: 1.5rem 1.6rem;
  border-radius: 10px;
  background: rgba(8, 10, 16, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  opacity: .15; transform: translateY(24px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.moment:nth-child(even) { align-items: flex-end; }
.moment.is-visible .moment__card { opacity: 1; transform: none; }
.moment__step { color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 1rem; }
.moment__title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1;
  margin: .3rem 0 .6rem;
}
.moment__text { color: var(--white); font-size: 1.08rem; }

.concert__outro {
  min-height: 90vh; min-height: 90svh;
  display: grid; align-content: center; justify-items: center; gap: 2.2rem;
  padding: 6rem var(--gutter) 8rem; text-align: center;
}
.concert__reflection {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.35rem, 3.4vw, 2.1rem); line-height: 1.35;
  max-width: 36rem;
  text-shadow: 0 2px 30px rgba(8, 10, 16, .9);
}
.concert__next {
  display: inline-flex; flex-direction: column; align-items: center; gap: .9rem;
  color: var(--muted); text-decoration: none; font-size: .95rem;
  min-height: 44px; padding: .5rem 1rem;
}
.concert__next::after {
  content: ""; width: 1px; height: 56px;
  background: linear-gradient(var(--gold), transparent);
  animation: drip 2.4s var(--ease) infinite;
  transform-origin: top;
}
.concert__next:hover { color: var(--gold); }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* =====================================================================
   VISTA E · La carta
   ===================================================================== */
.letter { display: grid; justify-items: center; }

.envelope {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 1.55 / 1;
  perspective: 1400px;
}
.envelope__back, .envelope__front, .envelope__flap { position: absolute; inset: 0; border-radius: 10px; }
.envelope__back { background: #1d2c43; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.envelope__front {
  z-index: 3;
  background:
    linear-gradient(to top right, #22344f 49.6%, transparent 50%) left bottom / 50.5% 100% no-repeat,
    linear-gradient(to top left,  #213250 49.6%, transparent 50%) right bottom / 50.5% 100% no-repeat,
    linear-gradient(to top, #263a58 0 52%, transparent 52%);
  -webkit-clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
          clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.envelope__flap {
  z-index: 4; bottom: auto; height: 62%;
  background: linear-gradient(180deg, #2a3f5f, #22344f);
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
          clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform .9s var(--ease), z-index 0s .45s;
}
.envelope__seal {
  position: absolute; z-index: 5; left: 50%; top: 58%;
  transform: translate(-50%, -50%);
  min-height: 52px; padding: .8rem 1.6rem;
  border-radius: 999px; border: 0;
  background: var(--gold); color: var(--black);
  font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(216, 183, 122, .6);
  transition: opacity .4s var(--ease), transform .4s var(--ease), background .3s;
}
.envelope__seal:hover { background: #e6c98f; }

/* El papel: escondido dentro del sobre hasta que se abre */
.paper {
  position: absolute; z-index: 2;
  left: 5%; right: 5%; top: 6%; height: 86%;
  overflow: hidden;
  border-radius: 6px;
  background: var(--white); color: #1d1a16;
  padding: 1.4rem;
}
.paper > * { visibility: hidden; }
.envelope:not(.is-opening) .paper { opacity: 0; }

/* Abriendo */
.envelope.is-opening .envelope__flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-opening .envelope__seal { opacity: 0; transform: translate(-50%, -40%); pointer-events: none; }
.envelope.is-opening .paper { transform: translateY(-22%); transition: transform .8s var(--ease) .55s; }

/* Abierta: el papel sale y ocupa su espacio real */
.envelope.is-open { aspect-ratio: auto; width: min(680px, 100%); perspective: none; }
.envelope.is-open .envelope__back,
.envelope.is-open .envelope__front,
.envelope.is-open .envelope__flap,
.envelope.is-open .envelope__seal { display: none; }
.envelope.is-open .paper {
  position: relative; left: auto; right: auto; top: auto; height: auto;
  overflow: visible;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 6vw, 4.5rem);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9);
  background:
    linear-gradient(180deg, rgba(216, 183, 122, .08), transparent 30%),
    var(--white);
  animation: unfold 1s var(--ease) both;
  transform-origin: 50% 0;
}
.envelope.is-open .paper > * { visibility: visible; }
@keyframes unfold { from { opacity: 0; transform: translateY(-30px) scaleY(.92); } to { opacity: 1; transform: none; } }

.paper__greeting { font-family: var(--hand); font-size: clamp(1.7rem, 5vw, 2.3rem); color: #5b4a86; margin-bottom: 1.2rem; }
.paper__body p {
  font-family: var(--serif); font-size: clamp(1.02rem, 2.2vw, 1.14rem);
  line-height: 1.85; margin-bottom: 1.1em; max-width: 36rem;
}
.paper__body p:first-child { font-size: clamp(1.3rem, 3vw, 1.6rem); font-style: italic; }
.paper__closing { margin-top: 2rem; font-family: var(--serif); font-style: italic; }
.paper__signature { font-family: var(--hand); font-size: 2rem; color: #5b4a86; }
.paper__signature:empty { display: none; }

/* Revelado de párrafos */
.envelope.is-open .paper__body p { opacity: 0; animation: ink .9s var(--ease) forwards; }
@keyframes ink { to { opacity: 1; } }

/* =====================================================================
   VISTA F · Cierre
   ===================================================================== */
.closing {
  min-height: 90vh; min-height: 90svh;
  display: grid; align-content: center; justify-items: center; gap: 1.6rem;
  text-align: center;
}
.closing__text {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.6vw, 3rem); line-height: 1.25;
  max-width: 44rem;
}
.closing__dedication { font-family: var(--hand); font-size: clamp(1.5rem, 4vw, 2rem); color: var(--gold); }
.closing .btn { margin-top: 1rem; }

/* =====================================================================
   Recuerdos en Polaroid (aparecen al elegir una canción con fotos)
   ===================================================================== */
.memories {
  grid-column: 1 / -1;
  list-style: none;
  position: relative;
  margin: .5rem 0 1rem;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(.75rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
  border-radius: 14px;
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(139, 114, 217, .16), transparent 70%),
    radial-gradient(60% 70% at 50% 100%, rgba(216, 183, 122, .07), transparent 70%),
    rgba(8, 10, 16, .65);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(243, 240, 234, .04);
  overflow: hidden;                      /* las rotaciones nunca generan scroll lateral */
  animation: memories-in .8s var(--ease) both;
}
@keyframes memories-in { from { opacity: 0; } to { opacity: 1; } }
.notes__list .memories { margin: 0 0 1.5rem; }

.memories__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.memories__dedication {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.4;
  color: var(--white); max-width: 34rem;
}
.memories__hide {
  flex: none; margin-left: auto;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: .88rem;
  min-height: 40px; padding: .4rem .2rem;
}
.memories__hide:hover { color: var(--gold); }

.memories__photos {
  list-style: none; margin: 0; padding: 0 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  row-gap: 2rem;
}

.polaroid {
  --rot: 0deg; --i: 0; --lift: 0px;
  position: relative;
  width: clamp(160px, 16vw, 220px);
  margin: 0 -1.1rem;                     /* superposición suave: nunca tapan más de ~20 % */
  transform: translateY(var(--lift)) rotate(var(--rot));
  transition: transform .6s var(--ease);
  animation: polaroid-in 1.1s var(--ease) both;
  animation-delay: calc(var(--i) * 170ms + 150ms);
}
.polaroid:nth-child(even) { --lift: 14px; }
.polaroid:hover, .polaroid:focus-within {
  z-index: 3;
  transform: translateY(calc(var(--lift) - 6px)) rotate(0deg) scale(1.03);
}
@keyframes polaroid-in {
  from { opacity: 0; transform: translateY(calc(var(--lift) + 22px)) rotate(calc(var(--rot) - 5deg)) scale(.97); }
}

.polaroid__frame {
  display: block; width: 100%;
  padding: 9% 7% 0; border: 0; border-radius: 3px;
  background: linear-gradient(180deg, #f6f2e9, #ece6d9);
  color: #3a3448; text-align: center; cursor: zoom-in;
  box-shadow: 0 22px 40px -20px rgba(0, 0, 0, .9), 0 3px 8px rgba(0, 0, 0, .35);
}
.polaroid__photo {
  display: block; aspect-ratio: 4 / 5; overflow: hidden;
  background: #d9d2c4;
}
.polaroid__photo img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 35%;   /* recorte centrado algo alto: protege caras */
  opacity: 0; transition: opacity .8s var(--ease);
}
.polaroid.is-loaded .polaroid__photo img { opacity: 1; }
.polaroid__caption {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 3.6rem; padding: .35rem .2rem .55rem;
}
.polaroid__pie { font-family: var(--hand); font-size: 1.2rem; line-height: 1.2; }
.polaroid__date { font-size: .74rem; color: #6d6676; margin-top: .15rem; }

/* Vista ampliada */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--white);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(8, 10, 16, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox__figure {
  margin: 0; display: grid; justify-items: center; gap: .9rem;
  padding: calc(4rem + var(--safe-top)) 3.5rem calc(2rem + var(--safe-bottom));
  max-width: 100%;
}
.lightbox__img {
  max-width: min(92vw, 1100px); max-height: 74vh; max-height: 74dvh;
  width: auto; height: auto; object-fit: contain;   /* la foto completa, sin recorte */
  border: 10px solid #f6f2e9; border-bottom-width: 34px; border-radius: 3px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
  animation: memories-in .5s var(--ease) both;
}
.lightbox__caption { font-family: var(--serif); font-style: italic; color: var(--white); text-align: center; max-width: 36rem; }
.lightbox__close {
  position: fixed; top: calc(1rem + var(--safe-top)); right: 1rem;
  min-height: 44px; padding: .5rem 1.1rem; border-radius: 999px;
  background: rgba(243, 240, 234, .1); border: 1px solid var(--line);
  color: var(--white); cursor: pointer;
}
.lightbox__close:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(243, 240, 234, .08); border: 1px solid var(--line);
  color: var(--white); font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.lightbox__nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__nav--prev { left: .5rem; }
.lightbox__nav--next { right: .5rem; }
body.has-lightbox { overflow: hidden; }

/* =====================================================================
   Reproductor único
   ===================================================================== */
.dock {
  position: fixed; z-index: 35; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem var(--gutter) calc(.6rem + var(--safe-bottom));
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  transform: translateY(0);
  transition: transform .5s var(--ease);
}
.dock[hidden] { display: none; }
.dock { flex-wrap: wrap; }
.dock__hint {
  flex: 1 0 100%; order: -1;
  color: var(--gold); font-size: .88rem; text-align: center;
}
.dock--attention { border-top-color: rgba(216, 183, 122, .6); box-shadow: 0 -12px 40px -16px rgba(216, 183, 122, .5); }
.dock--attention .dock__player { box-shadow: 0 0 0 2px var(--gold); }
.dock__player { flex: 1; min-width: 0; height: 80px; border-radius: 12px; overflow: hidden; background: var(--slate); }
.dock__player iframe { display: block; background: var(--slate); width: 100%; height: 80px; border: 0; }
.dock__loading { height: 80px; display: grid; place-items: center; padding: 0 1rem; color: var(--muted); font-size: .9rem; text-align: center; }
.dock__actions { display: flex; flex-direction: column; gap: .2rem; align-items: flex-end; }
.dock__link, .dock__close {
  font-size: .85rem; color: var(--muted); text-decoration: none;
  background: none; border: 0; cursor: pointer;
  min-height: 36px; padding: .3rem .4rem; white-space: nowrap;
}
.dock__link:hover, .dock__close:hover { color: var(--gold); }

/* =====================================================================
   Movimiento reducido
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .welcome__beams i, .stage__beams i { animation: none; transform: rotate(var(--r)); }
  .stage__waves i { display: none; }
  .moment__card { opacity: 1; transform: none; }
  .polaroid, .memories, .lightbox__img { animation: none; }
  .polaroid, .polaroid:hover, .polaroid:focus-within { transform: rotate(var(--rot)); }
}
