@charset "UTF-8";

:root {
  --red: #8c1f2d;
  --red-dark: #64141f;
  --paper: #f6f0e6;
  --paper-deep: #eadcc8;
  --ink: #2d2623;
  --gold: #b28a4d;
  --gold-light: #d8bd88;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--red-dark); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

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

.opening {
  position: fixed;
  z-index: 20;
  inset: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 43%, rgba(218, 169, 111, .22), transparent 32%),
    repeating-linear-gradient(120deg, rgba(255,255,255,.014) 0 1px, transparent 1px 7px),
    linear-gradient(145deg, #a72c3d, #7b1725 64%, #66111c);
  transition: opacity .9s ease .9s, visibility 0s linear 1.8s;
}

.opening::before,
.opening::after {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(226, 194, 135, .58);
}

.opening::after {
  inset: 23px;
  border-color: rgba(226, 194, 135, .2);
}

.opening__glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(222, 190, 132, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(222,190,132,.025), 0 0 0 90px rgba(222,190,132,.018);
}

.opening__eyebrow {
  margin: 0 0 18px;
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: .45em;
}

.opening__title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 500;
  letter-spacing: .16em;
}

.opening__title i {
  color: var(--gold-light);
  font-size: .4em;
  font-style: normal;
  letter-spacing: 0;
}

.opening__wish {
  margin: 10px 0 30px;
  color: rgba(246,240,230,.62);
  font-size: 11px;
  letter-spacing: .32em;
}

.envelope {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1.48;
  margin: 38px 0 50px;
  padding: 0;
  border: 0;
  outline: none;
  cursor: pointer;
  background: transparent;
  filter: drop-shadow(0 24px 22px rgba(34, 4, 9, .3));
  perspective: 1000px;
  transition: transform .75s cubic-bezier(.4,0,.2,1);
}

.envelope:focus-visible { filter: drop-shadow(0 0 0 3px var(--gold-light)) drop-shadow(0 24px 22px rgba(34,4,9,.3)); }

.envelope__back,
.envelope__front,
.envelope__flap,
.envelope__side,
.envelope__paper { position: absolute; inset: 0; display: block; }

.envelope__back {
  z-index: 2;
  background: #e8d5ba;
  border: 1px solid rgba(151,108,63,.25);
  border-radius: 3px;
  box-shadow: inset 0 0 18px rgba(126,89,48,.055);
}

.envelope__paper {
  z-index: 1;
  top: 7%;
  bottom: 8%;
  left: 7%;
  right: 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--red);
  background: #fbf7ef;
  border: 1px solid rgba(178,138,77,.34);
  box-shadow: inset 0 0 0 5px #fbf7ef, inset 0 0 0 6px rgba(178,138,77,.22);
  transition: transform 1.05s cubic-bezier(.22,.82,.22,1) .4s;
  will-change: transform;
}

.envelope__paper small { font: 8px/1.2 Georgia, serif; letter-spacing: .24em; }
.envelope__paper b { margin: 10px 0 4px; font-size: 47px; font-weight: 500; }
.envelope__paper em { font-size: 9px; font-style: normal; letter-spacing: .12em; }

.envelope__front {
  z-index: 4;
  clip-path: polygon(0 100%, 50% 47%, 100% 100%);
  background: linear-gradient(180deg, #f0e2cd, #e4cfb2);
  filter: drop-shadow(0 -1px 0 rgba(150,111,67,.22));
}

.envelope__side {
  z-index: 3;
  background: #ead8bf;
}

.envelope__side--left {
  clip-path: polygon(0 0, 52% 51%, 0 100%);
  filter: drop-shadow(1px 0 0 rgba(151,109,63,.18));
}

.envelope__side--right {
  clip-path: polygon(100% 0, 48% 51%, 100% 100%);
  filter: drop-shadow(-1px 0 0 rgba(151,109,63,.18));
}

.envelope__flap {
  z-index: 5;
  height: 53%;
  transform-origin: center top;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(165deg, #f3e7d5, #e3cfb4);
  filter: drop-shadow(0 1px 0 rgba(151,109,63,.22));
  transition: transform .7s cubic-bezier(.4,0,.2,1);
}

.envelope__seal {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: #e8cda2;
  font-size: 23px;
  background: radial-gradient(circle at 38% 32%, #a93b48, #731521 72%);
  border: 2px solid #a84450;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #71111c, 0 4px 8px rgba(74,9,16,.35);
  transition: opacity .25s ease .15s, transform .35s ease .1s;
}

.opening__hint {
  position: absolute;
  bottom: max(38px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: rgba(246,240,230,.72);
  font-size: 10px;
  letter-spacing: .18em;
  animation: breathe 2.2s ease-in-out infinite;
}

.opening__hint span { width: 25px; height: 1px; background: rgba(216,189,136,.5); }

.opening.is-open .envelope__flap { z-index: 0; transform: rotateX(180deg); }
.opening.is-open .envelope__back { z-index: 0; }
.opening.is-open .envelope__paper { z-index: 2; transform: translateY(-52%); }
.opening.is-open .envelope { transform: translateY(64px); }
.opening.is-open .envelope__seal { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(20deg); }
.opening.is-open { opacity: 0; visibility: hidden; }

.invitation { overflow: hidden; opacity: 0; background: var(--paper); transition: opacity .8s ease; }
.invitation.is-visible { opacity: 1; }

.music-toggle {
  position: fixed;
  z-index: 12;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, calc((100vw - 480px) / 2 + 16px));
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  font: 21px/1 Georgia, serif;
  border: 1px solid rgba(216,189,136,.68);
  border-radius: 50%;
  background: rgba(117,22,34,.9);
  box-shadow: 0 8px 22px rgba(72,15,23,.22);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity .25s ease, transform .25s ease;
}

.music-toggle::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(216,189,136,.62);
  border-radius: 50%;
  animation: music-spin 8s linear infinite;
}

.music-toggle span { position: relative; z-index: 1; transform: translateY(-1px); }
.music-toggle:hover { transform: translateY(-2px); }
.music-toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.music-toggle.is-paused { opacity: .64; }
.music-toggle.is-paused::before { animation-play-state: paused; }
.music-toggle.is-paused span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 1px; background: var(--paper); transform: translate(-50%,-50%) rotate(-45deg); }

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(178,138,77,.09), transparent 28%),
    linear-gradient(90deg, transparent 49.7%, rgba(178,138,77,.08) 50%, transparent 50.3%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(178,138,77,.22);
  border-radius: 50%;
}

.hero::before { top: -82px; left: -70px; box-shadow: 36px 18px 0 -1px var(--paper), 37px 18px rgba(178,138,77,.13); }
.hero::after { right: -86px; bottom: -66px; box-shadow: -34px -21px 0 -1px var(--paper), -35px -21px rgba(178,138,77,.13); }

.hero__topline, .section-label {
  color: var(--gold);
  font: 10px/1.4 Georgia, serif;
  letter-spacing: .28em;
}

.double-happiness {
  margin: 28px 0 18px;
  color: var(--red);
  font-size: clamp(80px, 25vw, 116px);
  line-height: .9;
  text-shadow: 0 5px 16px rgba(140,31,45,.12);
}

.hero__kicker { margin: 0 0 22px; font-size: 12px; letter-spacing: .18em; }
.hero h2 { display: flex; align-items: center; gap: 16px; margin: 0; font-size: clamp(28px, 8vw, 40px); font-weight: 500; letter-spacing: .13em; }
.hero h2 i { color: var(--gold); font: italic 22px/1 Georgia, serif; }

.hero__rule { display: flex; align-items: center; gap: 12px; width: min(270px, 75vw); margin: 24px 0; color: var(--gold); font-size: 10px; letter-spacing: .2em; }
.hero__rule::before, .hero__rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-light)); }
.hero__rule::after { background: linear-gradient(90deg, var(--gold-light), transparent); }
.hero__lead { margin: 0; color: #544943; font-size: 15px; line-height: 2.1; letter-spacing: .18em; }

.scroll-cue { position: absolute; bottom: 30px; width: 1px; height: 44px; overflow: hidden; background: rgba(178,138,77,.2); }
.scroll-cue span { display: block; width: 1px; height: 18px; background: var(--gold); animation: scroll 2s ease-in-out infinite; }

.petal { position: absolute; width: 11px; height: 7px; border-radius: 100% 0 100% 0; background: rgba(140,31,45,.55); animation: float 7s ease-in-out infinite; }
.petal--one { top: 22%; left: 12%; transform: rotate(18deg); }
.petal--two { top: 42%; right: 13%; animation-delay: -3s; transform: rotate(70deg) scale(.7); }

.section-card { margin: 18px; padding: 64px 28px; text-align: center; border: 1px solid rgba(178,138,77,.27); background: rgba(255,252,246,.72); box-shadow: 0 12px 35px rgba(74,50,31,.055); }
.section-card h3, .venue h3, .closing h3 { margin: 12px 0 26px; color: var(--red); font-size: 23px; font-weight: 500; letter-spacing: .13em; }
.letter > p:not(.section-label) { margin: 0; color: #5b504a; font-size: 14px; line-height: 2.35; letter-spacing: .08em; }
.signature { margin-top: 34px; color: var(--red); font-size: 18px; letter-spacing: .14em; }
.signature span { margin: 0 13px; color: var(--gold); font-size: 10px; }

.date-block { padding: 74px 24px; text-align: center; background: var(--red); color: var(--paper); }
.date-block__main { display: inline-grid; grid-template-columns: auto; min-width: 124px; margin: 0 15px; padding: 15px 24px; vertical-align: middle; border-left: 1px solid rgba(216,189,136,.45); border-right: 1px solid rgba(216,189,136,.45); }
.date-block__main span, .date-block__main em { color: var(--gold-light); font: normal 10px/1.3 Georgia, serif; letter-spacing: .2em; }
.date-block__main strong { margin: 3px 0; font: 60px/1 Georgia, serif; font-weight: 400; }
.date-block__side { display: inline-block; width: 62px; font-size: 11px; line-height: 1.8; letter-spacing: .08em; vertical-align: middle; }
.date-block > p { margin: 30px 0 0; color: rgba(246,240,230,.68); font-size: 11px; letter-spacing: .32em; }

.timeline { margin-top: 30px; }
.timeline__items { position: relative; max-width: 290px; margin: 38px auto 0; text-align: left; }
.timeline__items::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 78px; width: 1px; background: rgba(178,138,77,.32); }
.timeline__items div { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 42px; align-items: center; margin: 24px 0; }
.timeline__items div::before { content: ""; position: absolute; left: 75px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px var(--paper); }
.timeline__items time { color: var(--red); font: 15px/1 Georgia, serif; }
.timeline__items span { font-size: 13px; letter-spacing: .14em; }

.venue { padding: 68px 18px 82px; text-align: center; }
.venue__card { position: relative; max-width: 420px; margin: 0 auto; padding: 52px 24px 28px; border: 1px solid rgba(178,138,77,.32); background: #eee1cf; }
.venue__pin { position: absolute; top: -23px; left: 50%; width: 46px; height: 46px; transform: translateX(-50%) rotate(45deg); border-radius: 50% 50% 50% 0; background: var(--red); box-shadow: 0 6px 16px rgba(91,18,27,.18); }
.venue__pin span { position: absolute; top: 14px; left: 14px; width: 18px; height: 18px; border: 1px solid var(--gold-light); border-radius: 50%; }
.venue__card p { margin: 0 0 12px; color: var(--red); font-size: 20px; letter-spacing: .15em; }
.venue__card address { color: #66574f; font-size: 13px; font-style: normal; line-height: 2; letter-spacing: .1em; }
.venue__card a { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding: 15px 19px; color: var(--paper); font-size: 12px; letter-spacing: .12em; text-decoration: none; background: var(--red); }
.venue__card a span { font: 20px/1 Georgia, serif; transition: transform .2s ease; }
.venue__card a:hover span { transform: translateX(4px); }

.closing { padding: 72px 24px max(80px, calc(60px + env(safe-area-inset-bottom))); text-align: center; color: var(--paper); background: linear-gradient(145deg, #8f2231, #68121e); }
.closing__seal { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 25px; color: var(--gold-light); font-size: 30px; border: 1px solid var(--gold); border-radius: 50%; }
.closing p { margin: 0; color: rgba(246,240,230,.67); font-size: 11px; letter-spacing: .28em; }
.closing h3 { margin: 18px 0 32px; color: var(--paper); font-size: 25px; }
.closing small { color: var(--gold-light); font: 9px/1 Georgia, serif; letter-spacing: .25em; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in-view { opacity: 1; transform: none; }

@keyframes breathe { 50% { opacity: .45; transform: translateY(4px); } }
@keyframes scroll { 0% { transform: translateY(-18px); } 65%,100% { transform: translateY(46px); } }
@keyframes float { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 15px 24px; rotate: 90deg; } }
@keyframes music-spin { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .invitation { max-width: 480px; margin: 0 auto; box-shadow: 0 0 80px rgba(48,14,15,.25); }
  body { background: #4c1119; }
  .opening__glow { width: 560px; height: 560px; }
}

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