:root {
  color-scheme: dark;
  --ink: #050608;
  --ivory: #f5f0e8;
  --sky: #44a6c9;
  --spring: #6cad43;
  --violet: #725191;
  --magenta: #c54b83;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); }

button { font: inherit; }

.experience, .cinema, .access-screen { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; }

.experience { background: #000; isolation: isolate; }

.access-screen {
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111;
  transition: opacity 1.1s cubic-bezier(.55, 0, .1, 1), visibility 1.1s;
}

.access-screen.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.access-screen__image {
  position: absolute;
  inset: -3%;
  background: url("portada.jpg") center 46% / cover no-repeat;
  filter: saturate(.82) contrast(1.05) brightness(.62);
  animation: openingDrift 16s ease-out both;
}

.access-screen__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 10, .3) 0%, rgba(5, 6, 8, .08) 38%, rgba(5, 6, 8, .92) 100%),
    radial-gradient(circle at 50% 43%, transparent 18%, rgba(2, 3, 5, .55) 100%);
}

.access-screen__content {
  position: absolute;
  z-index: 1;
  bottom: clamp(2.5rem, 8vh, 5rem);
  width: min(87vw, 620px);
  text-align: center;
  text-shadow: 0 2px 32px rgba(0, 0, 0, .7);
}

.eyebrow, .access-screen__place {
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: clamp(.69rem, 1.5vw, .82rem);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.access-screen h1 {
  margin: .65rem 0 .8rem;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 8.5vw, 5.8rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .83;
}

.access-screen h1 em { color: #d8efc2; font-weight: 400; }

.access-screen__place { margin-bottom: clamp(2rem, 5vh, 3.5rem); color: rgba(255,255,255,.66); }

.start-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.15rem;
  width: min(88vw, 370px);
  min-height: 78px;
  padding: .55rem 1.9rem .55rem .62rem;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 9, 11, .42);
  box-shadow: 0 14px 48px rgba(0,0,0,.42), 0 0 34px rgba(216,239,194,.08), inset 0 0 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: .045em;
  transition: transform .3s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease;
  animation: startButtonGlow 3.8s ease-in-out infinite;
}

.start-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(216,239,194,.08), transparent 45%, rgba(68,166,201,.08));
  opacity: .75;
}

.start-button:hover { transform: translateY(-3px) scale(1.01); background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.75); box-shadow: 0 18px 54px rgba(0,0,0,.46), 0 0 44px rgba(216,239,194,.14); }
.start-button:focus-visible, .control-button:focus-visible { outline: 2px solid white; outline-offset: 4px; }
.start-button:disabled { cursor: wait; opacity: .7; }

.start-button__icon { flex: 0 0 auto; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: #13200e; background: #d8efc2; box-shadow: 0 0 26px rgba(216,239,194,.22); }
.start-button__icon svg { width: 29px; fill: currentColor; }

.sound-note { display: flex; justify-content: center; align-items: center; gap: .45rem; margin: 1rem 0 0; color: rgba(255,255,255,.55); font-size: .72rem; letter-spacing: .06em; }
.sound-note svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.access-screen__line { position: absolute; z-index: 1; right: max(22px, 3vw); bottom: 0; width: 1px; height: 12vh; background: linear-gradient(transparent, rgba(255,255,255,.6)); }

.cinema { z-index: 1; display: grid; place-items: center; background: #000; }

.ambient { position: absolute; inset: -7%; overflow: hidden; opacity: 0; transition: opacity 1s ease; }
.ambient.is-visible { opacity: .52; }
.ambient video { width: 100%; height: 100%; object-fit: cover; filter: blur(45px) saturate(.72) brightness(.45); transform: scale(1.08); }
.ambient__wash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.04) 0%, rgba(0,0,0,.68) 72%, #000 100%), linear-gradient(110deg, rgba(68,166,201,.08), transparent 38%, rgba(197,75,131,.08)); }

.film-frame {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
  opacity: 0;
  overflow: hidden;
  background: #000;
  transition: opacity .75s ease;
}

.film-frame.is-visible { opacity: 1; }
.film-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.film-frame__shade { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0,0,0,.2); }

.presentation {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  opacity: 0;
  text-align: center;
  pointer-events: none;
}

.presentation.is-visible { animation: titleSequence 3.7s ease both; }
.presentation__rule { display: block; width: 0; height: 1px; margin-bottom: 1.2rem; background: linear-gradient(90deg, transparent, #d8efc2, transparent); }
.presentation.is-visible .presentation__rule { animation: ruleReveal 2.8s .35s ease both; }
.presentation p { margin: 0; font-size: clamp(.76rem, 2.1vw, 1.05rem); font-weight: 500; letter-spacing: .25em; text-transform: uppercase; }
.presentation strong { margin-top: .65rem; color: rgba(245,240,232,.72); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.4rem, 4.2vw, 2.5rem); font-style: italic; font-weight: 400; letter-spacing: .04em; }

.chapter-opening {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--ivory);
  background: #000;
  opacity: 0;
  text-align: center;
  pointer-events: none;
}

.chapter-opening.is-visible { animation: chapterOpeningSequence 4.1s cubic-bezier(.45, 0, .2, 1) both; }
.chapter-opening p { margin: 0 0 1rem; color: rgba(216,239,194,.74); font-size: clamp(.7rem, 1.6vw, .86rem); font-weight: 650; letter-spacing: .3em; text-transform: uppercase; }
.chapter-opening__rule { width: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,239,194,.9), transparent); }
.chapter-opening.is-visible .chapter-opening__rule { animation: chapterRule 3.4s .3s ease both; }
.chapter-opening h2 { margin: 1rem 0 .7rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 8vw, 6.5rem); font-weight: 400; letter-spacing: -.05em; line-height: .9; }
.chapter-opening strong { color: rgba(245,240,232,.64); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1rem, 2.6vw, 1.45rem); font-style: italic; font-weight: 400; }

.farewell-transition {
  position: absolute;
  z-index: 11;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 58%, rgba(237,174,94,.3), transparent 34%),
    radial-gradient(circle at 50% 42%, rgba(255,226,173,.12), transparent 58%),
    #000;
  pointer-events: none;
  transition: opacity 1.15s ease;
}

.farewell-transition.is-active { opacity: 1; animation: farewellWarmth 3s ease-in-out both; }
.farewell-transition.is-freeze { opacity: .52; background: radial-gradient(circle at 50% 54%, rgba(236,167,83,.24), transparent 44%), linear-gradient(180deg, rgba(0,0,0,.05), rgba(25,10,2,.42)); mix-blend-mode: screen; }

.final-credits {
  position: absolute;
  z-index: 13;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 50% 58%, rgba(102,48,20,.2), transparent 48%),
    radial-gradient(circle at 50% 32%, rgba(225,160,78,.08), transparent 35%),
    #020202;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.5s ease, visibility 1.5s;
}

.final-credits.is-visible { opacity: 1; visibility: visible; }
.final-credits.is-ending { opacity: 0; }

.credits-particles { position: absolute; inset: 0; overflow: hidden; opacity: .32; }
.credits-particles span { position: absolute; bottom: -5%; width: 3px; height: 3px; border-radius: 50%; background: rgba(255,214,153,.7); box-shadow: 0 0 12px rgba(255,180,90,.4); animation: creditParticle 13s linear infinite; }
.credits-particles span:nth-child(1) { left: 9%; animation-delay: -3s; }
.credits-particles span:nth-child(2) { left: 21%; width: 2px; height: 2px; animation-delay: -9s; animation-duration: 17s; }
.credits-particles span:nth-child(3) { left: 36%; animation-delay: -6s; animation-duration: 15s; }
.credits-particles span:nth-child(4) { left: 48%; width: 2px; height: 2px; animation-delay: -12s; }
.credits-particles span:nth-child(5) { left: 62%; animation-delay: -5s; animation-duration: 18s; }
.credits-particles span:nth-child(6) { left: 73%; width: 2px; height: 2px; animation-delay: -10s; }
.credits-particles span:nth-child(7) { left: 84%; animation-delay: -2s; animation-duration: 16s; }
.credits-particles span:nth-child(8) { left: 93%; width: 2px; height: 2px; animation-delay: -8s; }

.credits-card {
  position: absolute;
  width: min(86vw, 900px);
  opacity: 0;
  text-align: center;
  text-shadow: 0 4px 35px rgba(0,0,0,.8);
  pointer-events: none;
}

.credits-card.is-current { animation: creditMoment var(--credit-duration, 4s) cubic-bezier(.45, 0, .2, 1) both; }
.credits-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 6vw, 5.6rem); font-weight: 400; letter-spacing: -.045em; line-height: .94; }
.credits-card p { margin: .6rem 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 3.4vw, 2.8rem); font-weight: 400; line-height: 1.18; }
.credits-card--final h2 { font-size: clamp(2.6rem, 6.8vw, 6.2rem); }
.credits-card--final h2 em { color: #d8efc2; font-weight: 400; }
.credits-card--final p { margin: 1.25rem 0 .55rem; font-family: inherit; font-size: clamp(.75rem, 1.6vw, 1rem); font-weight: 650; letter-spacing: .2em; text-transform: uppercase; }
.credits-card--final span { color: rgba(255,255,255,.55); font-size: clamp(.68rem, 1.3vw, .82rem); font-weight: 650; letter-spacing: .22em; text-transform: uppercase; }
.credits-card--recognition span, .credits-card--detail span, .credits-card--donation span { display: block; margin-bottom: 1.1rem; color: rgba(216,239,194,.68); font-size: clamp(.68rem, 1.3vw, .85rem); font-weight: 650; letter-spacing: .22em; text-transform: uppercase; }
.credits-card--recognition h2 { color: #fff8ec; font-size: clamp(2.65rem, 6.7vw, 6rem); text-shadow: 0 0 45px rgba(238,174,91,.2); }
.credits-card--detail h2 { font-size: clamp(2.1rem, 5.3vw, 4.7rem); }
.credits-card--donation span { margin-bottom: .7rem; color: rgba(255,255,255,.48); font-size: clamp(.62rem, 1.05vw, .74rem); }
.credits-card--donation p { margin: 0; color: rgba(255,255,255,.78); font-family: inherit; font-size: clamp(.82rem, 1.5vw, 1.05rem); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }

.location-title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(1.4rem, 6vw, 4rem) max(11vh, 5rem);
  color: white;
  background: linear-gradient(180deg, transparent 36%, rgba(0,0,0,.7) 100%);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 3px 30px rgba(0,0,0,.72);
}

.location-title.is-visible { animation: locationReveal 1.5s ease forwards; }
.location-title p { margin: 0 0 .8rem; font-size: clamp(.7rem, 1.8vw, .86rem); font-weight: 650; letter-spacing: .22em; text-transform: uppercase; }
.location-title p span { margin-left: .7rem; color: #d8efc2; }
.location-title i { width: 0; height: 1px; margin-bottom: 1rem; background: linear-gradient(90deg, #d8efc2, transparent); transition: width 1.1s .25s ease; }
.location-title.is-visible i { width: min(62vw, 290px); }
.location-title h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.15rem, 7.4vw, 4.5rem); font-weight: 400; letter-spacing: -.04em; line-height: .9; }
.location-title h2 em { color: #d8efc2; font-weight: 400; }

.curtain { position: absolute; z-index: 10; inset: 0; background: #000; opacity: 1; pointer-events: none; transition: opacity .9s ease; }
.curtain.is-open { opacity: 0; }

.direct-navigation {
  position: absolute;
  z-index: 18;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  display: flex;
  gap: .45rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s, transform .35s ease;
}
.direct-navigation.is-visible { opacity: .88; visibility: visible; }
.direct-navigation.is-idle { opacity: 0; visibility: hidden; transform: translateY(-7px); pointer-events: none; }
.direct-navigation button { display: flex; align-items: center; gap: .48rem; min-height: 40px; padding: .48rem .78rem; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; color: rgba(255,255,255,.86); background: rgba(3,4,6,.4); backdrop-filter: blur(14px); cursor: pointer; font-size: .68rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; transition: color .25s ease, background .25s ease, border-color .25s ease; }
.direct-navigation button:hover, .direct-navigation button:focus-visible { color: white; border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.12); outline: 0; }
.direct-navigation svg { width: 17px; fill: currentColor; }

.controls {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: max(4.8rem, calc(env(safe-area-inset-bottom) + 4.1rem));
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(3,4,6,.42);
  box-shadow: 0 12px 45px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity .35s ease, visibility .35s, transform .35s ease;
}

.controls.is-visible { opacity: .88; visibility: visible; }
.controls.is-idle { opacity: 0; visibility: hidden; transform: translate(-50%, 8px); pointer-events: none; }
.controls:hover { opacity: 1; }
.control-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255,255,255,.27); border-radius: 50%; color: white; background: rgba(0,0,0,.3); backdrop-filter: blur(12px); cursor: pointer; }
.control-button:hover { background: rgba(255,255,255,.15); }
.control-button svg { width: 20px; fill: currentColor; }
.control-button svg text { font: 700 7px Inter, sans-serif; fill: currentColor; }
.chapter-menu-control { display: none; }
.cinema.is-chapter #restartButton { display: none; }
.cinema.is-chapter .chapter-menu-control { display: grid; }
.icon-play { display: none; }
.is-paused .icon-pause { display: none; }
.is-paused .icon-play { display: block; }
.icon-fullscreen-exit { display: none; }
.is-fullscreen .icon-fullscreen { display: none; }
.is-fullscreen .icon-fullscreen-exit { display: block; }

.progress { position: absolute; z-index: 17; right: clamp(1rem, 4vw, 3.5rem); bottom: max(.85rem, env(safe-area-inset-bottom)); left: clamp(1rem, 4vw, 3.5rem); padding: .55rem .65rem .65rem; border-radius: 12px; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s; }
.progress::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(3,4,6,.2), rgba(3,4,6,.62)); backdrop-filter: blur(12px); opacity: .82; }
.progress.is-visible { opacity: 1; visibility: visible; }
.progress.is-idle { opacity: 0; visibility: hidden; pointer-events: none; }
.progress__meta { position: relative; display: grid; grid-template-columns: 1fr auto auto auto; gap: .45rem; align-items: center; margin-bottom: .28rem; color: rgba(255,255,255,.56); font-size: .68rem; font-weight: 600; letter-spacing: .06em; }
.progress__meta > span:first-child { overflow: hidden; color: rgba(255,255,255,.78); text-overflow: ellipsis; white-space: nowrap; }
.progress__track { position: relative; height: 22px; }
.progress__track::before { content: ""; position: absolute; top: 10px; right: 0; left: 0; height: 2px; background: rgba(255,255,255,.16); }
.progress__fill { position: absolute; top: 10px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, var(--sky), #d8efc2, var(--magenta)); box-shadow: 0 0 10px rgba(216,239,194,.24); pointer-events: none; }
.progress__markers { position: absolute; inset: 0; pointer-events: none; }
.progress__markers i { position: absolute; top: 7px; width: 1px; height: 8px; background: rgba(255,255,255,.36); transform: translateX(-.5px); }
#timelineRange { position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; opacity: 0; cursor: pointer; touch-action: none; }
.progress:focus-within .progress__track::before { background: rgba(255,255,255,.28); }

.chapter-switcher { position: absolute; z-index: 19; right: max(1rem, env(safe-area-inset-right)); bottom: max(8.2rem, calc(env(safe-area-inset-bottom) + 7.4rem)); display: grid; width: min(88vw, 320px); padding: 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: white; background: rgba(3,4,6,.78); box-shadow: 0 22px 65px rgba(0,0,0,.55); backdrop-filter: blur(22px); opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .32s ease, visibility .32s, transform .32s ease; }
.chapter-switcher.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.chapter-switcher p { margin: 0 0 .45rem; color: rgba(216,239,194,.6); font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.chapter-switcher button { display: grid; grid-template-columns: 2rem 1fr; gap: .35rem; width: 100%; padding: .72rem .45rem; border: 0; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.68); background: transparent; cursor: pointer; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; text-align: left; transition: color .25s ease, background .25s ease; }
.chapter-switcher button:first-of-type, .chapter-switcher button:last-of-type { grid-template-columns: 1fr; font-family: inherit; font-size: .7rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.chapter-switcher button:hover, .chapter-switcher button:focus-visible, .chapter-switcher button.is-current { color: white; background: rgba(255,255,255,.06); outline: 0; }
.chapter-switcher button span { color: rgba(216,239,194,.58); font-family: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .1em; }

@media (min-aspect-ratio: 4/5) {
  .film-frame { width: min(56.25vh, 44vw); height: min(100vh, 177.78vw); box-shadow: 0 0 100px rgba(0,0,0,.58), 0 0 0 1px rgba(255,255,255,.08); }
  .film-frame__shade { box-shadow: inset 0 0 65px rgba(0,0,0,.24); }
  .location-title { padding-inline: clamp(1.4rem, 3vw, 2.6rem); }
}

@media (max-width: 520px) {
  .access-screen__content { bottom: max(3.2rem, env(safe-area-inset-bottom)); }
  .access-screen h1 { font-size: clamp(2.75rem, 13vw, 4.1rem); }
  .start-button { width: min(90vw, 355px); min-height: 76px; padding-right: 1.3rem; font-size: .96rem; }
  .start-button__icon { width: 60px; height: 60px; }
  .controls { bottom: max(5.05rem, calc(env(safe-area-inset-bottom) + 4.45rem)); gap: .18rem; padding: .32rem; }
  .control-button { width: 37px; height: 37px; }
  .control-button svg { width: 18px; }
  #restartButton { display: none; }
  .progress { right: .6rem; bottom: max(.45rem, env(safe-area-inset-bottom)); left: .6rem; padding-inline: .5rem; }
  .progress__meta { font-size: .62rem; }
  .chapter-switcher { right: .7rem; bottom: max(7.9rem, calc(env(safe-area-inset-bottom) + 7.2rem)); }
  .direct-navigation { top: max(.7rem, env(safe-area-inset-top)); left: max(.7rem, env(safe-area-inset-left)); }
  .direct-navigation button { min-height: 37px; padding: .42rem .64rem; font-size: .62rem; }
  .direct-navigation svg { width: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

@keyframes openingDrift { from { transform: scale(1.04); } to { transform: scale(1); } }
@keyframes contentReveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes titleSequence { 0% { opacity: 0; transform: translateY(12px); } 18%, 76% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes ruleReveal { 0% { width: 0; opacity: 0; } 24%, 76% { width: min(58vw, 390px); opacity: 1; } 100% { width: 0; opacity: 0; } }
@keyframes locationReveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes startButtonGlow { 0%, 100% { box-shadow: 0 14px 48px rgba(0,0,0,.42), 0 0 28px rgba(216,239,194,.06), inset 0 0 0 1px rgba(255,255,255,.05); } 50% { box-shadow: 0 16px 52px rgba(0,0,0,.45), 0 0 44px rgba(216,239,194,.14), inset 0 0 0 1px rgba(255,255,255,.08); } }
@keyframes chapterOpeningSequence { 0% { opacity: 0; } 16%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes chapterRule { 0% { width: 0; opacity: 0; } 24%, 78% { width: min(64vw, 430px); opacity: 1; } 100% { width: 0; opacity: 0; } }
@keyframes farewellWarmth { 0% { opacity: 0; } 32%, 72% { opacity: 1; } 100% { opacity: .82; } }
@keyframes creditMoment { 0% { opacity: 0; transform: translateY(15px); } 18%, 76% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes creditParticle { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 18% { opacity: .7; } 82% { opacity: .32; } 100% { transform: translate3d(18px, -110vh, 0); opacity: 0; } }

/* Menú principal — continuidad visual de la introducción */
.main-menu {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(420px, 1.15fr);
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: clamp(2rem, 7vw, 8rem);
  min-height: 100%;
  min-height: 100dvh;
  padding: clamp(2rem, 6vw, 6rem);
  overflow: hidden;
  color: white;
  background: #030405;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.6s cubic-bezier(.45, 0, .1, 1), visibility 1.6s;
}

.main-menu.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }

.menu-backdrops, .menu-backdrop, .menu-atmosphere { position: absolute; inset: 0; }

.menu-backdrops { z-index: -1; overflow: hidden; background: #060708; }

.menu-backdrop {
  background-image: var(--menu-image);
  background-position: center 42%;
  background-size: cover;
  opacity: 0;
  filter: saturate(.72) contrast(1.04) brightness(.62);
  transform: scale(1.06);
  transition: opacity 1.15s ease, transform 6s ease;
}

.menu-backdrop.is-active { opacity: 1; transform: scale(1.015); }

.menu-atmosphere {
  background:
    linear-gradient(90deg, rgba(2,3,5,.88) 0%, rgba(2,3,5,.6) 30%, rgba(2,3,5,.12) 55%, rgba(2,3,5,.72) 100%),
    linear-gradient(180deg, rgba(3,4,6,.25) 0%, transparent 33%, rgba(1,2,3,.88) 100%),
    radial-gradient(ellipse at 68% 40%, transparent 8%, rgba(0,0,0,.4) 76%);
}

.menu-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .15;
  background-image: radial-gradient(rgba(255,255,255,.25) .55px, transparent .75px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.menu-light { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .14; pointer-events: none; animation: lightDrift 10s ease-in-out infinite alternate; }
.menu-light--one { right: 10%; bottom: 10%; width: 36vw; height: 18vw; background: var(--magenta); }
.menu-light--two { top: 3%; left: 24%; width: 28vw; height: 20vw; background: var(--sky); animation-delay: -5s; }

.menu-heading { position: relative; z-index: 1; align-self: end; padding-bottom: 1.1rem; text-shadow: 0 3px 35px rgba(0,0,0,.78); }

.menu-heading > p, .chapter-menu__eyebrow, .menu-location {
  margin: 0;
  color: rgba(255,255,255,.67);
  font-size: clamp(.7rem, 1.15vw, .82rem);
  font-weight: 650;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.menu-heading h2 {
  margin: .85rem 0 1.2rem;
  max-width: 620px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 6.1vw, 6.7rem);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .82;
}

.menu-heading h2 em { color: #d8efc2; font-weight: 400; }
.menu-heading__line { display: block; width: min(36vw, 350px); height: 1px; background: linear-gradient(90deg, #d8efc2, rgba(216,239,194,0)); }

.chapter-menu { position: relative; z-index: 1; align-self: center; width: min(100%, 620px); padding-top: 5vh; }
.chapter-menu__eyebrow { margin: 0 0 1.25rem 3.9rem; color: rgba(255,255,255,.55); }
.chapter-menu ol { margin: 0; padding: 0; list-style: none; }
.chapter-menu li { border-top: 1px solid rgba(255,255,255,.16); }
.chapter-menu li:last-child { border-bottom: 1px solid rgba(255,255,255,.16); }

.chapter-choice {
  position: relative;
  display: grid;
  grid-template-columns: 2.8rem 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: clamp(64px, 9vh, 90px);
  padding: .5rem .35rem;
  border: 0;
  color: rgba(255,255,255,.58);
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-shadow: 0 3px 24px rgba(0,0,0,.9);
  transition: color .4s ease, padding-left .4s ease;
}

.chapter-choice:hover, .chapter-choice:focus-visible, .chapter-choice.is-active { color: white; padding-left: .7rem; }
.chapter-choice:focus-visible { outline: 1px solid rgba(216,239,194,.72); outline-offset: -1px; }
.chapter-choice__number { font-size: .72rem; font-weight: 650; letter-spacing: .15em; color: rgba(216,239,194,.65); }
.chapter-choice__title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 2.9vw, 2.75rem); letter-spacing: -.025em; }
.chapter-choice__mark { width: 0; height: 1px; background: linear-gradient(90deg, #d8efc2, transparent); transition: width .45s ease; }
.chapter-choice.is-active .chapter-choice__mark { width: clamp(38px, 5vw, 76px); }

.chapter-menu__status {
  min-height: 1.4rem;
  margin: 1rem 0 0 3.9rem;
  color: rgba(255,255,255,.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .95rem;
  font-style: italic;
  transition: opacity .25s ease;
}

.chapter-menu__status.is-changing { opacity: 0; }

.menu-utilities {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  justify-self: start;
}

.replay-intro, .music-toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 0;
  border: 0;
  color: rgba(255,255,255,.62);
  background: transparent;
  cursor: pointer;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: color .3s ease;
}

.replay-intro:hover, .music-toggle:hover { color: white; }
.replay-intro:focus-visible, .music-toggle:focus-visible { outline: 1px solid rgba(255,255,255,.65); outline-offset: 6px; }
.replay-intro svg, .music-toggle svg { width: 18px; fill: currentColor; }
.music-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.music-toggle__off { display: none; }
.music-toggle.is-muted .music-toggle__on { display: none; }
.music-toggle.is-muted .music-toggle__off { display: block; }
.menu-location { position: relative; z-index: 2; align-self: center; justify-self: end; color: rgba(255,255,255,.42); }
.menu-location span { margin: 0 .35rem; color: #d8efc2; }

.main-menu.is-visible .menu-heading { animation: menuContentIn 1.2s .45s both; }
.main-menu.is-visible .chapter-menu { animation: menuContentIn 1.2s .7s both; }
.main-menu.is-visible .menu-utilities, .main-menu.is-visible .menu-location { animation: menuContentIn 1s 1s both; }

@media (max-width: 860px) {
  .main-menu {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: initial;
    gap: 1.2rem;
    padding: max(1.5rem, env(safe-area-inset-top)) 1.35rem max(1.2rem, env(safe-area-inset-bottom));
  }
  .menu-backdrop { background-position: center 30%; }
  .menu-atmosphere { background: linear-gradient(180deg, rgba(2,3,5,.55) 0%, rgba(2,3,5,.2) 34%, rgba(2,3,5,.93) 68%, #020304 100%); }
  .menu-heading { align-self: start; padding: 0; }
  .menu-heading > p { font-size: .63rem; }
  .menu-heading h2 { margin: .6rem 0 .7rem; font-size: clamp(2.5rem, 11.5vw, 4rem); }
  .menu-heading__line { width: 42vw; }
  .chapter-menu { align-self: end; width: 100%; padding: 0; }
  .chapter-menu__eyebrow { margin: 0 0 .55rem 2.7rem; font-size: .62rem; }
  .chapter-choice { grid-template-columns: 1.75rem 1fr auto; gap: .7rem; min-height: clamp(52px, 7.2vh, 66px); }
  .chapter-choice__title { font-size: clamp(1.35rem, 6.3vw, 1.9rem); }
  .chapter-choice__mark { display: none; }
  .chapter-menu__status { margin: .65rem 0 0 2.7rem; font-size: .82rem; }
  .menu-utilities { grid-row: 3; gap: 1rem; }
  .replay-intro, .music-toggle { font-size: .65rem; padding-bottom: 0; }
  .menu-location { position: absolute; right: 1.35rem; bottom: max(1.2rem, env(safe-area-inset-bottom)); font-size: .62rem; }
}

@media (max-width: 520px) {
  .menu-location { display: none; }
}

@media (max-height: 680px) and (max-width: 860px) {
  .menu-heading h2 { font-size: 2.35rem; }
  .chapter-choice { min-height: 45px; }
  .chapter-menu__status { display: none; }
}

@keyframes lightDrift { from { transform: translate3d(-3%, -2%, 0) scale(.92); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
@keyframes menuContentIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
