:root {
  --bg-1: #fff5f8;
  --bg-2: #ffe4ec;
  --ink: #2d1f2d;
  --ink-soft: #6b4c5a;
  --accent: #e63975;
  --accent-soft: #f8a5c2;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(230, 57, 117, 0.18);
  --good: #e63975;
  --rose-gold: #f7cac9;
  --deep-rose: #c94c7c;
  --soft-purple: #d4a5d9;
  --gold: #f5d491;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(248, 165, 194, 0.5), transparent 45%),
    radial-gradient(circle at 85% 12%, rgba(212, 165, 217, 0.4), transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(247, 202, 201, 0.4), transparent 40%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2), #fce4ec);
  background-size: 120% 120%, 120% 120%, 150% 150%, 160% 160%;
  animation: background-wave 14s ease-in-out infinite alternate;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  max-width: 420px;
  max-height: 420px;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.34;
  z-index: -1;
  animation: glow-drift 12s ease-in-out infinite alternate;
}

.glow-a {
  background: linear-gradient(135deg, #ff9a9e, #fecfef);
  top: -90px;
  left: -50px;
}

.glow-b {
  background: linear-gradient(135deg, #f8a5c2, #d4a5d9);
  right: -80px;
  bottom: 10%;
  animation-delay: 1.4s;
}

.glow-c {
  position: fixed;
  width: 35vw;
  height: 35vw;
  max-width: 380px;
  max-height: 380px;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.28;
  z-index: -1;
  background: linear-gradient(135deg, #ffd1dc, #f5d491);
  bottom: -60px;
  left: 30%;
  animation: glow-drift 15s ease-in-out infinite alternate-reverse;
}

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

.ambient-heart {
  position: absolute;
  bottom: -30px;
  font-size: 0.95rem;
  opacity: 0.45;
  animation: ambient-float linear forwards;
  color: #e63975;
  text-shadow: 0 0 8px rgba(230, 57, 117, 0.3);
}

.page {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 40px 0 80px;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  padding: 70px 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before,
.eyebrow::after {
  content: "♡";
  font-size: 0.7rem;
  color: var(--accent-soft);
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0;
  line-height: 1.03;
}

h1 {
  font-size: clamp(2.25rem, 6.5vw, 4.8rem);
  margin-top: 10px;
  animation: title-breathe 3.4s ease-in-out infinite;
  background: linear-gradient(135deg, var(--accent) 0%, var(--deep-rose) 50%, var(--soft-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin: 14px auto 24px;
  max-width: 700px;
  font-size: clamp(1rem, 2.3vw, 1.28rem);
  color: var(--deep-rose);
  font-style: italic;
}

.author-name {
  color: #9b59b6;
  font-style: normal;
  font-weight: 600;
}

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  backdrop-filter: blur(8px);
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(230, 57, 117, 0.08);
  transition: box-shadow 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

.section:hover {
  box-shadow: 0 12px 40px rgba(230, 57, 117, 0.18);
  transform: translateY(-4px);
  border-color: var(--accent-soft);
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-radius: 50%;
}

h2 {
  font-size: clamp(1.8rem, 4.3vw, 3rem);
  color: var(--ink);
}

h2::after {
  content: " ";
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  margin-top: 8px;
  border-radius: 3px;
}

.section-copy {
  color: var(--ink-soft);
  margin-top: 8px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.photo-card {
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--accent-soft);
  background: linear-gradient(145deg, #fff5f8, #ffe4ec);
  animation: photo-dance 5s ease-in-out infinite, border-pulse 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.photo-card:hover {
  transform: translateY(-12px) scale(1.05) rotate(2deg);
  box-shadow: 0 20px 40px rgba(230, 57, 117, 0.35);
  border-color: var(--accent);
  animation-play-state: paused;
}

.photo-card:hover img,
.photo-card:hover video {
  transform: scale(1.1);
}

.photo-card img,
.photo-card video {
  transition: transform 0.5s ease;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.photo-card.video-card {
  aspect-ratio: 9 / 16;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 248, 0.8));
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: card-float 4s ease-in-out infinite, card-glow 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  position: relative;
  overflow: hidden;
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: card-shine 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.timeline-item:hover {
  transform: translateY(-8px) scale(1.02) rotate(-1deg);
  border-color: var(--accent);
  box-shadow: 0 15px 35px rgba(230, 57, 117, 0.25);
}

.timeline-date {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.timeline-date::before {
  content: "♡ ";
  color: var(--accent-soft);
}

.timeline-text {
  margin: 7px 0 0;
  font-size: 0.95rem;
  line-height: 1.42;
}

.constellation {
  position: relative;
  min-height: 240px;
  border: 2px dashed rgba(230, 57, 117, 0.25);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 245, 248, 0.9), rgba(255, 228, 236, 0.8));
}

.star {
  position: absolute;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, #ffd1dc, #f8a5c2);
  color: #2d1f2d;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 8px 20px rgba(230, 57, 117, 0.2);
  animation: star-float 3s ease-in-out infinite;
}

.star:nth-child(odd) {
  animation-delay: 0.5s;
}

.star:nth-child(3n) {
  animation-delay: 1s;
}

.star:hover,
.star:focus-visible {
  transform: scale(1.25) rotate(10deg);
  box-shadow: 0 15px 35px rgba(230, 57, 117, 0.45), 0 0 20px rgba(248, 165, 194, 0.5);
  background: linear-gradient(160deg, #ff9a9e, #e63975);
  color: #fff;
  animation-play-state: paused;
}

.star.claimed {
  background: linear-gradient(160deg, #e63975, #c94c7c);
  color: #fff;
  box-shadow: 0 8px 24px rgba(230, 57, 117, 0.4);
  animation: star-pulse 1.5s ease-in-out infinite;
}

@keyframes star-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.05);
  }
}

@keyframes star-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(230, 57, 117, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(230, 57, 117, 0.5), 0 0 15px rgba(230, 57, 117, 0.3);
  }
}

.star.spark {
  animation: star-spark 0.6s ease;
}

.reason-output {
  margin-top: 14px;
  min-height: 28px;
  color: var(--ink);
  font-size: 1.05rem;
  padding: 12px 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 209, 220, 0.3));
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  transition: all 0.3s ease;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.promise-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 209, 220, 0.4));
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
  animation: promise-wiggle 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  position: relative;
  overflow: hidden;
}

.promise-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft), var(--soft-purple), var(--accent));
  background-size: 200% 100%;
  animation: gradient-slide 3s linear infinite;
}

.promise-card::after {
  content: "💕";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%) scale(0);
  font-size: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0.7;
}

.promise-card:hover::after {
  transform: translateY(-50%) scale(1);
}

.promise-card:hover {
  transform: rotate(-2deg) translateY(-8px) scale(1.03);
  box-shadow: 0 15px 35px rgba(230, 57, 117, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 209, 220, 0.6));
}

.promise-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.ask {
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 228, 236, 0.9));
  border: 2px solid var(--accent-soft);
  position: relative;
  overflow: hidden;
}

.ask::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft), var(--soft-purple), var(--gold), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.ask h2::after {
  margin: 8px auto 0;
}

.action-row {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #e63975, #c94c7c);
  color: #fff;
  animation: button-pulse 2.1s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(230, 57, 117, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #c94c7c, #e63975);
  box-shadow: 0 6px 20px rgba(230, 57, 117, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--accent-soft);
  color: var(--accent);
}

.btn-ghost:hover {
  background: rgba(248, 165, 194, 0.3);
  border-color: var(--accent);
}

.tiny-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 16px;
  font-style: italic;
}

.tiny-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-soft);
  transition: border-color 0.2s ease;
}

.tiny-note a:hover {
  border-color: var(--accent);
}

.celebration {
  position: fixed;
  inset: 0;
  background: rgba(45, 31, 45, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 100;
}

.celebration.visible {
  display: grid;
}

.celebration-card {
  width: min(600px, 92vw);
  border-radius: 28px;
  background: linear-gradient(145deg, #fff, #fff5f8, #ffe4ec);
  border: 2px solid var(--accent-soft);
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(230, 57, 117, 0.3);
  animation: celebration-pop 0.5s ease-out;
}

.celebration-card h3 {
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  color: var(--accent);
  margin-bottom: 12px;
}

.celebration-card p {
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.6;
}

@keyframes celebration-pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.confetti-heart {
  position: fixed;
  top: -24px;
  font-size: 18px;
  pointer-events: none;
  animation: fall linear forwards;
  text-shadow: 0 2px 8px rgba(230, 57, 117, 0.4);
  z-index: 101;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(280deg);
    opacity: 0;
  }
}

@keyframes background-wave {
  0% {
    background-position: 0% 0%, 100% 0%, 0% 0%;
  }
  100% {
    background-position: 12% 20%, 78% 25%, 100% 100%;
  }
}

@keyframes glow-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(16px, -10px, 0) scale(1.09);
  }
}

@keyframes ambient-float {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.32;
  }
  100% {
    transform: translateY(-110vh) translateX(26px) rotate(28deg);
    opacity: 0;
  }
}

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

@keyframes card-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-6px) rotate(0.5deg);
  }
  75% {
    transform: translateY(-3px) rotate(-0.5deg);
  }
}

@keyframes card-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(230, 57, 117, 0.1);
  }
  50% {
    box-shadow: 0 8px 25px rgba(230, 57, 117, 0.2);
  }
}

@keyframes card-shine {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

@keyframes photo-dance {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  20% {
    transform: translateY(-5px) rotate(1deg);
  }
  40% {
    transform: translateY(-8px) rotate(-0.5deg);
  }
  60% {
    transform: translateY(-4px) rotate(0.5deg);
  }
  80% {
    transform: translateY(-6px) rotate(-1deg);
  }
}

@keyframes border-pulse {
  0%, 100% {
    border-color: var(--accent-soft);
  }
  50% {
    border-color: var(--accent);
  }
}

@keyframes promise-wiggle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) rotate(0.8deg);
  }
  50% {
    transform: translateY(-2px) rotate(0deg);
  }
  75% {
    transform: translateY(-5px) rotate(-0.8deg);
  }
}

@keyframes gradient-slide {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

@keyframes button-pulse {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(230, 57, 117, 0.35);
  }
  50% {
    box-shadow: 0 4px 15px rgba(230, 57, 117, 0.35), 0 0 0 10px rgba(230, 57, 117, 0.15);
  }
}

@keyframes title-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes star-spark {
  0% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 8px 20px rgba(230, 57, 117, 0.2);
  }
  50% {
    transform: scale(1.18);
    filter: brightness(1.15);
    box-shadow: 0 10px 30px rgba(230, 57, 117, 0.45), 0 0 20px rgba(248, 165, 194, 0.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 8px 20px rgba(230, 57, 117, 0.2);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0s);
}

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

@media (max-width: 640px) {
  .hero {
    padding-top: 42px;
  }

  .section {
    padding: 20px;
  }

  .star {
    width: 52px;
    height: 52px;
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(248, 165, 194, 0.6), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(212, 165, 217, 0.5), transparent 45%),
    linear-gradient(140deg, #fff5f8, #ffe4ec, #fce4ec);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 92vw);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(230, 57, 117, 0.2);
  border: 2px solid var(--accent-soft);
  animation: login-float 3s ease-in-out infinite;
}

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

.login-hearts {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: heartbeat 1.2s ease-in-out infinite;
}

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

.login-card h2 {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-card h2::after {
  display: none;
}

.login-card > p {
  color: var(--ink-soft);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.input-group {
  text-align: left;
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(230, 57, 117, 0.15);
}

.input-group input::placeholder {
  color: #bbb;
}

.input-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 6px;
  font-style: italic;
}

.login-error {
  color: #d63031;
  font-size: 0.88rem;
  min-height: 20px;
  margin: 0 0 12px;
}

.login-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
}

.main-content.hidden {
  display: none;
}
