/* ================================================
   SOHAN SUN — Homepage Styles
   ================================================ */

/* ---- Star Canvas (3D scene) ---- */
#star-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Aurora Canvas (above 3D, below all UI) ---- */
#aurora-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---- Rose Galaxy Background (lower-page atmosphere) ---- */
#rose-galaxy-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  /* Fade from transparent at top to fully visible — smooth seam with aurora */
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,0.35) 18%,
    rgba(0,0,0,0.72) 38%,
    black 60%
  );
  mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,0.35) 18%,
    rgba(0,0,0,0.72) 38%,
    black 60%
  );
}

#rose-galaxy-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.44;
  will-change: transform;
  animation: galaxyDrift 90s ease-in-out infinite alternate;
}

@keyframes galaxyDrift {
  from { transform: scale(1.06) translateX(-1.5%) translateY(0%); }
  to   { transform: scale(1.00) translateX(1.5%)  translateY(-1%); }
}

/* ---- Hero Section ---- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--navbar-h) + 2rem) 2rem 4rem;
  z-index: 1;
  overflow: hidden;
}

/* Light rays */
.light-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 900px;
  height: 900px;
  pointer-events: none;
  z-index: 0;
}

.ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 400px;
  transform-origin: top center;
  background: linear-gradient(to bottom, rgba(201, 168, 76, 0.15), transparent);
  border-radius: 1px;
  animation: rayPulse 4s ease-in-out infinite;
  will-change: opacity;
}

.ray:nth-child(1)  { transform: rotate(0deg)   translateX(-50%); animation-delay: 0s; }
.ray:nth-child(2)  { transform: rotate(22.5deg) translateX(-50%); animation-delay: 0.25s; }
.ray:nth-child(3)  { transform: rotate(45deg)   translateX(-50%); animation-delay: 0.5s; }
.ray:nth-child(4)  { transform: rotate(67.5deg) translateX(-50%); animation-delay: 0.75s; }
.ray:nth-child(5)  { transform: rotate(90deg)   translateX(-50%); animation-delay: 1s; }
.ray:nth-child(6)  { transform: rotate(112.5deg) translateX(-50%); animation-delay: 1.25s; }
.ray:nth-child(7)  { transform: rotate(135deg)  translateX(-50%); animation-delay: 1.5s; }
.ray:nth-child(8)  { transform: rotate(157.5deg) translateX(-50%); animation-delay: 1.75s; }
.ray:nth-child(9)  { transform: rotate(180deg)  translateX(-50%); animation-delay: 2s; }
.ray:nth-child(10) { transform: rotate(202.5deg) translateX(-50%); animation-delay: 2.25s; }
.ray:nth-child(11) { transform: rotate(225deg)  translateX(-50%); animation-delay: 2.5s; }
.ray:nth-child(12) { transform: rotate(247.5deg) translateX(-50%); animation-delay: 2.75s; }
.ray:nth-child(13) { transform: rotate(270deg)  translateX(-50%); animation-delay: 3s; }
.ray:nth-child(14) { transform: rotate(292.5deg) translateX(-50%); animation-delay: 3.25s; }
.ray:nth-child(15) { transform: rotate(315deg)  translateX(-50%); animation-delay: 3.5s; }
.ray:nth-child(16) { transform: rotate(337.5deg) translateX(-50%); animation-delay: 3.75s; }

@keyframes rayPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(135deg, #C9A84C 0%, #F0D98A 40%, #C9A84C 60%, #8A6A1F 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  animation: goldShimmer 4s ease-in-out infinite, heroFadeUp 1s ease forwards;
  text-shadow: none;
  opacity: 0;
  transform: translateY(40px);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: var(--color-silver);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s ease forwards 0.3s;
}

@keyframes goldShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Arabic Calligraphy Block ---- */
.hero-calligraphy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s ease forwards 0.6s;
}

.arabic-name {
  font-family: var(--font-arabic);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--color-gold);
  direction: rtl;
  font-weight: 700;
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.6), 0 0 60px rgba(201, 168, 76, 0.3);
  animation: arabicGlow 3s ease-in-out infinite;
  will-change: text-shadow;
}

@keyframes arabicGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(201, 168, 76, 0.5), 0 0 40px rgba(201, 168, 76, 0.2); }
  50%       { text-shadow: 0 0 40px rgba(201, 168, 76, 0.9), 0 0 80px rgba(201, 168, 76, 0.5), 0 0 120px rgba(201, 168, 76, 0.2); }
}

/* ---- Quote Block ---- */
.hero-quote-wrap {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s ease forwards 0.9s;
  max-width: 600px;
  width: 100%;
}

.hero-quote {
  position: relative;
  padding: 2rem 2.5rem;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
}

.hero-quote::before,
.hero-quote::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
}

.hero-quote::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--color-gold);
  border-left: 2px solid var(--color-gold);
}

.hero-quote::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--color-gold);
  border-right: 2px solid var(--color-gold);
}

/* Islamic geometric corner ornaments */
.quote-corner {
  position: absolute;
  width: 20px; height: 20px;
}

.quote-corner.tr { top: -1px; right: -1px;
  border-top: 2px solid var(--color-gold);
  border-right: 2px solid var(--color-gold);
}
.quote-corner.bl { bottom: -1px; left: -1px;
  border-bottom: 2px solid var(--color-gold);
  border-left: 2px solid var(--color-gold);
}

.arabic-quote {
  font-family: var(--font-arabic);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--color-gold);
  direction: rtl;
  display: block;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

.quote-translation {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-silver);
  font-style: italic;
  display: block;
  letter-spacing: 0.05em;
}

.quote-attribution {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}

/* ---- Explore CTA ---- */
.hero-cta {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 1s ease forwards 1.2s;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: transparent;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  padding: 0.9rem 2.5rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: none;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.cta-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  color: var(--color-gold-lt);
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.25), inset 0 0 20px rgba(201, 168, 76, 0.05);
}

.cta-arrow {
  font-size: 1.1rem;
  animation: arrowBounce 2s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---- Scroll Indicator ---- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  animation: heroFadeUp 1s ease forwards 1.8s;
}

.scroll-indicator span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-silver);
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--color-gold), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
  will-change: transform;
}

@keyframes scrollDrop {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ---- About Section ---- */
#about-section {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem;
  text-align: center;
}

.about-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
  border: 1px solid rgba(201, 168, 76, 0.4);
  padding: 0.3rem 1rem;
  border-radius: 30px;
  margin-bottom: 1.8rem;
}

.about-title {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--color-ivory);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

.about-body {
  color: var(--color-silver);
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

/* ---- Domain Preview Strip ---- */
#domain-preview {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.section-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--color-ivory);
  margin-bottom: 3rem;
  letter-spacing: 0.04em;
}

.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.domain-chip {
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--color-silver);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-size: 0.85rem;
  cursor: none;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
}

.domain-chip:hover {
  background: rgba(201, 168, 76, 0.15);
  color: var(--color-gold);
  border-color: rgba(201, 168, 76, 0.6);
}

/* ---- Animated Quote Banner (Imam Ali as) ---- */
#quote-banner {
  position: fixed;
  bottom: 7rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  width: min(680px, 92vw);
}

.qb-frame {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.6rem;
  background: rgba(6, 6, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(201, 168, 76, 0.42);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.12),
    0 8px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(201, 168, 76, 0.12);
  position: relative;
}

/* Gold corner marks */
.qb-frame::before,
.qb-frame::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
}
.qb-frame::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--color-gold);
  border-left: 2px solid var(--color-gold);
}
.qb-frame::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--color-gold);
  border-right: 2px solid var(--color-gold);
}

.qb-ornament {
  color: rgba(201, 168, 76, 0.65);
  font-size: 0.65rem;
  flex-shrink: 0;
}

.qb-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--color-gold);
  direction: rtl;
  text-shadow: 0 0 18px rgba(201, 168, 76, 0.5);
  flex-shrink: 0;
}

.qb-divider {
  width: 1px;
  height: 28px;
  background: rgba(201, 168, 76, 0.28);
  flex-shrink: 0;
}

.qb-text {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  color: var(--color-ivory);
  font-style: italic;
  flex: 1;
  letter-spacing: 0.04em;
}

.qb-attr {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ---- Apparition (lower-center, below CTA button) ---- */

/* ── BEFORE: had no explicit background declarations, ::before used
   farthest-corner ellipse which left ~20% gold at element edges → visible box.
   AFTER: explicit background: none on all layers; ::before uses explicit
   ellipse 50% 46% so its edges hit gradient position ≥100% (past transparent
   at 58%) — provably 0 opacity at every element boundary. ── */

.hero-apparition {
  position: absolute;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(140px, 18vw, 230px);
  pointer-events: none;
  z-index: 1;
  background: none;
  border: none;
  box-shadow: none;
  outline: none;
  opacity: 0;
  animation: apparitionFade 2s ease forwards 1.4s;
}

.hero-apparition-inner {
  position: relative;
  background: none;
  /* Padding gives drop-shadow room to render off the img edges without clipping */
  padding: 22px;
  margin: -22px;
  animation: apparitionFloat 8s ease-in-out 3.4s infinite;
}

/* Ambient golden aura: explicit ellipse 50% 46% — edges of ::before fall at
   gradient pos ≥100% (well past transparent 58%) → absolutely zero color at
   element boundary edges, no box artifact possible. */
.hero-apparition-inner::before {
  content: '';
  position: absolute;
  inset: -40% -30%;
  background: radial-gradient(
    ellipse 50% 46% at 50% 36%,
    rgba(201, 168, 76, 0.55) 0%,
    rgba(201, 168, 76, 0.28) 22%,
    rgba(201, 168, 76, 0.07) 42%,
    transparent 58%
  );
  pointer-events: none;
  animation: auraGlow 4.5s ease-in-out infinite;
  z-index: 0;
}

@keyframes auraGlow {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50%       { opacity: 1.00; transform: scale(1.09); }
}

.hero-apparition img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  /* No opacity — mask handles all fading; avoids compositing layer edge artifact */
  /* Tighter mask: center at 40%, transparent at 76% → top/bottom/sides all
     fall beyond 76% of ellipse radii → provably transparent at element edges */
  -webkit-mask-image: radial-gradient(
    ellipse 46% 52% at 50% 40%,
    black 0%,
    rgba(0,0,0,0.90) 24%,
    rgba(0,0,0,0.55) 46%,
    rgba(0,0,0,0.12) 62%,
    transparent 76%
  );
  mask-image: radial-gradient(
    ellipse 46% 52% at 50% 40%,
    black 0%,
    rgba(0,0,0,0.90) 24%,
    rgba(0,0,0,0.55) 46%,
    rgba(0,0,0,0.12) 62%,
    transparent 76%
  );
  animation: figureGlow 4.5s ease-in-out infinite;
  will-change: filter;
}

@keyframes figureGlow {
  0%, 100% {
    filter: drop-shadow(0 0 18px rgba(201,168,76,0.55))
            drop-shadow(0 0 45px rgba(201,168,76,0.22));
  }
  50% {
    filter: drop-shadow(0 0 32px rgba(201,168,76,0.90))
            drop-shadow(0 0 80px rgba(201,168,76,0.42))
            drop-shadow(0 -8px 40px rgba(255,200,80,0.32));
  }
}

@keyframes apparitionFade {
  to { opacity: 1; }
}

@keyframes apparitionFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* Sparkles around the apparition */
.app-spark {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 218, 90, 0.95);
  pointer-events: none;
  box-shadow: 0 0 5px 2px rgba(201,168,76,0.7), 0 0 2px 1px rgba(255,240,150,0.5);
  animation: sparkGlow 3.8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes sparkGlow {
  0%, 100% { opacity: 0;   transform: translateY(0)    scale(0.5); }
  25%       { opacity: 1;   transform: translateY(-6px)  scale(1.4); }
  55%       { opacity: 0.5; transform: translateY(-12px) scale(0.9); }
  80%       { opacity: 0;   transform: translateY(-18px) scale(0.4); }
}


/* ---- Mobile ---- */
@media (max-width: 768px) {
  .hero-apparition { display: none; }

  .light-rays {
    width: 500px;
    height: 500px;
  }

  #about-section { padding: 4rem 1.5rem; }

  /* Quote banner — compact on mobile */
  #quote-banner {
    bottom: 5rem;
    width: 94vw;
  }

  .qb-frame {
    padding: 0.65rem 1rem;
    gap: 0.6rem;
  }

  /* Hide attribution and decorative ornaments on very small screens */
  .qb-attr    { display: none; }
  .qb-ornament { display: none; }

  .qb-arabic {
    font-size: 1rem;
  }

  .qb-text {
    font-size: 0.78rem;
  }

  .qb-divider {
    height: 20px;
  }
}

@media (max-width: 480px) {
  /* Stack Arabic + French vertically on very small screens */
  .qb-frame {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .qb-divider { display: none; }

  .qb-text {
    flex: 1 1 100%;
    font-size: 0.76rem;
  }
}
