/* Invitation — elegant & classic theme */
:root {
  --paper: #f8f3e8;
  --paper-2: #efe7d4;
  --ink: #2a2118;
  --ink-soft: #5b5040;
  --gold: #a9884b;
  --gold-deep: #8c6d36;
  --gold-soft: #c9ab76;
  --rule: rgba(169, 136, 75, 0.45);
  --serif: "Cormorant Garamond", "Didot", "Hoefler Text", "Times New Roman", serif;
  --serif-sc: "Cormorant SC", "Cormorant Garamond", serif;
  --display: "Italiana", "Cormorant Garamond", serif;
  --rim: 732px;

  --bg-grad:
    radial-gradient(ellipse 80% 60% at 70% 10%, rgba(201,171,118,0.18), transparent 60%),
    radial-gradient(ellipse 70% 50% at 18% 90%, rgba(169,136,75,0.20), transparent 60%),
    linear-gradient(180deg, #f8f3e8 0%, #f1e9d8 70%, #e9dec9 100%);
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Prevent the bottom ornament's flipped peak from clipping its parent frame. */
.ornament { overflow: visible; }

/* Subtle paper-grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(60,48,28,0.12) 1px, transparent 0);
  background-size: 3px 3px, 5px 5px;
  mix-blend-mode: multiply;
}

.page {
  position: relative;
  z-index: 2;
  width: min(100%, var(--rim));
  isolation: isolate;
}

/* Soft drop-shadow + ink frame sits behind the card */
.page::before,
.page::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 2px;
  pointer-events: none;
  z-index: -1;
}
.page::before {
  /* shadow */
  filter: blur(18px);
  background: rgba(40, 28, 10, 0.18);
  transform: translateY(12px);
}
.page::after {
  /* ornamental double border */
  border: 1px solid var(--rule);
  margin: 8px;
  border-radius: 2px;
}

.frame {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,250,240,0.6), transparent 60%),
    linear-gradient(180deg, #fbf6ea, #f3ecda 60%, #ece1cc);
  padding: clamp(32px, 6vw, 64px) clamp(24px, 5vw, 56px) clamp(40px, 6vw, 72px);
  text-align: center;
  border-radius: 2px;
  border: 1px solid var(--rule);
  position: relative;
}

/* double inner rule line */
.frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(169,136,75,0.35);
  border-radius: 1px;
  pointer-events: none;
}

/* ============================================ Note (formerly host row) */
.note {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ============================================ Eyebrow / eyebrow ribbon */
.eyebrow {
  font-family: var(--serif-sc);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-deep);
  margin: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.eyebrow .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  transform: translateY(-1px);
}

/* ============================================ Title */
.title {
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  line-height: 0.92;
  margin: 0 0 24px;
  display: grid;
  gap: 14px;
}
.title-line {
  display: block;
  font-style: normal;
}
.title-1 {font-size: clamp(44px, 8.5vw, 80px); letter-spacing: 0.02em;}
.title-2 {font-size: clamp(44px, 8.5vw, 80px); letter-spacing: 0.08em; font-style: italic;}
.title-accent {
  display: block;
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--gold);
  letter-spacing: 0;
  margin: -4px 0;
}

/* ============================================ Divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 28px 0 26px;
}
.divider-line {
  height: 1px;
  width: clamp(60px, 18vw, 140px);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}
.divider-glyph {
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
  transform: translateY(1px);
}

/* ============================================ Host */
.host {
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--ink-soft);
  margin: 0 0 32px;
  letter-spacing: 0.02em;
}
.host-name {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ============================================ Details (date/time/place) */
.details {
  list-style: none;
  padding: 0;
  margin: 0 auto 36px;
  display: grid;
  gap: 16px;
  max-width: 420px;
}
.detail {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  text-align: left;
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px dashed rgba(169,136,75,0.30);
}
.detail:last-child { border-bottom: 1px dashed rgba(169,136,75,0.30); }
.detail-icon {
  width: 28px; height: 28px;
  color: var(--gold-deep);
  opacity: 0.85;
}
.detail-icon svg { width: 100%; height: 100%; }
.detail-meta { display: grid; gap: 2px; }
.detail-label {
  font-family: var(--serif-sc);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  font-weight: 600;
}
.detail-value {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink);
  line-height: 1.3;
  font-weight: 500;
}

/* ============================================ Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0 0 32px;
}

.btn {
  --pad-x: 30px;
  --pad-y: 16px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  font-family: var(--serif-sc);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.btn-glyph {
  font-size: 11px;
  color: currentColor;
  opacity: 0.8;
}
.btn-glyph.rtl { transform: scaleX(-1); display: inline-block; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #fcf6e9;
  border: 1px solid var(--gold-deep);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 -2px 0 rgba(0,0,0,0.12) inset,
    0 8px 18px -8px rgba(90, 64, 12, 0.55),
    0 1px 0 rgba(90,64,12,0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.45) inset,
    0 -2px 0 rgba(0,0,0,0.15) inset,
    0 14px 24px -10px rgba(90,64,12,0.6),
    0 1px 0 rgba(90,64,12,0.45);
}
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--gold-deep);
  border: 1px solid var(--rule);
}
.btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(169,136,75,0.08);
  border-color: var(--gold);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--gold);
}

/* ============================================ Bottom ornament */
.ornament {
  color: var(--gold);
  opacity: 0.6;
  font-size: 12px;
  margin-top: 4px;
}
.ornament svg { width: 120px; height: 18px; }
.ornament--top { padding-bottom: 14px; }

/* ============================================ Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 60ms);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .btn { transition: none; }
}

/* ============================================ Media */
@media (max-width: 480px) {
  body { padding: 18px; }
  .page::before, .page::after { inset: -8px; }
  .frame::before { inset: 6px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .eyebrow { letter-spacing: 0.32em; font-size: 10px; }
  .detail { grid-template-columns: 24px 1fr; padding: 8px 0; }
}

@media (min-width: 1280px) {
  .page { animation: floaty 9s ease-in-out infinite alternate; }
  @keyframes floaty {
    from { transform: translateY(-3px); }
    to   { transform: translateY(3px); }
  }
}

/* ============================================ Bot gate (Turnstile) */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 70% 10%, rgba(201,171,118,0.18), transparent 60%),
    radial-gradient(ellipse 70% 50% at 18% 90%, rgba(169,136,75,0.20), transparent 60%),
    linear-gradient(180deg, #f8f3e8 0%, #f1e9d8 70%, #e9dec9 100%);
  background-attachment: fixed;
  transition: opacity 0.4s ease;
}
.gate.is-hidden { opacity: 0; pointer-events: none; }
.gate .eyebrow { margin-bottom: 22px; }
.gate-card {
  width: min(100%, 420px);
  text-align: center;
  padding: clamp(34px, 6vw, 52px) clamp(26px, 5vw, 44px);
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, #fbf6ea, #f3ecda 60%, #ece1cc);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 18px 40px -22px rgba(40,28,10,0.35);
  position: relative;
}
.gate-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(169,136,75,0.35);
  border-radius: 1px;
  pointer-events: none;
}
.gate-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 7vw, 60px);
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  margin: 0 0 14px;
}
.gate-sub { font-size: 15px; color: var(--ink-soft); margin: 0 0 26px; font-style: italic; }
.gate-widget { display: flex; justify-content: center; min-height: 65px; }
.gate-err {
  display: none;
  margin: 16px 0 0;
  color: #b23b2e;
  font-size: 13px;
  font-style: italic;
}

/* Loading spinner shown while the Turnstile API script loads. */
.gate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 65px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
}
.gate-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--rule);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: gate-spin 0.8s linear infinite;
}
@keyframes gate-spin { to { transform: rotate(360deg); } }

.gate--ready .gate-card { animation: gate-rise 0.5s ease both; }
@keyframes gate-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .gate-spinner, .gate--ready .gate-card { animation: none; }
}

/* ============================================ Print — clean card for ink */
@media print {
  body { background: #fff; padding: 24px; }
  .grain, .ornament, .btn-ghost, .title-accent { display: none; }
  .page::before { box-shadow: none; filter: none; }
  .page::after, .frame, .frame::before { border-color: #9a8a5c; }
  .btn-primary {
    background: #fff !important;
    color: #5a491f !important;
    border: 1px solid #5a491f !important;
    box-shadow: none;
  }
  .btn-primary::before {
    content: "✦  RSVP at the link in the message  ✦";
  }
  .btn-primary .btn-glyph { display: none; }
}
