:root {
  --bg: #f7f3e9;
  --card: #fffdf7;
  --ink: #2b2417;
  --muted: #8a7d63;
  --emerald: #1f5c47;
  --gold: #b8892b;
  --line: #e7ddc7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.arabic { font-family: 'Amiri', 'Scheherazade New', serif; }
.ayah-marker { font-family: 'Amiri', serif; }

.app-title {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* atmospheric geometric backdrop */
.pattern-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(31, 92, 71, 0.08), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(184, 137, 43, 0.07), transparent 45%),
    repeating-linear-gradient(45deg, rgba(184,137,43,0.035) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(31,92,71,0.035) 0 2px, transparent 2px 22px);
}

/* featured Luqman card with shimmering gold border */
.surah-featured {
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, #d9b45a, #f3e4b0, #b8892b, #f3e4b0, #d9b45a) border-box;
  border: 2px solid transparent;
  background-size: 100% 100%, 300% 100%;
  animation: shimmer 5s linear infinite;
  box-shadow: 0 8px 30px rgba(184, 137, 43, 0.22);
}
@keyframes shimmer {
  0% { background-position: 0 0, 0% 0; }
  100% { background-position: 0 0, 300% 0; }
}

.wisdom-chip {
  background: linear-gradient(135deg, rgba(243,228,176,0.6), rgba(255,253,247,0.9));
  border: 1px solid rgba(184,137,43,0.35);
}

.crescent {
  display: inline-block;
  animation: sway 6s ease-in-out infinite;
}
@keyframes sway {
  0%,100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.verse-row { transition: background-color 0.25s ease; }
.verse-row:hover { background-color: rgba(31,92,71,0.05); }

.reader-fade { animation: fadeIn 0.35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* staggered card entrance */
@media (prefers-reduced-motion: no-preference) {
  main .grid > * {
    animation: rise 0.4s ease both;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }