/* ═══════════════════════════════════════════════════════════════════
   RSVP — Globalization & The Sri Lankan Opportunity
   Mobile-first · Premium · Universal device support
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 1. DESIGN TOKENS ──────────────────────────────────────────── */
:root {
  /* Backgrounds — layered depth */
  --navy:     #06090F;
  --navy2:    #0D1420;
  --navy3:    #111827;
  --navy4:    #1A2236;

  /* Gold — disciplined accent */
  --gold:     #C9A55A;
  --gold2:    #E8C87A;
  --gold-15:  rgba(201, 165, 90, 0.15);
  --gold-08:  rgba(201, 165, 90, 0.08);
  --gold-30:  rgba(201, 165, 90, 0.30);
  --gold-50:  rgba(201, 165, 90, 0.50);
  --gold-12:  rgba(201, 165, 90, 0.12);
  --gold-05:  rgba(201, 165, 90, 0.05);
  --gold-03:  rgba(201, 165, 90, 0.03);

  /* Sapphire — diplomatic depth */
  --sapphire:  #1E3A6E;
  --sapphire2: #2563EB;

  /* Text */
  --white:    #F7F3EC;
  --white-85: rgba(247, 243, 236, 0.85);
  --white-50: rgba(247, 243, 236, 0.50);
  --white-20: rgba(247, 243, 236, 0.20);
  --white-07: rgba(247, 243, 236, 0.07);

  /* Functional */
  --success:  #4CAF7D;
  --error:    #FF6B6B;

  /* Motion */
  --ease:           cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo:  cubic-bezier(0.19, 1, 0.22, 1);
  --dur-micro:      150ms;
  --dur-std:        350ms;
  --dur-lg:         600ms;
  --dur-xl:         900ms;

  /* Layout */
  --container:      1200px;
  --gutter:         clamp(20px, 5vw, 48px);
  --section-y:      clamp(64px, 12vw, 120px);
}

/* ─── 2. RESET + GLOBAL ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (pointer: fine) {
  html { cursor: none; }
}
body {
  margin: 0;
  min-height: 100svh;
  background: var(--navy);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
@media (pointer: fine) {
  button, a, label { cursor: none; }
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
::selection { background: var(--gold-30); color: var(--white); }

/* Skip link for keyboard users */
.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--gold); color: var(--navy);
  padding: 10px 16px; z-index: 1000; font-weight: 500;
  letter-spacing: 0.1em; text-decoration: none;
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: 8px; }

/* ─── 3. NOISE OVERLAY ──────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  opacity: 0.025;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* ─── 4. CUSTOM CURSOR (desktop only) ───────────────────────────── */
#cursor-dot, #cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, width, height;
  transition: width 250ms var(--ease), height 250ms var(--ease),
              background 250ms var(--ease), border-color 250ms var(--ease);
}
#cursor-dot {
  width: 6px; height: 6px;
  background: var(--gold);
  mix-blend-mode: normal;
}
#cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid var(--gold-50);
}
body.cursor-hover #cursor-dot { width: 10px; height: 10px; }
body.cursor-hover #cursor-ring {
  width: 52px; height: 52px;
  background: var(--gold-08);
  border-color: var(--gold);
}
@media (pointer: coarse), (max-width: 768px) {
  #cursor-dot, #cursor-ring { display: none !important; }
}

/* ─── 5. SCROLL PROGRESS BAR ────────────────────────────────────── */
#progress-bar {
  position: fixed; top: 0; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  z-index: 100;
  box-shadow: 0 0 12px var(--gold-50);
  transition: width 80ms linear;
}

/* ─── 6. BACKGROUND CANVAS ──────────────────────────────────────── */
#bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ─── 7. NAVIGATION ─────────────────────────────────────────────── */
nav#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-std) var(--ease),
              padding var(--dur-std) var(--ease),
              border-color var(--dur-std) var(--ease),
              backdrop-filter var(--dur-std) var(--ease);
}
nav#navbar.scrolled {
  background: rgba(6, 9, 15, 0.85);
  border-bottom-color: var(--gold-12);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
@media (min-width: 768px) {
  nav#navbar { padding: 24px var(--gutter); }
  nav#navbar.scrolled { padding: 16px var(--gutter); }
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.nav-logo svg { flex-shrink: 0; }
.nav-logo-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--white-85);
}
@media (max-width: 480px) {
  .nav-logo-text { font-size: 0.875rem; }
}
.nav-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--gold-30);
  background: var(--gold-08);
  color: var(--gold);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
}
.nav-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@media (max-width: 480px) {
  .nav-badge { padding: 6px 10px; font-size: 0.5625rem; letter-spacing: 0.18em; }
  .nav-badge span { display: none; }
  .nav-badge::after { content: 'VIP'; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

/* ─── 8. HERO ───────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 100px var(--gutter) 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(30, 58, 110, 0.35), transparent 70%),
    radial-gradient(ellipse 100% 80% at 80% 80%, rgba(201, 165, 90, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 20% 90%, rgba(30, 58, 110, 0.20), transparent 60%),
    var(--navy);
}
.hero-bg::after {
  /* Optional venue photo overlay — drops in if hero-bg.webp loads */
  content: '';
  position: absolute; inset: 0;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  mix-blend-mode: lighten;
  filter: saturate(0.7);
}
.hero-grid {
  position: absolute; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--gold-03) 1px, transparent 1px),
    linear-gradient(90deg, var(--gold-03) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 100%);
}
.hero-vignette {
  position: absolute; inset: 0;
  z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(6, 9, 15, 0.6) 100%);
}
.hero-content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow {
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.hero-eyebrow-line {
  width: clamp(20px, 6vw, 60px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-50));
}
.hero-eyebrow-line:last-child {
  background: linear-gradient(90deg, var(--gold-50), transparent);
}
.hero-eyebrow span {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.25rem, 8vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 32px;
  text-wrap: balance;
  opacity: 0; transform: translateY(30px);
  transition: opacity 1000ms var(--ease), transform 1000ms var(--ease);
}
.hero-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold) 20%, var(--gold2) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-subtitle-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  margin-bottom: 44px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms var(--ease) 100ms, transform 800ms var(--ease) 100ms;
}
.hero-divider {
  width: 60px; height: 1px;
  background: var(--gold);
  position: relative;
}
.hero-divider::before, .hero-divider::after {
  content: '';
  position: absolute; top: 50%;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateY(-50%);
}
.hero-divider::before { left: -8px; }
.hero-divider::after  { right: -8px; }
.hero-subtitle {
  font-size: clamp(0.875rem, 2.2vw, 1.0625rem);
  color: var(--white-85);
  margin: 0;
  line-height: 1.7;
  text-wrap: pretty;
  max-width: 600px;
}
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 28px;
  margin-bottom: 44px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms var(--ease) 200ms, transform 800ms var(--ease) 200ms;
}
.hero-meta-item {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8125rem;
  color: var(--white-85);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.hero-meta-dot {
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
}
.hero-cta-wrap {
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms var(--ease) 300ms, transform 800ms var(--ease) 300ms;
}
/* Triggered class — applied via JS on DOMContentLoaded */
.hero-eyebrow.in,
.hero-title.in,
.hero-subtitle-block.in,
.hero-meta.in,
.hero-cta-wrap.in { opacity: 1; transform: translateY(0); }

/* Hero scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeInScroll 800ms var(--ease) 1800ms forwards;
}
.scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, transparent, var(--gold));
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 12px;
  background: var(--gold);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
.scroll-label {
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
@media (max-width: 640px) { .hero-scroll { display: none; } }
@keyframes fadeInScroll { to { opacity: 0.8; } }
@keyframes scrollPulse {
  0%   { transform: translateY(-12px); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateY(36px); opacity: 0; }
}

/* ─── 9. PRIMARY BUTTON ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 12px;
  padding: 18px 36px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0; border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-std) var(--ease),
              box-shadow var(--dur-std) var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  opacity: 0;
  transition: opacity var(--dur-std) var(--ease);
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary svg { transition: transform var(--dur-std) var(--ease); }
@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(201, 165, 90, 0.35);
  }
  .btn-primary:hover::before { opacity: 1; }
  .btn-primary:hover svg { transform: translateX(4px); }
}
.btn-primary:active { transform: translateY(0); }

/* ─── 10. SECTION DIVIDERS ──────────────────────────────────────── */
.gold-rule {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-30), transparent);
}

/* ─── 11. HOSTS STRIP ───────────────────────────────────────────── */
#hosts {
  position: relative;
  padding: clamp(48px, 8vw, 80px) var(--gutter);
  background: rgba(13, 20, 32, 0.6);
  border-top: 1px solid var(--gold-08);
  border-bottom: 1px solid var(--gold-08);
}
.hosts-label {
  text-align: center;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 36px;
}
.hosts-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 0;
  max-width: var(--container);
  margin: 0 auto;
}
@media (min-width: 640px) {
  .hosts-inner { grid-template-columns: repeat(3, 1fr); }
}
.host-item {
  text-align: center;
  padding: 0 16px;
  position: relative;
}
@media (min-width: 640px) {
  .host-item:not(:last-child)::after {
    content: '';
    position: absolute; right: 0; top: 10%; bottom: 10%;
    width: 1px;
    background: var(--gold-15);
  }
}
.host-flag {
  margin-bottom: 14px;
  line-height: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.host-flag img {
  width: 44px;
  height: auto;
  display: inline-block;
}
.host-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.host-title {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

/* ─── 12. EVENT DETAILS ─────────────────────────────────────────── */
#details {
  padding: var(--section-y) var(--gutter);
  background: var(--navy);
}
.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--gold-08);
  max-width: var(--container);
  margin: 0 auto;
  border: 1px solid var(--gold-08);
}
@media (min-width: 768px) {
  .details-grid { grid-template-columns: repeat(3, 1fr); }
}
.detail-card {
  background: var(--navy2);
  padding: clamp(36px, 6vw, 56px) clamp(28px, 5vw, 48px);
  position: relative;
  overflow: hidden;
  transition: background var(--dur-lg) var(--ease);
}
.detail-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gold-05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-lg) var(--ease);
  pointer-events: none;
}
@media (hover: hover) {
  .detail-card:hover { background: var(--navy3); }
  .detail-card:hover::before { opacity: 1; }
}
.detail-card-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--gold-30);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  position: relative;
}
.detail-card-icon svg { width: 22px; height: 22px; }
.detail-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.detail-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.detail-sub {
  font-size: 0.8125rem;
  color: var(--white-50);
  line-height: 1.7;
  text-wrap: pretty;
}

/* ─── 13. RSVP SECTION ──────────────────────────────────────────── */
#rsvp {
  padding: var(--section-y) var(--gutter);
  position: relative;
  scroll-margin-top: 80px;
}
.rsvp-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(48px, 8vw, 80px);
  max-width: var(--container);
  margin: 0 auto;
  align-items: start;
}
@media (min-width: 1024px) {
  .rsvp-inner { grid-template-columns: 1fr 1fr; gap: 80px; }
}
.section-eyebrow {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 24px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.section-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold) 20%, var(--gold2) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-line {
  width: 60px; height: 1px;
  background: var(--gold);
  margin-bottom: 32px;
}
.rsvp-desc {
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  color: var(--white-85);
  line-height: 1.85;
  margin: 0 0 32px;
  text-wrap: pretty;
  max-width: 540px;
}
.invitation-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border: 1px solid var(--gold-30);
  background: var(--gold-08);
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.invitation-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ─── 14. FORM CARD ─────────────────────────────────────────────── */
.form-card {
  background: rgba(13, 20, 32, 0.85);
  border: 1px solid var(--gold-12);
  padding: clamp(28px, 5vw, 48px);
  position: relative;
  overflow: hidden;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 1px 0 var(--gold-08) inset,
    0 30px 80px rgba(0, 0, 0, 0.5);
}
.form-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.form-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 400;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.form-card-sub {
  font-size: 0.875rem;
  color: var(--white-50);
  line-height: 1.7;
  margin: 0 0 28px;
}

/* ─── 15. FORM FIELDS ───────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
}
.field-group { position: relative; }
.field-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.field-label .req {
  color: var(--gold);
  margin-left: 4px;
  opacity: 0.6;
}
.field-input,
.field-textarea {
  width: 100%;
  background: var(--white-07);
  border: 1px solid var(--gold-12);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px; /* iOS zoom prevention */
  font-weight: 300;
  padding: 14px 16px;
  min-height: 52px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: background var(--dur-std) var(--ease),
              border-color var(--dur-std) var(--ease),
              box-shadow var(--dur-std) var(--ease);
  touch-action: manipulation;
}
@media (min-width: 768px) {
  .field-input, .field-textarea { font-size: 0.9375rem; }
}
.field-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
  font-family: inherit;
}
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--white-20);
  font-weight: 300;
}
.field-input:focus,
.field-textarea:focus {
  border-color: var(--gold-50);
  background: var(--gold-05);
  box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.06);
}
.field-input:autofill,
.field-input:-webkit-autofill {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px var(--navy3) inset;
  caret-color: var(--white);
}
.field-group.has-error .field-input,
.field-group.has-error .field-textarea {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.04);
}
.field-error {
  display: none;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--error);
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.field-group.has-error .field-error { display: block; animation: shake 380ms var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

/* Honeypot */
.hp-field {
  position: absolute !important;
  opacity: 0 !important;
  height: 0 !important; width: 0 !important;
  top: 0; left: 0;
  z-index: -1;
  pointer-events: none;
}

/* ─── 16. RADIO GROUP (attendance) ──────────────────────────────── */
.radio-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 480px) {
  .radio-group { grid-template-columns: 1fr 1fr; }
}
.radio-option { position: relative; }
.radio-option input {
  position: absolute;
  opacity: 0; width: 1px; height: 1px;
  pointer-events: none;
}
.radio-label {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  min-height: 56px;
  background: var(--white-07);
  border: 1px solid var(--gold-12);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--white-85);
  transition: background var(--dur-std) var(--ease),
              border-color var(--dur-std) var(--ease),
              color var(--dur-std) var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.radio-check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--gold-50);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--dur-std) var(--ease);
}
.radio-check::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform var(--dur-std) var(--ease);
}
.radio-option input:checked + .radio-label {
  background: var(--gold-08);
  border-color: var(--gold-50);
  color: var(--gold);
}
.radio-option input:checked + .radio-label .radio-check {
  border-color: var(--gold);
}
.radio-option input:checked + .radio-label .radio-check::after {
  transform: scale(1);
}
.radio-option input:focus-visible + .radio-label {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
@media (hover: hover) {
  .radio-label:hover { border-color: var(--gold-30); }
}

/* ─── 17. SUBMIT BUTTON ─────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  margin-top: 28px;
  padding: 18px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-std) var(--ease),
              box-shadow var(--dur-std) var(--ease),
              opacity var(--dur-std) var(--ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-submit .btn-text { position: relative; z-index: 1; }
.btn-submit .btn-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-std) var(--ease);
}
.btn-submit .btn-spinner svg {
  width: 22px; height: 22px;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) {
  .btn-submit:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(201, 165, 90, 0.35);
  }
}
.btn-submit:disabled { opacity: 0.7; transform: none; cursor: not-allowed; }
.btn-submit.loading .btn-text   { opacity: 0; }
.btn-submit.loading .btn-spinner { opacity: 1; }

.form-feedback {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 2px solid var(--error);
  background: rgba(255, 107, 107, 0.06);
  font-size: 0.8125rem;
  color: var(--error);
  display: none;
  line-height: 1.5;
}
.form-feedback.show { display: block; }
.form-meta {
  margin-top: 16px;
  font-size: 0.6875rem;
  color: var(--white-50);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ─── 18. SUCCESS STATE ─────────────────────────────────────────── */
.success-state {
  display: none;
  text-align: center;
  padding: clamp(32px, 6vw, 48px) clamp(20px, 4vw, 32px);
  animation: fadeInUp 600ms var(--ease) both;
}
.success-state.show { display: block; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-icon-wrap {
  width: 72px; height: 72px;
  margin: 0 auto 28px;
  border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.success-icon-wrap::before, .success-icon-wrap::after,
.success-icon-wrap > i::before, .success-icon-wrap > i::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: var(--gold);
}
.success-icon-wrap::before { top: -2px; left: -2px; }
.success-icon-wrap::after  { top: -2px; right: -2px; }
.success-icon-wrap > i::before { bottom: -2px; left: -2px; }
.success-icon-wrap > i::after  { bottom: -2px; right: -2px; }
.success-check {
  width: 36px; height: 36px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck 700ms var(--ease) 250ms forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.625rem, 4vw, 2rem);
  font-weight: 400;
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}
.success-divider {
  width: 50px; height: 1px;
  background: var(--gold);
  margin: 0 auto 20px;
}
.success-desc {
  font-size: 0.9375rem;
  color: var(--white-85);
  line-height: 1.8;
  margin: 0;
  text-wrap: pretty;
  max-width: 440px;
  margin-inline: auto;
}
.success-name {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.success-meta {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--white-50);
  letter-spacing: 0.08em;
}

/* ─── 19. FOOTER ────────────────────────────────────────────────── */
footer {
  padding: clamp(48px, 8vw, 80px) var(--gutter);
  background: var(--navy);
  border-top: 1px solid var(--gold-08);
  text-align: center;
}
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 300;
  font-style: italic;
  color: var(--white-85);
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  text-wrap: balance;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 18px;
  font-size: 0.75rem;
  color: var(--white-50);
  letter-spacing: 0.08em;
}
.footer-sep {
  width: 4px; height: 4px;
  background: var(--gold-30);
  border-radius: 50%;
}
@media (max-width: 480px) {
  .footer-sep { display: none; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

.footer-credit {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(201, 165, 90, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 243, 236, 0.35);
}
.footer-credit a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.footer-credit a:hover { color: #E8C87A; }
.footer-credit span { opacity: 0.5; }

/* ─── 20. SCROLL REVEALS ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--dur-xl) var(--ease),
              transform var(--dur-xl) var(--ease);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity var(--dur-xl) var(--ease),
              transform var(--dur-xl) var(--ease);
}
.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity var(--dur-xl) var(--ease),
              transform var(--dur-xl) var(--ease);
}
.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Stagger children */
.stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* ─── 21. CONFETTI CANVAS ───────────────────────────────────────── */
#confetti-canvas {
  position: fixed; inset: 0;
  z-index: 200;
  pointer-events: none;
  display: none;
}

/* ─── 22. REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #cursor-dot, #cursor-ring,
  #bg-canvas, #confetti-canvas,
  .hero-scroll { display: none !important; }
  .reveal, .reveal-left, .reveal-right,
  .hero-eyebrow, .hero-title, .hero-subtitle-block,
  .hero-meta, .hero-cta-wrap {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─── 23. PRINT ─────────────────────────────────────────────────── */
@media print {
  nav, .hero-scroll, #bg-canvas, #cursor-dot, #cursor-ring,
  #progress-bar, #confetti-canvas, .btn-submit, .btn-primary,
  body::before { display: none !important; }
  body { background: #fff; color: #000; }
  .hero-title, .section-title, .form-card-title, .success-title {
    color: #000 !important; -webkit-text-fill-color: #000 !important;
  }
  .form-card { border: 1px solid #000; box-shadow: none; }
}

/* ─── 24. CUSTOM SCROLLBAR (desktop) ────────────────────────────── */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: var(--navy); }
  ::-webkit-scrollbar-thumb {
    background: var(--gold-30);
    border-radius: 0;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--gold-50); }
  html { scrollbar-color: var(--gold-30) var(--navy); }
}

/* ─── 25. TABLET-SPECIFIC TUNING ────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .rsvp-inner { gap: 56px; }
  .form-card  { padding: 40px; }
}

/* ─── 26. LARGE PHONE SAFE AREAS (notch / dynamic island) ───────── */
@supports (padding: max(0px)) {
  body {
    padding-left:  env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  nav#navbar {
    padding-top: max(18px, env(safe-area-inset-top, 18px));
  }
  footer {
    padding-bottom: max(48px, calc(48px + env(safe-area-inset-bottom, 0)));
  }
}

/* ═══════════════════════════════════════════════════════════════════
   v3 — FREE PREMIUM ADDITIONS
   Personalised greeting · Countdown · Map · Plus-one · Calendar · PDF
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 27. PERSONALISED HERO GREETING ───────────────────────────── */
.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 16px;
  border: 1px solid var(--gold-30);
  background: var(--gold-08);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-std) var(--ease), transform var(--dur-std) var(--ease);
}
.hero-greeting[hidden] { display: none; }
.hero-greeting.in { opacity: 1; transform: none; }
.hero-greeting span { color: var(--white-50); }
.hero-greeting strong {
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 0.8125rem;
}

/* ─── 28. LIVE COUNTDOWN ──────────────────────────────────────── */
.hero-countdown {
  display: inline-flex;
  align-items: flex-end;
  gap: clamp(12px, 2.5vw, 24px);
  margin-top: 28px;
  padding: 14px 24px;
  border: 1px solid var(--gold-12);
  background: rgba(13, 20, 32, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-lg) var(--ease) 1000ms, transform var(--dur-lg) var(--ease) 1000ms;
}
.hero-countdown.in { opacity: 1; transform: none; }
.countdown-cell {
  display: flex; flex-direction: column; align-items: center;
  min-width: 56px;
}
.countdown-num {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.countdown-lbl {
  margin-top: 6px;
  font-size: 0.5625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white-50);
}
.countdown-sep {
  color: var(--gold-30);
  font-size: 1.5rem;
  font-weight: 300;
  padding-bottom: 18px;
}
.hero-countdown.event-live .countdown-num { color: var(--success); }

/* ─── 29. VENUE MAP (Leaflet) ─────────────────────────────────── */
.venue-map-wrap {
  margin-top: clamp(32px, 5vw, 56px);
  border: 1px solid var(--gold-12);
  background: var(--navy2);
  overflow: hidden;
}
#venue-map {
  width: 100%;
  height: clamp(280px, 38vw, 420px);
  filter: grayscale(0.35) brightness(0.85) contrast(1.05);
  background: var(--navy3);
}
.venue-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--gold-12);
}
.map-btn {
  flex: 1 1 0;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  min-height: 52px;
  background: transparent;
  color: var(--white-85);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border-right: 1px solid var(--gold-12);
  transition: background var(--dur-micro), color var(--dur-micro);
}
.map-btn:last-child { border-right: 0; }
.map-btn:hover { background: var(--gold-08); color: var(--gold); }
.map-btn svg { color: var(--gold); flex-shrink: 0; }
/* Leaflet attribution polish — smaller, on-brand */
.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(6, 9, 15, 0.7) !important;
  color: rgba(247, 243, 236, 0.6) !important;
}
.leaflet-control-attribution a { color: var(--gold) !important; }
.leaflet-bar a {
  background: var(--navy2) !important;
  color: var(--gold) !important;
  border-color: var(--gold-12) !important;
}
.leaflet-bar a:hover { background: var(--gold-08) !important; }

/* ─── 30. CONDITIONAL FIELDS (plus-one, dietary) ──────────────── */
.field-group.conditional {
  max-height: 0;
  overflow: hidden;
  margin: 0;
  opacity: 0;
  transition:
    max-height 350ms var(--ease),
    opacity   220ms var(--ease) 80ms,
    margin    350ms var(--ease);
}
.field-group.conditional.show {
  max-height: 400px;
  opacity: 1;
  margin-top: 18px;
  margin-bottom: 0;
  overflow: visible;
}

.field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) center,
    calc(100% - 16px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 44px;
  cursor: pointer;
}
.field-select option {
  background: var(--navy2);
  color: var(--white);
  padding: 8px;
}

/* Checkbox list */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 52px;
  border: 1px solid var(--gold-12);
  background: var(--white-07);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--white-85);
  transition: border-color var(--dur-micro), background var(--dur-micro);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.checkbox-option:hover { border-color: var(--gold-30); background: var(--gold-05); }
.checkbox-option input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-mark {
  width: 18px; height: 18px;
  border: 1.5px solid var(--gold-50);
  background: transparent;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--dur-micro), background var(--dur-micro);
}
.checkbox-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  transform: scale(0);
  transition: transform var(--dur-micro) var(--ease);
}
.checkbox-option input:checked ~ .checkbox-mark { border-color: var(--gold); }
.checkbox-option input:checked ~ .checkbox-mark::after { transform: scale(1); }
.checkbox-option input:focus-visible ~ .checkbox-mark {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ─── 31. SUCCESS-STATE ACTION BUTTONS ────────────────────────── */
.success-actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gold-12);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.success-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  min-height: 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy);
  border: 0;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--dur-micro), box-shadow var(--dur-std);
  -webkit-tap-highlight-color: transparent;
}
.success-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201, 165, 90, 0.3); }
.success-btn:active { transform: translateY(0); }
.success-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.success-btn.secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-30);
}
.success-btn.secondary:hover { background: var(--gold-08); }

/* Calendar dropdown */
.cal-wrap { position: relative; }
.cal-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 220px;
  background: var(--navy2);
  border: 1px solid var(--gold-30);
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: cal-fade-in 200ms var(--ease);
}
.cal-menu[hidden] { display: none; }
@keyframes cal-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.cal-item {
  display: block;
  padding: 14px 18px;
  min-height: 48px;
  color: var(--white);
  font-size: 0.8125rem;
  text-decoration: none;
  border-bottom: 1px solid var(--gold-12);
  transition: background var(--dur-micro), color var(--dur-micro);
}
.cal-item:last-child { border-bottom: 0; }
.cal-item:hover { background: var(--gold-08); color: var(--gold); }

/* ─── 32. LIVE RSVP COUNTER (footer) ──────────────────────────── */
.rsvp-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 0 auto 24px;
  border: 1px solid var(--gold-12);
  background: var(--navy2);
  font-size: 0.75rem;
  color: var(--white-85);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}
.rsvp-counter[hidden] { display: none; }
.rsvp-counter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: counter-pulse 2s ease-in-out infinite;
}
@keyframes counter-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
.rsvp-counter-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 400;
}
.rsvp-counter-lbl {
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-50);
}

/* ─── 33. RESPONSIVE TWEAKS ──────────────────────────────────── */
@media (max-width: 480px) {
  .hero-countdown {
    gap: 10px;
    padding: 12px 16px;
    width: 100%;
    justify-content: space-around;
  }
  .countdown-num { font-size: 1.625rem; }
  .countdown-sep { display: none; }
  .map-btn { font-size: 0.625rem; letter-spacing: 0.16em; }
  .success-actions { flex-direction: column; }
  .success-btn { justify-content: center; width: 100%; }
  .cal-menu { left: 0; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-counter-dot { animation: none; }
}
