:root {
  --bg: #FBF6EC;
  --ink: #2A2620;
  --ink-soft: #5B5648;
  --forest: #2F5233;
  --forest-dark: #223D27;
  --sage: #8FA998;
  --sunrise: #E8873A;
  --sunrise-strong: #B65C15;
  --yellow: #F4C95D;
  --card: #FFFFFF;
  --border: #E8DFC8;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(42, 38, 32, 0.08);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
}
.hero-photos { position: absolute; inset: 0; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; background: var(--forest); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(34,61,39,0.35) 0%, rgba(24,32,20,0.55) 55%, rgba(20,24,16,0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 100px 20px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  max-width: 42ch;
  margin: 0 0 14px;
  font-weight: 500;
}
.hero-microcopy {
  font-size: 0.95rem;
  max-width: 46ch;
  opacity: 0.9;
  margin: 0 0 24px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-countdown { margin-top: 18px; font-size: 0.9rem; opacity: 0.85; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.btn--primary { background: var(--sunrise-strong); color: #fff; box-shadow: 0 6px 18px rgba(182,92,21,0.35); }
.btn--ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.6); }
.btn--small { padding: 10px 18px; font-size: 0.9rem; min-height: 44px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* dark ghost variant used outside hero (light bg) */
.section .btn--ghost {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}

/* ---- Sections ---- */
.section { padding: 64px 20px; }
.section--tint { background: #F3EDDE; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-inner--narrow { max-width: 640px; }
.section h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 8px;
  color: var(--forest-dark);
}
.section-lead { color: var(--ink-soft); margin: 0 0 28px; max-width: 60ch; }

/* ---- Info cards ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease;
}
.info-card:hover { transform: translateY(-3px); }
.info-icon { font-size: 1.6rem; }
.info-card strong { color: var(--forest-dark); }
.info-card span:last-child { color: var(--ink-soft); font-size: 0.92rem; }

/* ---- Why join ---- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.why-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.why-card:hover { transform: translateY(-3px); }
.why-card h3 { margin: 0 0 6px; color: var(--forest); }
.why-card p { margin: 0; color: var(--ink-soft); }

/* ---- Rundown ---- */
.rundown-day { margin-bottom: 36px; }
.rundown-day h3 { color: var(--forest-dark); margin-bottom: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--sage); }
.timeline li {
  position: relative;
  padding: 8px 0 8px 22px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 4px 14px;
  align-items: baseline;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 16px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--sunrise);
  border: 2px solid var(--bg);
}
.timeline .time { font-weight: 700; color: var(--forest); }
.timeline .agenda { grid-column: 2; font-weight: 600; }
.timeline .note { grid-column: 2; color: var(--ink-soft); font-size: 0.88rem; }

/* ---- RSVP form ---- */
.rsvp-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; border: none; padding: 0; margin: 0; }
.field legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.field label:not(.radio-group label) { font-weight: 700; }
.required { color: var(--sunrise); }
input[type="text"], input[type="tel"], textarea {
  font: inherit;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card);
  min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--forest); outline-offset: 1px; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-group label { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 24px; }
.radio-group input { width: 20px; height: 20px; accent-color: var(--forest); }
.hidden { display: none !important; }

.form-error {
  background: #FBE6DD;
  border: 1px solid var(--sunrise);
  color: #7A3210;
  padding: 12px 16px;
  border-radius: 10px;
}

.rsvp-success {
  text-align: center;
  padding: 36px 24px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.rsvp-success h3 { color: var(--forest); font-size: 1.6rem; margin-top: 0; }
.rsvp-success-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---- Gallery ---- */
.gallery-videos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}
.gallery-video {
  max-width: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--ink);
}
.gallery-video video { width: 100%; display: block; aspect-ratio: 9/16; background: var(--ink); }
.gallery-video--wide { max-width: 420px; }
.gallery-video--wide video { aspect-ratio: 16/9; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.gallery-grid figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--sage); cursor: pointer; }
.gallery-grid img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-grid figcaption { padding: 12px 16px; background: var(--card); color: var(--ink-soft); font-size: 0.9rem; }
.img-fallback { min-height: 180px; display: flex; align-items: center; justify-content: center; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 24, 16, 0.92);
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 40px 20px 100px;
  color: var(--ink-soft);
}
.footer p { margin: 2px 0; }
.footer a { color: var(--forest); font-weight: 600; }

/* ---- Background music toggle ---- */
.bgm-toggle {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 55;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  background: rgba(34,61,39,0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.bgm-toggle:hover { transform: scale(1.06); }
.bgm-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.bgm-toggle.is-muted { background: rgba(91,86,72,0.55); }
.bgm-toggle-icon { pointer-events: none; }

#bgm-player { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .bgm-toggle { transition: none; }
}

/* ---- Sticky CTA (mobile) ---- */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--forest-dark);
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta a {
  display: block;
  text-align: center;
  background: var(--sunrise);
  color: #fff;
  font-weight: 700;
  padding: 14px;
  border-radius: 999px;
  text-decoration: none;
}
@media (min-width: 860px) { .sticky-cta { display: none; } }

/* ---- Motion ---- */
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
