/* Story player v2: isolated visual system for the published static build. */
.story-player {
  --motion-scene: 860ms;
  --motion-act: 1080ms;
  --motion-enter: 620ms;
  --motion-gastro: 700ms;
  --ease-cinema: cubic-bezier(.22, 1, .36, 1);
}

/* The landing page has one direct entry into the story; the old teaser is no longer a second step. */
.event-page .story-teaser,
.event-page .hero-scroll { display: none; }

/* Keep the welcome portrait aligned with the refined right-side facial detail. */
.event-page .hero-hosts {
  background-image: url("/la-perigalla-01/media/storytelling/perigalla-01/hosts/hosts-hero-v6-right-face-refined.png");
}

/* The welcome image and its promise are one opening composition, before the story begins. */
.event-page .event-hero {
  height: 64svh;
  min-height: 500px;
  max-height: none;
  padding-block: clamp(92px, 12vh, 142px) clamp(52px, 7vh, 84px);
}

/* On wide screens, keep the hosts' faces within the opening frame and crop from below. */
@media (min-width: 801px) {
  .event-page .hero-hosts { background-position: 50% 0%; }
}

.event-page .promise {
  min-height: 36svh;
  padding: clamp(38px, 6vh, 66px) clamp(42px, 9.5vw, 184px);
}
.event-page .promise p {
  max-width: 36ch;
  font-size: clamp(32px, 3.2vw, 52px);
  line-height: 1.04;
}

.event-hero .hero-copy > button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  min-width: 205px;
  padding: 15px 18px;
  border: 0;
  color: var(--ink);
  background: var(--cream);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.event-hero .hero-copy > button:hover,
.event-hero .hero-copy > button:focus-visible { color: var(--cream); background: var(--ink); outline: 1px solid var(--cream); outline-offset: 4px; }

@media (max-width: 800px) {
  .event-page .event-hero {
    height: auto;
    min-height: 600px;
    padding: 140px 22px 56px;
  }
  .event-page .promise {
    min-height: 0;
    padding: 54px 22px;
  }
  .event-page .promise p { max-width: 22ch; }
}

.story-player .scene-composition { overflow: hidden; }
.story-player .scene-artwork { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.story-player .scene-artwork-bleed,
.story-player .scene-artwork-main { position: absolute; inset: -1px; display: block; }
.story-player .scene-artwork-bleed { transform: scale(1.08); filter: blur(18px) brightness(.55) saturate(.86); }
.story-player .scene-artwork-bleed img,
.story-player .scene-artwork-main img { display: block; inline-size: 100%; block-size: 100%; object-position: var(--art-position-desktop, center); }
.story-player .scene-artwork-bleed img { object-fit: cover; }
.story-player .scene-artwork-main img { object-fit: cover; }

.story-player .scene-stage { min-block-size: 100%; padding-bottom: max(172px, env(safe-area-inset-bottom)); }
.story-player .scene-stage.has-gastronomy { padding-bottom: max(172px, env(safe-area-inset-bottom)); }
.story-player .scene-marker { top: max(20px, calc(env(safe-area-inset-top) + 8px)); right: max(22px, calc(env(safe-area-inset-right) + 18px)); left: auto; z-index: 7; }
.story-player .scene-marker span { transform: none; }
.story-player .player-controls button { min-inline-size: 46px; min-block-size: 46px; }
.story-player .player-controls button:active { transform: scale(.94); }
.story-player .player-top,
.story-player .player-progress,
.story-player .player-controls { z-index: 30; pointer-events: auto; }
.story-player .player-controls { padding-bottom: max(15px, calc(env(safe-area-inset-bottom) + 10px)); }
.story-audio-recovery {
  display: none;
  position: absolute;
  z-index: 40;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 64px));
  padding: 12px 16px;
  border: 1px solid var(--cream);
  color: var(--ink);
  background: var(--cream);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.story-player.needs-audio-recovery .story-audio-recovery { display: inline-flex; }
.ios-story-start { position: absolute; z-index: 80; inset: 0; display: grid; align-content: center; justify-items: start; gap: 20px; padding: max(48px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left)); background: radial-gradient(ellipse 72% 90% at 86% 50%, rgba(16, 38, 43, .18), rgba(2, 11, 16, .9) 64%), rgba(2, 11, 16, .52); color: var(--cream); text-align: left; }
.ios-story-start p { margin: 0; color: var(--sun); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.ios-story-start h1 { margin: 0; font: 400 clamp(42px, 13vw, 62px)/.94 Georgia, serif; letter-spacing: -.055em; }
.ios-story-start h1 em { color: var(--sun); }
.ios-story-start span { max-width: 31ch; color: rgba(244, 239, 229, .82); font-size: 14px; line-height: 1.5; }
.ios-story-start button { display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; min-width: 236px; margin-top: 8px; padding: 16px 18px; border: 1px solid var(--cream); background: var(--cream); color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.ios-story-start button b { font-size: 18px; font-weight: 400; }
.ios-story-start button:disabled { cursor: wait; opacity: .62; }
.story-player.is-audio-buffering .scene-marker::after {
  content: " · preparando narración";
  color: var(--cream);
  font-size: 8px;
  letter-spacing: .1em;
}

.story-player .scene-artwork-main img { animation-delay: var(--story-camera-delay, 0ms); }
.story-player.is-starting .scene-composition.is-active:not(.is-outgoing) .scene-artwork-main { animation: story-v2-art-in var(--motion-enter) var(--ease-cinema) both; }
.story-player.is-starting .scene-composition.is-active:not(.is-outgoing) .scene-copy { animation: story-v2-copy-in 560ms 150ms var(--ease-cinema) both; }
.story-player.is-starting .scene-composition.is-active:not(.is-outgoing) .scene-marker { animation: story-v2-marker-in 500ms 90ms var(--ease-cinema) both; }
.story-player.is-starting .scene-composition.is-active:not(.is-outgoing) .dialogue-bubbles { animation: story-v2-copy-in 460ms 270ms var(--ease-cinema) both; }
.story-player .scene-composition.is-outgoing .scene-copy,
.story-player .scene-composition.is-outgoing .dialogue-safe-area { animation: story-v2-copy-out 220ms ease both; }
.story-player .scene-composition.is-outgoing .scene-artwork-main { animation: none; }
.story-player.is-transitioning .scene-composition.is-outgoing { animation: story-v3-scene-exit var(--story-transition) var(--ease-cinema) both; }
.story-player.is-transitioning .scene-composition.is-active { animation: story-v3-scene-enter var(--story-transition) var(--ease-cinema) both; }
.story-player .scene-composition.is-outgoing .scene-artwork-main img { animation: none !important; transform: var(--story-frozen-transform, none); }

.story-player .gastronomy-layer { position: absolute; z-index: 9; inset: auto max(20px, env(safe-area-inset-right)) max(76px, calc(env(safe-area-inset-bottom) + 58px)) max(20px, env(safe-area-inset-left)); pointer-events: none; }
.story-player .gastronomy-layer > * { pointer-events: auto; }
.story-player .gastronomy-layer.phase-hidden { display: none; }
.story-player .gastronomy-layer.phase-revealing,
.story-player .gastronomy-layer.phase-visible { display: block; }
.story-player .gastronomy-layer.phase-revealing { animation: story-v2-gastro-in var(--motion-gastro) var(--ease-cinema) both; }
.story-player .gastronomy-layer.phase-visible { opacity: 1; transform: translateY(0); filter: blur(0); }
.story-player .gastronomy-layer.phase-dismissing { animation: story-v2-gastro-out 320ms ease both; }
.story-player .gastronomy-layer .scene-gastronomy-bar { position: relative; inset: auto; left: auto; right: auto; bottom: auto; width: min(100%, 1180px); margin: 0 auto; max-inline-size: 1180px; max-block-size: min(30dvh, 236px); overflow: auto; transform: none; }
.story-player .gastronomy-layer .scene-gastronomy-media { animation: story-v2-gastro-media 520ms 90ms var(--ease-cinema) both; }
.story-player .gastronomy-layer .scene-gastronomy-content > * { animation: story-v2-gastro-copy 400ms var(--ease-cinema) both; }
.story-player .gastronomy-layer .scene-gastronomy-content > :nth-child(1) { animation-delay: 130ms; }
.story-player .gastronomy-layer .scene-gastronomy-content > :nth-child(2) { animation-delay: 190ms; }
.story-player .gastronomy-layer .scene-gastronomy-content > :nth-child(n+3) { animation-delay: 250ms; }

.story-player.is-starting .story-intro { animation: story-v2-intro-out 430ms var(--ease-cinema) both; pointer-events: none; }
.story-player.is-starting .player-top,
.story-player.is-starting .player-progress,
.story-player.is-starting .player-controls { opacity: 0; }
.story-player.has-started .player-top,
.story-player.has-started .player-progress,
.story-player.has-started .player-controls { animation: story-v2-controls-in 440ms 480ms var(--ease-cinema) both; }

@keyframes story-v2-art-in { from { opacity: .25; transform: scale(1.012); } to { opacity: 1; transform: scale(1); } }
@keyframes story-v2-art-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.008); } }
@keyframes story-v3-scene-exit { from { opacity: 1; filter: brightness(1); } to { opacity: 0; filter: brightness(.93); } }
@keyframes story-v3-scene-enter { from { opacity: 0; filter: brightness(.93); } to { opacity: 1; filter: brightness(1); } }
@keyframes story-v2-copy-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes story-v2-copy-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }
@keyframes story-v2-marker-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes story-v2-gastro-in { from { opacity: 0; transform: translateY(22px); filter: blur(3px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes story-v2-gastro-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }
@keyframes story-v2-gastro-media { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes story-v2-gastro-copy { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes story-v2-intro-out { to { opacity: 0; transform: scale(1.015); } }
@keyframes story-v2-controls-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (orientation: portrait) and (max-width: 1100px) {
  .story-player .scene-artwork-main { inset: 0; }
  .story-player .scene-artwork-main img { object-fit: contain; object-position: var(--art-position-mobile, center); }
  .story-player .scene-stage { padding-top: max(80px, calc(env(safe-area-inset-top) + 60px)); padding-bottom: max(228px, calc(env(safe-area-inset-bottom) + 184px)); }
  .story-player .scene-copy { max-inline-size: min(100%, 37rem); }
  .story-player .gastronomy-layer { inset-inline: max(14px, env(safe-area-inset-left)); bottom: max(70px, calc(env(safe-area-inset-bottom) + 56px)); }
  .story-player .gastronomy-layer .scene-gastronomy-bar { max-block-size: min(31dvh, 256px); }
  .story-player .dialogue-safe-area { max-block-size: 34dvh; }
  .story-audio-recovery { right: max(14px, env(safe-area-inset-right)); bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px)); }
}

@media (prefers-reduced-motion: reduce) {
  .story-player *, .story-player *::before, .story-player *::after { animation-duration: 180ms !important; transition-duration: 180ms !important; }
  .story-player .scene-artwork-bleed { filter: brightness(.55); }
}
