/* =====================================================
 * hero.css — Fully Adaptive
 * ===================================================== */

html:has(body.hero-page) {
  background-color: #b6dad2;
}

body.hero-page {
  margin: 0;
  padding: 0;
  background-color: #b6dad2;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

body.hero-page::after {
  content: '';
  position: absolute;
  top: 100dvh;
  left: 0;
  right: 0;
  height: 50vh;
  background-color: #9bc6c1;
  z-index: -1;
}

.hero-container {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 1;
}

.hero-bg {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100dvh;
  background-color: #b6dad2;
  background-image: none;
  pointer-events: none;
  z-index: 0;
}

.hero-bg-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(242, 251, 247, 0.18) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ---- Adaptive frame ---- */
.hero-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px max(34px, calc(env(safe-area-inset-bottom) + 24px));
  box-sizing: border-box;
}

/* ---- Sparkles ---- */
.hf-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.sparkle-item {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow:
    0 0 8px 2px rgba(255, 255, 255, 0.8),
    0 0 16px 4px rgba(255, 255, 255, 0.3);
  animation: heroSparkle 3s ease-in-out infinite;
}
.sparkle-item::before,
.sparkle-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: white;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0.8;
}
.sparkle-item::before {
  width: 14px;
  height: 1.5px;
}
.sparkle-item::after {
  width: 1.5px;
  height: 14px;
}
.sparkle-item.s1 { left: 20%; top: 30%; animation-delay: 0s; animation-duration: 2.8s; }
.sparkle-item.s2 { left: 80%; top: 40%; animation-delay: 0.5s; animation-duration: 3.2s; }
.sparkle-item.s3 { left: 30%; top: 60%; animation-delay: 1s; animation-duration: 2.6s; }
.sparkle-item.s4 { left: 70%; top: 70%; animation-delay: 1.5s; animation-duration: 3.4s; }
.sparkle-item.s5 { left: 50%; top: 20%; animation-delay: 2s; animation-duration: 3s; }

@keyframes heroSparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  15% {
    opacity: 0.8;
    transform: scale(1.2) rotate(30deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(90deg);
  }
  85% {
    opacity: 0.5;
    transform: scale(0.8) rotate(150deg);
  }
}

/* ---- Head ---- */
.hf-head {
  position: absolute;
  top: max(52px, calc(env(safe-area-inset-top) + 42px));
  left: 50%;
  width: min(344px, calc(100% - 48px));
  display: flex;
  flex-direction: column;
  gap: 2vh;
  align-items: center;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 14px rgba(127, 167, 158, 0.18));
  z-index: 2;
}

.hf-head__title {
  font-family: var(--font-base);
  font-size: clamp(32px, 10vw, 42px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.42px;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  margin: 0;
  opacity: 0;
  animation: heroFadeUp 0.85s var(--ease-spring) 0.15s forwards;
}

.hf-head__sub {
  font-family: var(--font-base);
  font-size: clamp(18px, 5.5vw, 22px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.22px;
  color: #ffffff;
  text-align: center;
  max-width: 292px;
  margin: 0;
  opacity: 0;
  animation: heroFadeUp 0.85s var(--ease-spring) 0.35s forwards;
}

/* ---- Cake ---- */
.hf-cake-new {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  animation: heroScale 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
  pointer-events: none;
}
.hf-cake-new img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  transform: translateY(-14px) scale(1.025);
  transform-origin: center center;
}

/* ---- Button ---- */
.hf-btn-wrap {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  width: auto;
  opacity: 0;
  z-index: 5;
  animation: heroFadeUp 0.8s var(--ease-spring) 0.9s forwards;
}

.hf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 32px;
  padding: 0 12px 0 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 1px 3.8px rgba(0, 113, 87, 0.30),
    2px 2px 8.4px rgba(0, 113, 87, 0.38);
  transition:
    transform 0.15s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.15s ease,
    background 0.15s ease;
  will-change: transform;
  opacity: 0.9;
  position: relative;
  overflow: hidden;
}

@media (max-height: 760px) {
  .hf-head {
    top: max(38px, calc(env(safe-area-inset-top) + 28px));
  }

  .hf-btn-wrap {
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px));
  }

  .hf-cake-new img {
    transform: translateY(-10px) scale(1.02);
  }
}

.hf-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.4) 45%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.4) 55%,
    transparent 60%,
    transparent 100%
  );
  background-size: 250% 100%;
  animation: lightSweep 5s ease-in-out 2s infinite;
  pointer-events: none;
  border-radius: inherit;
}

.hf-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(0, 113, 87, 0.22),
    2px 6px 20px rgba(0, 113, 87, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.4);
}

.hf-btn:active {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 1px 2px rgba(0, 113, 87, 0.18),
    1px 1px 4px rgba(0, 113, 87, 0.28);
  background: rgba(240, 250, 245, 0.97);
  transition-duration: 0.08s;
}

.hf-btn__label {
  font-family: var(--font-base);
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.24px;
  color: #00715c;
  white-space: nowrap;
  text-shadow: 0.5px 0.5px 1px white;
  -webkit-font-smoothing: antialiased;
}

/* ---- Animations ---- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
  }
  50% {
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes heroScale {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  70% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heroScaleCentered {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes heroFadeIn {
  from { opacity: 0; filter: blur(4px); }
  to   { opacity: 1; filter: blur(0); }
}
