:root {
  --bg: #f8eee9;
  --paper: #fffaf7;
  --ink: #705f5d;
  --muted: #9d8582;
  --accent: #e9a9b7;
  --accent-2: #b7d7ce;
  --accent-3: #f4d79a;
  --line: rgba(112, 95, 93, 0.18);
  --shadow: 0 18px 44px rgba(99, 78, 74, 0.18);
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(135deg, var(--bg), #f2e7d7);
  color: var(--ink);
}

body.theme-princess {
  --bg: #f8eaf3;
  --accent: #d98bb8;
  --accent-2: #d9c06d;
  --accent-3: #f6dfe9;
}

body.theme-teddy {
  --bg: #f5eadf;
  --accent: #c79b7c;
  --accent-2: #f0c2c2;
  --accent-3: #e8d0b2;
}

body.theme-clouds {
  --bg: #edf5f7;
  --accent: #9dc8d4;
  --accent-2: #f2c6d2;
  --accent-3: #f7e9b8;
}

body.theme-butterfly {
  --bg: #f5edf7;
  --accent: #bf91cf;
  --accent-2: #efb0c1;
  --accent-3: #cfe6d8;
}

body.theme-safari {
  --bg: #f6efe2;
  --accent: #d6ad73;
  --accent-2: #8db99b;
  --accent-3: #efd49a;
}

button,
a {
  font: inherit;
}

[contenteditable="true"] {
  outline: 0;
  border-radius: 8px;
}

[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px rgba(233, 169, 183, 0.45);
  background: rgba(255, 255, 255, 0.65);
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75), var(--shadow);
}

.section {
  padding: 48px 28px;
  position: relative;
}

.cover {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 32px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.88)),
    repeating-linear-gradient(90deg, rgba(112, 95, 93, 0.04) 0 1px, transparent 1px 10px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.cover.is-hidden {
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.cover-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.b1 {
  top: 8%;
  left: -34px;
}

.b2 {
  right: -42px;
  top: 35%;
  background: color-mix(in srgb, var(--accent-2) 34%, transparent);
}

.b3 {
  bottom: 9%;
  left: 24%;
  background: color-mix(in srgb, var(--accent-3) 42%, transparent);
}

.envelope {
  width: min(82vw, 330px);
  height: 245px;
  position: relative;
  filter: drop-shadow(0 18px 24px rgba(94, 76, 72, 0.2));
}

.envelope-back,
.envelope-front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 170px;
  border-radius: 8px;
}

.envelope-back {
  background:
    linear-gradient(150deg, transparent 49%, rgba(0, 0, 0, 0.08) 50%, transparent 51%),
    linear-gradient(210deg, transparent 49%, rgba(0, 0, 0, 0.08) 50%, transparent 51%),
    var(--accent-2);
}

.envelope-front {
  background:
    linear-gradient(33deg, var(--accent-2) 49%, transparent 50%),
    linear-gradient(-33deg, var(--accent-2) 49%, transparent 50%),
    color-mix(in srgb, var(--accent-2) 72%, #fff 28%);
  clip-path: polygon(0 22%, 50% 72%, 100% 22%, 100% 100%, 0 100%);
}

.pass-card {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 8px;
  height: 178px;
  padding: 36px 18px 20px;
  text-align: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(45deg, rgba(112, 95, 93, 0.05) 0 2px, transparent 2px 8px);
  border: 1px solid rgba(112, 95, 93, 0.12);
  border-radius: 8px;
  z-index: 1;
}

.pass-card p,
.eyebrow,
.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pass-card strong {
  display: block;
  margin: 12px 0;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.28;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pass-card span {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
}

.seal {
  position: absolute;
  left: 50%;
  top: 126px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--accent-3);
  border: 5px solid rgba(255, 255, 255, 0.62);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: #8a6d55;
  z-index: 3;
}

.primary-btn,
.line-btn,
.theme-grid button,
.editor-actions button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.primary-btn {
  padding: 0 28px;
  color: white;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(188, 107, 126, 0.22);
}

.line-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  padding: 0 22px;
}

.content {
  display: none;
}

.content.is-visible {
  display: block;
}

.hero {
  min-height: 96vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding-bottom: 72px;
  background:
    linear-gradient(to bottom, transparent, rgba(255, 250, 247, 0.95) 64%),
    radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 36%);
}

.mobile-art {
  position: absolute;
  top: 58px;
  left: 50%;
  width: 280px;
  height: 300px;
  transform: translateX(-50%);
}

.moon {
  position: absolute;
  left: 50%;
  top: 0;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent-3);
  box-shadow: inset -18px -10px 0 rgba(255, 255, 255, 0.45);
}

.crib {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  height: 118px;
  border: 10px solid var(--accent-2);
  border-top: 0;
  border-radius: 0 0 24px 24px;
}

.crib::before {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  top: -18px;
  height: 24px;
  border-radius: 16px;
  background: var(--accent-2);
}

.crib span {
  position: absolute;
  top: 4px;
  bottom: 12px;
  width: 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 65%, white 35%);
}

.crib span:nth-child(1) {
  left: 25%;
}

.crib span:nth-child(2) {
  left: 50%;
}

.crib span:nth-child(3) {
  left: 75%;
}

.garland {
  position: absolute;
  inset: 28px 0 auto;
  display: flex;
  justify-content: space-between;
}

.garland i {
  width: 22px;
  height: 28px;
  border-radius: 50% 50% 45% 45%;
  background: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, serif;
  font-size: clamp(3.8rem, 19vw, 5.8rem);
  font-weight: 400;
  line-height: 0.9;
  color: color-mix(in srgb, var(--accent) 82%, #6c5050 18%);
}

h2 {
  font-family: Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.75;
}

.date-card,
.info,
.themes,
.itinerary,
.details,
.gallery,
.rsvp {
  border-top: 1px solid var(--line);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}

.date-grid div,
.countdown div,
.details article,
.photo-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.date-grid div {
  padding: 18px;
}

.date-grid span,
.countdown span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-grid strong {
  display: block;
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 2.6rem;
  font-weight: 400;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 24px;
  background: color-mix(in srgb, var(--accent-2) 17%, transparent);
}

.countdown div {
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
}

.countdown strong {
  font-family: Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
}

.info .big {
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.theme-grid button {
  background: white;
  color: var(--ink);
}

.theme-grid button.is-active {
  background: var(--accent);
  color: white;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline p {
  margin: 0;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--accent);
}

.timeline span {
  display: inline-block;
  min-width: 58px;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 76%, #6c5050 24%);
}

.details {
  display: grid;
  gap: 14px;
}

.details article {
  padding: 20px;
}

.details p {
  margin-bottom: 0;
  line-height: 1.6;
}

.photo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}

.photo-card {
  aspect-ratio: 4 / 5;
  margin: 0;
  position: relative;
  overflow: hidden;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.54)),
    radial-gradient(circle at 70% 24%, var(--accent-3), transparent 26%),
    radial-gradient(circle at 28% 72%, var(--accent-2), transparent 28%);
  scroll-snap-align: center;
}

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

.photo-card img[src=""],
.photo-card img:not([src]) {
  display: none;
}

.photo-card figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  text-align: center;
}

.rsvp {
  min-height: 78vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
}

.editor-toggle {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 18px;
  min-width: 78px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #413837;
  color: white;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.editor-panel {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(360px, 100vw);
  height: 100vh;
  padding: 18px;
  background: #fff;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.16);
  transform: translateX(105%);
  transition: transform 0.28s ease;
  overflow-y: auto;
}

.editor-panel.is-open {
  transform: translateX(0);
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.editor-head button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
}

.editor-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #615654;
  font-size: 0.88rem;
}

.editor-panel input,
.editor-panel select {
  width: 100%;
  height: 42px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 12px;
  color: #453b3a;
  background: white;
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.editor-actions button {
  background: #f6f1ee;
}

@media (min-width: 860px) {
  body {
    padding: 28px 0;
  }

  .phone-shell {
    min-height: calc(100vh - 56px);
    border-radius: 22px;
  }
}

@media print {
  body {
    background: white;
    padding: 0;
  }

  .editor-toggle,
  .editor-panel,
  .cover {
    display: none !important;
  }

  .phone-shell {
    box-shadow: none;
    width: 100%;
  }

  .content {
    display: block;
  }
}
