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

:root {
  --cream: #faf7f2;
  --warm-white: #fffef9;
  --gold: #b8975a;
  --gold-light: #d4b07a;
  --ink: #1c1a17;
  --ink-soft: #4a4540;
  --rule: #d9cfc0;
  --error: #9b3a2e;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.6;
}

/* ── Header ── */

header {
  width: 100%;
  text-align: center;
  padding: 72px 24px 40px;
  animation: fadeUp 0.8s ease both;
}

.eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 10px;
}

h1 em {
  font-style: italic;
  color: var(--gold);
}

.rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 24px auto 0;
  opacity: 0.6;
}

/* ── Main / Cards ── */

main {
  width: 100%;
  max-width: 980px;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
  animation: fadeUp 0.8s 0.15s ease both;
}

.card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

.invite-card {
  width: 100%;
  max-width: 720px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.07),
    0 12px 40px rgba(0, 0, 0, 0.09),
    0 0 0 1px rgba(184, 151, 90, 0.18);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.invite-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 24px 56px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(184, 151, 90, 0.28);
}

.invite-card img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Divider ── */

.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.divider-icon {
  color: var(--gold);
  font-size: 18px;
  opacity: 0.7;
}

/* ── Footer / CTA ── */

footer {
  width: 100%;
  max-width: 980px;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeUp 0.8s 0.3s ease both;
  text-align: center;
}

.footer-note {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 300;
}

.cta-btn {
  display: inline-block;
  padding: 14px 44px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  border-radius: 2px;
}

.cta-btn:hover {
  background: var(--gold);
  color: var(--warm-white);
}

.cta-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Animations ── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */

@media (max-width: 600px) {
  header {
    padding: 48px 20px 32px;
  }

  main {
    gap: 40px;
    padding-bottom: 56px;
  }
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 23, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--warm-white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 52px 48px 48px;
  width: 100%;
  max-width: 460px;
  position: relative;
  text-align: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.modal h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.2;
  color: var(--ink);
}

.modal h2 em {
  font-style: italic;
  color: var(--gold);
}

.modal .rule {
  margin-bottom: 32px;
}

/* ── Form fields ── */

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

.field-group input {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 14px;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

.field-group input::placeholder {
  color: var(--rule);
}

.field-group input:focus {
  border-color: var(--gold);
}

.form-error {
  font-size: 0.82rem;
  color: var(--error);
  text-align: center;
  letter-spacing: 0.02em;
}

.submit-btn {
  margin-top: 8px;
  width: 100%;
  text-align: center;
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--warm-white);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 14px 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  color: var(--gold-light);
  font-size: 13px;
}

@media (max-width: 600px) {
  .modal {
    padding: 44px 28px 36px;
  }

  .toast {
    bottom: 24px;
    font-size: 0.8rem;
    padding: 12px 20px;
  }
}