/* Fonts, page layout, screens, page turns, shared .message/.next-btn, black-text lists (+ screen28 message rules, which must stay before the mobile overrides), arrow buttons. */

@font-face {
  font-family: 'Sacrifice Demo';
  src: url('fonts/SacrificeDemo-8Ox1B.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Super Mario 256';
  src: url('fonts/SuperMario256.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

body {
  height: 100vh;
  height: 100svh;
  width: 100vw;
  overflow: hidden;
  background: #000000;
  touch-action: manipulation;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100vw;
  z-index: 2;
  perspective: 1600px;
}

.color-wipe {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, #ffffff 0%, #ffffff 33.3%, #808080 50%, #000000 66.6%, #000000 100%);
  background-size: 100% 300%;
  background-position: 0% 100%;
  transition: background-position 2.8s ease;
  z-index: 1;
  pointer-events: none;
}

.color-wipe.active {
  background-position: 0% 0%;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* A carousel/marquee photo sets its own inline pointer-events (see
   applyStyle in script.js) so faded-out photos within an active carousel
   stay unclickable - but an inline style always wins over this stylesheet's
   .screen rule above, so once a screen's gallery has been built, its photos
   stay hit-testable forever, even while a different screen is showing. That
   only becomes visible when the built-but-inactive screen sits later in the
   DOM than whatever's currently active (it then paints on top for hit-testing
   purposes despite opacity: 0) - screen27 hit this in practice, being the
   last screen in the document. !important is required to outrank the inline
   style itself, not just win on specificity. */
.screen:not(.active) .carousel-photo,
.screen:not(.active) .marquee-photo,
.screen:not(.active) .vase-body,
.screen:not(.active) .vase-fan-card,
.screen:not(.active) .regalos-photo {
  pointer-events: none !important;
}

.page-turn {
  backface-visibility: hidden;
  transition: opacity 2.2s ease, transform 2.2s ease;
}

.page-turn.page-leave {
  transform-origin: left center;
}

.page-turn.page-leave.turning {
  opacity: 0;
  transform: rotateY(-110deg);
  pointer-events: none;
}

.page-turn.page-enter {
  transform-origin: right center;
  transform: rotateY(110deg);
}

.page-turn.page-enter.active {
  transform: rotateY(0deg);
}

/* Mirror of the states above, used to turn back to the previous page. */
.page-turn.page-leave-back {
  transform-origin: right center;
}

.page-turn.page-leave-back.turning {
  opacity: 0;
  transform: rotateY(110deg);
  pointer-events: none;
}

.page-turn.page-enter-back {
  transform-origin: left center;
  transform: rotateY(-110deg);
}

.page-turn.page-enter-back.active {
  transform: rotateY(0deg);
}

.message {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.5rem;
  color: #ffffff;
  letter-spacing: 1px;
  max-width: 40rem;
  line-height: 1.4;
}

.message--small {
  font-size: 1.5rem;
}

.next-btn {
  font-family: 'Super Mario 256', 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.next-btn:hover {
  background: #ffffff;
  color: #000000;
}

.flower-img {
  max-width: 80vw;
  max-height: 45vh;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.flower-img.visible {
  opacity: 1;
}

#nextBtn3 {
  opacity: 0;
  transition: opacity 1.5s ease, background 0.3s ease, color 0.3s ease;
}

#nextBtn3.visible {
  opacity: 1;
}

#screen5 .message,
#screen6 .message,
#screen7 .message,
#screen8 .message,
#screen9 .message,
#screen10 .message,
#screen11 .message,
#screen12 .message,
#screen13 .message,
#screen14 .message,
#screen15 .message,
#screen16 .message,
#screen17 .message,
#screen19 .message,
#screen20 .message,
#screen21 .message,
#screen22 .message,
#screen23 .message,
#screen24 .message,
#screen25 .message,
#screen26 .message,
#screen27 .message,
#screen28 .message,
#screen29 .message,
#screen30 .message,
#screen31 .message,
#screen32 .message,
#screen33 .message,
#screen35 .message {
  color: #000000;
}

#screen8 .next-btn,
#screen9 .next-btn,
#screen10 .next-btn,
#screen11 .next-btn,
#screen12 .next-btn,
#screen15 .next-btn,
#screen16 .next-btn,
#screen17 .next-btn,
#screen19 .next-btn,
#screen20 .next-btn,
#screen21 .next-btn,
#screen22 .next-btn,
#screen23 .next-btn,
#screen24 .next-btn,
#screen25 .next-btn,
#screen26 .next-btn,
#screen27 .next-btn,
#screen28 .next-btn,
#screen29 .next-btn,
#screen30 .next-btn,
#screen31 .next-btn,
#screen32 .next-btn,
#screen33 .next-btn,
#screen35 .next-btn {
  color: #000000;
  border-color: #000000;
}

/* screen28's message/button crossfade in place (see screen28NextBtn's click
   handler in script.js) instead of a normal screen-to-screen fade - needs
   its own opacity transition since .message/.next-btn don't have one by
   default (a screen's own .active opacity fade is what normally covers
   this). Timed to match .screen's own 1.2s fade (FADE_MS in script.js) so
   it reads the same speed as every other transition in the site. Re-list
   background/color here too, or this ID-scoped rule would otherwise fully
   override the base .next-btn transition and silently drop its hover fade. */
#screen28 .message,
#screen28 .next-btn {
  transition: opacity 1.2s ease, background 0.3s ease, color 0.3s ease;
}

/* Reserves the first (longer) message's own rendered height (see
   lockScreen28MessageHeight in script.js, which sets min-height inline once
   webfonts are ready) so swapping to the second, shorter line doesn't
   shrink the box and pull the next-btn/photo up with it. Turning the <p>
   itself into a flex container centers the shorter text vertically inside
   that reserved space instead of leaving it stuck at the top. */
#screen28 .message {
  /* Screen28's message is unusually long for a plain text+photo screen
     (three lines at the base 2.5rem) - shrinking it here frees up room to
     let .final-photo's own max-height go back up without overflowing a
     typical desktop window again. */
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Added once the gift box slides into view (see script.js, right where
   .gift-box--visible is added). Up to that point #screen28's own
   justify-content: center is fine, but once the box is a fixed, bottom-
   anchored overlay, centering the flex column against it read as the
   message and the box crowding each other (confirmed from a recording) -
   #finalPhoto is invisible by then but still occupying flex space, so
   exactly how close they sit isn't predictable/stable across screen
   sizes. Switching to a fixed top anchor decouples the message entirely
   from the box's own position, instead of trying to tune a centered
   layout around an invisible spacer. */
#screen28.gift-phase {
  justify-content: flex-start;
  padding-top: 20vh;
}

#screen8 .next-btn:hover,
#screen9 .next-btn:hover,
#screen10 .next-btn:hover,
#screen11 .next-btn:hover,
#screen12 .next-btn:hover,
#screen15 .next-btn:hover,
#screen16 .next-btn:hover,
#screen17 .next-btn:hover,
#screen19 .next-btn:hover,
#screen20 .next-btn:hover,
#screen21 .next-btn:hover,
#screen22 .next-btn:hover,
#screen23 .next-btn:hover,
#screen24 .next-btn:hover,
#screen25 .next-btn:hover,
#screen26 .next-btn:hover,
#screen27 .next-btn:hover,
#screen28 .next-btn:hover,
#screen29 .next-btn:hover,
#screen30 .next-btn:hover,
#screen31 .next-btn:hover,
#screen32 .next-btn:hover,
#screen33 .next-btn:hover,
#screen35 .next-btn:hover {
  background: #000000;
  color: #ffffff;
}

.arrow-btn {
  background: none;
  border: none;
  color: #000000;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.arrow-btn:hover {
  transform: translateX(6px);
}

.arrow-row {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3rem;
}

.arrow-row--top {
  top: 1.5rem;
  bottom: auto;
}

.arrow-btn--back:hover {
  transform: translateX(-6px);
}

.no-transition,
.no-transition * {
  transition: none !important;
}
