:root {
  --sage: #b2bca3;
  --sage-soft: #c5ceba;
  --sage-deep: #6d7b64;
  --forest: #39473a;
  --ink: #2a2a2a;
  --muted: #8a8a8a;
  --line: #d7dcd0;
  --cream: #fbfaf6;
  --paper: #ffffff;
  --wax: #8d5b45;
  --wax-light: #c08a6a;
  --shadow: 0 18px 50px rgba(57, 71, 58, 0.12);
  --max: 430px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.app {
  width: min(100%, var(--max));
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.08);
}

.leaf {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.leaf-tl {
  top: -10px;
  left: -18px;
  width: 140px;
}

.leaf-tr {
  top: -8px;
  right: -24px;
  width: 150px;
}

.leaf-mid {
  top: 8px;
  left: 18px;
  width: 92px;
}

.blob {
  position: absolute;
  right: -30px;
  top: 20px;
  width: 170px;
  height: 130px;
  background: radial-gradient(circle at 40% 40%, rgba(178, 188, 163, 0.45), transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}

/* Cover */
.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.cover.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cover-inner {
  width: min(100%, var(--max));
  min-height: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
  text-align: center;
  position: relative;
  background: #fff;
}

.kicker {
  font-family: "Italiana", serif;
  letter-spacing: 0.42em;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--forest);
  margin-top: 36px;
}

.script-title {
  font-family: "Great Vibes", cursive;
  font-size: 72px;
  line-height: 0.9;
  color: var(--ink);
  margin: 6px 0 18px;
}

.double-happiness {
  font-size: 64px;
  font-weight: 500;
  color: var(--forest);
  line-height: 1;
  font-family: "Noto Serif SC", "Songti SC", serif;
  margin: 8px 0 36px;
}

.envelope-btn {
  border: 0;
  background: none;
  cursor: pointer;
  width: 250px;
  margin: 0 auto;
  display: block;
  transition: transform 0.35s ease;
}

.envelope-btn:hover {
  transform: translateY(-6px) scale(1.02);
}

.envelope-svg {
  width: 100%;
  filter: drop-shadow(0 14px 22px rgba(57, 71, 58, 0.22));
}

.hint {
  margin-top: 18px;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.12em;
  font-size: 13px;
  text-transform: uppercase;
}

/* Hero after open */
.section {
  position: relative;
  padding: 56px 28px;
}

.hero {
  padding-top: 70px;
  text-align: center;
}

.hero-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 28px;
}

.hero-name {
  font-family: "Great Vibes", cursive;
  font-size: 42px;
  color: var(--ink);
}

.hero-date {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  letter-spacing: 0.18em;
  margin: 4px 0;
}

.invite-line {
  margin-top: 42px;
}

.small-caps {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 15px;
}

.guest-name {
  font-family: "Allura", cursive;
  font-size: 34px;
  margin-top: 4px;
}

/* Letter / family */
.letter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding-top: 20px;
}

.letter-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  writing-mode: horizontal-tb;
  margin-bottom: 18px;
}

.rule {
  width: 1px;
  background: #9aa394;
  position: absolute;
  left: 27px;
  top: 118px;
  bottom: 40px;
}

.family {
  margin: 18px 0 22px;
  padding-left: 14px;
}

.family-label {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 15px;
  margin-bottom: 4px;
}

.family-parents {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.family-address {
  font-size: 12px;
  color: #555;
  margin-top: 2px;
}

.bookmark {
  width: 78px;
  height: 210px;
  background: var(--sage);
  border-radius: 4px 4px 8px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: #fff;
  font-size: 42px;
  font-family: "Noto Serif SC", serif;
  padding-bottom: 28px;
  position: relative;
  margin-top: 48px;
  box-shadow: 0 10px 24px rgba(109, 123, 100, 0.25);
}

.bookmark::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 12px;
  box-shadow: inset 0 0 0 3px var(--sage-soft);
}

/* Couple */
.center {
  text-align: center;
}

.announce {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-style: italic;
  margin-bottom: 10px;
}

.script-lg {
  font-family: "Great Vibes", cursive;
  font-size: 46px;
  line-height: 1.1;
}

.amp {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  margin: 2px 0;
}

.portrait {
  width: 168px;
  height: 210px;
  margin: 28px auto 0;
  background:
    linear-gradient(180deg, rgba(57, 71, 58, 0.08), rgba(57, 71, 58, 0.22)),
    var(--sage-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.2em;
  font-size: 18px;
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Calendar card */
.cal-card {
  max-width: 320px;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.cal-head {
  background: var(--forest);
  color: #fff;
  text-align: center;
  padding: 14px 10px 10px;
}

.cal-month {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cal-year {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 0.2em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 12px 10px 16px;
  text-align: center;
  font-size: 12px;
}

.cal-grid span {
  padding: 8px 0;
  color: #666;
}

.cal-grid .dow {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #999;
  text-transform: uppercase;
}

.cal-grid .today {
  color: #fff;
  font-weight: 600;
  background: var(--forest);
  border-radius: 50%;
}

.event-title {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 18px;
  margin-top: 22px;
}

.event-meta {
  margin-top: 8px;
  font-size: 14px;
}

.muted {
  color: #666;
  font-size: 13px;
  margin-top: 6px;
}

/* Reception */
.venue-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 8px 0;
}

.map-wrap {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  height: 220px;
  border: 1px solid var(--line);
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 12px 20px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.14em;
  font-size: 12px;
  text-transform: uppercase;
  margin-top: 16px;
  cursor: pointer;
  transition: 0.25s ease;
}

.btn:hover {
  background: #2b382c;
}

.btn.ghost {
  background: transparent;
  color: var(--forest);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 340px;
  margin: 22px auto 0;
}

.cd-item {
  border: 1px solid var(--line);
  padding: 10px 4px;
}

.cd-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  color: var(--forest);
}

.cd-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Form */
.form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #cfcfcf;
  padding: 12px 4px;
  font-size: 14px;
  background: transparent;
  outline: none;
  color: var(--ink);
}

.form textarea {
  min-height: 72px;
  resize: vertical;
}

.form-msg {
  min-height: 22px;
  font-size: 13px;
  color: var(--sage-deep);
}

.form-msg.error {
  color: #8a3b3b;
}

.sheet-hint {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  line-height: 1.5;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.gallery-item {
  background: var(--sage-soft);
  min-height: 160px;
  overflow: hidden;
  position: relative;
}

.gallery-item:nth-child(3n) {
  min-height: 120px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: inherit;
}

.gallery-item .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--forest);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.16em;
  font-size: 12px;
  text-transform: uppercase;
}

/* Gift */
.gift-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.gift-card {
  border: 1px solid var(--line);
  padding: 16px;
  text-align: center;
}

.gift-qr {
  width: 148px;
  height: 148px;
  margin: 10px auto;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--sage-deep);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.2em;
  background: #f7f6f2;
}

.gift-qr::after {
  content: "QR";
}

.gift-qr:has(img)::after {
  content: none;
}

.gift-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.gift-bank {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

.copy-btn {
  border: 0;
  background: none;
  color: var(--sage-deep);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.footer {
  text-align: center;
  padding: 28px 20px 90px;
  color: #888;
  font-size: 12px;
}

.music-btn {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.music-btn[hidden] {
  display: none;
}

.music-btn svg {
  width: 22px;
  height: 22px;
}

@media (min-width: 900px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, #f4f6ef, #e6e6e6);
  }
}
