/* THEME TOKENS START */
:root {
  --bg: #0d0a0a;
  --bg-2: #171111;
  --panel: #171212;
  --panel-2: #100c0c;
  --surface: #1b1414;
  --surface-2: #241a19;
  --text: #f4e8e0;
  --muted: #bca89d;
  --line: rgba(137, 107, 97, 0.34);
  --line-strong: rgba(176, 135, 121, 0.44);
  --accent: #8d5a5b;
  --accent-2: #b07a72;
  --success: #7ea287;
  --warning: #c0955a;
  --danger: #c97777;
  --hero-overlay: linear-gradient(180deg, rgba(18, 13, 13, 0.16) 0%, rgba(18, 13, 13, 0.62) 100%);
  --hero-image: linear-gradient(135deg, #2b201f 0%, #553836 52%, #8d5a5b 100%);
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --max-width: 760px;
  --header-height: 50px;
}
/* THEME TOKENS END */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(96, 63, 57, 0.12) 0%, rgba(13, 10, 10, 0) 30%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  padding: 0;
}

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.32s ease; }

/* PROTECTED: PAGE FRAMEWORK STYLES START */
.page-shell {
  min-height: 100vh;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 20px;
  display: grid;
  gap: 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

#gc-universal-menu-root {
  width: 100%;
}

.invitation-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0b0909;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.invitation-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.invitation-stage {
  width: min(100%, 720px);
  display: grid;
  gap: 18px;
  justify-items: center;
}

.envelope {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1.45 / 1;
  perspective: 1400px;
}

.envelope__shadow {
  position: absolute;
  inset: auto 8% -18px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  filter: blur(18px);
  transform: scaleX(0.92);
}

.envelope__back {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, #171212 0%, #0d0a0a 100%);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.envelope__lining {
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(120, 29, 45, 0.18) 0%, rgba(41, 16, 18, 0.16) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.envelope__card {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 78%;
  height: 76%;
  transform: translateX(-50%) translateY(74%) scale(0.985);
  transform-origin: bottom center;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffaf6 0%, #f3e7de 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(180, 152, 140, 0.22);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  transition: transform 1.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease;
}

.envelope__card-title {
  color: #2f2320;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  text-align: center;
}

.envelope__card-text {
  color: #746661;
  text-align: center;
  line-height: 1.65;
  max-width: 26ch;
}

.envelope__flap {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  transition: transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease;
  z-index: 6;
}

.envelope__flap::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 66%);
  background: linear-gradient(180deg, #1d1616 0%, #100c0c 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.envelope__front {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, #3a2823 0%, #1b120f 100%);
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 4;
}

.envelope__seal {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 7;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  width: clamp(118px, 17vw, 154px);
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, opacity 0.35s ease;
}

.envelope__seal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
  transition: opacity 0.35s ease, filter 0.28s ease;
}

.envelope__seal:hover {
  transform: translate(-50%, -50%) scale(0.95);
}

.envelope__seal:active {
  transform: translate(-50%, -50%) scale(0.9);
}

.envelope.is-open .envelope__flap {
  transform: rotateX(178deg);
  opacity: 0.08;
}

.envelope.is-open .envelope__card {
  transform: translateX(-50%) translateY(-4%) scale(1);
}

.envelope.is-open .envelope__seal {
  pointer-events: none;
  opacity: 0;
}

.envelope.is-open .envelope__seal img {
  opacity: 0;
}

.envelope.is-opening .envelope__seal {
  animation: sealPressButton 0.42s ease forwards;
}

.hero-shell,
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-shell {
  overflow: visible;
  padding: 0;
  position: relative;
  min-height: 91svh;
  margin-top: 0;
  margin-bottom: 312px;
  background: #2f2320;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: #2f2320;
  overflow: hidden;
}

.hero-media__slide {
  position: absolute;
  inset: 0;
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity 2.2s ease-in-out, transform 7s ease-out;
  will-change: opacity, transform;
}

.hero-media__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay {
  position: relative;
  z-index: 2;
  min-height: 91svh;
  padding: 0;
  display: block;
  background: linear-gradient(180deg, rgba(10, 8, 8, 0.04) 0%, rgba(10, 8, 8, 0.18) 56%, rgba(10, 8, 8, 0.42) 100%);
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -272px;
  max-width: none;
  display: grid;
  gap: 16px;
  color: #fff;
  padding: 22px 24px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgb(0 0 0 / 15%) 0%, rgb(14 11 11 / 34%) 100%);
  border: 1px solid rgba(176, 135, 121, 0.18);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  display: none;
}

h1, h2, h3, p {
  margin: 0;
}

.hero-couple {
  display: block;
  width: min(100%, 420px);
  color: rgba(255, 245, 241, 0.98);
  text-shadow: 0 8px 24px rgba(47, 35, 32, 0.22);
  overflow: hidden;
}

.hero-couple__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  clip-path: inset(0 100% 0 0);
  animation: signatureReveal 3.2s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.hero-couple__svg path {
  fill: rgba(255, 245, 241, 0);
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: handwritingDraw 2.6s cubic-bezier(0.65, 0, 0.2, 1) 0.18s forwards,
             handwritingFill 0.9s ease 2.35s forwards;
}

.hero-couple__svg::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  background: linear-gradient(90deg, rgba(255, 245, 241, 0) 0%, rgba(255, 245, 241, 0.18) 40%, rgba(255, 245, 241, 0.58) 52%, rgba(255, 245, 241, 0.18) 64%, rgba(255, 245, 241, 0) 100%);
  filter: blur(4px);
  opacity: 0;
  transform: translateX(-120%);
  animation: penGlow 2.55s ease 0.22s forwards;
  pointer-events: none;
}

.hero-couple:not(:has(svg)) {
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  filter: blur(8px);
  animation: coupleReveal 1.9s cubic-bezier(0.22, 1, 0.36, 1) 0.18s forwards;
}

.hero-title {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
  font-size: 1rem;
}

.panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.stack { display: grid; gap: 14px; }

.section-heading {
  display: grid;
  gap: 8px;
}

.section-heading__title {
  font-size: 1.4rem;
  line-height: 1.15;
}

.section-heading__text {
  color: var(--muted);
  line-height: 1.6;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 248, 244, 0.06);
  color: var(--text);
  font-size: 0.84rem;
}

.chip--stacked {
  display: grid;
  gap: 4px;
  align-items: start;
  border-radius: 18px;
  padding: 10px 14px;
  min-height: auto;
}

.chip__label {
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chip__list {
  display: grid;
  gap: 2px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.chip.success {
  color: var(--success);
  background: rgba(79, 122, 85, 0.08);
  border-color: rgba(79, 122, 85, 0.28);
}

.chip.warning {
  color: var(--warning);
  background: rgba(155, 107, 47, 0.08);
  border-color: rgba(155, 107, 47, 0.28);
}

.chip.danger {
  color: var(--danger);
  background: rgba(169, 77, 77, 0.08);
  border-color: rgba(169, 77, 77, 0.28);
}

.hero-content .status-row {
  gap: 12px;
}

.hero-content .chip,
.hero-content .chip.success,
.hero-content .chip.warning,
.hero-content .chip.danger {
  color: #ffffff;
  background: rgba(8, 7, 7, 0.44);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.hero-content .chip__label,
.hero-content .chip__list,
.hero-content .chip__list span {
  color: #ffffff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { display: grid; gap: 7px; }

label {
  font-size: 0.92rem;
  color: var(--muted);
}

input {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(176, 135, 121, 0.28);
  background: rgba(255, 248, 244, 0.04);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(176, 135, 121, 0.62);
  box-shadow: 0 0 0 3px rgba(141, 90, 91, 0.14);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.primary-btn {
  color: #fff8f4;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  box-shadow: 0 12px 24px rgba(95, 54, 53, 0.22);
}

.secondary-btn {
  color: var(--text);
  background: rgba(255, 248, 244, 0.06);
  border: 1px solid rgba(176, 135, 121, 0.28);
}

.ghost-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(4px);
}

.message-box {
  border: 1px solid rgba(176, 135, 121, 0.24);
  border-radius: var(--radius-lg);
  background: rgba(255, 248, 244, 0.045);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.message-box strong { font-size: 1rem; }

.summary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.summary-item {
  color: var(--muted);
  line-height: 1.55;
}

.rsvp-list {
  display: grid;
  gap: 12px;
}

.guest-rsvp-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(176, 135, 121, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 248, 244, 0.045);
}

.guest-rsvp-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.guest-rsvp-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.guest-rsvp-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(176, 135, 121, 0.28);
  border-radius: 999px;
  background: rgba(255, 248, 244, 0.05);
  color: var(--text);
  cursor: pointer;
}

.choice-pill input {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

#rsvpPanel {
  scroll-margin-top: calc(var(--header-height) + 20px);
}
/* PROTECTED: PAGE FRAMEWORK STYLES END */

@keyframes sealPressButton {
  0% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -50%) scale(0.9); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes signatureReveal {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes handwritingDraw {
  0% {
    opacity: 1;
    stroke-dashoffset: 1200;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes handwritingFill {
  0% {
    fill: rgba(255, 245, 241, 0);
    filter: drop-shadow(0 0 0 rgba(47, 35, 32, 0));
  }
  100% {
    fill: rgba(255, 245, 241, 0.98);
    filter: drop-shadow(0 8px 24px rgba(47, 35, 32, 0.2));
  }
}

@keyframes penGlow {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  12% {
    opacity: 0.9;
  }
  88% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translateX(560%);
  }
}

@keyframes coupleReveal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: blur(8px);
    letter-spacing: 0.08em;
  }
  55% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    letter-spacing: 0.03em;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    letter-spacing: 0.02em;
  }
}

@media (max-width: 700px) {
  .header-shell {
    padding: 0 14px;
  }

  .invitation-gate {
    padding: 16px;
  }

  .invitation-stage {
    width: 100%;
  }

  .envelope {
    width: 100%;
    aspect-ratio: 1.2 / 1;
  }

  .envelope__card {
    width: 84%;
    height: 74%;
    padding: 22px;
    transform: translateX(-50%) translateY(76%) scale(0.985);
  }

  .envelope__front {
    height: 60%;
  }

  .envelope__seal {
    top: 58%;
    width: 112px;
  }

  .page-content { padding: 0 14px 14px; }
  .field-grid { grid-template-columns: 1fr; }
  .hero-shell,
  .hero-overlay {
    min-height: 75svh;
  }
  .hero-shell {
    margin-bottom: 336px;
  }
  .hero-content {
    left: 0;
    right: 0;
    bottom: -276px;
    max-width: none;
  }
}
