:root {
  --bg-main: #FAFAFA; 
  --bg-card: #FFFFFF;
  --bg-soft: #F6F4F0; 
  
  --gold: #D4AF37; 
  --gold-bright: #F3E5AB;
  --gold-dim: #997A24;
  --gold-light: #EBE5D3;
  
  --ink: #2C2A28;
  --ink-light: #7A7570;

  --font-display: 'Aref Ruqaa', serif; 
  --font-accent: 'Amiri', serif;
  --font-body: 'Amiri', serif; 
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  overflow-x: hidden;
  direction: rtl;
}

body.locked { overflow: hidden; height: 100vh; }

h1, h2, .display { 
  font-family: var(--font-display); 
  font-weight: 700; 
}

.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 24px;
  text-align: center;
  overflow: hidden;
  background-color: var(--bg-main);
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.03), transparent 70%);
  pointer-events: none;
}

.frame { 
  position: relative; 
  z-index: 2; 
  max-width: 580px; 
  width: 100%; 
}

.divider-flora { 
  width: 150px; 
  height: 30px; 
  margin: 10px auto 20px; 
  opacity: 0.8; 
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold-dim);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.corner-flora {
  position: absolute;
  width: 55px;
  height: 55px;
  opacity: 0.5;
  z-index: 5;
  pointer-events: none;
}
.top-right { top: 8px; right: 8px; transform: rotate(0deg); }
.top-left { top: 8px; left: 8px; transform: rotate(-90deg); }
.bottom-right { bottom: 8px; right: 8px; transform: rotate(90deg); }
.bottom-left { bottom: 8px; left: 8px; transform: rotate(180deg); }

.petal-drift {
  position: fixed; 
  top: -40px; 
  z-index: 50; 
  pointer-events: none;
  opacity: 0.6;
  animation-name: drift-fall, drift-sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

@keyframes drift-fall {
  from { transform: translateY(-5vh) rotate(0deg); }
  to { transform: translateY(105vh) rotate(340deg); }
}
@keyframes drift-sway { 0%, 100% { margin-right: 0; } 50% { margin-right: 30px; } }

#envelope-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at center, #ffffff 0%, #f6f4f0 100%);
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .8s ease;
}
#envelope-stage.fading { opacity: 0; pointer-events: none; }
#envelope-stage.hidden { display: none; }

.invite-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 3.5rem); 
  color: var(--gold-dim);
  margin-bottom: 30px;
  z-index: 3;
  position: relative;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.envelope-wrap {
  position: relative;
  width: min(320px, 80vw);
  height: min(220px, 55vw);
  margin: 0 auto;
  perspective: 1400px;
  z-index: 3;
}

.env-back {
  position: absolute; inset: 0;
  background: #fbfaf8;
  border-radius: 4px;
  border: 1px solid var(--gold-light);
  box-shadow: 0 15px 40px rgba(0,0,0,0.06);
}

.env-letter {
  position: absolute;
  left: 5%; right: 5%; top: 5%;
  height: 90%;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  transform: translateY(6%);
  transition: transform 1.2s cubic-bezier(.2,.9,.25,1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10%;
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--gold-light);
  outline-offset: -6px;
}
.env-letter svg { width: 50%; height: 50%; opacity: 0.9; }

.env-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 110px solid #f6f4f0;
  transform-origin: top center;
  transition: transform 1s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.05));
  z-index: 3;
}

.env-front-fold {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-bottom: 90px solid #fdfcfb;
  z-index: 2;
}

.env-seal {
  position: absolute;
  top: 50%; left: 50%;
  width: 55px; height: 55px;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold) 60%, var(--gold-dim) 100%);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
  transition: transform .6s ease, opacity .5s ease;
}
.env-seal svg { width: 26px; height: 26px; }

.envelope-wrap.open .env-flap { transform: rotateX(180deg); }
.envelope-wrap.open .env-seal { opacity: 0; transform: translate(-50%,-50%) scale(0.5) rotate(45deg); }
.envelope-wrap.open .env-letter { transform: translateY(-65%); }

.click-hint {
  margin-top: 25px;
  font-family: var(--font-accent);
  font-size: 1.1rem;
  color: var(--ink-light);
  z-index: 3;
}

.chevron-hint {
  margin-top: 10px; width: 24px; height: 24px; z-index: 3; position: relative;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.4; transform:translateY(0);} 50%{opacity:1; transform:translateY(5px);} }

#names { background: var(--bg-soft); }

.names-card {
  border: 1px solid var(--gold);
  padding: 60px 40px;
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgba(0,0,0,0.04);
  position: relative;
  outline: 1px solid var(--gold);
  outline-offset: -10px; 
}

.top-flower {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  display: block;
  opacity: 0.85;
}

.basmala { 
  font-family: var(--font-display); 
  font-size: 1.8rem; 
  color: var(--gold-dim); 
  margin-bottom: 25px; 
}

.couple-names { 
  font-family: var(--font-display); 
  font-size: clamp(3rem, 10vw, 4.5rem); 
  line-height: 1.2; 
  color: var(--gold-dim); 
}

.couple-names .amp { 
  color: var(--ink-light); 
  display: block; 
  font-size: 2rem; 
  margin: 10px 0; 
  font-family: var(--font-accent);
}

.invite-line { 
  margin-top: 30px; 
  font-size: 1.2rem; 
  line-height: 1.8; 
  color: var(--ink); 
}

.date-badge {
  margin-top: 35px; 
  display: inline-block; 
  padding: 8px 30px;
  border-top: 1px solid var(--gold); 
  border-bottom: 1px solid var(--gold); 
  color: var(--gold-dim); 
  font-family: var(--font-display); 
  font-size: 1.4rem;
}

/* ================= دیزاینی نوێی کاتژمێری کاتی ماوە ================= */
.countdown-wrapper {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px stroke var(--gold-light);
}

.countdown-title {
  font-family: var(--font-accent);
  font-size: 1.1rem;
  color: var(--gold-dim);
  margin-bottom: 15px;
}

.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
  direction: ltr; /* بۆ ئەوەی خشتەکە لە چەپەوە بۆ ڕاست ڕێکبێت */
}

.cd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--gold-light);
  min-width: 65px;
  padding: 10px 5px;
  border-radius: 4px;
}

.cd-box span {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-dim);
  font-weight: bold;
  line-height: 1;
}

.cd-box label {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-top: 6px;
}

#note { background: var(--bg-main); }

.note-card {
  color: var(--ink);
  padding: 40px 20px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 2;
  position: relative;
}

#details { background: var(--bg-soft); }

.detail-block { margin-bottom: 35px; }

.detail-label { 
  font-family: var(--font-accent); 
  color: var(--gold-dim); 
  font-size: 1.1rem; 
  margin-bottom: 5px; 
}

.detail-value { 
  font-size: clamp(1.5rem, 4vw, 1.8rem); 
  font-family: var(--font-display); 
  color: var(--ink); 
}

.map-frame { 
  margin-top: 20px; 
  width: 100%; 
  aspect-ratio: 4/3; 
  border: 1px solid var(--gold-light); 
  padding: 5px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

#music { background: var(--bg-main); }

.vinyl {
  width: 140px; height: 140px; margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--gold) 0 12%, #333 13% 35%, #111 36% 100%);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  animation: spin 5s linear infinite paused;
  border: 2px solid var(--gold-light);
}
.vinyl.playing { animation-play-state: running; }
.vinyl .hole { width: 14px; height: 14px; border-radius: 50%; background: #ffffff; }
@keyframes spin { to { transform: rotate(360deg); } }

.music-hint { font-size: 1rem; color: var(--ink-light); font-family: var(--font-accent);}

#rsvp { background: var(--bg-soft); }

form { text-align: right; display: flex; flex-direction: column; gap: 20px; margin-top: 20px;}

label { 
  font-family: var(--font-accent); 
  font-size: 1.1rem; 
  color: var(--ink); 
}

input, select, textarea {
  width: 100%; padding: 12px 15px;
  background: var(--bg-main);
  border: 1px solid var(--gold-light);
  color: var(--ink);
  font-family: var(--font-body); 
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  background: #ffffff;
}

button {
  margin-top: 15px; 
  padding: 15px;
  background: var(--gold); 
  color: #ffffff;
  border: 0; 
  font-family: var(--font-display); 
  font-size: 1.5rem;
  cursor: pointer; 
  transition: background .3s ease;
}

button:hover { background: var(--gold-dim); }

.thanks { 
  display: none; 
  padding: 40px 20px; 
  font-family: var(--font-display); 
  font-size: 2rem; 
  color: var(--gold-dim); 
}
.thanks.show { display: block; }

footer { 
  font-family: var(--font-accent); 
  text-align: center; 
  padding: 40px; 
  font-size: 1rem; 
  color: var(--ink-light); 
  background: var(--bg-main);
  border-top: 1px solid var(--gold-light);
}