:root {
  --app-height: min(100svh, 852px);
  --bg: #f8f2e9;
  --bg-soft: #f8f5ef;
  --text: #3a3028;
  --muted: #7a6f64;
  --gold: #c7954a;
  --gold-dark: #b88a45;
  --line: rgba(184, 138, 69, 0.35);
  --card: rgba(255, 252, 246, 0.88);
  --shadow: 0 22px 45px rgba(89, 65, 39, 0.16);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Times New Roman", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  background: #eee3d5;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.9), transparent 28rem),
    linear-gradient(135deg, #eadcc9, #f8f2e9 42%, #e9dccb);
}

button {
  font: inherit;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main {
  width: min(100vw, 430px);
  height: var(--app-height);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(80, 56, 34, 0.16);
  scrollbar-width: none;
}

.main::-webkit-scrollbar {
  display: none;
}

.section {
  position: relative;
  min-height: var(--app-height);
  padding: calc(env(safe-area-inset-top) + 30px) 20px calc(env(safe-area-inset-bottom) + 28px);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.98;
  background:
    linear-gradient(180deg, rgba(248, 242, 233, 0.16), rgba(248, 242, 233, 0.08)),
    url("assets/images/background.png") center / cover no-repeat;
}

.section-inner {
  position: relative;
  z-index: 1;
  min-height: calc(var(--app-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cover-inner {
  justify-content: space-between;
  gap: 16px;
}

.date-mark {
  margin-top: 46px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(76px, 24vw, 116px);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 4px 15px rgba(151, 103, 43, 0.22);
}

.top-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--gold);
}

.top-flourish::before,
.top-flourish::after {
  content: "";
  width: 54px;
  height: 1px;
  background: var(--gold);
  opacity: 0.72;
}

.cover-divider {
  width: 178px;
  height: 42px;
  object-fit: contain;
  object-position: center;
}

.top-flourish {
  position: relative;
  width: 170px;
  height: 30px;
  margin: 8px auto 22px;
  background:
    linear-gradient(var(--gold), var(--gold)) left 50% / 52px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 50% / 52px 1px no-repeat;
}

.top-flourish::before,
.top-flourish::after {
  display: none;
}

.top-flourish::before {
  content: "✦";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: auto;
  height: auto;
  color: var(--gold);
  background: none;
  font-size: 18px;
  line-height: 1;
  opacity: 0.72;
  transform: translate(-50%, -50%);
}

.greeting-card {
  position: relative;
  width: min(100%, 354px);
  min-height: 0;
  margin: 18px 0 8px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  transform: none;
}

.greeting-card img,
.boarding-pass img,
.map-card img,
.future-card-image {
  display: block;
  width: 100%;
  height: auto;
}

.greeting-card img {
  filter:
    drop-shadow(0 16px 18px rgba(91, 63, 35, 0.16))
    drop-shadow(0 3px 3px rgba(255, 255, 255, 0.7));
}

.primary-button {
  width: 224px;
  min-width: 0;
  min-height: 0;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary-button img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(120, 78, 34, 0.18));
}

.primary-button:active {
  transform: translateY(1px);
}

.decor {
  display: none;
}

.decor-left {
  left: -44px;
  transform: rotate(-18deg);
}

.decor-right {
  right: -52px;
  bottom: 78px;
  transform: rotate(26deg);
  opacity: 0.25;
}

.eyebrow,
.section-copy,
.page-title,
.future-title {
  margin: 0;
  text-align: center;
}

.eyebrow {
  color: #5f5145;
  font-family: var(--serif);
  font-size: 23px;
}

.days-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  color: var(--gold-dark);
  font-family: var(--serif);
  text-shadow: 0 5px 14px rgba(151, 103, 43, 0.2);
}

.days-number {
  font-size: clamp(100px, 30vw, 134px);
  line-height: 0.82;
}

.days-unit {
  font-size: 42px;
}

.section-copy {
  max-width: 342px;
  margin-top: 18px;
  color: #5b4d41;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
}

.carousel-wrap {
  width: calc(100% + 40px);
  margin-top: 18px;
}

.carousel {
  display: flex;
  gap: 17px;
  overflow-x: auto;
  padding: 0 38px 10px;
  scroll-padding: 38px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

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

.carousel-card {
  flex: 0 0 83%;
  scroll-snap-align: center;
}

.memory-card,
.list-card {
  border: 1px solid rgba(199, 149, 74, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 34%),
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.72), transparent 9rem),
    var(--card);
  box-shadow: var(--shadow);
}

.boarding-pass,
.map-card {
  flex: 0 0 auto;
  height: 367px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.boarding-pass img,
.map-card img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.boarding-pass img {
  filter:
    drop-shadow(0 15px 18px rgba(91, 63, 35, 0.15))
    drop-shadow(0 2px 3px rgba(255, 255, 255, 0.72));
}

.map-card img {
  filter:
    drop-shadow(0 15px 18px rgba(91, 63, 35, 0.15))
    drop-shadow(0 2px 3px rgba(255, 255, 255, 0.72));
}

.swipe-hint {
  margin: 8px 0 10px;
  color: #7f6f60;
  text-align: center;
  letter-spacing: 0;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(122, 111, 100, 0.22);
}

.dots button.is-active {
  background: var(--gold);
}

.page-title,
.future-title {
  max-width: 360px;
  color: var(--gold-dark);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.28;
  text-shadow: 0 4px 12px rgba(151, 103, 43, 0.16);
}

.memories-section .section-inner {
  justify-content: flex-start;
  padding-top: 82px;
}

.memory-carousel {
  margin-top: 26px;
}

.memory-card {
  position: relative;
  overflow: hidden;
  height: 512px;
  padding: 16px 16px 22px;
  border-radius: 18px;
}

.memory-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  opacity: 0.95;
  filter:
    drop-shadow(0 15px 18px rgba(91, 63, 35, 0.15))
    drop-shadow(0 2px 3px rgba(255, 255, 255, 0.72));
}

.photo-box {
  z-index: 1;
  position: relative;
  height: 225px;
  margin: 19px 20px 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 46%),
    radial-gradient(circle at 24% 22%, rgba(199, 149, 74, 0.18), transparent 7rem),
    linear-gradient(145deg, #efe1cf, #faf4ea);
  border: 1px solid rgba(199, 149, 74, 0.45);
  border-radius: 14px;
}

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

.photo-box.is-missing img {
  display: none;
}

.photo-box span {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: rgba(184, 138, 69, 0.58);
  font-family: var(--serif);
  font-size: 30px;
}

.photo-box.is-missing span {
  display: grid;
}

.memory-card .memory-date,
.memory-card h2,
.memory-card p {
  position: relative;
  z-index: 3;
  margin-left: 12px;
  margin-right: 12px;
  text-align: center;
}

.memory-date {
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--gold-dark);
  font-family: var(--serif);
  font-size: 22px;
}

.memory-card h2 {
  position: relative;
  margin-top: 4px;
  margin-bottom: 20px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  color: var(--gold-dark);
}

.memory-card h2::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.memory-card p:last-child {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.78;
}

.future-inner {
  justify-content: flex-start;
  gap: 12px;
  padding-top: 58px;
}

.list-card {
  position: relative;
  width: fit-content;
  height: 512px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.future-card-image {
  position: static;
  width: auto;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 1;
  filter:
    drop-shadow(0 15px 18px rgba(91, 63, 35, 0.16))
    drop-shadow(0 2px 3px rgba(255, 255, 255, 0.72));
}

.list-card::before {
  display: none;
}

.list-ornament {
  display: none;
}

.future-list {
  display: none;
}

.future-list li {
  position: relative;
  min-height: 33px;
  padding: 5px 0 5px 39px;
  color: #4a3e34;
  font-size: 16px;
  line-height: 1.5;
  border-bottom: 1px dashed rgba(184, 138, 69, 0.2);
  counter-increment: future;
}

.future-list li:last-child {
  border-bottom: 0;
}

.future-list li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 3px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(184, 138, 69, 0.75);
  border-radius: 0;
}

.future-list li::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 11px;
  width: 6px;
  height: 12px;
  border-right: 2px solid var(--gold-dark);
  border-bottom: 2px solid var(--gold-dark);
  transform: rotate(42deg);
}

.list-separator {
  display: none;
}

.list-separator::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.list-note {
  display: none;
}

.primary-button.secondary {
  margin-bottom: 0;
}

.reveal-item,
.section .eyebrow,
.section .section-copy,
.page-title,
.future-list li,
.primary-button {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.section.is-active .reveal-item,
.section.is-active .eyebrow,
.section.is-active .section-copy,
.section.is-active .page-title,
.section.is-active .primary-button {
  opacity: 1;
  transform: translateY(0);
}

.future-section.is-active .future-list li {
  opacity: 1;
  transform: translateY(0);
}

.future-list li:nth-child(1) { transition-delay: 80ms; }
.future-list li:nth-child(2) { transition-delay: 170ms; }
.future-list li:nth-child(3) { transition-delay: 260ms; }
.future-list li:nth-child(4) { transition-delay: 350ms; }
.future-list li:nth-child(5) { transition-delay: 440ms; }
.future-list li:nth-child(6) { transition-delay: 530ms; }

@media (max-height: 780px) {
  .date-mark {
    margin-top: 18px;
    font-size: 78px;
  }

  .greeting-card {
    min-height: 220px;
    margin-top: 12px;
  }

  .boarding-pass,
  .map-card {
    height: 410px;
  }

  .photo-box {
    height: 198px;
    margin-top: 15px;
  }

  .memory-card,
  .list-card {
    height: 452px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal-item,
  .section .eyebrow,
  .section .section-copy,
  .page-title,
  .future-list li,
  .primary-button {
    opacity: 1;
    transform: none;
  }
}
