/* ═══════════════════════════════════════════════════
   Greeting Mode Styles
   ═══════════════════════════════════════════════════ */

/* --- Theme backgrounds --- */

body.greeting-morning #greeting-page {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(200, 100, 30, 0.35) 0%, rgba(160, 70, 20, 0.15) 30%, transparent 55%),
    radial-gradient(ellipse at 20% 70%, rgba(180, 80, 20, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 85%, rgba(220, 120, 40, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 40%, rgba(80, 40, 15, 0.4) 0%, transparent 60%),
    linear-gradient(to top, #2E1508 0%, #1A0C04 40%, #0F0803 70%, #0A0502 100%);
}

body.greeting-afternoon #greeting-page {
  background:
    radial-gradient(ellipse at 50% -5%, rgba(240, 180, 50, 0.3) 0%, rgba(200, 140, 30, 0.1) 30%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(220, 160, 40, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 30% 50%, rgba(180, 120, 20, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, rgba(100, 60, 15, 0.3) 0%, transparent 55%),
    linear-gradient(to bottom, #2A1808 0%, #1A1005 40%, #100A03 70%, #0A0702 100%);
}

body.greeting-night #greeting-page {
  background:
    radial-gradient(ellipse at 25% 15%, rgba(80, 60, 160, 0.3) 0%, rgba(50, 40, 120, 0.1) 30%, transparent 50%),
    radial-gradient(ellipse at 75% 55%, rgba(50, 80, 180, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(30, 40, 100, 0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 30%, rgba(40, 30, 90, 0.25) 0%, transparent 50%),
    linear-gradient(to bottom, #0C0E28 0%, #080A1E 35%, #050818 65%, #030510 100%);
}

/* --- Page layout --- */

#greeting-page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 24px;
  overflow: hidden;
}

#greeting-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* --- Atmospheric layers --- */

.greeting-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Morning: warm sunrise glow */
body.greeting-morning .greeting-atmosphere::before {
  content: '';
  position: absolute;
  bottom: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 160%;
  height: 70%;
  background:
    radial-gradient(ellipse at 50% 90%, rgba(255, 140, 40, 0.2) 0%, transparent 40%),
    radial-gradient(ellipse at 35% 100%, rgba(200, 80, 20, 0.12) 0%, transparent 35%),
    radial-gradient(ellipse at 65% 95%, rgba(240, 160, 50, 0.1) 0%, transparent 35%);
  animation: sunriseBreath 6s ease-in-out infinite;
}

body.greeting-morning .greeting-atmosphere::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(255, 160, 50, 0.25) 30%, rgba(255, 180, 80, 0.45) 50%, rgba(255, 160, 50, 0.25) 70%, transparent 95%);
  box-shadow: 0 0 60px 25px rgba(255, 140, 40, 0.1), 0 0 120px 40px rgba(200, 100, 30, 0.06);
}

/* Afternoon: golden light from top */
body.greeting-afternoon .greeting-atmosphere::before {
  content: '';
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 60%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240, 180, 50, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 15%, rgba(200, 140, 30, 0.1) 0%, transparent 35%),
    radial-gradient(ellipse at 60% 10%, rgba(220, 160, 40, 0.08) 0%, transparent 35%);
  animation: goldenPulse 8s ease-in-out infinite;
}

body.greeting-afternoon .greeting-atmosphere::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, rgba(240, 180, 50, 0.2) 30%, rgba(240, 192, 80, 0.35) 50%, rgba(240, 180, 50, 0.2) 70%, transparent 90%);
  box-shadow: 0 0 50px 20px rgba(240, 180, 50, 0.06);
}

/* Night: aurora + nebula */
body.greeting-night .greeting-atmosphere::before {
  content: '';
  position: absolute;
  top: 0;
  left: -20%;
  width: 140%;
  height: 45%;
  background: linear-gradient(
    120deg,
    transparent 15%,
    rgba(70, 110, 200, 0.07) 30%,
    rgba(100, 70, 180, 0.09) 42%,
    rgba(60, 90, 170, 0.06) 55%,
    rgba(80, 50, 160, 0.05) 65%,
    transparent 80%
  );
  animation: auroraDrift 12s ease-in-out infinite;
  filter: blur(40px);
}

body.greeting-night .greeting-atmosphere::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: radial-gradient(ellipse at 50% 100%, rgba(30, 40, 100, 0.2) 0%, transparent 60%);
}

/* --- Night moon & stars --- */

.greeting-moon {
  position: fixed;
  top: 7%;
  right: 10%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 10px -6px 0 0 #D8E4F8;
  opacity: 0;
  animation: moonGlow 4s ease-in-out infinite, greetFadeIn 2s 0.5s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}

.greeting-stars {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.greeting-stars .star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #D8E4F8;
  border-radius: 50%;
  animation: twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}

/* Shooting stars */
.shooting-star {
  position: fixed;
  pointer-events: none;
  z-index: 3;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 4px 1px rgba(200, 220, 255, 0.6);
}

.shooting-star.active {
  animation: shootingStar 1s ease-in forwards;
}

/* --- Hero name display --- */

.greeting-name-wrap {
  position: relative;
  z-index: 10;
  text-align: center;
  margin-bottom: 8px;
}

.greeting-time-label {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(14px, 2.5vw, 20px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--g-sub);
  opacity: 0;
  animation: greetFadeIn 1.5s 0.3s ease-out forwards;
  margin-bottom: 12px;
}

.greeting-name {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(48px, 10vw, 96px);
  color: var(--g-name);
  line-height: 1.1;
  opacity: 0;
  animation: greetNameReveal 1.8s 0.6s forwards;
  text-shadow: 0 0 40px var(--g-name-glow), 0 0 80px var(--g-name-glow);
  position: relative;
}

.greeting-name::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--g-accent), transparent);
  animation: lineExpand 1.2s 2s forwards;
}

.greeting-time-heading {
  font-family: 'Amiri', serif;
  font-style: italic;
  font-size: clamp(16px, 3vw, 24px);
  color: var(--g-sub);
  opacity: 0;
  animation: greetFadeIn 1.5s 1.2s ease-out forwards;
  margin-top: 10px;
  margin-bottom: 24px;
}

/* --- Greeting card --- */

.greeting-card {
  position: relative;
  z-index: 10;
  max-width: min(580px, 85vw);
  width: 100%;
  padding: 44px 40px 36px;
  background: var(--g-card-bg);
  border: 1px solid transparent;
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--g-card-glow);
  text-align: center;
  opacity: 0;
  animation: cardEntrance 1s 1.5s ease-out forwards;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* Animated gradient border glow */
.greeting-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    transparent 20%,
    var(--g-accent) 35%,
    var(--g-name) 50%,
    var(--g-accent) 65%,
    transparent 80%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.35;
  animation: borderRotate 6s linear infinite;
  pointer-events: none;
  z-index: -1;
}

/* Inner decorative border */
.greeting-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--g-card-inner-border);
  border-radius: 16px;
  pointer-events: none;
}

.greeting-card .geo-corner { opacity: 0.06; }

/* --- Card content --- */

.greeting-message {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 2.3vw, 21px);
  color: var(--g-body);
  line-height: 1.85;
  font-weight: 300;
  margin-bottom: 28px;
  opacity: 0;
  animation: greetFadeUp 0.8s 1.8s ease-out forwards;
}

.greeting-divider {
  width: 100%;
  max-width: 260px;
  height: 18px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: greetFadeUp 0.6s 2s ease-out forwards;
}

.greeting-divider::before,
.greeting-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--g-divider), transparent);
  opacity: 0.45;
}

.greeting-divider .diamond {
  width: 5px;
  height: 5px;
  background: var(--g-divider);
  transform: rotate(45deg);
  margin: 0 12px;
  opacity: 0.6;
}

/* --- Ayah block --- */

.ayah-block {
  margin-bottom: 28px;
  opacity: 0;
  animation: greetFadeUp 0.8s 2.2s ease-out forwards;
}

.ayah-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(20px, 3.5vw, 30px);
  color: var(--g-arabic);
  direction: rtl;
  line-height: 2;
  margin-bottom: 12px;
  font-weight: 400;
}

.ayah-translation {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--g-body);
  line-height: 1.7;
  font-style: italic;
  font-weight: 300;
  margin-bottom: 6px;
}

.ayah-reference {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  color: var(--g-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.8;
}

/* --- Prayer block --- */

.prayer-block {
  margin-bottom: 24px;
  opacity: 0;
  animation: greetFadeUp 0.8s 2.5s ease-out forwards;
}

.prayer-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(18px, 3vw, 26px);
  color: var(--g-arabic);
  direction: rtl;
  line-height: 2;
  margin-bottom: 10px;
  font-weight: 400;
}

.prayer-translation {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--g-body);
  line-height: 1.7;
  font-style: italic;
  font-weight: 300;
  opacity: 0.9;
}

/* --- Personal note --- */

.personal-note {
  margin-bottom: 20px;
  opacity: 0;
  animation: greetFadeUp 0.8s 2.8s ease-out forwards;
}

.personal-note-text {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--g-heading);
  line-height: 1.7;
  margin-bottom: 6px;
}

.personal-note-sign {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: var(--g-accent);
  letter-spacing: 2px;
  font-style: italic;
  opacity: 0.7;
}

.greeting-footer {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--g-footer);
  letter-spacing: 4px;
  margin-top: 8px;
  opacity: 0;
  animation: greetFadeUp 0.6s 3.1s ease-out forwards;
  text-transform: uppercase;
  font-weight: 400;
}

/* --- Floating decorative elements --- */

.greeting-flower {
  position: fixed;
  font-size: 22px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  animation: flowerBob 5s ease-in-out infinite, flowerFadeIn 1.5s ease-out forwards;
  animation-delay: var(--fd), var(--fd);
}
