:root {
  color-scheme: dark;
  --bg: #180714;
  --bg-2: #2a0a21;
  --text: #fff7fb;
  --muted: #f4bfd6;
  --rose: #ff6fae;
  --rose-2: #ff9fc9;
  --gold: #ffd18c;
  --glass: rgba(255, 255, 255, 0.11);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.22);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --max: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  padding-bottom: var(--safe-bottom);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 111, 174, 0.34), transparent 34rem),
    radial-gradient(circle at 85% 6%, rgba(255, 209, 140, 0.22), transparent 29rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 54%, #100511);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent, rgba(0,0,0,0.34));
  z-index: -1;
}

a { color: inherit; text-decoration: none; }

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

.aurora,
.grain,
#heartsCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#heartsCanvas { z-index: 1; }

.aurora {
  z-index: -3;
  filter: blur(42px);
  opacity: 0.78;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 65, 134, 0.42), transparent 24rem),
    radial-gradient(circle at 76% 55%, rgba(180, 78, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 54% 16%, rgba(255, 216, 130, 0.24), transparent 24rem);
  animation: drift 16s ease-in-out infinite alternate;
}

.grain {
  z-index: -2;
  opacity: 0.11;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(0.9rem + var(--safe-top)) 0 0.85rem;
  backdrop-filter: blur(18px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

.brand {
  gap: 0.55rem;
  border-radius: 999px;
  padding: 0.58rem 0.82rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  color: #411024;
}

.nav {
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 999px;
}

.nav a {
  padding: 0.62rem 0.8rem;
  border-radius: 999px;
  color: rgba(255,255,255,0.8);
  font-size: 0.92rem;
  transition: background 180ms ease, color 180ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(255,255,255,0.12);
  color: #fff;
  outline: none;
}

.section {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.hero {
  min-height: calc(100svh - 5.8rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(3rem, 8vw, 7rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(4rem, 12vw, 9.3rem);
  line-height: 0.82;
  letter-spacing: -0.08em;
  text-wrap: balance;
}

h1 span,
.script,
.signature span {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--rose-2);
}

.hero-text,
.glass-letter p,
.timeline-card p,
.reason-card p,
.family-card p,
.promise-inner p,
.footer p {
  color: rgba(255, 247, 251, 0.78);
  line-height: 1.75;
}

.hero-text {
  max-width: 42rem;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.9rem 1.18rem;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:active { transform: scale(0.98); }

.button:focus-visible {
  outline: 3px solid rgba(255, 209, 140, 0.45);
  outline-offset: 3px;
}

.primary {
  background: linear-gradient(135deg, var(--rose), #d63585 55%, var(--gold));
  box-shadow: 0 18px 50px rgba(255, 111, 174, 0.25);
}

.ghost {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
}

.hero-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(360px, 52vw, 610px);
  perspective: 1000px;
}

.photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(82vw, 410px);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 36% 64% 55% 45% / 42% 38% 62% 58%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,0.34), transparent 8rem),
    linear-gradient(145deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.12);
  overflow: hidden;
  animation: morph 9s ease-in-out infinite;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.18);
}

.initials {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(24, 7, 20, 0.48);
  backdrop-filter: blur(18px);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  box-shadow: inset 0 0 45px rgba(255, 159, 201, 0.24);
}

.moon {
  position: absolute;
  right: 17%;
  top: 14%;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 36px rgba(255, 209, 140, 0.9);
}

.shine {
  position: absolute;
  inset: -30%;
  background: linear-gradient(100deg, transparent 38%, rgba(255,255,255,0.22), transparent 58%);
  transform: translateX(-60%) rotate(18deg);
  animation: shine 4.8s ease-in-out infinite;
}

.orbital-ring {
  position: absolute;
  width: min(92vw, 500px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 45% 55% 50% 50%;
}

.ring-one { animation: spin 18s linear infinite; }
.ring-two { transform: rotate(67deg); animation: spin 24s linear infinite reverse; }

.floating-note {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  background: rgba(255,255,255,0.11);
  backdrop-filter: blur(16px);
  font-weight: 800;
  box-shadow: 0 16px 45px rgba(0,0,0,0.2);
  animation: float 4.2s ease-in-out infinite;
}

.note-one { left: 2%; top: 25%; }
.note-two { right: 0; bottom: 23%; animation-delay: -1s; }
.note-three { left: 21%; bottom: 8%; animation-delay: -2s; }

.glass-letter,
.timeline-card,
.reason-card,
.family-card,
.promise-inner {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--glass-strong), rgba(255,255,255,0.07));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.glass-letter {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(1.4rem, 5vw, 4rem);
  border-radius: clamp(1.5rem, 4vw, 3rem);
}

.script {
  margin-bottom: 0.2rem;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1;
}

.glass-letter h2,
.section-heading h2,
.family-card h2,
.promise-inner h2 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.signature {
  margin-bottom: 0;
  padding-top: 1rem;
}

.signature span { font-size: 2.6rem; }

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.timeline-card,
.reason-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 1.4rem;
}

.timeline-card::before,
.reason-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255, 159, 201, 0.22), transparent 15rem);
  opacity: 0.75;
  pointer-events: none;
}

.timeline-card > *,
.reason-card > * { position: relative; }

.timeline-dot {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  margin-bottom: 4rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 24px var(--gold);
}

.timeline-card h3,
.reason-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.25rem;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.reason-card span {
  display: inline-block;
  margin-bottom: 4.2rem;
  color: var(--gold);
  font-weight: 900;
}

.family-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  border-radius: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.star-stack {
  display: grid;
  gap: 0.8rem;
}

.star-stack span {
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.09);
  text-align: center;
  font-weight: 900;
}

.promise-inner {
  max-width: 960px;
  margin: 0 auto;
  border-radius: 2.4rem;
  padding: clamp(1.5rem, 5vw, 4rem);
  text-align: center;
}

.love-note {
  min-height: 2rem;
  margin: 1.2rem 0 0;
  font-weight: 800;
  color: var(--rose-2) !important;
}

.footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 calc(2rem + var(--safe-bottom));
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

.delay-1 { transition-delay: 110ms; }
.delay-2 { transition-delay: 210ms; }
.delay-3 { transition-delay: 310ms; }

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

@keyframes morph {
  0%, 100% { border-radius: 36% 64% 55% 45% / 42% 38% 62% 58%; transform: rotateX(0deg) rotateY(0deg); }
  50% { border-radius: 56% 44% 38% 62% / 52% 56% 44% 48%; transform: rotateX(2deg) rotateY(-4deg); }
}

@keyframes spin { to { transform: rotate(360deg); } }

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

@keyframes shine {
  0%, 38% { transform: translateX(-70%) rotate(18deg); }
  60%, 100% { transform: translateX(70%) rotate(18deg); }
}

@media (hover: hover) {
  .button:hover,
  .timeline-card:hover,
  .reason-card:hover {
    transform: translateY(-3px);
  }
}

@media (max-width: 900px) {
  .hero,
  .timeline,
  .reason-grid,
  .family-card {
    grid-template-columns: 1fr;
  }

  .hero { text-align: left; }
  .hero-card { order: -1; min-height: 380px; }
  .reason-grid { grid-template-columns: repeat(2, 1fr); }
  .family-card { align-items: start; }
  .star-stack { grid-template-columns: repeat(3, 1fr); }
  .star-stack span { min-width: 0; }
}

@media (max-width: 620px) {
  .topbar {
    width: min(100% - 1rem, var(--max));
    gap: 0.5rem;
  }

  .brand span:last-child { display: none; }

  .nav {
    flex: 1;
    justify-content: space-between;
  }

  .nav a {
    flex: 1;
    text-align: center;
    padding-inline: 0.4rem;
    font-size: 0.84rem;
  }

  .section { width: min(100% - 1rem, var(--max)); }
  .hero { min-height: auto; padding-top: 2rem; }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .reason-grid { grid-template-columns: 1fr; }
  .star-stack { grid-template-columns: 1fr; width: 100%; }
  .photo-frame { border-radius: 2rem; animation: none; }
  .floating-note { font-size: 0.85rem; }
}

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

  #heartsCanvas { display: none; }
}
