/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --cream: #FBF6EE;
  --ivory: #FFFFFF;
  --espresso: #3A2E22;
  --espresso-soft: #6B5B49;
  --gold: #A9834B;
  --gold-deep: #8A6A38;
  --sage: #7C8564;
  --line: #E6DAC1;
  --blush: #D8B8A4;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --container-w: 1080px;
  --radius: 2px;
  --shadow-soft: 0 10px 40px -12px rgba(58, 46, 34, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--espresso); }

a { color: inherit; }

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 28px; }
.container--narrow { max-width: 720px; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--gold-deep);
  margin: 0 0 14px;
  text-align: center;
  font-weight: 500;
}
.eyebrow--light { color: rgba(255,255,255,0.85); }

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 6px;
}

.divider { display: flex; justify-content: center; color: var(--gold); margin: 22px auto 40px; }
.divider__sprig { width: 120px; height: 24px; }

/* =========================================================
   TOP NAV
   ========================================================= */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--ivory);
  mix-blend-mode: normal;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.topnav.is-scrolled {
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  color: var(--espresso);
  box-shadow: 0 1px 0 var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.topnav__mono { font-weight: 600; }
.topnav__links { display: flex; gap: 28px; font-family: var(--font-body); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.topnav__links a { text-decoration: none; opacity: 0.9; border-bottom: 1px solid transparent; padding-bottom: 3px; transition: border-color 0.25s var(--ease), opacity 0.25s; }
.topnav__links a:hover { border-color: currentColor; opacity: 1; }

@media (max-width: 640px) {
  .topnav__links { gap: 16px; font-size: 0.7rem; }
}

/* =========================================================
   PETALS (ambient background decoration)
   ========================================================= */
.petal-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.petal-layer::before, .petal-layer::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.petal-layer::before { top: -140px; left: -120px; background: var(--blush); }
.petal-layer::after { bottom: -160px; right: -140px; background: var(--sage); opacity: 0.18; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ivory);
  text-align: center;
}
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.08);
  animation: heroZoom 18s ease-out forwards;
}
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,30,20,0.45) 0%, rgba(40,30,20,0.55) 55%, rgba(40,30,20,0.75) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 32px;
  animation: heroFadeIn 1.4s var(--ease) both;
}
@keyframes heroFadeIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.monogram { position: relative; width: 108px; height: 108px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; }
.monogram__ring { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(255,255,255,0.55); animation: spinSlow 40s linear infinite; }
.monogram--small .monogram__ring { color: var(--gold); }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.monogram__letters { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; letter-spacing: 0.05em; }

.hero__names {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
.hero__names .amp { font-style: italic; color: var(--blush); padding: 0 6px; }

.hero__quote { font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 520px; margin: 0 auto 14px; opacity: 0.95; }
.hero__date { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.85rem; margin-bottom: 34px; opacity: 0.9; }

.hero__scrollcue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 46px; background: rgba(255,255,255,0.6);
  z-index: 2;
}
.hero__scrollcue::after {
  content: ''; position: absolute; top: 0; left: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ivory);
  animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop { 0% { top: 0; opacity: 1; } 90% { opacity: 1; } 100% { top: 42px; opacity: 0; } }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 15px 34px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn--ghost-light { border-color: rgba(255,255,255,0.7); color: var(--ivory); background: transparent; }
.btn--ghost-light:hover { background: rgba(255,255,255,0.12); }

.btn--solid { background: var(--espresso); color: var(--ivory); border-color: var(--espresso); width: 100%; }
.btn--solid:hover { background: var(--gold-deep); border-color: var(--gold-deep); box-shadow: var(--shadow-soft); }
.btn--solid:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--outline { border-color: var(--gold); color: var(--gold-deep); background: transparent; }
.btn--outline:hover { background: var(--gold); color: var(--ivory); }

/* =========================================================
   SECTIONS - GENERIC
   ========================================================= */
.section { position: relative; z-index: 2; padding: 96px 0; }
.section--story { background: var(--ivory); }
.section--rsvp { background: var(--ivory); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.story-text { text-align: center; font-size: 1.08rem; color: var(--espresso-soft); }

/* =========================================================
   COUNTDOWN
   ========================================================= */
.section--countdown {
  background: linear-gradient(160deg, #4A3A28, #2E2419);
  color: var(--ivory);
}
.countdown { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.countdown__item {
  min-width: 92px;
  padding: 22px 14px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255,255,255,0.04);
}
.countdown__num { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 500; line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.countdown__label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; }

/* =========================================================
   DETAILS (CEREMONY / RECEPTION)
   ========================================================= */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 12px; }
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.detail-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-4px); }
.detail-card__label { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.72rem; color: var(--gold-deep); margin-bottom: 10px; }
.detail-card__place { font-size: 1.5rem; margin-bottom: 6px; }
.detail-card__meta { color: var(--espresso-soft); font-size: 0.92rem; margin: 0 0 4px; }
.detail-card__address { color: var(--espresso-soft); font-size: 0.9rem; margin: 0 0 20px; }

.dresscode { text-align: center; margin-top: 52px; }
.dresscode__label { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; margin-bottom: 6px; }
.dresscode__value { color: var(--espresso-soft); }

/* =========================================================
   FORMS (shared: RSVP + gift modal)
   ========================================================= */
.form { margin-top: 8px; }
.form__row { margin-bottom: 20px; text-align: left; }
.form__row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form__row--split { grid-template-columns: 1fr; } }

label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--espresso-soft); margin-bottom: 8px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--espresso);
  transition: border-color 0.25s, box-shadow 0.25s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,131,75,0.18); }

.form__hint { font-size: 0.8rem; color: var(--espresso-soft); margin: -8px 0 20px; }
.form__checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; text-transform: none; letter-spacing: 0; color: var(--espresso-soft); margin-bottom: 20px; cursor: pointer; }
.form__checkbox input { margin-top: 3px; }
.form__status { margin-top: 14px; font-size: 0.9rem; min-height: 1.2em; text-align: center; }
.form__status.is-error { color: #B5432E; }
.form__status.is-success { color: var(--sage); }

/* =========================================================
   GIFTS
   ========================================================= */
.gifts-intro { text-align: center; max-width: 640px; margin: 0 auto 44px; color: var(--espresso-soft); }
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 26px;
}
.gifts-loading, .gifts-empty { grid-column: 1 / -1; text-align: center; color: var(--espresso-soft); padding: 40px 0; }

.gift-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  animation: cardIn 0.6s var(--ease) both;
}
.gift-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-4px); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.gift-card__image-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.gift-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.gift-card:hover .gift-card__image { transform: scale(1.06); }

.gift-card__badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.92); color: var(--espresso);
}
.gift-card__badge--reserved { background: rgba(124,133,100,0.92); color: var(--ivory); }
.gift-card__badge--delivered { background: rgba(58,46,34,0.92); color: var(--ivory); }

.gift-card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.gift-card__name { font-size: 1.2rem; margin-bottom: 6px; }
.gift-card__desc { font-size: 0.88rem; color: var(--espresso-soft); flex: 1; margin-bottom: 14px; }
.gift-card__price { font-size: 0.85rem; color: var(--gold-deep); margin-bottom: 14px; }

.gift-card__action { width: 100%; }
.gift-card__action[disabled] { background: var(--line); border-color: var(--line); color: var(--espresso-soft); }

/* =========================================================
   MODAL
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(40,30,20,0.55); animation: fadeIn 0.3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__panel {
  position: relative;
  background: var(--ivory);
  border-radius: var(--radius);
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  animation: modalIn 0.35s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal__close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--espresso-soft); cursor: pointer; }
.modal__gift-name { font-size: 1.6rem; margin-bottom: 20px; }
.modal__success-text { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; margin-bottom: 20px; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { position: relative; z-index: 2; background: #2E2419; color: rgba(255,255,255,0.85); text-align: center; padding: 64px 24px 40px; }
.footer__text { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; margin: 6px 0 22px; }
.footer__admin { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.45); text-decoration: none; }
.footer__admin:hover { color: rgba(255,255,255,0.8); }
