:root {
  color-scheme: light;
  --paper: #fff8f3;
  --paper-warm: #f9e9e4;
  --rose: #d8999d;
  --rose-deep: #a43e48;
  --wine: #7f202c;
  --ink: #241b1a;
  --muted: #7a6261;
  --leaf: #758a4d;
  --gold: #b78a44;
  --shadow: 0 24px 70px rgba(91, 39, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.9) 0 12%, transparent 24%),
    linear-gradient(135deg, #fffaf5 0%, #f8e7e3 44%, #eef1df 100%);
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", "STSong", "Times New Roman", serif;
}

.wechat-preview-image {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 300px;
  height: 300px;
  opacity: 0.01;
  pointer-events: none;
}

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

button {
  font: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(0deg, rgba(64, 38, 34, 0.12) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(64, 38, 34, 0.08) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

.petal-field {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -36px;
  width: 9px;
  height: 16px;
  border-radius: 70% 10% 70% 10%;
  background: rgba(193, 89, 99, 0.58);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.55);
  animation: petal-fall linear infinite;
  transform: rotate(18deg);
}

.petal:nth-child(3n) {
  width: 7px;
  height: 13px;
  background: rgba(255, 241, 239, 0.78);
}

.petal:nth-child(4n) {
  background: rgba(133, 155, 90, 0.48);
}

@keyframes petal-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -40px, 0) rotate(0deg);
  }
  12% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), calc(100vh + 60px), 0) rotate(420deg);
  }
}

.entry {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 249, 246, 0.86), rgba(248, 225, 221, 0.86)),
    url("./assets/invitation-original.jpg") center / cover;
  transition:
    opacity 720ms ease,
    visibility 720ms ease,
    transform 720ms ease;
}

.entry::before,
.entry::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background:
    linear-gradient(135deg, rgba(127, 32, 44, 0.12), rgba(255, 248, 243, 0.7)),
    var(--paper-warm);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.18, 1);
}

.entry::before {
  top: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.entry::after {
  bottom: 0;
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
}

.entry.is-open {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
}

.entry.is-open::before {
  transform: translateY(-70%);
}

.entry.is-open::after {
  transform: translateY(70%);
}

.entry__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 460px);
  min-height: 440px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 56px 30px 42px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.92) 0 34%, rgba(255, 246, 240, 0.92) 66%),
    var(--paper);
  border: 1px solid rgba(164, 62, 72, 0.2);
  box-shadow: var(--shadow);
}

.entry__panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(164, 62, 72, 0.32);
  pointer-events: none;
}

.entry__bow {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 110px;
  height: 42px;
  transform: translateX(-50%);
}

.entry__bow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wine);
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px rgba(164, 62, 72, 0.16);
}

.entry__bow span {
  position: absolute;
  top: 5px;
  width: 54px;
  height: 30px;
  border: 5px solid var(--wine);
  border-radius: 80% 45% 80% 45%;
}

.entry__bow span:first-child {
  left: 0;
  transform: rotate(12deg);
}

.entry__bow span:last-child {
  right: 0;
  transform: rotate(-12deg) scaleX(-1);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry h1 {
  margin: 32px 0 16px;
  color: var(--ink);
  font-size: 2.85rem;
  font-weight: 400;
  line-height: 1.18;
}

.entry__date {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.primary-action,
.text-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border: 1px solid rgba(127, 32, 44, 0.82);
  border-radius: 999px;
  background: var(--wine);
  color: #fffaf5;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(127, 32, 44, 0.2);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-action:active,
.text-action:active {
  transform: translateY(2px);
  box-shadow: 0 7px 20px rgba(127, 32, 44, 0.18);
}

.invitation {
  position: relative;
  z-index: 1;
}

.section {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 74px 22px;
}

.hero {
  min-height: 100svh;
  padding-top: max(68px, env(safe-area-inset-top));
}

.hero__content {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(420px, 1.16fr);
  gap: 42px;
  align-items: center;
}

.hero__copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 3.8rem;
  font-weight: 400;
  line-height: 1.18;
}

.hero__copy h2 span {
  display: inline-block;
  margin: 0 0.18em;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.8em;
}

.hero__line {
  margin: 26px 0 12px;
  color: var(--wine);
  font-size: 1.25rem;
}

.hero__meta {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.cover-art {
  position: relative;
  margin: 0;
  aspect-ratio: 1928 / 1282;
  overflow: hidden;
  border: 1px solid rgba(164, 62, 72, 0.2);
  background: #fff6f2;
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.62) 46%, transparent 60%);
  transform: translateX(-70%);
  animation: shine 5.8s ease-in-out infinite;
  pointer-events: none;
}

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

.cover-art figcaption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  max-width: 58%;
  color: rgba(127, 32, 44, 0.76);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  line-height: 1.5;
}

@keyframes shine {
  0%,
  48% {
    transform: translateX(-80%) rotate(5deg);
  }
  75%,
  100% {
    transform: translateX(82%) rotate(5deg);
  }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 22px;
  height: 36px;
  border: 1px solid rgba(127, 32, 44, 0.42);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--wine);
  transform: translateX(-50%);
  animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes scroll-dot {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  35%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

.vow {
  min-height: 76svh;
  background:
    linear-gradient(rgba(255, 248, 244, 0.72), rgba(255, 248, 244, 0.72)),
    repeating-linear-gradient(135deg, rgba(164, 62, 72, 0.08) 0 1px, transparent 1px 18px);
}

.vow__inner {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.vow h2,
.section-heading h2,
.closing h2 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.35;
}

.vow p:not(.eyebrow),
.closing p:not(.eyebrow) {
  margin: 24px auto 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 2.1;
}

.details {
  min-height: 92svh;
}

.section-heading {
  width: min(900px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}

.detail-grid {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.detail-card {
  min-height: 176px;
  padding: 26px 22px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(164, 62, 72, 0.18);
  background: rgba(255, 250, 246, 0.78);
  box-shadow: 0 18px 45px rgba(91, 39, 42, 0.1);
}

.detail-card__label {
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 0.12em;
}

.detail-card strong {
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.45;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.action-row {
  width: min(960px, 100%);
  margin: 28px auto 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.text-action {
  min-width: 132px;
  background: transparent;
  color: var(--wine);
  box-shadow: none;
}

.text-action:first-child {
  background: var(--wine);
  color: #fffaf5;
  box-shadow: 0 12px 30px rgba(127, 32, 44, 0.18);
}

.closing {
  min-height: 78svh;
  text-align: center;
  background:
    linear-gradient(rgba(255, 248, 244, 0.8), rgba(240, 244, 225, 0.78)),
    linear-gradient(90deg, transparent 0 14px, rgba(117, 138, 77, 0.12) 14px 15px, transparent 15px 30px);
}

.closing__ornament {
  width: min(360px, 82vw);
  margin: 0 auto 28px;
}

.closing__ornament svg {
  display: block;
  width: 100%;
  fill: none;
  stroke: var(--wine);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.closing__copy p:last-child {
  color: var(--wine);
  font-size: 1.5rem;
}

.music-toggle {
  position: fixed;
  right: 18px;
  top: max(18px, env(safe-area-inset-top));
  z-index: 6;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(127, 32, 44, 0.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--wine);
  background: rgba(255, 250, 246, 0.82);
  box-shadow: 0 12px 30px rgba(91, 39, 42, 0.14);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.music-toggle.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.music-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-toggle__ring {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(164, 62, 72, 0.28);
}

.music-toggle.is-playing .music-toggle__ring {
  animation: music-ring 1.6s ease-in-out infinite;
}

@keyframes music-ring {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.9;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 760ms ease,
    transform 760ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 9;
  max-width: min(86vw, 360px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(36, 27, 26, 0.88);
  color: #fffaf5;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .section {
    min-height: auto;
    padding: 70px 18px;
  }

  .hero {
    min-height: 100svh;
  }

  .hero__content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero__copy {
    padding-right: 54px;
  }

  .hero__copy h2 {
    font-size: 2.6rem;
  }

  .cover-art {
    transform: rotate(0deg);
  }

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

  .vow h2,
  .section-heading h2,
  .closing h2 {
    font-size: 2rem;
  }
}

@media (max-width: 520px) {
  .entry {
    padding: 16px;
  }

  .entry__panel {
    min-height: 400px;
    padding: 54px 22px 34px;
  }

  .entry h1 {
    font-size: 2.28rem;
  }

  .entry__date {
    font-size: 0.94rem;
  }

  .hero__copy {
    padding-right: 48px;
  }

  .hero__copy h2 {
    font-size: 2.18rem;
  }

  .hero__line {
    font-size: 1.1rem;
  }

  .cover-art figcaption {
    display: none;
  }

  .detail-card {
    min-height: 154px;
  }
}

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