/* Full-bleed responsive shell: scales the 402px Figma frame to the viewport.
   --page-lift shifts the whole composition up (less top red) without changing
   margins between elements; the shell height shrinks by the same amount. */
.page-shell {
  width: 100%;
  height: calc((var(--page-height) - var(--page-lift)) * var(--frame-scale));
  overflow: hidden;
  position: relative;
}

.page {
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--page-lift) * var(--frame-scale));
  display: flex;
  flex-direction: column;
  width: var(--page-width);
  min-height: var(--page-height);
  margin-left: calc(var(--page-width) / -2);
  overflow: hidden;
  transform: scale(var(--frame-scale));
  transform-origin: top center;
}

.page__decor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.page__main {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 34px;
  margin-top: -8px;
}

.page__title {
  width: 311px;
  margin-top: 37px;
  animation: fade-up 700ms var(--ease-out) both;
}

.page__intro {
  width: 303px;
  margin-top: 22px;
  animation: fade-up 700ms var(--ease-out) 120ms both;
}

.page__intro p + p {
  margin-top: var(--space-sm);
}

.page__prize {
  margin-top: 36px;
  animation: fade-up 700ms var(--ease-out) 220ms both;
}

.page__cta {
  margin-top: 28px;
  /* Extra space so the hanging CTA bauble is not flush under the button */
  margin-bottom: 72px;
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fade-up 700ms var(--ease-out) 320ms both;
  position: relative;
  z-index: 6;
}

/* Absolute deco positions matching Figma frame */
.deco-pos-sparkle-1 {
  left: 56px;
  top: 436px;
  width: 6px;
  height: 6px;
}

.deco-pos-sparkle-2 {
  left: 341px;
  top: 410px;
  width: 11px;
  height: 6px;
}

.deco-pos-sparkle-3 {
  left: 24px;
  top: 595px;
  width: 6px;
  height: 6px;
}

.deco-pos-sparkle-4 {
  left: 377px;
  top: 619px;
  width: 6px;
  height: 6px;
}

.deco-pos-sparkle-5 {
  left: 44px;
  top: 645px;
  width: 6px;
  height: 6px;
}

.deco-pos-star-1 {
  left: 334px;
  top: 423px;
  width: 30px;
  height: 29px;
}

.deco-pos-star-2 {
  left: 22px;
  top: 619px;
  width: 30px;
  height: 29px;
}

.deco-pos-corner-1 {
  left: 22px;
  top: 663px;
  width: 34px;
  height: 34px;
}

.deco-pos-corner-2 {
  left: 341px;
  top: 782px;
  width: 34px;
  height: 34px;
}

.deco-pos-holly-1 {
  left: 39px;
  top: 446px;
}

.deco-pos-holly-2 {
  left: 341px;
  top: 299px;
}

.deco-pos-sparkle-large {
  left: 261px;
  top: 962px;
  width: 35px;
  height: 35px;
  background-image: url("../assets/sparkle-large.svg");
  background-size: contain;
  background-repeat: no-repeat;
}

.deco-pos-gold-cluster {
  /* scattered small gold sparkles around copy */
}

.deco-pos-gold-1 { left: 74px; top: 945px; }
.deco-pos-gold-2 { left: 296px; top: 1013px; }
.deco-pos-gold-3 { left: 153px; top: 936px; }
.deco-pos-gold-4 { left: 89px; top: 1017px; }
.deco-pos-gold-5 { left: 308px; top: 908px; }
.deco-pos-gold-6 { left: 212px; top: 949px; }

.deco-pos-gold-sm-1 { left: 21px; top: 294px; }
.deco-pos-gold-sm-2 { left: 353px; top: 552px; }
.deco-pos-gold-sm-3 { left: 21px; top: 294px; }
.deco-pos-gold-sm-4 { left: 386px; top: 477px; }
.deco-pos-gold-sm-5 { left: 84px; top: 299px; }
.deco-pos-gold-sm-6 { left: 330px; top: 298px; }
.deco-pos-gold-sm-7 { left: 50px; top: 373px; }
.deco-pos-gold-sm-8 { left: 43px; top: 407px; }
.deco-pos-gold-sm-9 { left: 29px; top: 639px; }

.deco-holly-near-cta-1 {
  left: 320px;
  top: 921px;
}

.deco-holly-near-cta-2 {
  left: 34px;
  top: 993px;
}

.deco-holly-near-cta-3 {
  left: 35px;
  top: 903px;
}

.deco-holly-near-cta-4 {
  left: 343px;
  top: 996px;
}

/* Motion */
.screen-enter {
  animation: screen-in 360ms var(--ease-out) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2.5deg);
  }
}

.deco.is-twinkle {
  animation: twinkle 2.8s ease-in-out infinite;
}

/* Pivot at the top of the string (string is now inside the ornament box) */
.ornament.is-sway {
  transform-origin: var(--string-x, 50%) 0;
  animation: sway 4.5s ease-in-out infinite;
}

/* Long side baubles on welcome: softer sway so they don't overlap the copy */
.page--bienvenida .ornament--1.is-sway,
.page--bienvenida .ornament--3.is-sway {
  animation-name: sway-soft;
}

@keyframes sway-soft {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1.2deg);
  }
}

.ornament--3.is-sway {
  animation-delay: 0.6s;
}

.ornament--2.is-sway {
  animation-delay: 1.1s;
}

.ornament--4.is-sway {
  animation-delay: 1.7s;
}

.btn.is-pulse {
  animation: cta-pulse 2.4s var(--ease-out) infinite;
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(202, 167, 91, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(202, 167, 91, 0);
  }
}

/* Desktop: soft stage behind the capped frame */
@media (min-width: 481px) {
  body {
    background: var(--color-fondo);
  }
}
