:root {
  --ink: #2f2114;
  --deep-ink: #1b1209;
  --gold: #c7a05a;
  --wine: #6b1f2f;
  --parchment: #f3e5c8;
  --parchment-dark: #d9c19a;
  --velvet: #241218;
  --glow: rgba(255, 210, 128, 0.45);
  --shadow: rgba(28, 17, 10, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "IM Fell English", "Times New Roman", serif;
  color: var(--deep-ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 210, 140, 0.35), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 160, 120, 0.3), transparent 35%),
    radial-gradient(circle at 70% 90%, rgba(130, 60, 70, 0.25), transparent 45%),
    linear-gradient(120deg, #2b151a 0%, #0f0d11 45%, #1b1214 100%);
  display: flex;
  justify-content: center;
  padding: 2.5rem clamp(1rem, 3vw, 3rem) 3rem;
}

.page {
  position: relative;
  width: min(1200px, 100%);
  isolation: isolate;
}

.page::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.back-link {
  position: relative;
  z-index: 5;
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 180, 0.6);
  background: rgba(20, 12, 10, 0.55);
  color: #f7e4c3;
  text-decoration: none;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.atmosphere {
  position: absolute;
  inset: -30px;
  z-index: 1;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.8;
  mix-blend-mode: screen;
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  top: -40px;
  left: -20px;
  background: radial-gradient(circle at 30% 30%, #ffe6b3, transparent 70%);
}

.orb-2 {
  top: 20%;
  right: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 40% 40%, #ffb7c2, transparent 65%);
  animation-delay: -4s;
}

.orb-3 {
  bottom: -60px;
  left: 40%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 50% 50%, #f7d47a, transparent 70%);
  animation-delay: -8s;
}

.sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 245, 210, 0.9) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 215, 160, 0.8) 1px, transparent 1px);
  background-size: 120px 120px, 200px 200px;
  background-position: 0 0, 40px 80px;
  opacity: 0.35;
  animation: shimmer 16s linear infinite;
}

.layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.2rem, 2vw, 2.4rem);
  margin-top: 2rem;
}

.invitation {
  background:
    linear-gradient(180deg, rgba(255, 245, 220, 0.92), rgba(240, 217, 176, 0.88)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><rect width='160' height='160' fill='%23f1e0bf'/><path d='M0 30h160' stroke='%23e1c59b' stroke-width='2' opacity='0.4'/><path d='M0 90h160' stroke='%23d6b585' stroke-width='1.5' opacity='0.35'/><circle cx='40' cy='50' r='18' fill='none' stroke='%23c7a05a' stroke-width='1' opacity='0.3'/></svg>");
  border-radius: 18px;
  padding: clamp(1.8rem, 3vw, 2.8rem);
  box-shadow: 0 30px 60px var(--shadow);
  position: relative;
  overflow: hidden;
}

.invitation::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(107, 31, 47, 0.4);
  border-radius: 14px;
  pointer-events: none;
}

.invitation::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(55, 30, 20, 0.25);
  border-radius: 16px;
  pointer-events: none;
}

.crest {
  text-align: center;
}

.overline {
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: rgba(90, 55, 35, 0.75);
  margin-bottom: 0.5rem;
}

h1 {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--wine);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}

.subtitle {
  margin: 1rem auto 1.4rem;
  max-width: 480px;
  font-style: italic;
  color: rgba(62, 36, 26, 0.8);
  line-height: 1.6;
}

.name-line {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  color: var(--deep-ink);
}

#guest-name {
  font-weight: 700;
  color: var(--wine);
}

.divider {
  height: 34px;
  margin: 1.4rem 0 1.8rem;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='34' viewBox='0 0 260 34'><path d='M5 17h90' stroke='%239c6f3a' stroke-width='1.5'/><path d='M165 17h90' stroke='%239c6f3a' stroke-width='1.5'/><circle cx='130' cy='17' r='6' fill='none' stroke='%239c6f3a' stroke-width='1.5'/><path d='M110 17c7-7 13-7 20 0' fill='none' stroke='%239c6f3a' stroke-width='1.5'/><path d='M150 17c-7 7-13 7-20 0' fill='none' stroke='%239c6f3a' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.detail-card {
  background: rgba(255, 248, 236, 0.85);
  border: 1px solid rgba(155, 110, 70, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1rem 1.1rem;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.5);
}

.detail-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(90, 55, 35, 0.7);
}

.detail-card .value {
  display: block;
  margin-top: 0.5rem;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
}

.detail-card .sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: rgba(55, 30, 20, 0.7);
}

.program {
  margin-top: 1.8rem;
}

.program h2 {
  font-family: "Cinzel Decorative", serif;
  font-size: 1.3rem;
  color: var(--wine);
  margin-bottom: 0.8rem;
}

.program ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.program li {
  background: rgba(255, 255, 255, 0.5);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
  box-shadow: 0 6px 14px rgba(90, 55, 35, 0.15);
}

.tribute {
  position: relative;
  margin-top: 2rem;
  padding: 1.4rem;
  border: 1px dashed rgba(120, 70, 40, 0.5);
  border-radius: 14px;
  background: rgba(248, 236, 210, 0.75);
}

.banner {
  font-family: "Cinzel Decorative", serif;
  text-align: center;
  color: var(--wine);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.seal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background:
    radial-gradient(circle at 30% 30%, #ffb1b1, #8f2234 70%),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.4), transparent 60%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 12px 20px rgba(90, 0, 20, 0.35);
  display: grid;
  place-items: center;
  font-family: "Cinzel Decorative", serif;
  color: #f9e2d1;
  letter-spacing: 0.2em;
}

.note {
  text-align: center;
  font-size: 0.95rem;
  color: rgba(60, 30, 18, 0.8);
}

.rsvp {
  background: rgba(20, 12, 10, 0.82);
  border-radius: 18px;
  padding: 1.8rem 1.6rem;
  color: #f8e6c5;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 212, 160, 0.3);
}

.panel-header {
  text-align: center;
  margin-bottom: 1.4rem;
}

.panel-title {
  font-family: "Cinzel Decorative", serif;
  font-size: 1.4rem;
  color: #f7d99a;
}

.panel-sub {
  font-style: italic;
  color: rgba(255, 225, 190, 0.8);
}

form {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
}

input,
select,
textarea {
  background: rgba(255, 248, 236, 0.96);
  border: 1px solid rgba(170, 120, 70, 0.5);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  color: var(--deep-ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(255, 214, 151, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 214, 151, 0.2);
}

button {
  margin-top: 0.3rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #f2c879, #c48b3f 60%, #a66c2b);
  color: #2a1407;
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
}

button:hover {
  transform: translateY(-1px);
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: #f5d7b1;
}

.status-banner {
  margin-top: 1.3rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 238, 205, 0.15);
  border: 1px solid rgba(255, 220, 170, 0.3);
  font-size: 0.95rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 0.15s;
}

.reveal:nth-of-type(3) {
  animation-delay: 0.3s;
}

.reveal:nth-of-type(4) {
  animation-delay: 0.45s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(20px);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(120px);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .rsvp {
    order: -1;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem 2.5rem;
  }

  .back-link {
    margin-bottom: 0.8rem;
  }

  .invitation {
    padding: 1.6rem;
  }
}
