/* =========================================================
   Chi & Chau — Vintage Wedding Invitation
   ========================================================= */

:root {
  --cream: #eef1e7;
  --cream-deep: #e4e8d9;
  --ivory: #f8f5ec;
  --gold: #b39a68;
  --gold-light: #cdb486;
  --gold-deep: #8a7647;
  --ink: #2f342b;
  --ink-soft: #59604f;
  --rose: #94a578;       /* soft sage — script accent echoing the foliage */
  --green: #4f5e40;
  --forest: #2c3726;
  --sage: #8a9a6f;
  --shadow: rgba(44, 55, 38, 0.20);

  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Playfair Display", Georgia, serif;
  --script: "Dancing Script", cursive;
  --monogram: "Great Vibes", "Dancing Script", cursive;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--gold-light); color: #fff; }

/* ===== Vintage paper texture overlay ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(176, 141, 87, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(176, 141, 87, 0.05) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* =========================================================
   Loader
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ivory);
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}
.loader.hidden { opacity: 0; visibility: hidden; }

.loader__monogram {
  font-family: var(--display);
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--gold);
  display: flex;
  gap: 0.3rem;
  letter-spacing: 0.1em;
}
.loader__monogram span { opacity: 0; transform: translateY(20px); animation: fadeUp 0.9s var(--ease) forwards; }
.loader__monogram span:nth-child(2) { animation-delay: 0.25s; }
.loader__monogram span:nth-child(3) { animation-delay: 0.5s; }
.loader__amp { font-family: var(--script); color: var(--rose); }

.loader__line {
  width: 0;
  height: 1px;
  background: var(--gold);
  margin: 1.4rem 0 1rem;
  animation: lineGrow 1.2s var(--ease) 0.7s forwards;
}
.loader__text {
  font-family: var(--script);
  font-size: 1.6rem;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 1s forwards;
}

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes lineGrow { to { width: 220px; } }

/* =========================================================
   Falling petals canvas
   ========================================================= */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
}

/* =========================================================
   Navigation
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 3rem;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.scrolled {
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.9rem 3rem;
  box-shadow: 0 4px 24px rgba(74, 63, 51, 0.08);
}
.nav__brand {
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  color: var(--ivory);
  text-decoration: none;
  transition: color 0.5s var(--ease);
}
.nav.scrolled .nav__brand { color: var(--gold-deep); }

.nav__menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav__menu a {
  position: relative;
  text-decoration: none;
  color: var(--ivory);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.4s var(--ease);
}
.nav.scrolled .nav__menu a { color: var(--ink); }
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease);
}
.nav__menu a:hover { color: var(--gold); }
.nav__menu a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 9100;
}
.nav__toggle span {
  width: 26px; height: 2px;
  background: var(--ivory);
  transition: 0.4s var(--ease);
}
.nav.scrolled .nav__toggle span { background: var(--ink); }

/* hamburger -> X when menu open */
.nav.menu-open .nav__toggle span { background: var(--ink); }
.nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile drawer overlay */
.nav__overlay {
  position: fixed;
  inset: 0;
  z-index: 8900;
  background: rgba(30, 40, 26, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.nav__overlay.show { opacity: 1; visibility: visible; }

body.nav-locked { overflow: hidden; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: -10% 0;
  background: url("images/banner.jpg") center 30%/cover no-repeat;
  filter: saturate(1.06) contrast(0.98) brightness(0.95);
  will-change: transform;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(28,38,24,0.12) 0%, rgba(28,38,24,0.52) 100%),
    linear-gradient(to bottom, rgba(28,38,24,0.28), rgba(28,38,24,0.22));
}
.hero__frame {
  position: relative;
  z-index: 5;
  margin: 2rem;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 8vw, 6rem);
  border: 1px solid rgba(246, 240, 230, 0.5);
  outline: 4px solid rgba(246, 240, 230, 0.18);
  outline-offset: 8px;
  text-align: center;
  color: var(--ivory);
}
.hero__pretitle {
  font-size: 1.2rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero__names {
  font-family: var(--script);
  font-weight: 600;
  font-size: clamp(3.4rem, 13vw, 8.5rem);
  line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.hero__names span { display: inline-block; }
.hero__amp { font-size: 0.55em; color: var(--gold-light); margin: 0 0.1em; vertical-align: middle; }
.hero__subtitle {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin-top: 0.5rem;
}
.hero__date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 2rem;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero__date-line { width: 50px; height: 1px; background: var(--gold-light); }

.hero__scroll {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--ivory);
  text-decoration: none;
}
.hero__scroll-text { font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase; }
.hero__scroll-arrow {
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, var(--ivory), transparent);
  position: relative;
  animation: scrollPulse 2s var(--ease) infinite;
}
@keyframes scrollPulse { 0%,100%{ opacity:0.4; transform:scaleY(0.7);} 50%{ opacity:1; transform:scaleY(1);} }

/* =========================================================
   Sections / shared
   ========================================================= */
.section { padding: clamp(4rem, 10vw, 8rem) 1.5rem; text-align: center; }
.section__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--gold-deep);
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}
.section__title.light { color: var(--ivory); }
.section__script {
  font-family: var(--script);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--rose);
  margin-bottom: 2.5rem;
}
.section__script.light { color: var(--gold-light); }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 0 auto 2rem;
}
.divider__leaf {
  width: 70px; height: 1px;
  background: var(--gold);
  position: relative;
}
.divider.light .divider__leaf { background: var(--gold-light); }
.divider__leaf::before {
  content: "";
  position: absolute; top: -3px;
  width: 7px; height: 7px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.divider__leaf.left::before { right: 0; }
.divider__leaf.right::before { left: 0; }
.divider__diamond {
  width: 10px; height: 10px;
  background: var(--gold);
  transform: rotate(45deg);
}
.divider.light .divider__diamond { background: var(--gold-light); }

/* =========================================================
   Story
   ========================================================= */
.story { background: var(--cream); }
.story__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  max-width: 1100px;
  margin: 1rem auto 0;
  text-align: left;
}
.story__photo {
  position: relative;
  padding: 14px;
  background: var(--ivory);
  box-shadow: 0 20px 50px var(--shadow);
}
.story__photo img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: saturate(1.04) contrast(0.99);
}
.story__photo-frame {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(176, 141, 87, 0.6);
  pointer-events: none;
}
.story__text p { margin-bottom: 1.2rem; color: var(--ink-soft); }
.story__sign {
  font-family: var(--script);
  font-size: 2rem;
  color: var(--gold-deep);
}

/* =========================================================
   Countdown
   ========================================================= */
.countdown {
  position: relative;
  background: linear-gradient(135deg, #3f4f37, #26301f);
  color: var(--ivory);
  overflow: hidden;
}
.countdown::before {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 0L33 27 60 30 33 33 30 60 27 33 0 30 27 27z' fill='%23b08d57' opacity='0.06'/%3E%3C/svg%3E");
}
.countdown__inner { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.countdown__timer {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin: 2.5rem 0 1.5rem;
}
.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  padding: 1.4rem 0.5rem;
  border: 1px solid rgba(201, 169, 116, 0.4);
  border-radius: 4px;
  background: rgba(0,0,0,0.12);
}
.countdown__unit span {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
  color: var(--gold-light);
}
.countdown__unit small {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(246,240,230,0.7);
}
.countdown__date {
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold-light);
}

/* =========================================================
   Gallery
   ========================================================= */
.gallery { background: var(--cream-deep); overflow: hidden; }

.gallery__viewport {
  position: relative;
  max-width: 1240px;
  margin: 1.5rem auto 0;
}

.gallery__scroller {
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 1.6rem clamp(1rem, 8vw, 7rem);
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gallery__scroller::-webkit-scrollbar { display: none; }
.gallery__scroller.dragging { cursor: grabbing; scroll-behavior: auto; }
.gallery__scroller.dragging img { pointer-events: none; }

.gallery__item {
  position: relative;
  flex: 0 0 auto;
  width: clamp(230px, 58vw, 330px);
  scroll-snap-align: center;
  background: var(--ivory);
  padding: 12px;
  box-shadow: 0 16px 40px var(--shadow);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  overflow: hidden;
}
/* gentle staggered rhythm */
.gallery__item:nth-child(even) { transform: translateY(22px); }
.gallery__item:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 28px 64px var(--shadow);
}
.gallery__item:nth-child(even):hover { transform: translateY(16px) scale(1.015); }

.gallery__item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: saturate(0.96) contrast(0.97) brightness(0.97);
  transition: transform 1s var(--ease), filter 1s var(--ease);
}
.gallery__item:hover img { transform: scale(1.1); filter: saturate(1.1) contrast(1) brightness(1.02); }

.gallery__item figcaption {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  padding: 1.6rem 1rem 1rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ivory);
  background: linear-gradient(to top, rgba(30,40,26,0.9), transparent);
  opacity: 0;
  transform: translateY(14px);
  transition: 0.55s var(--ease);
}
.gallery__item figcaption span {
  display: block;
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
}
.gallery__item:hover figcaption { opacity: 1; transform: translateY(0); }

/* arrows */
.gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 54px; height: 54px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.85);
  backdrop-filter: blur(4px);
  color: var(--gold-deep);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--shadow);
  transition: 0.4s var(--ease);
}
.gallery__arrow:hover { background: var(--gold); color: #fff; transform: translateY(-50%) scale(1.1); }
.gallery__arrow.disabled { opacity: 0.25; pointer-events: none; }
.gallery__arrow--prev { left: 0.4rem; }
.gallery__arrow--next { right: 0.4rem; }

/* progress + hint */
.gallery__progress {
  width: min(320px, 60%);
  height: 2px;
  margin: 1rem auto 0.8rem;
  background: rgba(176, 141, 87, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.gallery__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.15s linear;
}
.gallery__hint {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

/* =========================================================
   Details
   ========================================================= */
.details { background: var(--cream); }
.details__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 1rem auto 0;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  background: var(--ivory);
  border: 1px solid rgba(176,141,87,0.25);
  box-shadow: 0 16px 44px var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.card:hover { transform: translateY(-8px); box-shadow: 0 26px 60px var(--shadow); }
.card__icon { font-size: 2.4rem; color: var(--gold); display: block; margin-bottom: 0.6rem; }
.card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.9rem;
  color: var(--gold-deep);
  margin-bottom: 0.8rem;
}
.card__time {
  font-family: var(--script);
  font-size: 2rem;
  color: var(--rose);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.card__place { font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.card__addr { color: var(--ink-soft); margin-bottom: 1rem; }
.card__note { font-style: italic; color: var(--ink-soft); font-size: 1.05rem; }
.card__map {
  margin: auto 0 1rem;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(176, 141, 87, 0.35);
  box-shadow: inset 0 0 0 5px var(--ivory), 0 10px 26px var(--shadow);
  overflow: hidden;
  filter: saturate(0.92) contrast(0.98);
  transition: filter 0.5s var(--ease);
}
.card:hover .card__map { filter: saturate(1) contrast(1); }
.card__map iframe { width: 100%; height: 100%; border: 0; display: block; }
.card__directions {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.4s var(--ease);
}
.card__directions:hover { color: var(--green); gap: 0.8rem; border-color: var(--green); }

/* =========================================================
   RSVP
   ========================================================= */
.rsvp {
  position: relative;
  padding: clamp(4rem, 10vw, 8rem) 1.5rem;
  overflow: hidden;
}
.rsvp__bg {
  position: absolute;
  inset: -10% 0;
  background: url("images/rsvp.jpg") center/cover no-repeat;
  filter: saturate(1.05) brightness(0.62);
  will-change: transform;
}
.rsvp__overlay { position: absolute; inset: 0; background: rgba(30,40,26,0.62); }
.rsvp__inner {
  position: relative;
  z-index: 3;
  max-width: 680px;
  margin: 0 auto;
  color: var(--ivory);
}
.rsvp__deadline { font-style: italic; color: var(--gold-light); margin-bottom: 2.5rem; }

/* ===== Impressive animated RSVP button ===== */
.rsvp-btn {
  position: relative;
  display: inline-block;
  margin: 0.5rem auto 1rem;
  padding: 1.25rem 3.4rem;
  border: 1px solid var(--gold-light);
  border-radius: 60px;
  color: var(--ivory);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, rgba(176,154,104,0.18), rgba(124,138,107,0.18));
  box-shadow: 0 12px 40px rgba(0,0,0,0.32), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
  animation: rsvpPulse 3s ease-in-out infinite;
}
@keyframes rsvpPulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.32), 0 0 0 0 rgba(205,180,134,0.55); }
  50%      { box-shadow: 0 16px 50px rgba(0,0,0,0.38), 0 0 0 16px rgba(205,180,134,0); }
}
.rsvp-btn:hover { transform: translateY(-5px) scale(1.04); border-color: #fff; }
.rsvp-btn:active { transform: translateY(-1px) scale(0.99); }

/* gold→green fill on hover */
.rsvp-btn::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(135deg, var(--gold), var(--green));
  opacity: 0;
  transition: opacity 0.55s var(--ease);
}
.rsvp-btn:hover::before { opacity: 1; }

/* sweeping shine */
.rsvp-btn__shine {
  position: absolute;
  top: 0; left: -160%;
  width: 55%; height: 100%;
  z-index: -1;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-22deg);
  animation: rsvpShine 3.6s ease-in-out infinite;
}
@keyframes rsvpShine { 0% { left: -160%; } 55%, 100% { left: 160%; } }

.rsvp-btn__label {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.rsvp-btn__heart { color: #e7b6a4; animation: heartBeat 1.7s ease-in-out infinite; }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.28); }
  30% { transform: scale(1); }
  45% { transform: scale(1.18); }
}
.rsvp-btn__arrow { transition: transform 0.4s var(--ease); }
.rsvp-btn:hover .rsvp-btn__arrow { transform: translateX(7px); }
.rsvp__hint { margin-top: 0.5rem; font-style: italic; color: rgba(246,240,230,0.7); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .rsvp-btn, .rsvp-btn__shine, .rsvp-btn__heart { animation: none; }
}
.rsvp__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 1.4rem;
  text-align: left;
}
.field { position: relative; }
.field--full { grid-column: 1 / -1; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 1rem 0.4rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(246,240,230,0.45);
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.4s var(--ease);
  resize: none;
}
.field select option { color: var(--ink); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--gold-light); }
.field label {
  position: absolute;
  left: 0.4rem; top: 1rem;
  color: rgba(246,240,230,0.7);
  pointer-events: none;
  transition: 0.35s var(--ease);
  font-size: 1.1rem;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field select:focus + label,
.field select:valid + label,
.field__label--select {
  top: -0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.btn {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 1rem;
  padding: 0.95rem 3rem;
  background: transparent;
  border: 1px solid var(--gold-light);
  color: var(--ivory);
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.5s var(--ease);
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
  z-index: -1;
}
.btn:hover { color: #fff; }
.btn:hover::before { transform: scaleX(1); }
.rsvp__success {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold-light);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s var(--ease), max-height 0.6s var(--ease);
}
.rsvp__success.show { opacity: 1; max-height: 80px; margin-top: 0.5rem; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: #26301f;
  color: var(--ivory);
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}
.footer__monogram {
  font-family: var(--script);
  font-size: clamp(2.4rem, 7vw, 4rem);
  color: var(--gold-light);
}
.footer__monogram span { color: var(--rose); }
.footer__thanks {
  max-width: 520px;
  margin: 0 auto 1.2rem;
  font-style: italic;
  color: rgba(246,240,230,0.8);
}
.footer__date { letter-spacing: 0.4em; color: var(--gold-light); }

/* Back to top */
.to-top {
  position: fixed;
  right: 1.6rem; bottom: 1.6rem;
  z-index: 8000;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: 0.5s var(--ease);
  box-shadow: 0 8px 24px var(--shadow);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--gold-deep); }

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll-arrow, .loader__monogram span { animation: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .gallery__arrow { width: 46px; height: 46px; font-size: 1.3rem; }
}
@media (max-width: 768px) {
  .nav { padding: 1rem 1.4rem; }
  /* NB: no backdrop-filter here — it would make .nav the containing block
     for the fixed drawer and break the sidebar once the page is scrolled */
  .nav.scrolled { padding: 0.8rem 1.4rem; background: rgba(251, 248, 241, 0.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: auto;
    height: 100dvh;
    width: min(78vw, 320px);
    flex-direction: column;
    justify-content: center;
    gap: 1.8rem;
    padding: 3rem;
    background: rgba(251,248,241,0.98);
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    box-shadow: -10px 0 40px rgba(0,0,0,0.18);
    overflow-y: auto;
  }
  .nav__menu.open { transform: translateX(0); }
  .nav__menu a { color: var(--ink) !important; font-size: 1.15rem; }
  .nav__overlay { display: block; }
  .story__grid { grid-template-columns: 1fr; }
  .story__photo { max-width: 420px; margin: 0 auto; }
  .details__cards { grid-template-columns: 1fr; }
  .rsvp__form { grid-template-columns: 1fr; }
  .countdown__timer { flex-wrap: wrap; gap: 1rem; }
  .countdown__unit { min-width: 38%; }
}
@media (max-width: 480px) {
  .gallery__arrow--prev { left: 0.2rem; }
  .gallery__arrow--next { right: 0.2rem; }
  .hero__frame { margin: 1rem; }
}
