:root {
  color-scheme: light;
  --paper: #fffdf8;
  --porcelain: #ffffff;
  --ivory: #fff7eb;
  --champagne: #d6b987;
  --blush: #e8b9b0;
  --ink: #2b2520;
  --soft-ink: #776d63;
  --line: rgba(93, 72, 47, 0.14);
  --shadow: 0 20px 50px rgba(83, 64, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(232, 185, 176, 0.2), transparent 24rem),
    linear-gradient(180deg, #fffaf3 0%, #ffffff 52%, #fff7ec 100%);
  color: var(--ink);
  font-family:
    "Segoe UI",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: end center;
  padding: max(24px, env(safe-area-inset-top)) 22px max(34px, env(safe-area-inset-bottom));
  background: var(--paper);
  transition:
    opacity 700ms ease,
    transform 700ms ease,
    visibility 700ms ease;
}

.cover-screen.is-open {
  opacity: 0;
  transform: translateY(-18px) scale(1.02);
  visibility: hidden;
}

.cover-photo,
.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-photo {
  position: absolute;
  inset: 0;
}

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 251, 244, 0.38) 42%, rgba(255, 250, 243, 0.98));
}

.cover-content {
  position: relative;
  width: min(100%, 390px);
  padding-bottom: 6px;
  text-align: center;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: #a18455;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 12px 0 12px;
  color: #241e19;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 13vw, 4.8rem);
  font-weight: 500;
  line-height: 0.93;
  letter-spacing: 0;
}

.cover-note {
  width: min(100%, 330px);
  margin: 0 auto 22px;
  color: var(--soft-ink);
  font-size: 1.02rem;
  line-height: 1.58;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  font-weight: 800;
  touch-action: manipulation;
}

.primary-action {
  width: min(100%, 330px);
  gap: 12px;
  padding: 0 24px;
  background: #2b2520;
  color: white;
  box-shadow: 0 18px 38px rgba(43, 37, 32, 0.2);
}

.secondary-action {
  width: 100%;
  padding: 0 20px;
  background: var(--porcelain);
  color: var(--ink);
  border: 1px solid var(--line);
}

.experience {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -16px 18px;
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 1px solid rgba(214, 185, 135, 0.14);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.icon-button {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--porcelain);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(83, 64, 42, 0.08);
}

.sound-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--champagne);
  border-radius: 50%;
}

.sound-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--champagne);
}

.icon-button.is-playing .sound-icon {
  box-shadow: 0 0 0 7px rgba(214, 185, 135, 0.16);
}

.hero-panel {
  position: relative;
  height: min(72vh, 690px);
  min-height: 530px;
  margin: 0 -16px 24px;
  overflow: hidden;
  background: #fff8ef;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 56%, rgba(255, 253, 248, 0.98));
}

.date-pill {
  position: absolute;
  right: 18px;
  bottom: 20px;
  z-index: 1;
  max-width: calc(100% - 36px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.86);
  color: #7b633e;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(83, 64, 42, 0.12);
  backdrop-filter: blur(12px);
}

.section {
  padding: 18px 0 34px;
}

.section h2,
.finale h2 {
  margin: 6px 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  line-height: 1;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.step-count {
  color: var(--soft-ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.letter-card,
.reason-card,
.promise-card,
.finale {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.letter-card {
  padding: 24px 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 235, 0.72)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(214, 185, 135, 0.12) 32px);
}

.letter-card p {
  margin: 0;
  color: #423930;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.78;
}

.signature {
  padding-top: 18px;
  color: #8e744e;
  text-align: right;
}

.reason-card {
  min-height: 188px;
  display: grid;
  align-content: center;
  margin: 2px 0 14px;
  padding: 28px 22px;
}

.reason-card p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.78rem;
  line-height: 1.18;
}

.segmented-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented-actions button {
  min-height: 48px;
  border-radius: 999px;
  background: #f4ebdf;
  color: #5d4c39;
  font-weight: 800;
}

.segmented-actions button:last-child {
  background: #2b2520;
  color: white;
}

.memory-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(235px, 78%);
  gap: 12px;
  margin: 0 -16px;
  padding: 0 16px 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

.memory-card {
  min-height: 268px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(43, 37, 32, 0.56)),
    var(--memory-bg);
  background-size: cover;
  background-position: center;
  color: white;
  scroll-snap-align: start;
  box-shadow: 0 16px 34px rgba(83, 64, 42, 0.13);
}

.memory-card h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.memory-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
}

.note-grid {
  display: grid;
  gap: 12px;
}

.note-button {
  min-height: 72px;
  padding: 18px;
  border-radius: 8px;
  background: var(--porcelain);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(83, 64, 42, 0.08);
}

.note-button strong {
  display: block;
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.24rem;
  font-weight: 500;
}

.note-button span {
  display: none;
  color: var(--soft-ink);
  line-height: 1.5;
}

.note-button.is-open span {
  display: block;
}

.promise-card {
  padding: 22px;
  text-align: center;
}

.promise-wheel {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 2px auto 20px;
  border-radius: 50%;
  border: 1px solid rgba(214, 185, 135, 0.32);
  background:
    conic-gradient(from 15deg, #fff, #f1dbc0, #fff8ef, #e9c0b8, #fff, #d6b987, #fff);
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.6), 0 16px 34px rgba(83, 64, 42, 0.12);
  transition: transform 850ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.promise-wheel span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 58px;
  transform-origin: 50% 0;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 99px;
}

.promise-wheel span:nth-child(1) {
  transform: rotate(0deg);
}

.promise-wheel span:nth-child(2) {
  transform: rotate(45deg);
}

.promise-wheel span:nth-child(3) {
  transform: rotate(90deg);
}

.promise-wheel span:nth-child(4) {
  transform: rotate(135deg);
}

.promise-card p {
  min-height: 58px;
  margin: 0 0 18px;
  color: #423930;
  font-size: 1.08rem;
  line-height: 1.55;
}

.finale {
  margin: 18px 0 10px;
  padding: 34px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 247, 235, 0.86)),
    url("./public/white-love-gift.png") center bottom / cover;
  text-align: center;
}

.finale p {
  margin: 0 auto 22px;
  max-width: 34ch;
  color: var(--soft-ink);
  font-size: 1.05rem;
  line-height: 1.6;
}

.is-revealed {
  animation: revealUp 700ms both;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  body {
    padding: 28px 0;
  }

  .app-shell {
    min-height: calc(100vh - 56px);
    border-radius: 28px;
  }

  .cover-screen {
    width: min(100%, 520px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 28px;
    overflow: hidden;
  }

  .cover-screen.is-open {
    transform: translateX(-50%) translateY(-18px) scale(1.02);
  }
}

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