:root {
  --cream: #f8f3ec;
  --blush: #dbb8ae;
  --deep-rose: #004225;
  --rose: #b8736a;
  --sage: #7a9478;
  --gold: #a8854a;
  --text-dark: #2e2420;
  --text-mid: #5a4540;
  --text-light: #8a7570;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: transparent;
  color: var(--text-dark);
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Background painterly layer */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('Website-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.72;
  filter: blur(1px) saturate(0.9);
  transition: opacity 0.6s ease;
}

body.on-rsvp .site-bg {
  opacity: 0.72;
}

/* Pages */
.page {
  display: none;
  min-height: 100vh;
  padding: 100px 24px 80px;
}
.page.active {
  display: block;
}
.page-inner {
  max-width: 780px;
  margin: 0 auto;
  background: rgba(248, 243, 236, 0.82);
  border-radius: 14px;
  padding: 48px 40px;
  box-shadow: 0 10px 80px rgba(46, 36, 32, 0.08);
}
.center { text-align: center; }

.page-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 2.6rem;
  color: var(--deep-rose);
  text-align: center;
  margin: 0 0 12px;
}
.script-heading {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: 4rem;
}
.page-sub {
  text-align: center;
  color: var(--text-mid);
  margin: 0 0 36px;
  font-size: 1.05rem;
}

/* Landing */
#page-landing {
  padding: 0;
  min-height: 100vh;
}
#page-landing.active {
  display: flex;
  flex-direction: column;
}
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
}
.bismillah {
  font-size: 1.5rem;
  color: var(--deep-rose);
  margin: 0 0 30px;
  font-family: 'Amiri', 'Playfair Display', serif;
}
.couple-names {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--deep-rose);
  margin: 0 0 16px;
  line-height: 1.05;
}
.summer-tag {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-mid);
  letter-spacing: 3px;
  margin: 0;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Buttons — thin outline, transparent rectangles */
.btn {
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 13px 32px;
  border-radius: 2px;
  background: transparent;
  color: var(--deep-rose);
  border: 1px solid var(--deep-rose);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn:hover {
  background: var(--deep-rose);
  color: var(--cream);
}
.btn:disabled {
  color: var(--text-light);
  border-color: var(--text-light);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}
.btn-large {
  padding: 16px 48px;
  font-size: 0.95rem;
}

/* Form inputs */
.text-input {
  width: 100%;
  padding: 12px 4px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: var(--text-dark);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-light);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s ease;
}
.text-input:focus {
  border-bottom-color: var(--deep-rose);
}
textarea.text-input {
  border: 1px solid var(--text-light);
  padding: 12px 14px;
  resize: vertical;
}
textarea.text-input:focus {
  border-color: var(--deep-rose);
}

.field-label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* Lookup */
.lookup-form {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.error-msg {
  color: var(--deep-rose);
  text-align: center;
  margin: 4px 0 0;
  font-size: 0.95rem;
}

/* Event Cards */
.event-cards {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 40px;
}
.event-card {
  background: var(--cream);
  border-radius: 5px;
  padding: 28px 30px;
  border-left: 6px solid var(--rose);
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}
.event-card[data-event="mehndi"] { border-left-color: #DCF0C9; }
.event-card[data-event="nikkah"] { border-left-color: #FFD1DC; }
.event-card[data-event="reception"] { border-left-color: #004225; }

.event-name {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.1rem;
  color: var(--deep-rose);
  margin: 0 0 10px;
}
.event-detail {
  margin: 4px 0;
  color: var(--text-mid);
  font-size: 1rem;
}
.event-detail strong {
  color: var(--text-dark);
  font-weight: 600;
  margin-right: 6px;
}

/* RSVP */
.rsvp-page .page-inner,
.rsvp-page .page-inner * {
  font-weight: 700;
}
.rsvp-page .couple-names,
.rsvp-page .script-heading {
  font-weight: 400;
}
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.rsvp-section {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--blush);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.rsvp-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.rsvp-event-title {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 500 !important;
  font-size: 2.1rem;
  color: var(--deep-rose);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}

/* Guest names header (label + copy button) */
.guest-names-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.guest-names-header .field-label {
  margin-bottom: 0;
}

.btn-copy-names {
  background: transparent;
  border: none;
  padding: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  white-space: nowrap;
}
.btn-copy-names:hover:not(:disabled) {
  color: var(--deep-rose);
  text-decoration-color: var(--deep-rose);
}
.btn-copy-names:disabled {
  color: var(--text-light);
  cursor: not-allowed;
  text-decoration: none;
}

/* Segmented attendance control */
.segmented {
  display: inline-flex;
  border: 1px solid var(--text-light);
  border-radius: 2px;
  overflow: hidden;
}
.segmented button {
  appearance: none;
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s ease;
}
.segmented button + button {
  border-left: 1px solid var(--text-light);
}
.segmented .seg-yes.active {
  background: #9ec4a3;
  color: #1e3a24;
}
.segmented .seg-no.active {
  background: #e6b0ac;
  color: #6b2a26;
}
.segmented button:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
}

/* Guest rows */
.guest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.guest-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.guest-row .text-input { flex: 1; }
.btn-remove {
  background: transparent;
  border: 1px solid var(--blush);
  color: var(--deep-rose);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.btn-remove:hover { background: var(--blush); }
.guest-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.guest-counter {
  color: var(--text-mid);
  font-size: 0.92rem;
}
.event-rsvp-body[hidden] { display: none; }

.btn-add-guest {
  background: #2d5a3d;
  color: #ffffff;
  border: none;
  padding: 0.45rem 1.2rem;
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease;
  display: inline-block;
  width: auto;
  margin-bottom: 1.5rem;
}

.btn-add-guest:hover {
  background: transparent;
  color: #2d5a3d;
  border: 1px solid #2d5a3d;
}

.btn-add-guest:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #2d5a3d;
}

/* Confirm */
.confirm-text {
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-mid);
  margin: 8px 0;
}
.confirm-signature {
  text-align: center;
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  color: var(--deep-rose);
  margin-top: 30px;
}

/* Info pages */
.info-page {
  position: relative;
  min-height: 100vh;
  display: none;
}
.info-page.active {
  display: flex;
}
.info-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  width: 100%;
  min-width: 0;
}
.info-title {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: clamp(4rem, 10vw, 7rem);
  color: var(--deep-rose);
  margin: 0;
  text-align: center;
}
.btn-next-event {
  position: fixed;
  bottom: 36px;
  right: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  color: var(--deep-rose);
  z-index: 20;
}
.btn-next-event .next-label {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}
.btn-next-event .next-arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--deep-rose);
  background: var(--deep-rose);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.25s ease;
}
.btn-next-event:hover .next-arrow {
  background: transparent;
  color: var(--deep-rose);
}

.btn-primary-inverted {
  display: inline-block;
  margin-top: 7.5rem;
  background: #004225;
  color: #f8f3ec;
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 1rem 2.8rem;
  border: 1px solid #004225;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary-inverted:hover {
  background: transparent;
  color: #004225;
}

@media (max-width: 600px) {
  .page-inner { padding: 32px 22px; }
  .page-heading { font-size: 2rem; }
  .event-card { padding: 22px; }
  .rsvp-event-header { flex-direction: column; align-items: flex-start; }

  .info-card {
    padding: 36px 24px;
  }
  .info-details {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .song-actions {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 768px) {

  .landing-hero {
    min-height: 100svh;
    padding: 1.5rem 1.5rem;
    justify-content: center;
  }

  .couple-names {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .bismillah {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .wedding-date {
    margin: 1.2rem 0 0;
  }

  .inv-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .events-section {
    padding: 2rem 1rem;
  }

  .event-card {
    padding: 1.4rem 1.2rem;
  }

  .rsvp-wrap {
    padding: 1.5rem 1.2rem 4rem;
  }

  .lookup-card {
    padding: 0 1rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .confirm-wrap {
    padding: 0 1.5rem;
  }

}

.lookup-card {
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}

.inv-header {
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}

.rsvp-wrap {
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}

.confirm-wrap {
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}

.inv-rsvp-bar {
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
}

/* 1. Lookup page heading — doubled size, unbolded */
#page-lookup .page-heading {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: clamp(3.2rem, 10vw, 6rem);
  line-height: 0.9;
}

/* 2. Invitation page — unbolded "You're Invited" */
#page-invitation .page-heading {
  font-weight: 300;
  font-style: normal;
}

/* 2. Variable guest name — Pinyon Script, larger than "You're Invited" */
#invitation-greeting {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  display: block;
  margin-top: 0.2em;
  color: var(--text-mid);
}

/* 3. RSVP page — remove Pinyon from heading, add to subtitle */
#page-rsvp .page-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 0.15em;
}

#page-rsvp .page-sub {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-size: clamp(1.6rem, 4.5vw, 2.45rem);
}

/* 4. Confirm page — Pinyon Script, unbolded */
#page-confirm .page-heading,
#page-confirm .confirm-signature {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
}

/* ── Event detail layout ── */
.info-inner { flex-direction: column; text-align: center; gap: 0; }

.info-card {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  background: rgba(248, 243, 236, 0.82);
  border-radius: 14px;
  padding: 64px 56px;
  box-shadow: 0 16px 64px rgba(46, 36, 32, 0.28), 0 4px 24px rgba(46, 36, 32, 0.18);
  min-width: 0;
}

.info-eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 26px;
}
.info-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  color: var(--text-mid);
  margin: 16px 0 0;
}
.info-divider {
  margin: 44px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.info-divider-line {
  width: 64px; height: 1px;
  background: var(--gold);
}
.info-divider-diamond {
  width: 9px; height: 9px;
  transform: rotate(45deg);
  background: var(--gold);
}
.info-details {
  margin: 52px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 46px 36px;
  max-width: 760px;
  width: 100%;
}
.info-detail-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 12px;
}
.info-detail-primary {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.3;
}
.info-detail-secondary {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-mid);
  margin: 6px 0 0;
}

/* ── Song Request page ── */
.song-search {
  max-width: 520px;
  margin: 0 auto 8px;
}
.song-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.song-result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--blush);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: 'Open Sans', sans-serif;
}
.song-result:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--deep-rose);
}
.song-result img {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  flex-shrink: 0;
}
.song-result-text {
  min-width: 0;
}
.song-result-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-result-artist {
  color: var(--text-mid);
  font-size: 0.85rem;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-empty,
.song-error {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 14px 0 0;
}

.song-selected {
  margin-top: 20px;
}
.song-selected-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.song-selected-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--cream);
  border: 1px solid var(--deep-rose);
  border-radius: 6px;
}
.song-selected-card img {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  flex-shrink: 0;
}
.song-selected-card .song-result-title {
  font-size: 1rem;
}
.song-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--deep-rose);
  color: var(--cream);
  border: none;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.song-selected-card:hover .song-remove-btn,
.song-selected-card:focus-within .song-remove-btn,
.song-remove-btn:focus {
  opacity: 1;
  pointer-events: auto;
}
.song-remove-btn:hover {
  background: var(--rose);
}

.song-actions {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 16px;
}