:root {
  --ink: #321d2e;
  --wine: #4b203b;
  --berry: #9e4769;
  --rose: #d9899f;
  --blush: #f7e4e5;
  --cream: #fff9f2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
main { width: 100%; overflow: hidden; }

.section-shell {
  position: relative;
  width: 100%;
  padding-inline: clamp(20px, 6vw, 72px);
}

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(233, 162, 179, 0.26), transparent 32%),
    radial-gradient(circle at 86% 76%, rgba(178, 84, 119, 0.24), transparent 35%),
    linear-gradient(155deg, #241421 0%, #3d1c34 48%, #6c2c4c 100%);
  color: #fff8f2;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid rgba(255, 238, 228, 0.18);
  border-radius: 26px;
  pointer-events: none;
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  animation: drift 9s ease-in-out infinite;
}

.ambient-one { top: -65px; right: -55px; }
.ambient-two { bottom: 5%; left: -105px; width: 240px; height: 240px; animation-delay: -3s; }

.hero-content {
  width: min(100%, 620px);
  padding-block: 100px 76px;
  animation: reveal 1s both;
}

.eyebrow, .kicker, .letter-label {
  margin: 0;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow { color: #eab3c0; }

.heart-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 24px auto 22px;
  border: 1px solid rgba(255, 235, 225, 0.34);
  border-radius: 50%;
  color: #f4b4c2;
  font-size: 1.2rem;
  box-shadow: 0 0 38px rgba(226, 128, 156, 0.18);
}

h1, h2, h3, p { text-wrap: balance; }
h1, h2, .signature { font-family: Georgia, "Times New Roman", serif; }

h1 {
  margin: 0;
  font-size: clamp(3.15rem, 14vw, 6.5rem);
  font-weight: 400;
  line-height: 0.91;
  letter-spacing: -0.05em;
}

h1 em { color: #f0afbd; font-weight: 400; }

.hero-copy {
  max-width: 470px;
  margin: 30px auto 0;
  color: rgba(255, 248, 242, 0.73);
  font-size: 0.98rem;
  line-height: 1.75;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 42px;
  color: #fff5ed;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.scroll-cue span { font-size: 1rem; animation: bounce 1.8s ease-in-out infinite; }

.music-button {
  position: absolute;
  top: max(32px, env(safe-area-inset-top));
  right: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 2;
  padding: 8px 13px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7f0;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  backdrop-filter: blur(12px);
}

.music-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0b0bd;
  color: #421d34;
  font-size: 1rem;
}

.music-button.is-playing .music-icon {
  animation: pulse 1.8s ease-in-out infinite;
}

.music-hint {
  position: absolute;
  top: 80px;
  right: 25px;
  width: 220px;
  z-index: 3;
  padding: 12px 15px;
  border-radius: 14px;
  background: #fff9f2;
  color: #563048;
  font-size: 0.76rem;
  line-height: 1.45;
  box-shadow: 0 15px 40px rgba(18, 4, 14, 0.22);
}

.timer-section, .memories-section { padding-block: 84px; background: var(--cream); }

.section-heading {
  max-width: 620px;
  margin: 0 auto 34px;
  text-align: center;
}

.kicker { color: var(--berry); }

.section-heading h2, .letter-card h2 {
  margin: 10px 0 0;
  font-size: clamp(2.35rem, 10vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}

.timer-grid {
  width: min(100%, 720px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto;
}

.time-card {
  min-width: 0;
  padding: 20px 4px 17px;
  border: 1px solid #edd9d6;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
  box-shadow: 0 14px 32px rgba(75, 32, 59, 0.05);
}

.time-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wine);
  font-size: clamp(1.55rem, 7vw, 3rem);
  font-weight: 400;
  line-height: 1;
}

.time-card span {
  display: block;
  margin-top: 9px;
  color: #986f7d;
  font-size: clamp(0.55rem, 2.5vw, 0.72rem);
}

.placeholder-note { margin: 22px 0 0; color: #ac8791; font-size: 0.72rem; text-align: center; }

.photos-section {
  min-height: 760px;
  padding-block: 78px 88px;
  background: linear-gradient(180deg, #4b203b 0%, #30172a 100%);
  color: #fff9f2;
}

.light-heading .kicker { color: #e6a8b7; }

.carousel-shell {
  width: min(100%, 680px);
  margin: 28px auto 0;
}

.photo-carousel {
  width: 100%;
  display: flex;
  overflow-x: auto;
  border-radius: 26px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.photo-carousel::-webkit-scrollbar { display: none; }

.photo-slide {
  min-width: 100%;
  margin: 0;
  padding: 10px 10px 22px;
  scroll-snap-align: start;
  background: #fffaf3;
  color: #432537;
  box-shadow: 0 24px 55px rgba(12, 3, 10, 0.28);
}

.photo-frame {
  position: relative;
  height: min(112vw, 560px);
  overflow: hidden;
  border-radius: 18px 18px 5px 5px;
  background: #2c1727;
}

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

.photo-count {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(31, 12, 25, 0.55);
  color: #fff8f2;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  backdrop-filter: blur(9px);
}

.photo-slide > p {
  min-height: 52px;
  display: grid;
  place-items: center;
  margin: 18px 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 5vw, 1.45rem);
  font-style: italic;
  line-height: 1.3;
  text-align: center;
}

.carousel-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.carousel-controls > button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff9f2;
  font-size: 1.2rem;
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.carousel-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 180ms ease, background 180ms ease;
}

.carousel-dots button.active {
  width: 20px;
  background: #edaabd;
}

.swipe-hint {
  margin: 13px 0 0;
  color: rgba(255, 249, 242, 0.52);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-align: center;
}

.memory-list {
  width: min(100%, 760px);
  display: grid;
  gap: 12px;
  margin: 0 auto;
}

.memory-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  padding: 24px 20px;
  border: 1px solid #ecd9d7;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.memory-number {
  color: #c67c91;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-style: italic;
}

.memory-card h3 {
  margin: 0;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.memory-card p { margin: 9px 0 0; color: #775766; font-size: 0.87rem; line-height: 1.65; }

.letter-section { padding-block: 74px; background: var(--blush); }

.letter-card {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: 48px 26px 40px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.92), rgba(255, 253, 248, 0.92)),
    repeating-linear-gradient(0deg, transparent, transparent 29px, #eaded8 30px);
  box-shadow: 0 24px 60px rgba(88, 45, 67, 0.12);
  text-align: center;
}

.letter-heart { color: var(--berry); font-size: 1.3rem; }
.letter-label { margin-top: 16px; color: #a76a7d; }
.letter-card h2 { font-size: clamp(2.5rem, 11vw, 4.5rem); }

.letter-card > p:not(.letter-label) {
  margin: 25px auto 0;
  color: #705260;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.85;
}

.signature { margin-top: 30px; color: var(--berry); font-size: 1.35rem; font-style: italic; }

footer {
  display: grid;
  gap: 7px;
  padding: 48px 20px calc(48px + env(safe-area-inset-bottom));
  background: #261522;
  color: rgba(255, 248, 242, 0.58);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

footer strong { color: #e7a9b8; font-size: 0.78rem; font-weight: 600; }

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

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 14px, 0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

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

@media (min-width: 700px) {
  .memory-card { grid-template-columns: 72px 1fr; padding: 30px 32px; }
  .photo-frame { height: 560px; }
}

@media (max-width: 390px) {
  .section-shell { padding-inline: 16px; }
  .hero::after { inset: 9px; }
  .music-button { right: 20px; }
  .time-card { padding-inline: 1px; }
}

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