:root {
  --fig: #4b1f2f;
  --fig-deep: #27111a;
  --olive: #223322;
  --olive-soft: #60704a;
  --sage: #d4dec1;
  --copper: #b86f4b;
  --antique: #d4a94f;
  --ivory: #fff8e8;
  --linen: #f0e2c8;
  --shell: #fbefe1;
  --ink: #241716;
  --muted: #75675d;
  --glass: rgba(255, 248, 232, 0.78);
  --border: rgba(212, 169, 79, 0.34);
  --shadow: 0 28px 80px rgba(36, 23, 22, 0.18);
}

body.dark {
  --ivory: #120e0d;
  --linen: #1d1714;
  --ink: #fff4dc;
  --muted: #d9cab1;
  --glass: rgba(36, 28, 24, 0.78);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(34, 51, 34, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(34, 51, 34, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 10%, rgba(212, 222, 193, 0.36), transparent 28%),
    radial-gradient(circle at 88% 22%, rgba(75, 31, 47, 0.18), transparent 30%),
    var(--ivory);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  overflow-x: hidden;
}

a { text-decoration: none; }
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--olive);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  color: var(--ivory);
  font-family: Cinzel, serif;
  border: 1px solid var(--antique);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(212, 169, 79, 0.12);
  animation: pulse 1.35s infinite;
}

.navbar {
  background: rgba(18, 14, 13, 0.7);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(212, 169, 79, 0.25);
}
.navbar-brand, .nav-link { color: var(--ivory) !important; }
.navbar-brand {
  font-family: Cinzel, serif;
  font-weight: 700;
}
.nav-link { font-weight: 700; }
.nav-link:hover { color: var(--sage) !important; }
.icon-btn, .back-top, .quick-rail a {
  border: 1px solid rgba(212, 169, 79, 0.48);
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}

.quick-rail {
  position: fixed;
  right: 18px;
  top: 50%;
  translate: 0 -50%;
  z-index: 90;
  display: grid;
  gap: 10px;
}
.quick-rail a {
  background: rgba(34, 51, 34, 0.92);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}
.quick-rail a:hover { background: var(--fig); color: var(--sage); }

.hero {
  min-height: 96vh;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 112px 0 64px;
  background:
    linear-gradient(90deg, rgba(18,14,13,.72), rgba(18,14,13,.18)),
    url("https://images.unsplash.com/photo-1606800052052-a08af7148866?auto=format&fit=crop&w=1800&q=82") center/cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(transparent, var(--ivory));
}
.hero-pattern {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(212,169,79,.18) 0 1px, transparent 1px 24px),
    radial-gradient(circle at 78% 50%, rgba(212,222,193,.28), transparent 28%);
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.66fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
}
.hero-copy-block { color: var(--ivory); max-width: 820px; }
.eyebrow, .section-kicker {
  color: var(--copper);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0;
}
.hero .eyebrow {
  color: var(--sage);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(212, 169, 79, 0.34);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.1);
}
.hero .eyebrow::before,
.section-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}
h2 { color: var(--fig); }
.countdown-band h2, .venue-band h2, .contact-band h2 { color: var(--ivory); }
h1 {
  font-size: clamp(3.4rem, 8vw, 7.8rem);
  line-height: 0.9;
  margin: 12px 0 22px;
}
h1 span {
  display: block;
  color: var(--antique);
  font-family: Cinzel, serif;
  font-size: 0.36em;
  margin: 0.22em 0;
}
.hero-copy {
  max-width: 720px;
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  color: rgba(255, 248, 232, 0.88);
  line-height: 1.75;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
}
.hero-meta span {
  color: var(--ivory);
  background: rgba(255, 248, 232, 0.12);
  border: 1px solid rgba(212, 169, 79, 0.34);
  border-radius: 999px;
  padding: 0.74rem 1rem;
  font-weight: 800;
  backdrop-filter: blur(16px);
}
.hero-card {
  background: rgba(255, 248, 232, 0.86);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}
.hero-card img {
  width: 100%;
  aspect-ratio: 4 / 4.8;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  display: block;
}
.hero-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px 4px;
  color: var(--fig);
}
.hero-card span { color: var(--muted); font-weight: 800; }
.hero-card strong { font-family: Cinzel, serif; }

.section { padding: 94px 0; position: relative; }
.section-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 42px;
}
.section-heading h2 {
  margin-bottom: 10px;
}
.section-heading h2, .welcome h2, .venue-band h2, .contact-band h2 {
  font-size: clamp(2.25rem, 5vw, 4.2rem);
}
.section-subtitle {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.countdown-band .section-subtitle,
.venue-band .section-subtitle,
.contact-band .section-subtitle {
  color: rgba(255, 248, 232, 0.76);
}
.story-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  padding: clamp(26px, 5vw, 56px);
  background: linear-gradient(135deg, rgba(251,239,225,.92), rgba(255,248,232,.74));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.story-panel p:last-child {
  color: var(--muted);
  font-size: 1.17rem;
  line-height: 1.8;
}

.btn {
  border-radius: 999px;
  padding: 0.9rem 1.24rem;
  font-weight: 900;
  border-width: 1px;
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-gold {
  background: linear-gradient(135deg, #f2d582, var(--antique));
  color: #26160d;
  box-shadow: 0 16px 36px rgba(212, 169, 79, 0.28);
}
.btn-cream {
  background: var(--ivory);
  color: var(--olive);
  border-color: var(--border);
}
.btn-olive {
  background: var(--olive);
  color: var(--ivory);
  border-color: rgba(212, 222, 193, 0.42);
}
.button-row, .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.countdown-band, .venue-band, .contact-band {
  color: var(--ivory);
  background:
    linear-gradient(135deg, rgba(34,51,34,.96), rgba(75,31,47,.94)),
    radial-gradient(circle at top right, rgba(212,222,193,.28), transparent 32%);
}
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.countdown-grid div, .glass-card, .calendar-card, .qr-box {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.countdown-grid div {
  min-height: 152px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--olive);
}
.countdown-grid strong {
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  font-family: Cinzel, serif;
  line-height: 1;
}
.countdown-grid span {
  color: var(--fig);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.event-card {
  height: 100%;
  padding: clamp(26px, 4vw, 42px);
  color: var(--ink);
}
.event-card > i {
  font-size: 2.45rem;
  color: var(--copper);
  margin-bottom: 18px;
}
.event-card h3 {
  color: var(--fig);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}
.event-card p {
  color: var(--muted);
  margin-bottom: 0.7rem;
  font-weight: 700;
}
.event-card p i { width: 26px; color: var(--antique); }
.event-divider {
  display: grid;
  place-items: center;
  gap: 18px;
  color: var(--ivory);
}
.event-divider span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fig);
  border: 1px solid var(--antique);
  font-family: Cinzel, serif;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.venue-address, .phone { font-size: 1.2rem; color: rgba(255, 248, 232, 0.9); }
.map-frame, .pdf-preview {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--linen);
}
.map-frame iframe { min-height: 430px; }
.qr-box {
  width: fit-content;
  margin-top: 24px;
  padding: 14px;
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--olive);
  font-weight: 900;
}
.qr-box img { width: 150px; height: 150px; }

.pdf-preview {
  max-width: 980px;
  height: min(78vh, 760px);
  margin: 0 auto;
  transition: transform 0.35s ease;
}
.pdf-preview:hover { transform: scale(1.012); }
.pdf-preview object { width: 100%; height: 100%; display: block; }
.pdf-fallback {
  min-height: 460px;
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--fig);
}

.gallery-band {
  background: linear-gradient(180deg, rgba(96, 112, 74, 0.14), transparent);
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  grid-auto-rows: 230px;
  gap: 18px;
}
.gallery-grid div {
  border-radius: 8px;
  display: flex;
  align-items: end;
  padding: 22px;
  color: white;
  font-weight: 900;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(34,51,34,.84)), url("https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=900&q=82") center/cover;
  box-shadow: var(--shadow);
}
.gallery-large { grid-row: span 2; }
.gallery-grid div:nth-child(2) {
  background-image: linear-gradient(180deg, transparent, rgba(75,31,47,.84)), url("https://images.unsplash.com/photo-1511285560929-80b456fea0bc?auto=format&fit=crop&w=900&q=82");
}
.gallery-grid div:nth-child(3) {
  background-image: linear-gradient(180deg, transparent, rgba(34,51,34,.84)), url("https://images.unsplash.com/photo-1532712938310-34cb3982ef74?auto=format&fit=crop&w=900&q=82");
}

.timeline {
  max-width: 760px;
  margin: auto;
  display: grid;
  gap: 20px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--fig), var(--olive-soft));
}
.timeline div {
  padding-left: 58px;
  position: relative;
}
.timeline div::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ivory);
  border: 6px solid var(--olive-soft);
}
.timeline strong {
  display: block;
  font-family: Cinzel, serif;
  color: var(--fig);
  font-size: 1.05rem;
}
.timeline span {
  color: var(--muted);
  font-weight: 700;
}

.calendar-card {
  padding: 30px;
  color: var(--ink);
}
.rsvp-band {
  background:
    linear-gradient(180deg, rgba(75, 31, 47, 0.08), rgba(34, 51, 34, 0.08)),
    var(--linen);
}
.rsvp-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: start;
}
.rsvp-copy {
  position: sticky;
  top: 110px;
}
.rsvp-copy h2 {
  font-size: clamp(2.25rem, 4.8vw, 4rem);
}
.rsvp-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}
.privacy-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.72);
  color: var(--olive);
  font-weight: 800;
}
.privacy-note i {
  color: var(--fig);
  margin-top: 4px;
}
.guest-form {
  background: rgba(255, 248, 232, 0.84);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hidden-field { display: none; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.guest-form label {
  display: grid;
  gap: 8px;
}
.guest-form span {
  color: var(--fig);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}
.guest-form input,
.guest-form select,
.guest-form textarea {
  width: 100%;
  border: 1px solid rgba(96, 112, 74, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0.92rem 1rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guest-form textarea {
  resize: vertical;
  min-height: 116px;
}
.guest-form input:focus,
.guest-form select:focus,
.guest-form textarea:focus {
  border-color: var(--olive-soft);
  box-shadow: 0 0 0 4px rgba(212, 222, 193, 0.5);
}
.full-span { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.form-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--olive);
  font-weight: 900;
}
footer {
  text-align: center;
  padding: 58px 0;
  color: var(--ivory);
  background: linear-gradient(135deg, var(--fig-deep), var(--olive));
}
footer h2 { color: var(--antique); }
.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background: var(--fig);
}
.back-top.show { opacity: 1; pointer-events: auto; }

.petal {
  position: fixed;
  top: -30px;
  width: 12px;
  height: 18px;
  border-radius: 70% 20% 70% 20%;
  background: rgba(212, 222, 193, 0.68);
  z-index: 1;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translate3d(var(--drift), 105vh, 0) rotate(360deg); }
}
@keyframes pulse {
  50% { transform: scale(1.08); box-shadow: inset 0 0 0 10px rgba(212,169,79,.12), 0 0 36px rgba(212,169,79,.32); }
}

@media (max-width: 991px) {
  .hero-inner, .story-panel, .event-layout, .rsvp-layout {
    grid-template-columns: 1fr;
  }
  .hero { background-position: center; }
  .hero-card { transform: none; max-width: 460px; }
  .event-divider { display: none; }
  .rsvp-copy { position: static; }
}

@media (max-width: 768px) {
  .section { padding: 70px 0; }
  .quick-rail {
    top: auto;
    right: 50%;
    bottom: 16px;
    translate: 50% 0;
    grid-template-columns: repeat(3, 44px);
    padding: 8px;
    border-radius: 999px;
    background: rgba(18, 14, 13, 0.56);
    backdrop-filter: blur(16px);
  }
  .countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .countdown-grid div { min-height: 120px; }
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .gallery-large { grid-row: span 1; }
  .pdf-preview { height: 66vh; }
  .button-row, .hero-actions { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .btn { width: 100%; }
}

@media (max-width: 460px) {
  h1 { font-size: clamp(3rem, 16vw, 4.4rem); }
  .countdown-grid { gap: 10px; }
  .countdown-grid strong { font-size: 2.15rem; }
  .hero-meta span { width: 100%; }
}
