:root {
  --bg-blush: #F5E1DC;
  --bg-cream: #FBF1ED;
  --rose-light: #E8C8C2;
  --rose: #C99A93;
  --rose-deep: #A87168;
  --sage: #B5BFA8;
  --taupe: #9B7B5F;
  --brown-script: #8C6E54;
  --ink: #5C4A3A;

  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --font-arabic: "Amiri", "Traditional Arabic", serif;
  --font-ui: "Tajawal", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(168, 113, 104, 0.12);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg-blush);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ===================== SHARED ===================== */
.section-title {
  font-family: var(--font-arabic);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 2.75rem);
  color: var(--brown-script);
  text-align: center;
  margin: 0 0 0.75rem;
}

.section-divider {
  width: 60px;
  height: 1px;
  margin: 0 auto 2.5rem;
  background: var(--sage);
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn--primary {
  background: var(--rose);
  color: #fff;
}
.btn--primary:hover { background: var(--rose-deep); }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--rose-deep);
  border-color: var(--rose);
}
.btn--ghost:hover {
  background: var(--rose);
  color: #fff;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--bg-blush);
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.corner {
  position: fixed;
  width: clamp(120px, 20vw, 220px);
  height: auto;
  pointer-events: none;
  user-select: none;
  opacity: 0.9;
  transform-origin: center center;
  z-index: 5;
}

.corner--tl {
  top: -10px;
  left: -10px;
  transform: scaleX(-1) rotate(152deg);
}

.corner--tr {
  top: -10px;
  right: -10px;
  transform: rotate(152deg);
}

.corner--bl {
  bottom: -10px;
  left: -10px;
  transform: scaleX(-1) scaleY(-1) rotate(152deg);
}

.corner--br {
  bottom: -10px;
  right: -10px;
  transform: scaleY(-1) rotate(152deg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding-inline: clamp(0.5rem, 8vw, 4rem);
}

.verse {
  font-family: var(--font-arabic);
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  color: var(--brown-script);
  line-height: 2.1;
  margin: 0;
  max-width: 32ch;
}

.couple {
  font-family: var(--font-arabic);
  font-weight: 400;
  font-size: clamp(3.6rem, 9vw, 5.5rem);
  color: var(--brown-script);
  margin: 0.5rem 0 0;
  line-height: 1.2;
}

.datebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--brown-script);
  font-family: var(--font-arabic);
}

.datebar__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}

.datebar__divider {
  width: 1px;
  height: clamp(38px, 6vw, 56px);
  background: var(--brown-script);
  opacity: 0.55;
}

.datebar__month-name { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }
.datebar__month-num {
  font-size: clamp(2.1rem, 4.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  margin-top: 0.1rem;
}

.venue-line {
  font-family: var(--font-arabic);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--brown-script);
  margin: 0.5rem 0 0;
  line-height: 1.8;
}

.welcome {
  font-family: var(--font-arabic);
  font-size: clamp(1.15rem, 2.2vw, 1.3rem);
  color: var(--brown-script);
  line-height: 2.1;
  margin: 1rem 0 0;
}

/* ===================== COUNTDOWN ===================== */
.countdown {
  background: var(--bg-cream);
  padding: 4.5rem 1.5rem 5rem;
  text-align: center;
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.cd-tile {
  background: #fff;
  border: 1px solid var(--rose-light);
  border-radius: var(--radius);
  padding: 1.5rem 0.5rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.cd-tile__num {
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: clamp(2.3rem, 7vw, 3.5rem);
  color: var(--rose-deep);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-tile__label {
  font-size: 1rem;
  color: var(--taupe);
}

.cd-passed {
  margin: 2rem auto 0;
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--brown-script);
}

/* ===================== VENUE ===================== */
.venue {
  background: var(--bg-blush);
  padding: 5rem 1.5rem;
}

.venue__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 1040px;
  margin: 0 auto;
  align-items: center;
}

.venue__info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.venue__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.5vw, 2rem);
  color: var(--brown-script);
  margin: 0;
}

.venue__hint, .venue__time {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.venue__time strong { color: var(--brown-script); font-weight: 600; }

.venue__map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  background: var(--bg-cream);
}

.venue__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ===================== BLESSING ===================== */
.blessing {
  background: var(--bg-cream);
  padding: 4rem 1.5rem;
  text-align: center;
}

.blessing__text {
  font-family: var(--font-arabic);
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
  color: var(--brown-script);
  line-height: 2.1;
  max-width: 38ch;
  margin: 0 auto;
}

/* ===================== FOOTER ===================== */
.footer {
  position: relative;
  background: var(--bg-cream);
  padding: 4.5rem 1.5rem 5.5rem;
  text-align: center;
  overflow: hidden;
}

.footer__corner {
  width: clamp(120px, 24vw, 220px);
  opacity: 0.85;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer__sign {
  margin: 2.5rem 0 0;
  font-family: var(--font-arabic);
  color: var(--taupe);
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .venue__grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .venue__info { align-items: center; text-align: center; }

  .countdown__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .cd-tile { padding: 1.1rem 0.25rem; }

  .corner {
    width: clamp(100px, 22vw, 160px);
    opacity: 0.85;
  }
  /* All four corners stay visible — no display:none. */

  .datebar { gap: 0.5rem; }
}

@media (max-width: 480px) {
  .corner {
    width: clamp(80px, 26vw, 120px);
    opacity: 0.82;
  }
}

@media (max-width: 420px) {
  .countdown__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===================== OPEN-INVITE OVERLAY ===================== */
.open-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-blush) 100%);
  cursor: pointer;
  transition: opacity 0.6s ease, transform 0.6s ease;
  animation: open-overlay-in 0.5s ease both;
}

@keyframes open-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.open-overlay.is-open {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.open-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  color: var(--brown-script);
  text-align: center;
  padding: 0 1.5rem;
}

.open-overlay__pulse {
  position: relative;
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
}

.open-overlay__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--rose);
  opacity: 0;
  animation: open-overlay-pulse 2.5s ease-out infinite;
}

.open-overlay__ring:nth-child(2) {
  animation-delay: 1.25s;
}

@keyframes open-overlay-pulse {
  0% { transform: scale(0.65); opacity: 0.85; }
  100% { transform: scale(1.55); opacity: 0; }
}

.open-overlay__envelope {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  color: var(--brown-script);
  box-shadow: var(--shadow-soft);
  animation: open-overlay-bob 2.5s ease-in-out infinite;
}

@keyframes open-overlay-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.open-overlay__title {
  font-family: var(--font-arabic);
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  margin: 0;
  letter-spacing: 0.02em;
}

.open-overlay__hint {
  font-family: var(--font-arabic);
  font-size: 1rem;
  margin: 0;
  color: var(--taupe);
  opacity: 0.85;
}

.open-overlay:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: -8px;
}
