/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:      #f5ede0;
  --gold:       #ea785b;
  --dark:       #3f0013;
  --light:      #f4eef9;
  --olive:      #5f5420;
  --dusty-blue: #b0bde6;
  --champagne:  #e8debf;
  --lavender:   #edbee4;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--dark);
}

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  body * { cursor: none; }
}

/* ── Custom flower cursor (desktop only) ── */
@media not all and (hover: hover) and (pointer: fine) {
  #cursor { display: none; }
}

#cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, opacity 0.3s ease;
  will-change: transform;
}

#cursor svg {
  width: 58px;
  height: 58px;
  transition: width 0.2s ease, height 0.2s ease;
}

body.cursor-hover #cursor svg {
  width: 58px;
  height: 58px;
}

/* ── Section ghost text ── */
.section-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: 300;
  color: var(--dark);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.02em;
  line-height: 1;
}

h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  text-align: center;
  color: var(--dark);
  margin-bottom: 1rem;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.2rem;
  background: rgba(245,237,224,0.88);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

nav a {
  text-decoration: none;
  color: var(--dark);
  transition: color 0.3s;
}

nav a:hover { color: var(--gold); }

/* ── Hero ── */
#hero {
  height: 100vh;
  background: url('../images/hero.jpg') center 30%/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* Gradient overlay — works both as fallback and as tint over the photo */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(63,0,19,0.08)  0%,
      rgba(63,0,19,0.45) 100%
    ),
    linear-gradient(135deg,
      rgba(237,190,228,0.45) 0%,
      rgba(232,222,191,0.25) 50%,
      rgba(176,189,230,0.35) 100%
    );
  z-index: 0;
}

/* Solid fallback only when no image loaded */
#hero {
  background-color: #e8debf;
}

#hero > * { position: relative; z-index: 1; }

.hero-overlay {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
  padding: 3rem 4rem;
  border-radius: 2px;
}

.hero-overlay h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--dark);
}

.hero-overlay h1 span { color: var(--gold); font-style: italic; }

.hero-sub {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.hero-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--dark);
  margin-top: 0.6rem;
}

.btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.8rem 2.5rem;
  border: 1px solid var(--gold);
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  text-transform: uppercase;
  transition: all 0.3s;
}

.btn:hover { background: var(--gold); color: #fff; }

/* ── Countdown ── */
#countdown {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: #fff;
  padding: 5rem 2rem;
  text-align: center;
}

#countdown h2 { color: #fff; }
#countdown .section-ghost { color: #fff; opacity: 0.05; }

.countdown-grid {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.box span {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.box label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  color: #888;
}

/* ── Details ── */
#details {
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem;
  background: var(--light);
}

.timeline {
  max-width: 580px;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
  padding-left: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.event {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding-left: 1.5rem;
}

.time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--gold);
  min-width: 85px;
  font-style: italic;
  padding-top: 2px;
}

.info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.info p { font-size: 0.9rem; color: #777; line-height: 1.7; }

/* ── Dress Code ── */
#dresscode {
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem;
  background: var(--cream);
  text-align: center;
}

.palette-row {
  display: flex;
  max-width: 900px;
  margin: 2.5rem auto 4rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  height: 90px;
}

.swatch {
  flex: 1;
  background: var(--sw);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.5rem;
  position: relative;
  transition: flex 0.3s ease;
}

.swatch:hover { flex: 1.6; }

.swatch span {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  writing-mode: horizontal-tb;
  white-space: nowrap;
}

.dresscode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 1000px;
  margin: 0 auto 4rem;
  text-align: left;
}

.dresscode-card {
  background: var(--light);
  padding: 2.5rem 2rem;
  border-left: 2px solid var(--gold);
}

.dresscode-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 1.2rem;
}

.dresscode-card p {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.85;
  margin-bottom: 0.9rem;
}

.dresscode-colors {
  font-size: 0.78rem !important;
  color: var(--olive) !important;
  font-style: italic;
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}

.dresscode-notes {
  max-width: 700px;
  margin: 0 auto 3.5rem;
  background: #fdf5f0;
  border: 1px solid rgba(234,120,91,0.25);
  padding: 2rem 2.5rem;
  text-align: left;
}

.dresscode-notes-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.dresscode-notes p {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.85;
  margin-bottom: 0.7rem;
}

.dresscode-pinterest {
  margin-top: 1rem;
}

.pinterest-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 2.2rem;
  background: #e60023;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(230,0,35,0.35), 0 2px 6px rgba(0,0,0,0.12);
  transition: background 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.pinterest-btn:hover {
  background: #c0001d;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(230,0,35,0.45), 0 3px 8px rgba(0,0,0,0.15);
}

.pinterest-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .dresscode-grid { grid-template-columns: 1fr; }
  .palette-row { height: 70px; }
}

/* ── Gallery ── */
#gallery {
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem;
  background: var(--cream);
  text-align: center;
}

.section-sub {
  color: #999;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto;
}

.photo-card { overflow: hidden; aspect-ratio: 4/3; background: #e8d5b7; }

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.photo-card:hover img { transform: scale(1.06); }

.photo-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Footer ── */
footer {
  background: var(--dark);
  color: #666;
  text-align: center;
  padding: 2.5rem;
  font-size: 0.82rem;
  line-height: 2.2;
  letter-spacing: 0.08em;
}

/* ── Envelope Overlay ── */

#envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  background: linear-gradient(160deg, #edbee4 0%, #e8debf 45%, #b0bde6 100%);
  transition: opacity 0.9s ease;
}

#envelope-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(95,84,32,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

#envelope-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.env-scene {
  perspective: 1400px;
  perspective-origin: 50% 55%;
}

.env-wrapper {
  position: relative;
  width: min(720px, 92vw);
  aspect-ratio: 400 / 272;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: env-appear 1s cubic-bezier(0.34, 1.4, 0.64, 1) 0.3s both;
}

@keyframes env-appear {
  from { opacity: 0; transform: translateY(28px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.env-wrapper:not(.is-open):hover {
  filter: drop-shadow(0 32px 52px rgba(0,0,0,0.26));
}

/* Envelope rectangle body */
.env-body {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 38% 32%, #fefcf6 0%, #f8f0e3 55%, #eddec8 100%);
  border: none;
  box-shadow:
    0 28px 70px rgba(0,0,0,0.24),
    0 8px 22px rgba(0,0,0,0.1),
    inset 0 0 0 1px rgba(165,130,75,0.22),
    inset 0 2px 6px rgba(255,255,255,0.65),
    inset 0 -3px 10px rgba(140,100,50,0.07);
  overflow: hidden;
}

/* Side fold triangles — visible diagonal crease lines */
.env-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom right,
      rgba(140,105,55,0.13) 0%, rgba(140,105,55,0.13) 50%,
      transparent 50%),
    linear-gradient(to bottom left,
      rgba(140,105,55,0.13) 0%, rgba(140,105,55,0.13) 50%,
      transparent 50%);
}

/* Bottom flap triangle */
.env-body::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 52%;
  background: linear-gradient(175deg, #eddcc0 0%, #ddc59a 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  filter: drop-shadow(0 -4px 6px rgba(0,0,0,0.1));
}

/* Fold crease — dark line + light highlight below to simulate paper bend */
.env-fold-line {
  position: absolute;
  top: 55%;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(140,100,50,0.35) 12%,
    rgba(140,100,50,0.5) 50%,
    rgba(140,100,50,0.35) 88%,
    transparent 100%);
  z-index: 1;
}
.env-fold-line::after {
  content: '';
  position: absolute;
  top: 1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(255,255,255,0.55) 12%,
    rgba(255,255,255,0.75) 50%,
    rgba(255,255,255,0.55) 88%,
    transparent 100%);
}

/* Letter card */
.env-letter {
  position: absolute;
  left: 11%; right: 11%;
  bottom: 9%;
  background: linear-gradient(155deg, #ffffff 0%, #fdfaf4 100%);
  border: 1px solid rgba(165,130,75,0.18);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.14),
    0 2px 6px rgba(0,0,0,0.07),
    inset 0 1px 2px rgba(255,255,255,0.9);
  padding: clamp(0.7rem, 2.5%, 1rem) clamp(0.9rem, 3.5%, 1.5rem);
  text-align: center;
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.65s ease 0.5s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}

.env-wrapper.is-open .env-letter {
  opacity: 1;
  transform: translateY(-18px);
}

.env-letter-eyebrow {
  font-size: clamp(0.5rem, 1.6vw, 0.62rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.env-letter-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
  font-weight: 300;
  color: var(--dark);
  line-height: 1.2;
}

.env-letter-names em { color: var(--gold); font-style: italic; }

.env-letter-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.72rem, 2.2vw, 0.88rem);
  font-style: italic;
  color: #999;
  margin-top: 0.35rem;
}

/* Top flap (3D animated) */
.env-flap {
  position: absolute;
  top: 0; left: -1px; right: -1px;
  height: 56%;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.88s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
}

.env-wrapper.is-open .env-flap {
  transform: rotateX(180deg);
}

.env-flap-front,
.env-flap-back {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.env-flap-front {
  background: linear-gradient(162deg, #fefcf6 0%, #f4eadb 55%, #e8d8b8 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11%;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.14));
}

.env-flap-back {
  background: linear-gradient(to bottom, #ece0f0 0%, #cfc0e5 100%);
  transform: rotateX(180deg);
}

/* Wax seal */
.env-seal {
  width: clamp(46px, 13%, 62px);
  height: clamp(46px, 13%, 62px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 22%, #f5a585 0%, #ea785b 38%, #cc5535 68%, #8a2010 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.92);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.58rem, 1.7vw, 0.78rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  box-shadow:
    0 5px 18px rgba(160,50,20,0.45),
    0 2px 6px rgba(0,0,0,0.25),
    inset 0 2px 5px rgba(255,180,150,0.3),
    inset 0 -2px 5px rgba(80,10,0,0.28);
  border: 1.5px solid rgba(200,75,35,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.env-seal em { font-style: italic; font-size: 0.85em; }

.env-wrapper:not(.is-open):hover .env-seal {
  transform: scale(1.1);
  box-shadow:
    0 8px 24px rgba(160,50,20,0.55),
    0 3px 8px rgba(0,0,0,0.3),
    inset 0 2px 5px rgba(255,180,150,0.3),
    inset 0 -2px 5px rgba(80,10,0,0.28);
}

/* Hint text */
.env-hint {
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(44,44,44,0.38);
  font-family: 'Lato', sans-serif;
  opacity: 0;
  animation: env-hint-in 0.7s ease 2s forwards;
}

@keyframes env-hint-in {
  to { opacity: 0.45; }
}

#envelope-overlay.fade-out .env-hint {
  opacity: 0;
}

/* ── Envelope florals ── */
.env-floral-corner {
  position: absolute;
  width: 32%;
  height: auto;
  pointer-events: none;
  z-index: 1;
}
.env-floral-tl { top: 2%; left: 1%; }
.env-floral-tr { top: 2%; right: 1%; transform: scaleX(-1); }

.env-seal-flowers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.env-letter-corner {
  position: absolute;
  width: 28%;
  height: auto;
  pointer-events: none;
  opacity: 0.7;
}
.env-letter-corner.ltl { top: 4%; left: 3%; }
.env-letter-corner.ltr { top: 4%; right: 3%; transform: scaleX(-1); }
.env-letter-corner.lbl { bottom: 4%; left: 3%; transform: scaleY(-1); }
.env-letter-corner.lbr { bottom: 4%; right: 3%; transform: scale(-1); }

/* ── Floral Divider ── */
.floral-divider {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
  overflow: visible;
}

.floral-divider svg {
  width: min(520px, 90vw);
  height: auto;
  overflow: visible;
}

/* ── RSVP ── */
#rsvp {
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem;
  background: var(--dark);
  text-align: center;
}

#rsvp h2 { color: #fff; }
#rsvp .section-sub { color: rgba(255,255,255,0.45); margin-bottom: 3rem; }
#rsvp .section-ghost { color: #fff; opacity: 0.04; }

.rsvp-form {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.rsvp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Floating label fields */
.rsvp-field {
  position: relative;
}

.rsvp-field input,
.rsvp-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding: 1.2rem 0 0.5rem;
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
  resize: none;
}

.rsvp-field input:focus,
.rsvp-field textarea:focus {
  border-color: var(--gold);
}

.rsvp-field label {
  position: absolute;
  top: 1.2rem;
  left: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  transition: top 0.25s ease, font-size 0.25s ease, color 0.25s ease;
}

.rsvp-field input:focus ~ label,
.rsvp-field input:not(:placeholder-shown) ~ label,
.rsvp-field textarea:focus ~ label,
.rsvp-field textarea:not(:placeholder-shown) ~ label {
  top: 0;
  font-size: 0.62rem;
  color: var(--gold);
}

.rsvp-field .req { color: var(--gold); }

/* Group label */
.rsvp-group-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}

/* Pill radio buttons */
.rsvp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill {
  cursor: pointer;
}

.pill input { display: none; }

.pill span {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.25s ease;
  border-radius: 2px;
}

.pill input:checked ~ span {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(234,120,91,0.1);
}

.pill:hover span {
  border-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.85);
}

/* Submit button */
.rsvp-submit {
  align-self: flex-start;
  padding: 0.9rem 3rem;
  background: var(--gold);
  color: #fff;
  border: none;
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 18px rgba(234,120,91,0.35);
}

.rsvp-submit:hover {
  background: #d4613e;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(234,120,91,0.5);
}

.rsvp-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Feedback messages */
.rsvp-success {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--lavender);
  text-align: center;
  padding: 1rem 0;
}

.rsvp-error {
  font-size: 0.82rem;
  color: #f08080;
  letter-spacing: 0.08em;
}

[hidden] { display: none !important; }

/* ── Form validation ── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-7px); }
  80%      { transform: translateX(7px); }
}

.rsvp-form.shake { animation: shake 0.45s ease; }

.rsvp-field input.invalid {
  border-color: #f08080;
}

.rsvp-field.invalid-field::after {
  content: '*';
  position: absolute;
  right: 0;
  top: 1.1rem;
  color: #f08080;
  font-size: 1rem;
}

.pills-invalid .pill span {
  border-color: #f08080 !important;
  color: #f08080 !important;
}

.rsvp-group.invalid-group > .rsvp-group-label::after {
  content: ' *';
  color: #f08080;
}

/* ── Music toggle ── */
.music-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9998;
  background: var(--dark);
  border: 1px solid rgba(234,120,91,0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.music-toggle:hover {
  background: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(234,120,91,0.45);
}

.music-icon svg {
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.75);
  display: block;
}

/* Animated bars when playing */
.music-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.music-bars span {
  display: block;
  width: 3px;
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
  animation: bar 0.8s ease-in-out infinite alternate;
}

.music-bars span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.music-bars span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.music-bars span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.music-bars span:nth-child(4) { height: 16px; animation-delay: 0.45s; }

@keyframes bar {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1); }
}

.music-toggle.is-playing .music-icon { display: none; }
.music-toggle.is-playing .music-bars { display: flex; }

@media (max-width: 480px) {
  .music-toggle { bottom: 1rem; left: 1rem; width: 42px; height: 42px; }
}

/* ── Floating RSVP reminder ── */
.rsvp-reminder {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9998;
  background: var(--dark);
  border: 1px solid rgba(234,120,91,0.3);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.2rem 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 300px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.6s ease;
  border-radius: 2px;
}

.rsvp-reminder.show {
  transform: translateY(0);
  opacity: 1;
}

.rsvp-reminder.hide {
  transform: translateY(120%);
  opacity: 0;
}

.reminder-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s;
}
.reminder-close:hover { color: rgba(255,255,255,0.7); }

.reminder-flower svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  animation: spin 8s linear infinite;
}

.reminder-text { flex: 1; }

.reminder-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.2rem;
}

.reminder-sub {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

.reminder-btn {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(234,120,91,0.4);
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.reminder-btn:hover { background: var(--gold); color: #fff; }

@media (max-width: 480px) {
  .rsvp-reminder { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }
}

/* Success card */
.rsvp-success-card {
  max-width: 500px;
  margin: 2rem auto 0;
  text-align: center;
  animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

.rsvp-success-flower svg {
  width: 80px;
  height: 80px;
  animation: spin 12s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.rsvp-success-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 300;
  color: #fff;
  margin-bottom: 1rem;
  font-style: italic;
}

.rsvp-success-msg {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* Mobile */
@media (max-width: 600px) {
  .rsvp-row { grid-template-columns: 1fr; }
  .rsvp-submit { width: 100%; text-align: center; }
}

/* ── Hamburger nav toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  z-index: 201;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--dark);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.25s ease;
  transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile nav overlay ── */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.8rem;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.nav-mobile.is-open {
  transform: translateX(0);
  pointer-events: all;
}

.nav-mobile a {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 300;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.3s;
  opacity: 0;
  transform: translateX(30px);
  transition: color 0.3s, opacity 0.4s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
}

.nav-mobile.is-open a {
  opacity: 1;
  transform: translateX(0);
}

.nav-mobile.is-open a:nth-child(1) { transition-delay: 0.08s; }
.nav-mobile.is-open a:nth-child(2) { transition-delay: 0.13s; }
.nav-mobile.is-open a:nth-child(3) { transition-delay: 0.18s; }
.nav-mobile.is-open a:nth-child(4) { transition-delay: 0.23s; }
.nav-mobile.is-open a:nth-child(5) { transition-delay: 0.28s; }

.nav-mobile a:hover { color: var(--gold); }

/* decorative floral mark inside mobile nav */
.nav-mobile::before {
  content: 'S & V';
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(5rem, 25vw, 10rem);
  font-weight: 300;
  color: var(--dark);
  opacity: 0.04;
  position: absolute;
  pointer-events: none;
  letter-spacing: 0.1em;
}

/* ── Responsive ── */
@media (max-width: 768px) {

  /* Nav */
  nav > a { display: none; }
  nav { justify-content: flex-end; padding: 1rem 1.4rem; }
  .nav-toggle { display: flex; }

  /* Hero */
  .hero-overlay { padding: 2rem 1.5rem; }

  /* Countdown */
  .countdown-grid { gap: 1.8rem; }
  .box span { font-size: clamp(2.5rem, 10vw, 4rem); }

  /* Details */
  #details { padding: 5rem 1.5rem; }
  .timeline { max-width: 100%; }

  /* Dress code */
  #dresscode { padding: 5rem 1.2rem; }
  .dresscode-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .dresscode-notes { padding: 1.5rem; }
  .palette-row {
    height: auto;
    flex-direction: column;
    border-radius: 4px;
    max-width: 360px;
  }
  .swatch {
    height: 52px;
    flex: unset;
    align-items: center;
    padding-bottom: 0;
    justify-content: flex-start;
    padding-left: 1rem;
    gap: 0.6rem;
  }
  .swatch span {
    font-size: 0.62rem;
    opacity: 1;
    letter-spacing: 0.18em;
  }
  .swatch:hover { flex: unset; }

  /* Gallery */
  #gallery { padding: 5rem 1rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }

  /* Floral dividers */
  .floral-divider svg { width: min(360px, 94vw); }

  /* Footer */
  footer { padding: 2rem 1.2rem; }

  /* Pinterest btn */
  .pinterest-btn { width: 100%; max-width: 320px; justify-content: center; }
}

@media (max-width: 480px) {

  /* Hero */
  .hero-overlay { padding: 1.8rem 1.2rem; }
  .hero-overlay h1 { font-size: clamp(2.8rem, 14vw, 4rem); }

  /* Countdown */
  #countdown { padding: 4rem 1rem; }
  .countdown-grid { gap: 1.2rem; }

  /* Details */
  .event { flex-direction: column; gap: 0.4rem; }
  .time { min-width: unset; }

  /* Gallery */
  .gallery-grid { grid-template-columns: 1fr; }

  /* Dresscode */
  .dresscode-card { padding: 1.8rem 1.2rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
