:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #6f6a62;
  --paper: #f7f4ee;
  --pearl: #fffdfa;
  --rose: #d9506f;
  --coral: #e97955;
  --mint: #5bbfa8;
  --blue: #5b7fd9;
  --shadow: 0 28px 90px rgba(50, 38, 30, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(233, 121, 85, 0.18), transparent 26rem),
    radial-gradient(circle at 86% 34%, rgba(91, 191, 168, 0.16), transparent 24rem),
    linear-gradient(180deg, #faf7f1 0%, #f1eee7 46%, #f8f4ee 100%);
}

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

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

.topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 10;
  display: flex;
  width: min(calc(100% - 28px), 430px);
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.68);
  box-shadow: 0 16px 46px rgba(60, 46, 38, 0.12);
  backdrop-filter: blur(22px) saturate(1.35);
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--rose), var(--coral), var(--mint), var(--blue), var(--rose));
  box-shadow: 0 0 0 5px rgba(217, 80, 111, 0.1);
}

.dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dots a {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.22);
  transition: width 220ms ease, background 220ms ease;
}

.dots a.is-active {
  width: 24px;
  background: var(--ink);
}

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

.panel {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-items: center;
  gap: 34px;
  padding: 92px 22px 56px;
  overflow: hidden;
}

.copy {
  width: min(100%, 720px);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 18px;
  color: var(--rose);
  font-size: clamp(0.78rem, 2.7vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2 {
  max-width: 12ch;
  margin-bottom: 22px;
  font-size: clamp(3.15rem, 15vw, 6.8rem);
  line-height: 0.91;
  letter-spacing: 0;
}

h2 {
  max-width: 11ch;
  font-size: clamp(2.8rem, 13vw, 6rem);
}

.lead,
.copy > p:last-child,
.copy > p:not(.kicker) {
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 4.4vw, 1.35rem);
  line-height: 1.48;
}

.hero {
  padding-top: 112px;
}

.phone-orbit {
  position: relative;
  width: min(78vw, 340px);
  aspect-ratio: 0.78;
  margin: 0 auto;
  border-radius: 44px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.42)),
    linear-gradient(160deg, rgba(217, 80, 111, 0.22), rgba(91, 127, 217, 0.2));
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  animation: float 5.5s ease-in-out infinite;
}

.phone-orbit::before,
.phone-orbit::after {
  position: absolute;
  content: "";
  border-radius: inherit;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
}

.phone-orbit::after {
  inset: auto 32% 18px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.2);
}

.glass-card {
  position: absolute;
  inset: 15% 10%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 34px;
  background: rgba(255, 253, 250, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 22px 60px rgba(75, 48, 52, 0.14);
  backdrop-filter: blur(18px);
}

.shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 10%, rgba(255, 255, 255, 0.56) 36%, transparent 58%);
  transform: translateX(-90%);
  animation: shine 4.8s ease-in-out infinite;
}

.heart-core {
  width: clamp(104px, 35vw, 148px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--rose);
  font-size: clamp(4.6rem, 20vw, 7rem);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  animation: pulse 1.9s ease-in-out infinite;
}

.glass-card p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.scroll-cue {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  width: 30px;
  height: 48px;
  place-items: start center;
  border: 1px solid rgba(23, 23, 23, 0.18);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue span {
  width: 5px;
  height: 5px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--ink);
  animation: scrollDot 1.55s ease-in-out infinite;
}

.ribbon {
  display: grid;
  width: min(100%, 780px);
  gap: 12px;
  margin: 0 auto;
}

.ribbon article {
  min-height: 134px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 253, 250, 0.62);
  box-shadow: 0 20px 58px rgba(48, 39, 32, 0.1);
  backdrop-filter: blur(18px);
}

.ribbon span {
  display: block;
  margin-bottom: 28px;
  color: rgba(23, 23, 23, 0.32);
  font-size: 0.78rem;
  font-weight: 800;
}

.ribbon strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.ribbon p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.love {
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.58)),
    radial-gradient(circle at 50% 50%, rgba(217, 80, 111, 0.12), transparent 22rem);
}

.memory-stack {
  position: relative;
  width: min(86vw, 390px);
  height: clamp(260px, 58vw, 340px);
  margin: 10px auto 0;
  touch-action: pan-y;
  perspective: 900px;
}

.memory-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  color: var(--ink);
  font-size: clamp(2rem, 8.8vw, 3.35rem);
  font-weight: 850;
  line-height: 1.04;
  text-align: center;
  letter-spacing: 0;
  user-select: none;
  cursor: grab;
  box-shadow: 0 28px 80px rgba(61, 48, 40, 0.16);
  transform: translate3d(var(--stack-x, 0px), var(--stack-y, 0px), 0) rotate(var(--stack-rotate, 0deg)) scale(var(--stack-scale, 1));
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease, box-shadow 260ms ease;
  will-change: transform;
}

.memory-card::before {
  position: absolute;
  content: "";
  inset: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.memory-card:nth-child(4n + 1) {
  color: white;
  background: linear-gradient(145deg, #d94f72 0%, #e96f55 100%);
}

.memory-card:nth-child(4n + 2) {
  background: linear-gradient(145deg, rgba(255, 253, 250, 0.96), rgba(245, 239, 229, 0.8));
}

.memory-card:nth-child(4n + 3) {
  color: white;
  background: linear-gradient(145deg, #5b7fd9 0%, #5bbfa8 100%);
}

.memory-card:nth-child(4n + 4) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 226, 214, 0.82));
}

.memory-card.is-top {
  box-shadow: 0 34px 96px rgba(61, 48, 40, 0.2);
}

.memory-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.memory-card.is-flying {
  opacity: 0;
  transition: transform 430ms cubic-bezier(0.16, 0.84, 0.28, 1), opacity 430ms ease;
}

.memory-card:focus-visible {
  outline: 3px solid rgba(23, 23, 23, 0.72);
  outline-offset: 5px;
}

.finale {
  min-height: 92svh;
  padding-bottom: max(56px, env(safe-area-inset-bottom));
}

.love-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: white;
  font: inherit;
  font-weight: 800;
  background: #171717;
  box-shadow: 0 18px 50px rgba(23, 23, 23, 0.22);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.love-button:active {
  transform: scale(0.97);
  box-shadow: 0 10px 34px rgba(23, 23, 23, 0.22);
}

.message {
  min-height: 36px;
  margin: -12px auto 0;
  color: var(--rose);
  font-weight: 800;
  text-align: center;
}


.hug-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 253, 250, 0.96), rgba(255, 232, 221, 0.82) 38%, rgba(217, 80, 111, 0.34) 100%),
    linear-gradient(145deg, rgba(217, 80, 111, 0.74), rgba(233, 121, 85, 0.64));
  backdrop-filter: blur(20px) saturate(1.25);
  transform: scale(1.04);
  transition: opacity 280ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hug-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hug-overlay.is-open .hug-glow {
  animation: hugWrap 1.9s ease-in-out forwards;
}

.hug-overlay.is-open .hug-content {
  animation: hugArrive 1.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hug-glow {
  position: absolute;
  width: min(138vw, 660px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  box-shadow:
    inset 0 0 80px rgba(255, 255, 255, 0.45),
    0 0 90px rgba(217, 80, 111, 0.24);
  opacity: 0;
  transform: scale(1.2);
}

.hug-glow::before,
.hug-glow::after {
  position: absolute;
  content: "";
  top: 50%;
  width: 44%;
  height: 18%;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.58);
  filter: blur(1px);
}

.hug-glow::before {
  left: -7%;
  transform: translateY(-50%) rotate(17deg);
}

.hug-glow::after {
  right: -7%;
  transform: translateY(-50%) rotate(-17deg);
}

.hug-content {
  position: relative;
  display: grid;
  width: min(100%, 390px);
  min-height: 52svh;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--ink);
  text-align: center;
  transform: translateY(24px) scale(0.92);
}

.hug-heart {
  display: grid;
  width: clamp(132px, 42vw, 188px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: clamp(5.8rem, 24vw, 8.4rem);
  background: linear-gradient(145deg, var(--rose), var(--coral));
  box-shadow: 0 30px 90px rgba(122, 37, 56, 0.28);
}

.hug-content p {
  margin: 18px 0 0;
  color: rgba(23, 23, 23, 0.68);
  font-size: clamp(1rem, 4.3vw, 1.25rem);
  font-weight: 700;
}

.hug-content strong {
  max-width: 9ch;
  font-size: clamp(2.45rem, 12vw, 4.9rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.burst {
  position: fixed;
  z-index: 12;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--rose);
  animation: burst 780ms ease-out forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(42px) scale(0.985);
  transition: opacity 780ms ease, transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

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

@keyframes shine {
  0%,
  45% {
    transform: translateX(-92%);
  }
  72%,
  100% {
    transform: translateX(92%);
  }
}

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

@keyframes scrollDot {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}


@keyframes hugWrap {
  0% {
    opacity: 0;
    transform: scale(1.25);
  }
  34% {
    opacity: 1;
    transform: scale(0.84);
  }
  72% {
    opacity: 1;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes hugArrive {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.9);
  }
  28%,
  74% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scale(1.02);
  }
}

@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.2);
  }
}

@media (min-width: 760px) {
  .panel {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    padding-inline: clamp(36px, 8vw, 96px);
  }

  .copy {
    margin-left: 0;
  }

  .calm .copy,
  .finale .copy {
    grid-column: 1 / -1;
  }

  .ribbon {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .love .memory-stack {
    margin-right: 7vw;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
