:root {
  --background: #fbf4e8;
  --foreground: #3e3327;
  --muted: #8e7a62;
  --line: rgba(152, 121, 82, 0.24);
  --panel: rgba(255, 251, 244, 0.72);
  --champagne: #c7a469;
  --deep: #5c4633;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.95), transparent 28rem),
    linear-gradient(165deg, #fffaf0 0%, #f9eddd 42%, #f4dfc4 100%);
  color: var(--foreground);
  font-family:
    "Songti SC",
    "Noto Serif CJK SC",
    "PingFang SC",
    "Microsoft YaHei",
    serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.invite-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.3), rgba(244, 223, 196, 0.18)),
    var(--background);
  box-shadow: 0 0 60px rgba(86, 61, 36, 0.12);
}

.invite-shell::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}

.floating-button {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  right: calc(50% - min(100vw, 480px) / 2 + 18px);
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(161, 124, 78, 0.34);
  border-radius: 50%;
  background: rgba(255, 251, 244, 0.74);
  color: var(--deep);
  font-family: Georgia, serif;
  font-size: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(92, 70, 51, 0.13);
}

.hero-section {
  position: relative;
  min-height: 100svh;
  padding: 22px 22px 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slow-float 10s ease-in-out infinite alternate;
  filter: saturate(0.86) contrast(0.95) brightness(1.04);
}

.hero-image-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.16), rgba(251, 244, 232, 0.42) 34%, rgba(251, 244, 232, 0.95) 88%),
    radial-gradient(circle at 50% 35%, transparent 0, rgba(95, 70, 42, 0.1) 78%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  animation: rise-in 900ms ease both;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(44px, 16vw, 72px);
  font-weight: 400;
  line-height: 0.96;
}

.hero-copy h1 span {
  display: block;
  margin: 9px 0 7px;
  color: var(--champagne);
  font-size: 28px;
  font-style: italic;
}

.hero-date {
  margin: 22px 0 0;
  color: #6a533d;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.line-draw {
  width: 100%;
  height: 1px;
  margin: 26px 0;
  background: linear-gradient(90deg, transparent, rgba(139, 104, 63, 0.62), transparent);
  transform-origin: left;
  animation: line-draw 1.25s 500ms ease both;
}

.hero-note {
  max-width: 21rem;
  margin: 0;
  color: #6e5a44;
  font-size: 15px;
  line-height: 1.9;
}

.letter-section,
.details-section,
.timeline-section,
.closing-section {
  padding: 74px 24px;
}

.letter-section h2,
.details-section h2,
.closing-section h2 {
  margin: 0;
  color: var(--deep);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.35;
}

.letter-section p:not(.section-kicker) {
  margin: 22px 0 0;
  color: #6c5944;
  font-size: 15px;
  line-height: 2;
}

.gallery-section {
  padding: 20px 18px 68px;
}

.gallery-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(159, 121, 76, 0.25);
  border-radius: 8px;
  background: #f8ead7;
  box-shadow: 0 28px 60px rgba(91, 64, 39, 0.16);
}

.gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 900ms ease, transform 1200ms ease;
  filter: saturate(0.9) contrast(0.96);
}

.gallery-image.active {
  opacity: 1;
  transform: scale(1);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}

.gallery-dots button {
  width: 26px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(109, 84, 56, 0.24);
}

.gallery-dots button.active {
  background: var(--champagne);
}

.details-section {
  background: rgba(255, 250, 242, 0.5);
  border-block: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.detail-grid article,
.venue-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.detail-grid article {
  min-height: 104px;
  padding: 18px;
}

.detail-grid span,
.venue-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 14px;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.venue-card {
  margin-top: 10px;
  padding: 20px;
}

.venue-card p {
  margin: 0 0 9px;
  color: var(--deep);
  font-size: 18px;
}

.timeline-section {
  display: grid;
  gap: 20px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 18px;
  align-items: start;
}

.timeline-item time {
  color: var(--champagne);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.timeline-item h3 {
  margin: 0;
  color: var(--deep);
  font-size: 18px;
  font-weight: 400;
}

.timeline-item p {
  margin: 8px 0 0;
  color: #75624d;
  font-size: 14px;
  line-height: 1.7;
}

.actions-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 78px;
}

.actions-section a,
.actions-section button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(125, 93, 55, 0.28);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.65);
  color: var(--deep);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.actions-section .primary-action {
  background: #6a5038;
  color: #fffaf2;
}

.closing-section {
  min-height: 56svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.86), transparent 22rem),
    linear-gradient(180deg, transparent, rgba(218, 183, 136, 0.26));
}

.closing-section p {
  margin: 0 0 18px;
  color: var(--champagne);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.12em;
}

.closing-section span {
  margin-top: 16px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}

.reveal {
  animation: reveal-up linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 28%;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-draw {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes slow-float {
  from {
    transform: scale(1.02) translateY(-8px);
  }

  to {
    transform: scale(1.08) translateY(10px);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(34px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (min-width: 481px) {
  body {
    background: #ead7bd;
  }
}
