.hero {
  position: relative;
  margin: 0;
  padding: 18px 0 88px;
  color: #fff8ee;
  text-align: center;
  background-color: #ff7a1a;
  background-image:
    radial-gradient(circle at 14% calc(12% + 80px), #fffde7 0 12px, #ffe14a 22px, transparent 70px),
    radial-gradient(circle at 86% 10%, #fff59d 0 10px, #ffd54f 20px, transparent 80px),
    radial-gradient(circle at 50% 6%, rgba(255, 255, 255, 0.7) 0 8px, transparent 46px),
    radial-gradient(circle at 12% 18%, rgba(255, 225, 74, 0.55), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(230, 57, 43, 0.45), transparent 32%),
    linear-gradient(168deg, #ffe14a 0%, #ff8a1c 46%, #e6392b 78%, var(--page) 100%);
  overflow: hidden;
  -webkit-clip-path: url(#hero-wave);
  clip-path: url(#hero-wave);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 3;
  padding: 8px 16px 20px;
  font-family: "Festus", "Eskal", "Nunito", sans-serif;
}

.hero-title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(34px, 9vw, 72px);
  font-weight: 400;
  line-height: 1.2;
}

.hero-date {
  margin: 10px 0 0;
  font-family: "Eskal", "Bimbo", "Nunito", cursive;
  font-size: clamp(36px, 11vw, 86px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-sub {
  margin: 12px auto 0;
  font-family: inherit;
  font-size: clamp(22px, 4.8vw, 36px);
  font-weight: 400;
  line-height: 1.3;
  padding-bottom: 0.35em;
  max-width: 18em;
}

.hero-figure {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 8px auto 0;
  padding-top: 8px;
  overflow: visible;
}

.hero-stack {
  position: absolute;
  inset: 28px 0 auto;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.hero-photo,
canvas.hero-photo {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  max-width: min(520px, 82vw);
  height: auto;
  max-height: 58vh;
  object-fit: contain;
  object-position: center top;
  margin: 0 auto;
  opacity: 0;
  will-change: transform;
}

.hero-photo.is-cutout {
  opacity: 1;
  transition: opacity 0.4s ease;
  filter:
    drop-shadow(5px 0 0 #fff)
    drop-shadow(-5px 0 0 #fff)
    drop-shadow(0 5px 0 #fff)
    drop-shadow(0 -5px 0 #fff)
    drop-shadow(4px 4px 0 #fff)
    drop-shadow(-4px 4px 0 #fff)
    drop-shadow(4px -4px 0 #fff)
    drop-shadow(-4px -4px 0 #fff);
}

.hero-photo.cutout-fallback {
  mix-blend-mode: screen;
  filter: none;
}

.hero-stack-photo {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: min(520px, 82vw);
  max-height: 58vh;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 28px) rotate(var(--stack-rot, 0deg));
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  filter:
    drop-shadow(5px 0 0 #fff)
    drop-shadow(-5px 0 0 #fff)
    drop-shadow(0 5px 0 #fff)
    drop-shadow(0 -5px 0 #fff)
    drop-shadow(4px 4px 0 #fff)
    drop-shadow(-4px 4px 0 #fff)
    drop-shadow(4px -4px 0 #fff)
    drop-shadow(-4px -4px 0 #fff)
    drop-shadow(0 12px 18px rgba(42, 17, 8, 0.38));
}

/* Outline already in PNG (photos/stickers/) — one soft shadow only */
.hero-stack-photo.is-preoutlined {
  filter: drop-shadow(0 12px 18px rgba(42, 17, 8, 0.38));
}

@keyframes stack-hint-a {
  0%,
  100% {
    transform: translate(calc(-50% - 4px), 34px) rotate(-6deg);
    opacity: 1;
  }
  40%,
  55% {
    transform: translate(calc(-50% + var(--peek-x, -20px)), calc(var(--peek-y, 32px)))
      rotate(var(--stack-rot, -10deg));
    opacity: 1;
  }
}

@keyframes stack-hint-b {
  0%,
  100% {
    transform: translate(calc(-50% + 4px), 36px) rotate(5deg);
    opacity: 1;
  }
  40%,
  55% {
    transform: translate(calc(-50% + var(--peek-x, 16px)), calc(var(--peek-y, 28px)))
      rotate(var(--stack-rot, 7deg));
    opacity: 1;
  }
}

@keyframes stack-hint-c {
  0%,
  100% {
    transform: translate(calc(-50% - 2px), 38px) rotate(-3deg);
    opacity: 1;
  }
  40%,
  55% {
    transform: translate(calc(-50% + var(--peek-x, -8px)), calc(var(--peek-y, 38px)))
      rotate(var(--stack-rot, -5deg));
    opacity: 1;
  }
}

@keyframes photo-hint-tap {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-6px);
  }
  60% {
    transform: translateY(0);
  }
}

@keyframes hint-label {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  35%,
  60% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (hover: hover) and (min-width: 1025px) and (pointer: fine) {
  .hero-figure {
    cursor: pointer;
  }

  .hero-figure:hover .hero-stack-photo.is-peek:not(.is-flying),
  .hero-figure.is-hinting .hero-stack-photo.is-peek:not(.is-flying) {
    opacity: 1;
    transform: translate(
        calc(-50% + var(--mx, 0px) + var(--peek-x, 0px)),
        calc(var(--peek-y, 32px) + var(--my, 0px))
      )
      rotate(var(--stack-rot, 0deg));
  }

  .hero-figure.is-hinting .hero-stack-photo.is-peek:nth-child(1) {
    animation: stack-hint-a 1.8s ease-in-out 0.35s infinite;
  }

  .hero-figure.is-hinting .hero-stack-photo.is-peek:nth-child(2) {
    animation: stack-hint-b 1.8s ease-in-out 0.55s infinite;
  }

  .hero-figure.is-hinting .hero-stack-photo.is-peek:nth-child(3) {
    animation: stack-hint-c 1.8s ease-in-out 0.45s infinite;
  }

  .hero-figure.is-hinting .hero-photo-main {
    animation: photo-hint-tap 1.8s ease-in-out 0.2s infinite;
  }

  .hero-figure.is-hinting::after {
    content: var(--hint-click, "кликни");
    position: absolute;
    left: 50%;
    bottom: 6%;
    z-index: 5;
    transform: translateX(-50%);
    padding: 0.15em 0.55em 0.28em;
    font-family: "Bimbo", "Festus", "Nunito", sans-serif;
    font-size: clamp(18px, 2.4vw, 28px);
    letter-spacing: 0.02em;
    color: #fff8ee;
    text-shadow: 0 2px 8px rgba(42, 17, 8, 0.35);
    pointer-events: none;
    animation: hint-label 1.8s ease-in-out 0.2s infinite;
  }

  .hero-figure.is-scattered {
    z-index: 20;
  }

  .hero-figure.is-scattered .hero-photo,
  .hero-figure.is-scattered canvas.hero-photo {
    z-index: 21;
  }

  .hero-figure.is-scattered .hero-stack-photo.is-flying {
    opacity: 1;
  }

  .hero-stack-photo.is-flying {
    position: absolute;
    z-index: 6;
    opacity: 1;
    max-width: none;
    max-height: none;
    transform: rotate(var(--scatter-rot, 0deg));
    pointer-events: none;
    filter:
      drop-shadow(5px 0 0 #fff)
      drop-shadow(-5px 0 0 #fff)
      drop-shadow(0 5px 0 #fff)
      drop-shadow(0 -5px 0 #fff)
      drop-shadow(4px 4px 0 #fff)
      drop-shadow(-4px 4px 0 #fff)
      drop-shadow(4px -4px 0 #fff)
      drop-shadow(-4px -4px 0 #fff)
      drop-shadow(0 10px 14px rgba(42, 17, 8, 0.35));
  }

  .hero-stack-photo.is-flying.is-preoutlined {
    filter: drop-shadow(0 10px 14px rgba(42, 17, 8, 0.35));
  }

  .hero-inner {
    z-index: 22;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: calc(76px + env(safe-area-inset-top));
    padding-bottom: 72px;
  }

  .hero-inner {
    padding: 8px 12px 16px;
  }

  .hero-figure {
    margin-top: 4px;
  }

  .hero-photo,
  canvas.hero-photo {
    max-width: min(420px, 88vw);
    max-height: 48vh;
  }
}

