:root {
  --bg: #0f221e;
  --bg-deep: #091311;
  --text: #f9f0df;
  --muted: rgba(249, 240, 223, 0.72);
  --accent: #d8b97d;
  --accent-soft: #f3dfb4;
  --line: rgba(236, 209, 157, 0.18);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #17332d 0%, var(--bg) 52%, var(--bg-deep) 100%);
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
}

.invite-shell {
  width: min(100%, 380px);
}

.mute-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(236, 209, 157, 0.2);
  border-radius: 999px;
  background: rgba(15, 34, 30, 0.72);
  color: var(--accent-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

@media (min-width: 620px) {
  .mute-toggle {
    top: 20px;
    right: 20px;
  }
}

.mute-toggle:focus-visible {
  outline: 2px solid rgba(243, 223, 180, 0.75);
  outline-offset: 2px;
}

.mute-icon {
  width: 18px;
  height: 18px;
}

.icon-volume-off {
  display: none;
}

.mute-toggle.is-muted .icon-volume-on {
  display: none;
}

.mute-toggle.is-muted .icon-volume-off {
  display: block;
}

.eyebrow,
.back-eyebrow,
.detail-label,
.front-note,
.flip-hint {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.invite-card {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 100 / 148;
  cursor: pointer;
  outline: none;
  perspective: 2400px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.invite-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(243, 223, 180, 0.7);
  border-radius: 30px;
}

.card-rotator {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.22, 0.78, 0.2, 1);
}

.invite-card.is-intro .card-rotator {
  animation: settleCard 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.invite-card.is-open .card-rotator {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.card-front {
  z-index: 2;
  padding: 24px 22px;
  transform: rotateY(0deg) translateZ(1px);
  background:
    radial-gradient(circle at top, rgba(255, 253, 248, 0.98), rgba(248, 234, 202, 0.96) 60%, rgba(232, 209, 162, 0.98) 100%);
  border: 1px solid rgba(204, 169, 104, 0.28);
}

.front-stack {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  text-align: center;
}

.eyebrow {
  font-size: 0.6rem;
  color: rgba(116, 76, 29, 0.82);
}

.card-front img {
  width: min(64%, 210px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(83, 56, 18, 0.12));
}

h1,
h2 {
  margin: 0;
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  color: #7f511b;
}

h2 {
  font-size: clamp(2rem, 8vw, 3rem);
}

.name-inline,
.name-stack {
  display: grid;
  justify-items: center;
}

.name-inline {
  grid-auto-flow: column;
  align-items: baseline;
  gap: 0.18em;
  white-space: nowrap;
}

.name-stack {
  gap: 0.08em;
}

.name-line {
  display: block;
}

.name-join {
  display: block;
  font-size: 0.44em;
  line-height: 1;
  letter-spacing: 0.08em;
}

.name-inline .name-join {
  font-size: 0.62em;
}

.name-stack .name-line .name-join {
  display: inline;
  margin-left: 0.12em;
}

h1 .name-join,
h2 .name-join {
  color: var(--accent);
}

.front-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(116, 76, 29, 0.74);
}

.front-note {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(116, 76, 29, 0.68);
}

.card-back {
  z-index: 1;
  padding: 18px;
  transform: rotateY(180deg) translateZ(1px);
  background:
    radial-gradient(circle at top center, rgba(216, 185, 125, 0.1), transparent 12%),
    radial-gradient(circle at bottom right, rgba(243, 223, 180, 0.05), transparent 36%),
    linear-gradient(rgba(255, 248, 235, 0.025), rgba(255, 248, 235, 0.025)),
    radial-gradient(circle, rgba(243, 223, 180, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 41, 35, 0.99), rgba(9, 19, 17, 1));
  background-size: auto, auto, auto, 18px 18px, auto;
  border: 1px solid var(--line);
}

.invite-card.is-open .card-front {
  z-index: 1;
}

.invite-card.is-open .card-back {
  z-index: 2;
}

.back-stack {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  padding: 4px;
  text-align: center;
}

.back-eyebrow,
.detail-label {
  font-size: 0.6rem;
  color: var(--accent-soft);
}

.back-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.72rem;
}

.details-list {
  display: grid;
  gap: 10px;
  width: 100%;
  justify-items: center;
}

.detail-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 0;
  border-top: 1px solid rgba(236, 209, 157, 0.12);
  justify-items: center;
  text-align: center;
}

.detail-row:first-child {
  border-top: 0;
}

.detail-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.detail-copy strong {
  font-size: 1rem;
  line-height: 1.35;
}

.detail-copy span {
  font-size: 0.88rem;
  color: var(--muted);
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 209, 157, 0.14);
  border-radius: 999px;
  background: rgba(255, 248, 235, 0.04);
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-action:focus-visible {
  outline: 2px solid rgba(243, 223, 180, 0.7);
  outline-offset: 2px;
}

.card-action-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.flip-hint {
  margin-top: auto;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: rgba(249, 240, 223, 0.48);
  text-align: center;
}

@keyframes settleCard {
  0% {
    opacity: 0;
    transform: rotateX(8deg) rotateY(-10deg) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
}

@media (min-width: 620px) {
  .invite-shell {
    width: min(100%, 430px);
  }

  .mute-toggle {
    top: 20px;
    right: 20px;
  }

  .invite-card {
    width: min(100%, 430px);
    aspect-ratio: 10 / 13.8;
  }

  .card-front,
  .card-back {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-rotator {
    transition-duration: 0.01ms;
  }

  .invite-card.is-intro .card-rotator {
    animation: none;
  }
}
