/* =========================================================
   Engagement Invitation — Fadi & Jessica
   ========================================================= */

:root {
  --wine-900: #2a060e;
  --wine-800: #3d0a14;
  --wine-700: #521020;
  --wine-600: #6e1426;
  --wine-500: #8a1f35;
  --rose: #b4495d;

  /* all writing on the page */
  --text: #f7f3ea;              /* off white */
  --text-soft: rgba(247,243,234,.82);
  --text-faint: rgba(247,243,234,.6);

  /* Only two fonts per language:
     English → Great Vibes (script) + Cormorant Garamond
     Arabic  → Aref Ruqaa (script) + Amiri */
  --script: "Great Vibes", "Segoe Script", "Brush Script MT", serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Cormorant Garamond", Georgia, serif; /* small caps labels */

  --off-white: #faf6ef;
  --field: #f3ebe0;
}

/* Arabic fonts */
html[lang="ar"] {
  --script: "Aref Ruqaa", "Amiri", serif;
  --serif: "Amiri", "Times New Roman", serif;
  --sans: "Amiri", system-ui, sans-serif;
}
/* letter spacing breaks Arabic letter joining */
html[lang="ar"] body * { letter-spacing: 0 !important; text-transform: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(138, 31, 53, .55), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(110, 20, 38, .6), transparent 60%),
    var(--wine-800);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* subtle velvet grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.locked { overflow: hidden; height: 100vh; }

.script { font-family: var(--script); font-weight: 400; }

/* =========================================================
   LANGUAGE BUTTON
   ========================================================= */
.lang-btn {
  position: fixed; top: 16px; right: 16px;
  z-index: 110;
  padding: 9px 18px;
  border-radius: 40px;
  border: 1px solid var(--text);
  background: rgba(61,10,20,.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-family: "Amiri", serif;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  opacity: 0; visibility: hidden; transform: scale(.6);
  transition: opacity .6s ease, transform .6s ease, visibility .6s, background .3s ease;
}
.lang-btn.show { opacity: 1; visibility: visible; transform: scale(1); }
html[lang="ar"] .lang-btn { font-family: "Cormorant Garamond", Georgia, serif; font-size: 15px; font-weight: 600; letter-spacing: .15em !important; }
.lang-btn.show:hover { background: rgba(110,20,38,.95); transform: translateY(-1px); }

/* =========================================================
   VIDEO INTRO
   ========================================================= */
.intro {
  position: fixed; inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  background: var(--wine-800);
  overflow: hidden;
  transition: opacity 1.8s ease, visibility 1.8s ease;
}
.intro.hide { opacity: 0; visibility: hidden; }

.intro video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 1.4s ease, transform 2s ease, filter 1.4s ease;
}
/* tap screen over the first frame of the video */
.intro { cursor: pointer; }
.intro.playing { cursor: default; }
.intro-gate {
  position: absolute; inset: 0;
  transition: opacity 1s ease, visibility 1s;
}
.intro.playing .intro-gate { opacity: 0; visibility: hidden; }
.gate-hint {
  position: absolute; left: 0; right: 0; bottom: 7vh;
  text-align: center;
  font-family: var(--serif);
  font-size: 13px; font-weight: 500;
  letter-spacing: .45em; text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
  animation: blink 2.4s ease-in-out infinite;
}
html[lang="ar"] .gate-hint { font-size: 17px; }

.intro.fading video {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(6px) brightness(1.3);
}

/* =========================================================
   MUSIC BUTTON
   ========================================================= */
.music-btn {
  position: fixed; right: 18px; bottom: 18px;
  z-index: 90;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--text);
  background: rgba(61,10,20,.85);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  opacity: 0; visibility: hidden; transform: scale(.6);
  transition: opacity .6s ease, transform .6s ease, visibility .6s;
}
.music-btn.show { opacity: 1; visibility: visible; transform: scale(1); }
.music-btn svg { width: 20px; height: 20px; fill: var(--text); }
.music-btn .icon-play { display: none; margin-left: 3px; }
.music-btn.paused .icon-play { display: block; }
.music-btn.paused .icon-pause { display: none; }
.music-btn:not(.paused)::after {
  content: ""; position: absolute; inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--text);
  animation: ripple 2s ease-out infinite;
}

/* =========================================================
   LAYOUT
   ========================================================= */
main { position: relative; z-index: 2; }

.section {
  max-width: 560px;
  margin: 0 auto;
  padding: 90px 20px;
  text-align: center;
}

.section-title {
  font-size: clamp(48px, 12vw, 68px);
  line-height: 1.35;
  margin-bottom: 4px;
  padding: .25em .3em .1em;
  /* off-white shimmer */
  background: linear-gradient(110deg, #e6dfd0 0%, #ffffff 30%, #f7f3ea 50%, #fffdf7 70%, #e6dfd0 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
html[lang="ar"] .section-title { font-size: clamp(40px, 10vw, 56px); line-height: 1.6; }

.sub {
  font-style: italic;
  font-size: 19px;
  font-weight: 300;
  color: var(--text-soft);
  margin-bottom: 40px;
}
html[lang="ar"] .sub { font-style: normal; font-size: 20px; }

/* =========================================================
   1. OPENING CARD
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 70px 16px 30px;
  overflow: hidden;
}
/* roses image + soft dark veil; the bottom fades to transparent so the
   page background shows through — no visible edge between sections */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(20,2,6,.35), rgba(20,2,6,.15) 70%),
    url("images/red.jpg") center / cover no-repeat;
  pointer-events: none;
}
.invite {
  position: relative;
  width: min(100%, 520px);
  padding: 40px 16px;
  text-align: center;
}

.card-text { display: flex; flex-direction: column; align-items: center; color: var(--text); }
.card-text > * { opacity: 0; transform: translateY(10px); transition: opacity 1.2s ease, transform 1.2s ease; }
.opening.visible .card-text > * { opacity: 1; transform: none; }
.opening.visible .card-text > *:nth-child(1) { transition-delay: .4s; }
.opening.visible .card-text > *:nth-child(2) { transition-delay: 1s; }
.opening.visible .card-text > *:nth-child(3) { transition-delay: 1.6s; }
.opening.visible .card-text > *:nth-child(4) { transition-delay: 2.1s; }
.opening.visible .card-text > *:nth-child(5) { transition-delay: 2.6s; }
.opening.visible .card-text > *:nth-child(6) { transition-delay: 3s; }

.ct-names {
  font-size: clamp(44px, 13vw, 76px);
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--text);
  white-space: nowrap;
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.ct-names .amp { font-size: .75em; margin: 0 .15em; color: var(--text); }
html[lang="ar"] .ct-names { font-size: clamp(44px, 12vw, 62px); line-height: 1.5; }
.ct-body { font-style: italic; font-size: 20px; line-height: 1.4; color: var(--text-soft); }
html[lang="ar"] .ct-body { font-style: normal; }
.ct-event {
  font-size: clamp(42px, 11vw, 56px);
  line-height: 1.3;
  color: var(--text);
  margin: 4px 0 18px;
}
html[lang="ar"] .ct-event { line-height: 1.6; }
.ct-date {
  font-family: var(--sans);
  font-size: 15px; font-weight: 500;
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--text);
  padding: 6px;
}
html[lang="ar"] .ct-date { font-size: 19px; }

/* =========================================================
   2. CALENDAR + COUNTDOWN
   ========================================================= */
.calendar {
  background: transparent;
  border: 1px solid rgba(247,243,234,.4);
  border-radius: 6px;
  padding: 26px 18px 18px;
}
.cal-month {
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: .35em; text-transform: uppercase;
  color: var(--text); margin-bottom: 18px;
}
html[lang="ar"] .cal-month { font-size: 18px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  row-gap: 14px;
  font-family: var(--sans); font-size: 18px;
  color: var(--text-faint);
}
.cal-grid .d { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
html[lang="ar"] .cal-grid .d { font-size: 12px; }
.the-day { position: relative; color: var(--text); font-weight: 500; display: grid; place-items: center; }
.cal-heart {
  position: absolute;
  width: 46px; height: 42px;
  left: 50%; top: 50%; transform: translate(-50%, -52%);
  overflow: visible;
}
.cal-heart path {
  fill: none; stroke: var(--rose); stroke-width: 4;
  stroke-dasharray: 300; stroke-dashoffset: 300;
}
.calendar.visible .cal-heart path { animation: draw 2s .6s ease forwards, heartbeat 1.6s 2.8s ease-in-out infinite; transform-origin: center; }
.cal-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding: 0 8px;
  color: var(--text);
}
.cal-time { font-style: italic; font-size: 18px; color: var(--text-soft); text-align: start; }
html[lang="ar"] .cal-time { font-style: normal; font-size: 19px; }
.cal-month-name { font-size: 38px; line-height: 1.2; white-space: nowrap; }
html[lang="ar"] .cal-month-name { font-size: 28px; line-height: 1.8; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 40px; }
.countdown div {
  padding: 16px 4px;
  border: 1px solid rgba(247,243,234,.35);
  border-radius: 4px;
  background: transparent;
}
.countdown b {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 8vw, 42px);
  color: var(--text);
  line-height: 1;
}
.countdown span {
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-faint);
}
html[lang="ar"] .countdown span { font-size: 15px; }
.countdown-note { font-style: italic; margin-top: 18px; color: var(--text-soft); font-size: 18px; }
html[lang="ar"] .countdown-note { font-style: normal; font-size: 20px; }

/* =========================================================
   3. LOCATION
   ========================================================= */
.location-section { padding-top: 120px; }
.loc-label {
  font-family: var(--serif);
  font-size: 15px; letter-spacing: .5em; text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 22px;
}
html[lang="ar"] .loc-label { font-size: 20px; }
.loc-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 10vw, 54px);
  line-height: 1.15;
  color: var(--text);
}
html[lang="ar"] .loc-name { font-weight: 700; line-height: 1.5; }
.loc-place {
  font-style: italic;
  font-size: 19px;
  color: var(--text-soft);
  margin: 10px 0 40px;
}
html[lang="ar"] .loc-place { font-style: normal; font-size: 20px; }
/* same frame as the wine picture (.framed) */
.loc-image { margin-bottom: 44px; }
.loc-btn {
  display: inline-block;
  min-width: 260px;
  padding: 20px 34px;
  border: 1px solid rgba(247,243,234,.7);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 17px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: background .3s ease, border-color .3s ease;
}
html[lang="ar"] .loc-btn { font-size: 19px; padding: 16px 34px; }
.loc-btn:hover { background: rgba(247,243,234,.08); border-color: var(--text); }

/* =========================================================
   4. FRAMED IMAGE
   ========================================================= */
.framed {
  position: relative;
  margin: 0 auto 30px;
  max-width: 420px;
  padding: 12px;
  background: var(--off-white);
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.framed::after {
  content: ""; position: absolute; inset: 20px;
  border: 1px solid rgba(247,243,234,.5);
  pointer-events: none;
}
.framed img { display: block; width: 100%; height: auto; }

/* =========================================================
   RIBBON
   ========================================================= */
.date-section { padding-bottom: 0; }
.ribbon {
  position: relative; z-index: 3;
  /* extra room below so the ribbon's shadow fades out softly
     instead of being cut in a straight line */
  padding-bottom: 80px;
  margin: 0 0 -140px;
  pointer-events: none;
  overflow: hidden;
  direction: ltr; /* keep the ribbon positioned the same in Arabic (RTL) */
}
.ribbon img {
  display: block;
  width: 130%; max-width: 1100px;
  margin-left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 20px 30px rgba(0,0,0,.5));
}
.ribbon.reveal { transform: translateX(-60px); }
.ribbon.reveal.visible { transform: none; }
.ribbon.visible img { animation: wave 7s ease-in-out infinite; }

/* =========================================================
   5. QUOTES
   ========================================================= */
.quotes-section { padding-top: 60px; padding-bottom: 40px; }
.quotes { position: relative; min-height: 150px; }
.quotes blockquote {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-style: italic; font-weight: 300;
  font-size: clamp(25px, 6.5vw, 32px);
  line-height: 1.35;
  color: var(--text);
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}
html[lang="ar"] .quotes blockquote { font-style: normal; font-weight: 400; line-height: 1.6; }
.quotes blockquote.active { opacity: 1; transform: none; filter: none; }
.quote-dots { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.quote-dots button {
  width: 7px; height: 7px; border: none; border-radius: 50%;
  background: rgba(247,243,234,.3); cursor: pointer;
  transition: background .4s, transform .4s;
}
.quote-dots button.active { background: var(--text); transform: scale(1.4); }

/* =========================================================
   6. RSVP — off-white card, burgundy writing
   ========================================================= */
.rsvp-section { padding-bottom: 130px; }
.rsvp-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 9.5vw, 50px);
  line-height: 1.2;
  color: var(--text);
  text-shadow: 0 6px 24px rgba(0,0,0,.35);
  margin-bottom: 30px;
}
html[lang="ar"] .rsvp-title { font-weight: 700; line-height: 1.6; }

.rsvp-card {
  background: var(--off-white);
  color: var(--wine-600);
  border-radius: 14px;
  padding: 44px 30px 38px;
  box-shadow: 0 30px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(110,20,38,.12) inset;
  text-align: center;
}
.rsvp-head {
  font-size: clamp(38px, 10vw, 50px);
  line-height: 1.3;
  color: var(--wine-600);
}
html[lang="ar"] .rsvp-head { line-height: 1.7; }
.rsvp-before {
  font-style: italic;
  font-size: 20px;
  color: var(--wine-700);
  margin-top: 4px;
}
html[lang="ar"] .rsvp-before { font-style: normal; }

.rsvp-form { text-align: start; margin-top: 34px; }
.f-label {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--wine-700);
  margin: 0 0 10px;
}
html[lang="ar"] .f-label { font-style: normal; }
.f-input {
  display: block; width: 100%;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--wine-800);
  background: var(--field);
  border: 1px solid rgba(110,20,38,.22);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 26px;
  outline: none;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.f-input:focus { border-color: var(--wine-500); box-shadow: 0 0 0 3px rgba(138,31,53,.15); }
.f-radio {
  display: flex; align-items: center; gap: 12px;
  font-size: 21px;
  color: var(--wine-800);
  margin-bottom: 12px;
  cursor: pointer;
}
.f-radio input { width: 22px; height: 22px; accent-color: var(--wine-600); cursor: pointer; }
.f-radio:last-of-type { margin-bottom: 26px; }


.f-send {
  display: block; width: 100%;
  font-family: var(--serif);
  font-size: 18px; font-weight: 600;
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--off-white);
  background: linear-gradient(135deg, var(--wine-500), var(--wine-700));
  border: none;
  border-radius: 8px;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(61,10,20,.3);
  transition: transform .2s ease, box-shadow .3s ease, opacity .3s ease;
}
html[lang="ar"] .f-send { font-size: 21px; padding: 14px; }
.f-send:hover { box-shadow: 0 16px 30px rgba(61,10,20,.4); }
.f-send:active { transform: scale(.98); }
.f-send:disabled { opacity: .6; cursor: wait; }

.f-error { display: none; font-size: 17px; color: #a3172f; margin: -16px 0 20px; }
#sendError { margin: 14px 0 0; text-align: center; }
.rsvp-card.err-name #nameError,
.rsvp-card.err-send #sendError { display: block; }
.rsvp-card.err-name #fName { border-color: #a3172f; }

/* after sending / after the deadline */
.rsvp-done { display: none; margin-top: 18px; }
.rsvp-card.state-yes .rsvp-form,
.rsvp-card.state-no .rsvp-form,
.rsvp-card.state-closed .rsvp-form { display: none; }
.rsvp-card.state-yes #doneYes,
.rsvp-card.state-no #doneNo,
.rsvp-card.state-closed #rsvpClosed { display: block; animation: fadeUp 1s ease; }
.rsvp-card.state-yes > .rsvp-head,
.rsvp-card.state-yes > .rsvp-before,
.rsvp-card.state-no > .rsvp-head,
.rsvp-card.state-no > .rsvp-before { display: none; }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -250% center; } }
@keyframes blink { 0%,100% { opacity: .9; } 50% { opacity: .35; } }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes shine { 0% { left: -80%; } 60%,100% { left: 130%; } }
@keyframes wave { 0%,100% { transform: translateX(-50%) rotate(0deg); } 50% { transform: translateX(-50%) translateY(-8px) rotate(-1.5deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 420px) {
  .invite { padding: 56px 22px 48px; }
}
