:root {
  --bg-1: #22060d;
  --bg-2: #45111f;
  --bg-3: #7a1d35;
  --bg-4: #b33a50;
  --ink: #ffe9dc;
  --ink-soft: #ffcab5;
  --card: rgba(255, 227, 208, 0.14);
  --card-strong: rgba(255, 230, 214, 0.22);
  --accent: #ff8b7f;
  --accent-strong: #ff6c7e;
  --line: rgba(255, 222, 206, 0.32);
  --shadow: 0 16px 44px rgba(27, 3, 10, 0.5);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 181, 168, 0.26), transparent 35%),
    radial-gradient(circle at 82% 20%, rgba(255, 130, 130, 0.22), transparent 30%),
    radial-gradient(circle at 65% 85%, rgba(255, 164, 138, 0.2), transparent 36%),
    linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 32%, var(--bg-3) 65%, var(--bg-4) 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 220, 205, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 210, 196, 0.16) 1px, transparent 1px);
  background-size: 2px 2px, 2px 2px;
}

.section {
  width: min(1000px, calc(100% - 2rem));
  margin: 0 auto;
}

.screen-deck {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding-bottom: 6rem;
}

.screen {
  position: relative;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  scroll-margin-top: 0.5rem;
  padding: 2.2rem 0 5.5rem;
}

.screen.active {
  outline: none;
}

.screen-content {
  display: grid;
  gap: 1.15rem;
}

.hero {
  min-height: calc(100svh - 8rem);
  display: grid;
  align-content: center;
}

.screen-hero,
.screen-portrait {
  justify-content: center;
}

.screen-story,
.screen-photos,
.screen-reasons {
  align-items: flex-start;
}

.screen-story .screen-content,
.screen-photos .screen-content,
.screen-reasons .screen-content {
  padding-top: 1rem;
}

.screen-portrait .section {
  width: min(760px, calc(100% - 2rem));
}

.eyebrow {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin: 0;
  color: var(--ink-soft);
}

h1,
h2,
h3 {
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: 0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 0.95;
  max-width: 11ch;
  margin-top: 0.7rem;
  color: #ffd9ca;
}

.hero-copy {
  max-width: 560px;
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
  margin: 1rem 0 1.8rem;
  font-style: italic;
  color: #ffece2;
}

.hero-actions,
.reason-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.music-picker {
  display: grid;
  gap: 0.35rem;
  width: min(420px, 100%);
  margin-top: 0.3rem;
}

.music-picker label {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.music-picker select {
  width: 100%;
  appearance: none;
  border-radius: 18px;
  padding: 0.78rem 1rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(30, 8, 14, 0.45);
  backdrop-filter: blur(10px);
  font: inherit;
}

.music-picker select:focus {
  outline: 2px solid rgba(255, 210, 188, 0.65);
  outline-offset: 2px;
}

.btn {
  font: inherit;
  font-size: 1.1rem;
  border-radius: 999px;
  padding: 0.58rem 1.2rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #2f0614;
  box-shadow: 0 8px 22px rgba(17, 3, 7, 0.36);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: rgba(255, 242, 233, 0.08);
  color: var(--ink);
  border-color: var(--line);
  backdrop-filter: blur(2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

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

.stat-card,
.reason-card,
.timeline-list article,
.photo-card {
  background: linear-gradient(165deg, var(--card-strong), var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.stat-card {
  padding: 1rem;
}

.stat-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.stat-value {
  margin: 0.4rem 0 0;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
}

.stat-value.small {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.timeline h2,
.reasons h2,
.memories h2 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  margin: 0 0 0.7rem;
  color: #ffe0d3;
}

.timeline-list {
  display: grid;
  gap: 0.7rem;
}

.timeline-list article {
  padding: 0.75rem 0.9rem;
}

.timeline-date {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.timeline-title {
  margin: 0.1rem 0;
  font-size: 1.45rem;
}

.timeline-detail {
  margin: 0;
  font-size: 1.03rem;
}

.memories {
  align-content: start;
  padding-bottom: 2rem;
}

.memory-wish {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  max-width: 62ch;
}

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

.photo-card {
  overflow: hidden;
  min-height: 270px;
}

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

.photo-empty {
  margin: 0;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px dashed var(--line);
}

.reasons-wrap {
  align-content: center;
  min-height: calc(100svh - 10rem);
  padding-bottom: 2rem;
}

.screen-reasons {
  align-items: center;
}

.reasons {
  padding-bottom: 0.7rem;
}

.reason-card {
  padding: 1.15rem;
  margin-bottom: 0.8rem;
  transform-style: preserve-3d;
}

.reason-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.reason-text {
  margin: 0.4rem 0 0;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

.reason-media {
  margin-top: 0.9rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.reason-gif {
  display: block;
  width: 100%;
  height: min(44vw, 280px);
  border: 0;
}

.app-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  width: min(520px, calc(100% - 1.3rem));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(36, 8, 14, 0.45);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.screen-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.screen-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 228, 214, 0.8);
  background: transparent;
  cursor: pointer;
}

.screen-dot.active {
  background: #ffd2bc;
}

.screen-count {
  position: fixed;
  right: 1rem;
  top: 0.7rem;
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.portrait-cta {
  min-height: calc(100svh - 11rem);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.9rem;
}

.portrait-cta h2 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
}

.portrait-copy {
  margin: 0 auto;
  max-width: 48ch;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.portrait-copy span {
  color: #ffd8cc;
}

.portrait-link {
  justify-self: center;
}

.surprise-modal {
  border: 1px solid var(--line);
  border-radius: 22px;
  max-width: 620px;
  width: calc(100% - 2rem);
  padding: 0;
  box-shadow: var(--shadow);
  background: #fff6ee;
}

.surprise-modal::backdrop {
  background: rgba(73, 31, 21, 0.4);
  backdrop-filter: blur(2px);
}

.modal-inner {
  padding: 1.35rem;
}

.modal-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

#letterBody {
  font-size: 1.2rem;
}

#heartsCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

@media (max-width: 820px) {
  .stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.5rem, 11vw, 4.7rem);
  }

  .hero {
    min-height: calc(100svh - 10rem);
  }

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

  .photo-card {
    min-height: 220px;
  }

  .app-nav {
    bottom: 0.65rem;
    width: calc(100% - 0.9rem);
  }

  .btn {
    font-size: 1rem;
  }

  .screen {
    padding: 1.3rem 0 5rem;
  }

  .portrait-cta {
    min-height: calc(100svh - 9rem);
  }
}
