:root {
  --midnight: #09051b;
  --violet: #2a104d;
  --navy: #081533;
  --rose: #ff6fae;
  --pink: #ff9bc8;
  --gold: #f5d58a;
  --text: #fff7fb;
  --muted: rgba(255, 247, 251, 0.74);
  --glass: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 80px rgba(4, 0, 20, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 111, 174, 0.28), transparent 28rem),
    radial-gradient(circle at 78% 18%, rgba(245, 213, 138, 0.16), transparent 24rem),
    linear-gradient(135deg, var(--midnight), var(--violet) 42%, var(--navy));
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.replaying .reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.98);
}

#starfield,
.background-art,
#floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#starfield {
  z-index: -4;
}

.background-art {
  z-index: -5;
  overflow: hidden;
}

.background-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.background-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 5, 27, 0.14), rgba(9, 5, 27, 0.82)),
    radial-gradient(circle at 50% 100%, rgba(255, 111, 174, 0.16), transparent 28rem);
}

.blur-light {
  position: absolute;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.5;
  animation: drift 16s ease-in-out infinite alternate;
}

.light-one {
  left: -9rem;
  top: 14%;
  background: rgba(255, 111, 174, 0.34);
}

.light-two {
  right: -8rem;
  top: 8%;
  background: rgba(95, 105, 255, 0.26);
  animation-delay: -5s;
}

.light-three {
  left: 35%;
  bottom: -12rem;
  background: rgba(245, 213, 138, 0.2);
  animation-delay: -9s;
}

.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(1120px, calc(100% - 2rem));
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(11, 8, 32, 0.58);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand,
.nav-links a,
.primary-button,
.secondary-button {
  color: var(--text);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand img {
  width: 1.3rem;
  height: 1.3rem;
  filter: drop-shadow(0 0 12px rgba(255, 111, 174, 0.8));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.nav-links a:hover,
.nav-links a:focus-visible {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.section {
  position: relative;
  min-height: 100vh;
  padding: 8rem max(1.25rem, calc((100vw - 1120px) / 2)) 6rem;
}

.hero {
  display: grid;
  align-items: center;
  padding-top: 7rem;
}

.hero-inner {
  width: min(850px, 100%);
}

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

.hero h1,
.section-heading h2,
.letter h2,
.final-love h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  color: white;
  font-size: clamp(5rem, 16vw, 13rem);
  line-height: 0.82;
  text-shadow: 0 0 28px rgba(255, 111, 174, 0.4), 0 0 70px rgba(245, 213, 138, 0.14);
}

.date {
  margin: 1.2rem 0 0;
  color: var(--pink);
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  font-weight: 700;
}

.typed-line {
  min-height: 2.25rem;
  margin: 1.1rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
}

.cursor {
  color: var(--gold);
  animation: blink 900ms steps(2, start) infinite;
}

.primary-button,
.secondary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.25rem;
  padding: 0.95rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 111, 174, 0.95), rgba(245, 213, 138, 0.72));
  box-shadow: 0 15px 45px rgba(255, 111, 174, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  transform: translateY(-3px);
  filter: saturate(1.08);
  box-shadow: 0 20px 58px rgba(255, 111, 174, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  width: 1.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-hint::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 50%;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%);
  animation: scrollDot 1.7s ease-in-out infinite;
}

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

.section-heading h2,
.letter h2 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
}

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

.glass-card,
.glass-panel,
.timeline-item {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px);
}

.glass-card {
  min-height: 15rem;
  padding: 1.25rem;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.glass-card::before {
  content: "";
  display: block;
  width: 5rem;
  height: 0.18rem;
  margin-bottom: 1.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  box-shadow: 0 0 18px rgba(255, 111, 174, 0.48);
}

.glass-card:hover {
  border-color: rgba(245, 213, 138, 0.48);
  box-shadow: 0 28px 90px rgba(255, 111, 174, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: translateY(-8px);
}

.card-icon {
  margin-bottom: 0.85rem;
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(255, 111, 174, 0.6));
}

.glass-card h3,
.timeline-item span {
  margin: 0;
  color: white;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
}

.glass-card p,
.timeline-item p,
.letter p {
  color: var(--muted);
  line-height: 1.75;
}

.letter-section {
  display: grid;
  align-items: center;
}

.letter {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 3.5rem);
  border-radius: 8px;
}

.letter p {
  font-size: 1.04rem;
}

.signature {
  display: grid;
  gap: 0.35rem;
  margin-top: 2rem;
  color: white;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
}

.signature strong {
  color: var(--gold);
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.1rem;
  max-width: 820px;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--rose), var(--gold), rgba(255, 255, 255, 0.08));
  transform-origin: top;
  animation: growLine 2s ease both;
}

.timeline-item {
  position: relative;
  margin-left: 3rem;
  padding: 1.1rem 1.25rem;
  border-radius: 8px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.48rem;
  top: 1.38rem;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 20px rgba(255, 111, 174, 0.82);
}

.timeline-item p {
  margin: 0.3rem 0 0;
}

.final-love {
  display: grid;
  min-height: 85vh;
  align-items: center;
  text-align: center;
}

.final-love h2 {
  font-size: clamp(4.5rem, 12vw, 10rem);
  line-height: 0.9;
  text-shadow: 0 0 28px rgba(255, 111, 174, 0.45);
}

.final-love p {
  margin: 1.1rem auto 1.8rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.heart-burst {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  min-height: 4.2rem;
  margin-bottom: 1.4rem;
  font-size: 2rem;
}

.heart-burst span {
  display: inline-block;
  animation: heartPulse 2.2s ease-in-out infinite;
}

.heart-burst span:nth-child(2) {
  animation-delay: 0.2s;
}

.heart-burst span:nth-child(3) {
  animation-delay: 0.4s;
}

.heart-burst span:nth-child(4) {
  animation-delay: 0.6s;
}

.heart-burst span:nth-child(5) {
  animation-delay: 0.8s;
}

.floating-heart {
  position: absolute;
  bottom: -4rem;
  color: rgba(255, 155, 200, 0.78);
  font-size: var(--size);
  filter: drop-shadow(0 0 12px rgba(255, 111, 174, 0.72));
  animation: floatUp var(--duration) linear forwards;
}

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

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2.4rem, -2rem, 0) scale(1.1);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes scrollDot {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  35%,
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 1rem);
  }
}

@keyframes growLine {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes heartPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.76;
  }
  50% {
    transform: translateY(-0.7rem) scale(1.18);
    opacity: 1;
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12% {
    opacity: 0.9;
  }
  to {
    opacity: 0;
    transform: translate3d(var(--sway), -115vh, 0) rotate(24deg);
  }
}

@media (max-width: 820px) {
  .navbar {
    align-items: flex-start;
    border-radius: 8px;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .nav-links a {
    padding-inline: 0.5rem;
    font-size: 0.82rem;
  }

  .section {
    padding-top: 9.25rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .glass-card {
    min-height: 12rem;
  }
}

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