.page {
  position: relative;
  z-index: 2;
  /* svh is the height with browser chrome showing, so the container always
     fits and its size never changes while scrolling. */
  height: 100vh;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  /* One flick or wheel notch lands on the next full-height section. */
  scroll-snap-type: y mandatory;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 149, 216, 0.45) transparent;
}

html.is-intro-active .page {
  overflow-y: hidden;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.85s cubic-bezier(0.22, 0.68, 0.24, 1),
    transform 0.85s cubic-bezier(0.22, 0.68, 0.24, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Hero */

/* Each screen is exactly as tall as the scroll container, so every snap
   position lines up with a reachable scroll offset. */
.hero,
.section--full {
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.hero {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(1.5rem, 5vh, 3rem) 0;
  text-align: center;
}

.hero__body {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: clamp(1.5rem, 5vh, 2.8rem);
  width: 100%;
}

.hero__lead {
  max-width: 30rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.6vw, 1.55rem);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

/* The svh term keeps the 4:5 photo short enough on small screens that the
   scroll cue below it stays inside the first viewport. */
.frame {
  position: relative;
  margin: 0 auto;
  width: min(19rem, 78vw, 32svh);
  animation: float-soft 7s ease-in-out infinite;
}

.frame::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(168, 216, 248, 0.32) 45%,
    rgba(168, 216, 248, 0) 70%
  );
  z-index: -1;
}

.frame__inner {
  padding: 0.7rem;
  background: var(--white);
  border-radius: calc(var(--radius-lg) + 0.4rem);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9),
    0 26px 54px rgba(45, 116, 170, 0.28);
  transform: rotate(-1.6deg);
}

.frame__inner img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #eaf6ff, #d3e9fb);
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* Fades itself in rather than using .reveal: it sits on the viewport's bottom
   edge, which the reveal observer's negative bottom margin never triggers. */
.scroll-cue {
  display: grid;
  place-items: center;
  margin: 0 auto;
  opacity: 0;
  animation: cue-in 0.9s ease 0.5s forwards;
}

@keyframes cue-in {
  to {
    opacity: 1;
  }
}

.scroll-cue__mouse {
  position: relative;
  display: block;
  width: 1.6rem;
  height: 2.6rem;
  border: 2px solid rgba(63, 149, 216, 0.5);
  border-radius: 999px;
}

.scroll-cue__dot {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  width: 0.34rem;
  height: 0.34rem;
  margin-left: -0.17rem;
  border-radius: 50%;
  background: var(--primary);
  animation: cue 1.9s ease-in-out infinite;
}

@keyframes cue {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    transform: translateY(0.95rem);
    opacity: 0.15;
  }
}

/* Touch swipe hint, shown instead of the mouse on phones and tablets. */
.scroll-cue__touch {
  position: relative;
  display: none;
  width: 1.8rem;
  height: 2.6rem;
}

.scroll-cue__finger {
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  width: 0.8rem;
  height: 0.8rem;
  margin-left: -0.4rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0.32rem rgba(63, 149, 216, 0.18);
  animation: swipe-up 2.1s ease-in-out infinite;
}

@keyframes swipe-up {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  72% {
    transform: translateY(-1.4rem);
    opacity: 0.85;
  }
  100% {
    transform: translateY(-1.8rem);
    opacity: 0;
  }
}

@media (pointer: coarse) {
  .scroll-cue__mouse {
    display: none;
  }

  .scroll-cue__touch {
    display: block;
  }
}

/* Sections */

.section {
  width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 4.5rem) 0 0;
  text-align: center;
}

.section--full {
  display: grid;
  align-content: center;
  padding: clamp(2rem, 6vh, 3.5rem) 0;
}

.section__body {
  display: grid;
  justify-items: center;
  gap: clamp(1.5rem, 5vh, 2.8rem);
  width: 100%;
}

.section__lead {
  max-width: 35rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.6vw, 1.55rem);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

.section__address {
  max-width: 26rem;
  margin-inline: auto;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 3.4vw, 1.08rem);
  line-height: 1.55;
  color: var(--primary-deep);
  text-align: center;
  text-wrap: balance;
}

/* Countdown */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 2vw, 0.9rem);
  width: 100%;
}

.tile {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: clamp(0.85rem, 3vw, 1.2rem) 0.35rem;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.2rem;
}

.tile__value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 2.1rem);
  line-height: 1;
  color: var(--primary-deep);
  font-variant-numeric: tabular-nums;
}

.tile__label {
  font-size: 0.72rem;
  color: var(--muted);
}

.countdown__done {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  color: var(--primary-deep);
}

/* Map */

.map-shell {
  width: 100%;
  padding: 0.7rem;
  background: var(--white);
  border-radius: calc(var(--radius-lg) + 0.4rem);
  box-shadow: var(--shadow-lift);
}

#map {
  height: clamp(11rem, 32svh, 20rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #e4f2fd;
}

#map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Heart */

.heart {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: clamp(1.5rem, 6vh, 3.5rem);
  width: clamp(4.5rem, 17vw, 6.5rem);
  height: clamp(4.5rem, 17vw, 6.5rem);
}

.heart__shape {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 20px rgba(45, 116, 170, 0.32));
  animation: heartbeat 2.4s ease-in-out infinite;
}

/* Same glow and expanding rings that sit behind the intro envelope. */
.heart__glow {
  position: absolute;
  /* Negative inset both sizes and centres the circle without a transform,
     which the pulse and ring animations need for themselves. */
  inset: -80%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(207, 233, 252, 0.6) 45%,
    rgba(207, 233, 252, 0) 70%
  );
  animation: glow-pulse 5s ease-in-out infinite;
}

.heart__ring {
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  border: 1px solid rgba(63, 149, 216, 0.28);
  opacity: 0;
  animation: ring-out 4.4s ease-out infinite;
}

.heart__ring--2 {
  animation-delay: 1.8s;
}

/* Two quick contractions then a rest, the way a real pulse reads. */
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.17);
  }
  24% {
    transform: scale(1.02);
  }
  36% {
    transform: scale(1.11);
  }
  52% {
    transform: scale(1);
  }
}

@media (max-width: 26rem) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }
}
