:root {
  --bg-top: #170a1a;
  --bg-bottom: #35142d;
  --rose: #ff6fa8;
  --rose-soft: #ffd3e6;
  --gold: #ffd894;
  --text: #fff7fb;
  --card: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.24);
  --shadow: 0 20px 60px rgba(12, 0, 20, 0.45);
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: linear-gradient(150deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

a {
  color: inherit;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 24px 24px 48px;
  position: relative;
  z-index: 2;
}

.panel {
  width: min(860px, 100%);
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
}

h1 {
  line-height: 1.08;
  font-size: clamp(2.1rem, 6vw, 4.1rem);
}

h2 {
  line-height: 1.12;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
}

h3 {
  font-size: clamp(1.2rem, 2.3vw, 1.45rem);
}

.message {
  margin: 16px 0 0;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.7;
  color: var(--rose-soft);
  max-width: 62ch;
}

.pill-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: #ffeaf4;
  background: rgba(255, 255, 255, 0.08);
}

.action-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.surprise-btn,
.ghost-btn,
.letter-btn,
.note-btn {
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.surprise-btn {
  border: 0;
  color: #270312;
  background: linear-gradient(120deg, var(--gold), var(--rose));
  box-shadow: 0 8px 30px rgba(255, 111, 168, 0.4);
}

.surprise-btn:hover,
.surprise-btn:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 34px rgba(255, 111, 168, 0.5);
}

.ghost-btn,
.letter-btn,
.note-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffe9f4;
  background: rgba(255, 255, 255, 0.08);
}

.ghost-btn:hover,
.ghost-btn:focus-visible,
.letter-btn:hover,
.letter-btn:focus-visible,
.note-btn:hover,
.note-btn:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

.surprise-text,
.note-output {
  min-height: 1.8em;
  margin-top: 14px;
  font-weight: 500;
  color: #ffe2f0;
}

.quote-panel {
  text-align: center;
}

.quote-sub {
  margin: 16px 0 0;
  color: #f5c9dd;
  opacity: 0.85;
  font-size: 0.9rem;
}

.photo-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.photo-frame {
  margin: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(8, 0, 14, 0.32);
}

.photo-frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  display: block;
}

.photo-frame figcaption {
  margin: 0;
  padding: 10px 12px 12px;
  font-size: 0.84rem;
  color: #ffe5f2;
}

.photo-frame:nth-child(1) {
  transform: rotate(-1.8deg);
}

.photo-frame:nth-child(2) {
  transform: translateY(-4px);
}

.photo-frame:nth-child(3) {
  transform: rotate(1.5deg);
}

.photo-frame:nth-child(4) {
  transform: translateY(2px) rotate(-0.8deg);
}

.reasons-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reason-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.reason-card p {
  margin: 8px 0 0;
  color: #ffdff0;
  line-height: 1.55;
  font-size: 0.95rem;
}

.timeline {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 14px 16px;
  border-left: 3px solid rgba(255, 216, 148, 0.75);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-item p {
  margin: 8px 0 0;
  color: #ffdff0;
  line-height: 1.5;
}

.timeline-date {
  margin: 0;
  font-weight: 700;
  color: #ffe7be !important;
}

.note-buttons {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.letter-btn {
  margin-top: 20px;
}

.letter-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.5s ease, opacity 0.45s ease, transform 0.45s ease;
}

.letter-content.open {
  margin-top: 14px;
  max-height: 290px;
  opacity: 1;
  transform: translateY(0);
}

.letter-content p {
  margin: 0;
  color: #ffe2f0;
  line-height: 1.75;
}

.letter-signature {
  margin-top: 12px !important;
  color: #ffd9ea !important;
  font-family: "DM Serif Display", serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

.footer {
  width: min(860px, 100%);
  padding: 10px 8px 20px;
  text-align: center;
  color: #f7cfe2;
  z-index: 2;
}

.footer p {
  margin: 0;
}

.footer a {
  display: inline-block;
  margin-top: 8px;
  opacity: 0.9;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  animation: riseIn 0.8s ease-out both;
}

#heartCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  filter: blur(70px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.glow-left {
  left: -15vw;
  top: -10vw;
  background: radial-gradient(circle, #ff5ea9 0%, transparent 60%);
}

.glow-right {
  right: -10vw;
  bottom: -12vw;
  background: radial-gradient(circle, #ffb35c 0%, transparent 60%);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reasons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page {
    padding: 16px 16px 34px;
  }

  .panel {
    border-radius: 22px;
    padding: 22px;
  }

  .pill-row {
    gap: 8px;
  }

  .pill {
    font-size: 0.82rem;
    padding: 7px 12px;
  }

  .surprise-btn,
  .ghost-btn,
  .letter-btn {
    width: 100%;
  }

  .photo-grid,
  .reasons-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .photo-frame:nth-child(1),
  .photo-frame:nth-child(2),
  .photo-frame:nth-child(3),
  .photo-frame:nth-child(4) {
    transform: none;
  }
}
