/* ================================================
   SOHAN SUN — Global Styles
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Amiri:ital,wght@0,400;0,700;1,400&family=Noto+Naskh+Arabic:wght@400;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --color-bg:      #080810;
  --color-bg2:     #0D0D1F;
  --color-gold:    #C9A84C;
  --color-gold-lt: #E8C97A;
  --color-gold-dk: #8A6A1F;
  --color-ivory:   #F5F0E8;
  --color-silver:  #A8B8C8;
  --color-crimson: #8B1A1A;
  --color-navy:    #07071A;
  --color-purple:  #2D1B69;
  --color-muted:   #4A4A6A;

  --font-title:  'Cinzel Decorative', serif;
  --font-body:   'EB Garamond', serif;
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', serif;

  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --navbar-h: 72px;
  --border-gold: 1px solid rgba(201, 168, 76, 0.3);
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-ivory);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover { color: var(--color-gold-lt); }

img { max-width: 100%; }

ul { list-style: none; }

/* ---- Custom Cursor ---- */
.custom-cursor {
  position: fixed;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: transform;
}

.custom-cursor svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.8));
  transition: transform 0.25s var(--transition-bounce);
}

.custom-cursor.hovering svg {
  transform: scale(1.8);
  filter: drop-shadow(0 0 10px rgba(201, 168, 76, 1));
}

/* ---- Loading Screen ---- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000008;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 1s var(--transition-smooth);
  will-change: transform;
}

#loading-screen.loaded {
  transform: translateY(-100%);
}

.mandala-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 2.5rem;
}

.mandala-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.6);
  top: 50%; left: 50%;
  transform-origin: center center;
}

.mandala-ring:nth-child(1) {
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  border-color: var(--color-gold);
  animation: mandalaR 3s linear infinite;
}
.mandala-ring:nth-child(2) {
  width: 100px; height: 100px;
  margin: -50px 0 0 -50px;
  border-width: 1px;
  border-color: rgba(201,168,76,0.7);
  animation: mandalaR 5s linear infinite reverse;
}
.mandala-ring:nth-child(3) {
  width: 140px; height: 140px;
  margin: -70px 0 0 -70px;
  border-width: 1px;
  border-color: rgba(201,168,76,0.5);
  animation: mandalaR 7s linear infinite;
}
.mandala-ring:nth-child(4) {
  width: 180px; height: 180px;
  margin: -90px 0 0 -90px;
  border-width: 1px;
  border-color: rgba(201,168,76,0.35);
  animation: mandalaR 9s linear infinite reverse;
}
.mandala-ring:nth-child(5) {
  width: 216px; height: 216px;
  margin: -108px 0 0 -108px;
  border-width: 1px;
  border-color: rgba(201,168,76,0.2);
  animation: mandalaR 12s linear infinite;
}

.mandala-star {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: mandalaR 6s linear infinite;
}

.mandala-petals {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: center;
}

.mandala-petal {
  position: absolute;
  width: 8px;
  height: 30px;
  background: linear-gradient(to bottom, var(--color-gold), transparent);
  border-radius: 50% 50% 0 0;
  transform-origin: 50% 100%;
  left: -4px; top: -100px;
}

.loading-arabic {
  font-family: var(--font-arabic);
  font-size: 1.8rem;
  color: var(--color-gold);
  text-align: center;
  direction: rtl;
  letter-spacing: 0.05em;
  animation: fadeIn 1.5s ease forwards, loadingGlow 2s ease-in-out infinite 1s;
  opacity: 0;
  animation-delay: 0.8s, 0.8s;
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.7), 0 0 60px rgba(201, 168, 76, 0.3);
}

@keyframes loadingGlow {
  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 50px rgba(201,168,76,1), 0 0 100px rgba(201,168,76,0.5), 0 0 150px rgba(201,168,76,0.2); }
}

@keyframes mandalaR {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

/* ---- Navbar ---- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 1000;
  transition: background 0.4s ease, border-bottom 0.4s ease, backdrop-filter 0.4s ease;
  background: transparent;
}

#navbar.scrolled {
  background: rgba(8, 8, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: var(--border-gold);
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--color-gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.5);
  transition: text-shadow 0.3s ease;
}

.nav-logo:hover {
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.9), 0 0 60px rgba(201, 168, 76, 0.4);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-silver);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-gold);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.nav-mobile {
  position: fixed;
  top: var(--navbar-h);
  left: 0; right: 0;
  background: rgba(8, 8, 16, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: var(--border-gold);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(-120%);
  transition: transform 0.4s var(--transition-smooth);
  z-index: 999;
}

.nav-mobile.open {
  transform: translateY(0);
}

.nav-mobile a {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--color-silver);
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.nav-mobile a:hover { color: var(--color-gold); }

/* ---- Section Divider ---- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem auto;
  max-width: 400px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold-dk), transparent);
}

.section-divider-icon {
  color: var(--color-gold);
  font-size: 1.2rem;
}

/* ---- Scroll Animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--transition-smooth), transform 0.7s var(--transition-smooth);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade {
  opacity: 0;
  transition: opacity 0.9s var(--transition-smooth);
}

.animate-fade.visible {
  opacity: 1;
}

/* ---- Footer ---- */
#footer {
  background: #030309;
  border-top: var(--border-gold);
  padding: 4rem 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

#footer-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--color-gold);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

.footer-brand p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.footer-arabic-blessing {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--color-gold);
  direction: rtl;
  opacity: 0.8;
}

.footer-links h4 {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--color-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.footer-links ul { display: flex; flex-direction: column; gap: 0.6rem; }

.footer-links a {
  color: var(--color-muted);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover { color: var(--color-silver); }

.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-copy {
  color: var(--color-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ---- Music Player ---- */
#music-player {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(8, 8, 16, 0.9);
  border: var(--border-gold);
  border-radius: 50px;
  padding: 0.6rem 1rem;
  backdrop-filter: blur(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  transform: translateY(20px);
}

#music-player.visible {
  opacity: 1;
  transform: translateY(0);
}

#music-player.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.music-btn {
  background: none;
  border: none;
  color: var(--color-gold);
  cursor: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.music-btn:hover { transform: scale(1.15); }

.music-btn svg { width: 18px; height: 18px; fill: var(--color-gold); }

.track-name {
  font-size: 0.75rem;
  color: var(--color-silver);
  letter-spacing: 0.05em;
  white-space: nowrap;
  font-family: var(--font-body);
  font-style: italic;
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 3px;
  background: var(--color-muted);
  border-radius: 3px;
  outline: none;
  cursor: none;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-gold);
  cursor: none;
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.6);
}

/* ---- Audio Modal ---- */
#audio-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#audio-modal.show {
  opacity: 1;
  pointer-events: all;
}

.audio-modal-box {
  background: rgba(13, 13, 31, 0.96);
  border: var(--border-gold);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 100%;
  backdrop-filter: blur(20px);
  text-align: center;
  transform: translateY(30px);
  transition: transform 0.5s var(--transition-bounce);
}

#audio-modal.show .audio-modal-box {
  transform: translateY(0);
}

.audio-modal-box h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-gold);
  margin-bottom: 0.8rem;
  letter-spacing: 0.08em;
}

.audio-modal-box p {
  color: var(--color-silver);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.audio-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-gold {
  background: linear-gradient(135deg, var(--color-gold-dk), var(--color-gold));
  color: var(--color-bg);
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-muted);
  padding: 0.6rem 1.8rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover { color: var(--color-silver); border-color: var(--color-silver); }

/* ---- Dim Overlay (brightness control layer) ---- */
#dim-overlay {
  position: fixed;
  inset: 0;
  z-index: 9985;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  transition: background 0.4s ease;
}

/* ---- Brightness Widget ---- */
#brightness-widget {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9988;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

#brightness-btn {
  background: rgba(8, 8, 16, 0.88);
  border: var(--border-gold);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(201, 168, 76, 0.75);
  cursor: none;
  backdrop-filter: blur(10px);
  transition: color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpIn 0.6s ease forwards 3.5s;
}

#brightness-btn:hover {
  color: var(--color-gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.3);
  transform: scale(1.1);
}

#brightness-btn svg { width: 16px; height: 16px; }

#brightness-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(8, 8, 16, 0.92);
  border: var(--border-gold);
  border-radius: 30px;
  padding: 0.45rem 0.9rem;
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateX(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

#brightness-panel.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: all;
}

.bw-icon-dark, .bw-icon-light {
  font-size: 0.75rem;
  color: var(--color-muted);
  flex-shrink: 0;
}
.bw-icon-light { color: rgba(201, 168, 76, 0.7); }

#brightness-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-muted) 0%, rgba(201,168,76,0.6) 100%);
  border-radius: 3px;
  outline: none;
  cursor: none;
}

#brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-gold);
  cursor: none;
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.6);
}

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

/* Mobile: hide label text, keep widget compact */
@media (max-width: 768px) {
  #brightness-widget { bottom: 1rem; left: 1rem; }
  #brightness-slider { width: 70px; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  #music-player {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 0.8rem;
  }

  .track-name { display: none; }
}
