:root {
  --bg: #f4ede0;
  --bg-deep: #ece1cd;
  --card: #faf5ea;
  --ink: #2b2721;
  --ink-soft: #5c574c;
  --ink-faint: #948d7d;
  --accent: #8f7a54;
  --accent-soft: #cbb98f;
  --hairline: #ddcfb4;
  --glass: rgba(250, 245, 234, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);

  --display-en: 'Playfair Display', serif;
  --body-en: 'Cormorant Garamond', serif;
  --script-en: 'Parisienne', cursive;
  --display-ar: 'Amiri', serif;
  --body-ar: 'Tajawal', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-en);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

html[dir="rtl"] body { font-family: var(--body-ar); font-size: 17px; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Section rhythm */
.section-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 110px 32px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 36px;
}
html[dir="rtl"] .eyebrow { letter-spacing: 0.5px; text-transform: none; }

.section-title {
  font-family: var(--display-en);
  font-style: italic;
  font-weight: 400;
  font-size: 40px;
  color: var(--ink);
  margin-bottom: 52px;
}
html[dir="rtl"] .section-title { font-family: var(--display-ar); font-style: normal; font-weight: 700; font-size: 30px; }

/* Decorative blobs (used on RSVP section) */
.rsvp-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.blob-c { width: 400px; height: 400px; background: #e7d9b8; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Glass panel */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -40px rgba(80, 65, 30, 0.25);
}

/* Cover / landing page */
.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.1s;
}
.cover.cover-exit { opacity: 0; visibility: hidden; pointer-events: none; }

.cover-photo {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #3a3226 0%, #26221b 100%);
}
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; }
.cover.no-photo .cover-img { display: none; }

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 5, 0.55) 0%, rgba(10, 8, 5, 0.35) 42%, rgba(10, 8, 5, 0.68) 100%);
}

.cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 92vh;
  text-align: center;
  color: #fffdf8;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cover-quote {
  font-family: var(--body-en);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: rgba(247, 242, 232, 0.85);
  max-width: 420px;
}
html[dir="rtl"] .cover-quote { font-family: var(--display-ar); font-style: normal; font-size: 17px; }

.cover-quote-verse {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-soft);
  vertical-align: super;
  margin-inline-start: 6px;
}
html[dir="rtl"] .cover-quote-verse { font-family: var(--body-ar); letter-spacing: 0.3px; text-transform: none; vertical-align: baseline; font-size: 12px; }

.cover-mid { display: flex; flex-direction: column; align-items: center; }

.cover-intro {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(247, 242, 232, 0.7);
  margin-bottom: 22px;
}
html[dir="rtl"] .cover-intro { letter-spacing: 0.3px; text-transform: none; }

.cover-names {
  font-family: var(--display-en);
  font-style: italic;
  font-weight: 500;
  font-size: 76px;
  line-height: 1.05;
  margin-bottom: 22px;
  letter-spacing: 0.5px;
}
html[dir="rtl"] .cover-names { font-family: var(--display-ar); font-style: normal; font-size: 50px; font-weight: 700; }
.cover-amp {
  display: inline-block;
  font-style: italic;
  font-size: 0.55em;
  color: var(--accent-soft);
  margin: 0 16px;
  vertical-align: middle;
}
html[dir="rtl"] .cover-amp { margin: 0 10px; }

.cover-tagline {
  font-size: 16px;
  font-style: italic;
  color: rgba(247, 242, 232, 0.8);
  max-width: 380px;
}
html[dir="rtl"] .cover-tagline { font-family: var(--body-ar); font-style: normal; font-size: 15px; }

.cover-guest-greeting {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-soft);
}
html[dir="rtl"] .cover-guest-greeting { font-family: var(--body-ar); letter-spacing: 0.3px; text-transform: none; }
.cover-guest-greeting:empty { display: none; }

.cover-bottom { display: flex; flex-direction: column; align-items: center; gap: 26px; }

.cover-date {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(247, 242, 232, 0.75);
}
html[dir="rtl"] .cover-date { letter-spacing: 0.3px; text-transform: none; }

.enter-btn {
  background: transparent;
  border: 1px solid rgba(247, 242, 232, 0.6);
  color: #f7f2e8;
  padding: 15px 42px;
  font-family: var(--body-en);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, letter-spacing 0.4s ease;
}
html[dir="rtl"] .enter-btn { letter-spacing: 0.5px; font-family: var(--body-ar); }
.enter-btn:hover { background: #f7f2e8; color: var(--ink); letter-spacing: 4px; }
html[dir="rtl"] .enter-btn:hover { letter-spacing: 0.5px; }

/* Main content (revealed after entering) */
#main-content {
  opacity: 0;
  transition: opacity 1s ease;
}
#main-content.visible { opacity: 1; }
body.pre-enter { overflow: hidden; height: 100vh; }

/* Countdown */
.countdown-section {
  position: relative;
  overflow: hidden;
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.countdown-photo {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #3a3226 0%, #26221b 100%);
}
.countdown-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.countdown-img.active { opacity: 0.9; }
.countdown-section.no-photo .countdown-img { display: none; }
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 5, 0.35) 0%, rgba(10, 8, 5, 0.2) 45%, rgba(10, 8, 5, 0.5) 100%);
}
.countdown-section .section-inner {
  position: relative;
  z-index: 2;
  padding: 70px 32px;
}
.countdown-section .eyebrow {
  color: rgba(255, 253, 248, 0.85);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}
.countdown {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 22px;
  flex-wrap: wrap;
}
.countdown-unit { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.countdown-num {
  font-family: var(--display-en);
  font-size: 46px;
  font-weight: 400;
  color: #fffdf8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.countdown-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 253, 248, 0.75);
  margin-top: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
html[dir="rtl"] .countdown-label { letter-spacing: 0; text-transform: none; }
.countdown-sep { color: rgba(255, 253, 248, 0.6); font-size: 24px; align-self: center; }

/* Events */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.event-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 48px 36px;
  box-shadow: 0 24px 60px -36px rgba(60, 48, 20, 0.22);
}
.event-icon { width: 32px; height: 32px; color: var(--accent); margin-bottom: 18px; }
.event-card h3 {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
}
html[dir="rtl"] .event-card h3 { font-family: var(--display-ar); font-style: normal; font-size: 22px; }
.event-rule { width: 34px; height: 1px; background: var(--accent-soft); margin: 18px auto 20px; }
.event-intro { font-size: 15px; font-style: italic; color: var(--ink-soft); line-height: 1.6; margin-bottom: 22px; }
html[dir="rtl"] .event-intro { font-style: normal; }
.event-time { font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.event-venue { font-size: 16px; color: var(--ink-soft); margin-bottom: 22px; }
.event-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body-en);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  border-radius: 30px;
  padding: 13px 28px;
  box-shadow: 0 10px 24px -10px rgba(143, 122, 84, 0.6);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
html[dir="rtl"] .event-link { font-family: var(--body-ar); letter-spacing: 0; }
.event-link-icon { width: 19px; height: 19px; flex-shrink: 0; }
.event-link:hover {
  background: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(43, 39, 33, 0.55);
}
.event-link:active { transform: translateY(0); }

/* RSVP */
.rsvp-section { position: relative; }
.rsvp-sub { color: var(--ink-soft); margin-bottom: 12px; font-size: 17px; }
.rsvp-personal-note {
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.3px;
  color: var(--accent);
  margin-bottom: 32px;
}
html[dir="rtl"] .rsvp-personal-note { font-family: var(--body-ar); font-style: normal; }
.rsvp-personal-note:empty { display: none; }
.rsvp-form { max-width: 440px; margin: 0 auto; text-align: left; }
html[dir="rtl"] .rsvp-form { text-align: right; }
.form-group { margin-bottom: 26px; }
.form-group label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
html[dir="rtl"] .form-group label { letter-spacing: 0; text-transform: none; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 2px 12px;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font-family: var(--body-en);
  font-size: 17px;
  color: var(--ink);
  transition: border-color 0.3s ease;
}
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea { font-family: var(--body-ar); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.rsvp-deadline {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-faint);
  margin-bottom: 26px;
  text-align: center;
}
html[dir="rtl"] .rsvp-deadline { font-style: normal; }
.rsvp-submit {
  display: block;
  width: 100%;
  padding: 17px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 0;
  font-family: var(--body-en);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.4s ease, letter-spacing 0.4s ease;
}
html[dir="rtl"] .rsvp-submit { letter-spacing: 0.5px; font-family: var(--body-ar); }
.rsvp-submit:hover { background: var(--accent); letter-spacing: 4px; }
html[dir="rtl"] .rsvp-submit:hover { letter-spacing: 0.5px; }
.rsvp-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.rsvp-form.hidden { display: none; }
.rsvp-success {
  display: none;
  padding: 30px 10px;
}
.rsvp-success.visible {
  display: block;
  animation: fade-scale-in 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.rsvp-success-text {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 32px;
  line-height: 1.4;
  color: var(--ink);
  max-width: 420px;
  margin: 0 auto;
}
html[dir="rtl"] .rsvp-success-text { font-family: var(--display-ar); font-style: normal; font-size: 24px; }
@keyframes fade-scale-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Gift */
.gift-text { max-width: 520px; margin: 0 auto 36px; color: var(--ink-soft); font-size: 17px; }
.gift-card {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 28px 48px;
}
.gift-method {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 18px;
}
html[dir="rtl"] .gift-method { font-family: var(--display-ar); font-style: normal; font-size: 20px; }

.gift-account-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 30px;
  padding: 10px 12px 10px 22px;
  margin-bottom: 18px;
}
html[dir="rtl"] .gift-account-row { padding: 10px 22px 10px 12px; }
.gift-account-id {
  font-family: var(--body-en);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--ink);
}
.gift-copy-btn {
  font-family: var(--body-en);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.3s ease;
}
html[dir="rtl"] .gift-copy-btn { font-family: var(--body-ar); letter-spacing: 0; text-transform: none; }
.gift-copy-btn:hover { background: var(--ink); }
.gift-copy-btn.copied { background: #6b7d5c; }

.gift-app-link {
  display: block;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.gift-app-link:hover { color: var(--ink); border-color: var(--ink); }

/* Footer */
.footer {
  text-align: center;
  padding: 0;
}
.footer-photo {
  position: relative;
  width: 100%;
  background: linear-gradient(160deg, #3a3226 0%, #26221b 100%);
}
.footer-img { width: 100%; height: auto; display: block; opacity: 0.95; }
.footer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 5, 0.55) 0%, rgba(10, 8, 5, 0.15) 35%, rgba(10, 8, 5, 0) 60%);
}
.footer-text {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 100%;
  text-align: center;
}
.footer-names {
  font-family: var(--display-en);
  font-style: italic;
  font-size: 26px;
  color: #fffdf8;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: 8px;
}
html[dir="rtl"] .footer-names { font-family: var(--display-ar); font-style: normal; font-size: 22px; }
.footer-date {
  font-size: 12px;
  color: rgba(247, 242, 232, 0.85);
  letter-spacing: 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
html[dir="rtl"] .footer-date { letter-spacing: 0.3px; }

/* Responsive */
@media (max-width: 640px) {
  .cover-content { padding: 76px 24px 36px; min-height: 94vh; }
  .cover-names { font-size: 48px; }
  html[dir="rtl"] .cover-names { font-size: 34px; }
  .cover-amp { margin: 0 8px; }
  .section-title { font-size: 30px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .countdown { gap: 12px; }
  .countdown-sep { display: none; }
  .countdown-num { font-size: 34px; }
  .section-inner { padding: 80px 24px; }
}
