:root {
  --green-950: #092e0c;
  --green-800: #1f4b2b;
  --green-600: #365b3a;
  --moss: #8fa77c;
  --cream: #fffaf0;
  --paper: rgba(255, 252, 241, 0.88);
  --gold: #c79b2b;
  --gold-light: #f4df84;
  --wax: #7f1020;
  --shadow: 0 24px 70px rgba(6, 32, 16, 0.24);
  --swamp-position: center center;
  --swamp-size: cover;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--green-950);
  font-family: Montserrat, Arial, sans-serif;
  background: #edf4e9;
  min-height: 100vh;
  overflow-x: hidden;
}

body.gate-open {
  overflow: hidden;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(246, 251, 239, 0.78), rgba(246, 251, 239, 0.9)),
    url("assets/background-swamp.png") var(--swamp-position) / var(--swamp-size) no-repeat;
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(251, 232, 132, 0.42) 0 2px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(251, 232, 132, 0.5) 0 3px, transparent 6px),
    radial-gradient(circle at 42% 72%, rgba(251, 232, 132, 0.38) 0 2px, transparent 5px);
  background-size: 180px 220px, 260px 300px, 220px 260px;
  opacity: 0.85;
  animation: glow 8s ease-in-out infinite alternate;
}

main {
  isolation: isolate;
}

section {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px 20px;
  position: relative;
}

.cover {
  min-height: 96svh;
  padding-top: 44px;
}

.cover__inner {
  width: min(920px, 100%);
  text-align: center;
  display: grid;
  justify-items: center;
}

.cover__eyebrow,
.countdown p,
.info-grid span {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-600);
}

h1,
h2,
.script-label,
.cover__subtitle,
.seal-gate h2 {
  font-family: "Great Vibes", "Allura", cursive;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  position: relative;
  z-index: 2;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto -8px;
  padding: 0.12em 0.2em 0.08em;
  overflow: visible;
  font-size: clamp(5.2rem, 15vw, 12rem);
  line-height: 1;
  color: transparent;
  background: linear-gradient(135deg, #ffe98a, #a47a1e 54%, #f7d96e);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 8px 18px rgba(6, 32, 16, 0.22);
}

.greenery {
  position: relative;
  z-index: 1;
  width: min(720px, 92vw);
  margin: -18px auto 6px;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(22, 61, 24, 0.16));
}

.cover__subtitle {
  margin: 0;
  font-size: clamp(3.4rem, 10vw, 6.6rem);
  color: var(--green-950);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.6);
}

.cover__subtitle strong {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.78em;
}

.scroll-cue {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 64px;
  margin-top: 36px;
  border: 1px solid rgba(54, 91, 58, 0.32);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.52);
}

.scroll-cue span {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--green-600);
  border-bottom: 2px solid var(--green-600);
  transform: rotate(45deg);
  animation: bounce 1.6s ease-in-out infinite;
}

.section-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 58px);
  text-align: center;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.section-shell--wide {
  width: min(960px, 100%);
}

.script-label {
  margin: 0 0 8px;
  font-size: clamp(3.1rem, 8vw, 5.8rem);
  color: var(--green-950);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
  color: var(--green-800);
}

p {
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  line-height: 1.8;
}

.details::before,
.gift::before {
  content: "";
  position: absolute;
  width: min(760px, 92vw);
  height: 190px;
  background: url("assets/greenery.png") center / contain no-repeat;
  top: 32px;
  opacity: 0.76;
  pointer-events: none;
}

.countdown {
  margin: 34px auto;
  padding: 26px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(54, 91, 58, 0.18);
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.countdown__grid span,
.info-grid article {
  min-width: 0;
  padding: 18px 10px;
  background: rgba(252, 247, 225, 0.72);
  border: 1px solid rgba(143, 167, 124, 0.32);
}

.countdown strong {
  display: block;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  color: var(--green-950);
}

.countdown small {
  display: block;
  margin-top: 6px;
  color: var(--green-600);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 22px 0 30px;
}

.info-grid strong {
  display: block;
  margin-top: 10px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  color: #fffaf0;
  text-decoration: none;
  font-weight: 700;
  background: linear-gradient(135deg, var(--green-800), var(--green-950));
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 12px 28px rgba(6, 32, 16, 0.2);
}

.button--secondary {
  color: var(--green-950);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.frog {
  width: min(210px, 52vw);
  margin: -10px auto 10px;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(6, 32, 16, 0.16));
}

.closing {
  font-family: "Allura", "Great Vibes", cursive;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.2;
  color: var(--green-950);
}

.seal-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(244, 250, 238, 0.68), rgba(244, 250, 238, 0.84)),
    url("assets/background-swamp.png") var(--swamp-position) / var(--swamp-size) no-repeat;
  transition: opacity 520ms ease, visibility 520ms ease;
}

.seal-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.seal-gate__panel {
  width: min(760px, 100%);
  text-align: center;
}

.envelope {
  position: relative;
  width: min(680px, 94vw);
  aspect-ratio: 1.72;
  margin: 0 auto 24px;
  filter: drop-shadow(0 22px 30px rgba(44, 31, 15, 0.2));
}

.envelope__body,
.envelope__flap {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #d7bb87, #f8edcf 45%, #cba66f);
  border: 1px solid rgba(111, 76, 39, 0.24);
}

.envelope__body {
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}

.envelope__body::before,
.envelope__body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(95, 61, 30, 0.16);
}

.envelope__body::before {
  clip-path: polygon(0 0, 50% 54%, 0 100%);
}

.envelope__body::after {
  clip-path: polygon(100% 0, 50% 54%, 100% 100%);
}

.envelope__flap {
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  opacity: 0.88;
}

.seal-button {
  position: absolute;
  left: 50%;
  top: 52%;
  width: clamp(112px, 22vw, 172px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  animation: pulse 1.8s ease-in-out infinite;
}

.seal-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.seal-gate h2 {
  margin: 0;
  font-size: clamp(4.2rem, 13vw, 8rem);
  line-height: 0.9;
  color: #111;
}

.seal-gate p {
  margin: 8px 0 0;
  font-size: 1rem;
  color: var(--green-800);
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.045);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(-3px) rotate(45deg);
  }
  50% {
    transform: translateY(5px) rotate(45deg);
  }
}

@keyframes glow {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 0.9;
  }
}

@media (max-width: 760px) {
  section {
    min-height: auto;
    padding: 68px 16px;
  }

  .cover {
    min-height: 94svh;
  }

  .cover__eyebrow {
    max-width: 20rem;
    line-height: 1.55;
  }

  h1 {
    margin-bottom: -4px;
    padding-inline: 0.16em;
    font-size: clamp(4.7rem, 22vw, 6.2rem);
    line-height: 1.08;
  }

  .greenery {
    width: min(360px, 88vw);
    margin-top: -10px;
    margin-bottom: 18px;
  }

  .section-shell {
    padding: 28px 18px;
  }

  .countdown__grid,
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .details::before,
  .gift::before {
    top: 10px;
    height: 120px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .countdown {
    padding: 18px 12px;
  }

  .countdown__grid {
    gap: 8px;
  }

  .countdown__grid span,
  .info-grid article {
    padding: 14px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
