:root {
  --paper: #fffaf8;
  --ink: #4b3438;
  --muted: #8d7478;
  --rose: #d97888;
  --rose-dark: #b9576a;
  --rose-soft: #f5c5cc;
  --sage: #8dad8b;
  --shadow: 0 18px 44px rgba(103, 62, 69, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(247, 216, 197, 0.42), transparent 26%),
    radial-gradient(circle at 85% 34%, rgba(245, 197, 204, 0.3), transparent 32%),
    linear-gradient(180deg, #fffaf8 0%, #fff6f3 55%, #fffdf9 100%);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%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='.12'/%3E%3C/svg%3E");
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  touch-action: manipulation;
}

main {
  position: relative;
  z-index: 2;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 999px;
  opacity: 0.5;
  animation: drift 12s ease-in-out infinite alternate;
}

.glow-one {
  width: 230px;
  height: 230px;
  left: -90px;
  top: 16vh;
  background: rgba(248, 205, 211, 0.42);
}

.glow-two {
  width: 230px;
  height: 230px;
  right: -110px;
  top: 58vh;
  background: rgba(220, 231, 202, 0.35);
  animation-delay: -4s;
}

.glow-three {
  width: 190px;
  height: 190px;
  right: 10vw;
  top: -70px;
  background: rgba(255, 230, 195, 0.38);
  animation-delay: -8s;
}

.hero,
.story,
.tap-love,
.finale {
  width: min(100% - 28px, 760px);
  margin-inline: auto;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(34px, env(safe-area-inset-top)) 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rose-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
.handwritten {
  font-family: "Cormorant Garamond", Georgia, serif;
}

h1 {
  max-width: 520px;
  margin-bottom: 14px;
  font-size: clamp(3rem, 14vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 600;
}

h1 span {
  color: var(--rose-dark);
}

.hero-copy {
  max-width: 360px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.flower-button {
  position: relative;
  width: 210px;
  min-height: 286px;
  border: 0;
  padding: 0;
  display: grid;
  place-items: start center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.flower-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 220px;
  width: 150px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(96, 74, 74, 0.08);
  filter: blur(9px);
}

.flower {
  position: relative;
  display: block;
  width: 180px;
  height: 242px;
  transform-origin: 50% 94%;
  transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.flower-button:active .flower {
  transform: scale(.96) rotate(-3deg);
}

.petal {
  position: absolute;
  left: 50%;
  top: 38px;
  width: 66px;
  height: 86px;
  margin-left: -33px;
  border-radius: 55% 55% 46% 46%;
  background: linear-gradient(160deg, #ffd8de 0%, #e98da0 72%, #d66d82 100%);
  box-shadow: inset -8px -10px 18px rgba(155, 62, 81, 0.08), 0 6px 16px rgba(180, 85, 104, 0.08);
  transform-origin: 50% 72%;
  transition: 800ms cubic-bezier(.2,.75,.2,1);
}

.petal-1 { transform: rotate(0deg) translateY(-30px) scale(.94); }
.petal-2 { transform: rotate(60deg) translateY(-30px) scale(.94); }
.petal-3 { transform: rotate(120deg) translateY(-30px) scale(.94); }
.petal-4 { transform: rotate(180deg) translateY(-30px) scale(.94); }
.petal-5 { transform: rotate(240deg) translateY(-30px) scale(.94); }
.petal-6 { transform: rotate(300deg) translateY(-30px) scale(.94); }

.flower-center {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 58px;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c4, #f3c663 70%, #dba943 100%);
  box-shadow: 0 4px 16px rgba(170, 119, 29, 0.13);
}

.flower-center::after {
  content: "♡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(135, 85, 28, .7);
  font-size: 23px;
}

.stem {
  position: absolute;
  left: calc(50% - 5px);
  top: 103px;
  width: 10px;
  height: 132px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7da27b, #9bbb91 60%, #6e936e);
  z-index: -1;
}

.leaf {
  position: absolute;
  width: 60px;
  height: 31px;
  background: linear-gradient(145deg, #9dbc94, #72936e);
  z-index: -1;
}

.leaf-left {
  left: 33px;
  top: 158px;
  border-radius: 90% 10% 90% 10%;
  transform: rotate(16deg);
  transform-origin: right center;
}

.leaf-right {
  right: 31px;
  top: 187px;
  border-radius: 10% 90% 10% 90%;
  transform: rotate(-8deg);
  transform-origin: left center;
}

.flower-label {
  position: absolute;
  bottom: 0;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.flower-button.bloomed .petal-1 { transform: rotate(0deg) translateY(-43px) scale(1.08); }
.flower-button.bloomed .petal-2 { transform: rotate(60deg) translateY(-43px) scale(1.08); }
.flower-button.bloomed .petal-3 { transform: rotate(120deg) translateY(-43px) scale(1.08); }
.flower-button.bloomed .petal-4 { transform: rotate(180deg) translateY(-43px) scale(1.08); }
.flower-button.bloomed .petal-5 { transform: rotate(240deg) translateY(-43px) scale(1.08); }
.flower-button.bloomed .petal-6 { transform: rotate(300deg) translateY(-43px) scale(1.08); }

.scroll-hint {
  margin-top: 6px;
  color: var(--rose);
  font-size: 1.35rem;
  opacity: 0;
}

.scroll-hint.visible {
  opacity: 1;
  animation: hint 1.5s ease-in-out infinite;
}

.hidden-section {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 650ms ease, transform 650ms ease;
}

.hidden-section.unlocked {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.story,
.tap-love {
  padding: 62px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 26px;
}

.section-heading > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185, 87, 106, .2);
  border-radius: 50%;
  color: var(--rose-dark);
  background: rgba(255,255,255,.58);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.section-heading h2 {
  margin: 1px 0 0;
  font-size: clamp(2.5rem, 11vw, 4rem);
  line-height: .98;
  letter-spacing: -.035em;
  font-weight: 600;
}

.note-card,
.love-meter-card {
  position: relative;
  border: 1px solid rgba(151, 104, 111, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 251, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.main-note {
  padding: 32px 22px 28px;
  transform: rotate(-.45deg);
}

.main-note p {
  margin-bottom: 0;
  color: #654d51;
  font-size: 1.02rem;
  line-height: 1.72;
}

.main-note .handwritten {
  margin-top: 24px;
  color: var(--rose-dark);
  font-size: clamp(1.8rem, 8.7vw, 2.55rem);
  line-height: 1.14;
  font-weight: 600;
}

.tape {
  position: absolute;
  width: 96px;
  height: 29px;
  left: 50%;
  top: -14px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(245, 221, 182, .65);
}

.tiny-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(82%, 1fr);
  gap: 14px;
  margin: 24px -14px 0;
  padding: 6px 14px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.tiny-cards::-webkit-scrollbar {
  display: none;
}

.tiny-card {
  min-height: 220px;
  padding: 24px;
  scroll-snap-align: center;
  border: 1px solid rgba(151, 104, 111, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .66);
  box-shadow: 0 12px 30px rgba(103, 62, 69, .08);
}

.tiny-card > span {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 1.75rem;
}

.tiny-card h3 {
  margin-bottom: 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
}

.tiny-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.swipe-hint {
  margin: 6px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}

.love-meter-card {
  padding: 30px 22px;
  text-align: center;
  overflow: hidden;
}

.activity-copy {
  max-width: 420px;
  margin: 0 auto 20px;
  color: var(--muted);
  line-height: 1.65;
}

.heart-tap {
  width: min(230px, 72vw);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #fff1f2 52%, #f9d8dc 100%);
  box-shadow: inset 0 0 0 1px rgba(185, 87, 106, .12), 0 18px 34px rgba(185, 87, 106, .14);
  color: var(--rose-dark);
  cursor: pointer;
  user-select: none;
  transition: transform 140ms ease, box-shadow 180ms ease;
}

.heart-tap:active {
  transform: scale(.94);
  box-shadow: inset 0 0 0 1px rgba(185, 87, 106, .14), 0 9px 20px rgba(185, 87, 106, .12);
}

.heart-symbol {
  display: block;
  font-size: 6.2rem;
  line-height: .82;
  transform: scale(var(--heart-scale, .72));
  filter: drop-shadow(0 10px 12px rgba(185, 87, 106, .14));
  transition: transform 240ms cubic-bezier(.2,.9,.2,1.3), color 180ms ease;
}

.heart-symbol.bump {
  animation: heartBump 300ms ease;
}

.heart-tap-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.love-progress {
  height: 9px;
  margin: 24px auto 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(185, 87, 106, .1);
}

.love-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2a9b5, #d97888, #b9576a);
  transition: width 320ms ease;
}

.tap-message {
  min-height: 48px;
  margin: 0;
  color: var(--rose-dark);
  font-weight: 800;
  line-height: 1.45;
}

.finale {
  min-height: 96svh;
  padding: 82px 0 max(54px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.final-flower {
  margin-bottom: 14px;
  font-size: 2.8rem;
  animation: sway 2.8s ease-in-out infinite alternate;
}

.finale h2 {
  margin-bottom: 16px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.6rem, 15vw, 6rem);
  line-height: .9;
  letter-spacing: -.045em;
  font-weight: 600;
}

.final-copy {
  max-width: 430px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.love-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  background: var(--rose-dark);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(185, 87, 106, .22);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.love-button:active {
  transform: scale(.98);
  background: #a64c5e;
}

.kiss-photo-wrap {
  width: 100%;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px) scale(.97);
  transition: max-height 700ms ease, margin 500ms ease, opacity 500ms ease, transform 500ms ease;
}

.kiss-photo-wrap.visible {
  max-height: 760px;
  margin-top: 24px;
  opacity: 1;
  transform: none;
}

.kiss-photo {
  display: block;
  width: 100%;
  max-height: 62svh;
  object-fit: cover;
  border: 8px solid rgba(255,255,255,.88);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.kiss-caption {
  margin: 14px 0 0;
  color: var(--rose-dark);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
}

.restart-link {
  margin-top: 26px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(141, 116, 120, .25);
  font-size: .84rem;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(.2,.75,.2,1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: none;
}

.petal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.falling-petal {
  position: absolute;
  top: -50px;
  width: 17px;
  height: 26px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(145deg, #ffd8de, #e98da0);
  opacity: .82;
  animation: fall var(--fall-time, 5s) linear forwards;
}

.floating-love {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  color: var(--rose);
  font-size: 1.55rem;
  animation: floatAway 1.3s ease-out forwards;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(20px, -22px, 0) scale(1.08); }
}

@keyframes hint {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(8px); }
}

@keyframes heartBump {
  0% { transform: scale(var(--heart-scale)); }
  45% { transform: scale(calc(var(--heart-scale) + .14)); }
  100% { transform: scale(var(--heart-scale)); }
}

@keyframes sway {
  from { transform: rotate(-8deg); }
  to { transform: rotate(8deg); }
}

@keyframes fall {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .85; }
  100% { transform: translate3d(var(--drift-x, 40px), 110vh, 0) rotate(var(--spin, 520deg)); opacity: .12; }
}

@keyframes floatAway {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.8); }
  to { opacity: 0; transform: translate(-50%, -110px) scale(1.35) rotate(12deg); }
}

@media (min-width: 700px) {
  .hero,
  .story,
  .tap-love,
  .finale {
    width: min(100% - 48px, 900px);
  }

  .hero-copy {
    font-size: 1.12rem;
  }

  .story,
  .tap-love {
    padding: 90px 0;
  }

  .section-heading {
    grid-template-columns: 46px 1fr;
    gap: 20px;
  }

  .section-heading > span {
    width: 46px;
    height: 46px;
  }

  .main-note {
    padding: 50px;
  }

  .tiny-cards {
    grid-auto-flow: initial;
    grid-template-columns: repeat(3, 1fr);
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .swipe-hint {
    display: none;
  }

  .love-meter-card {
    padding: 48px;
  }

  .love-button {
    width: auto;
    min-width: 320px;
  }

  .kiss-photo-wrap {
    max-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
