:root {
  --green-950: #06251c;
  --green-900: #0b3d2e;
  --green-800: #12543f;
  --green-700: #1a6b50;
  --gold-500: #c9a227;
  --gold-400: #e0c15a;
  --gold-300: #f0d98a;
  --cream: #f8f4ea;
  --cream-dark: #efe6d4;
  --ink: #1a241f;
  --muted: #5c6b64;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(6, 37, 28, 0.14);
  --radius: 18px;
  --font-en: "Source Sans 3", "Segoe UI", sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-en);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.pattern {
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201, 162, 39, 0.08), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(18, 84, 63, 0.08), transparent 35%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L36 24L60 30L36 36L30 60L24 36L0 30L24 24Z' fill='none' stroke='%23c9a227' stroke-opacity='0.12' stroke-width='1'/%3E%3C/svg%3E");
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 37, 28, 0.94);
  backdrop-filter: blur(12px);
  color: var(--cream);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold-500);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-400);
  font-family: var(--font-ar);
  font-size: 1.15rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--gold-300);
}

.logo-text span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--cream);
  transition: 0.2s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(201, 162, 39, 0.18);
  color: var(--gold-300);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gold-500);
  color: var(--gold-300);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background:
    linear-gradient(160deg, rgba(6, 37, 28, 0.92), rgba(18, 84, 63, 0.78)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 8L48 32L72 40L48 48L40 72L32 48L8 40L32 32Z' fill='none' stroke='%23c9a227' stroke-opacity='0.18'/%3E%3C/svg%3E");
  color: var(--cream);
  padding: 5.5rem 0 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bismillah {
  font-family: var(--font-ar);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold-300);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: 0.03em;
}

.hero p {
  max-width: 620px;
  margin: 1rem auto 1.8rem;
  opacity: 0.9;
  font-size: 1.1rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.chip {
  border: 1px solid rgba(201, 162, 39, 0.45);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: inherit;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  color: var(--green-950);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}

.btn-outline {
  border-color: var(--gold-400);
  color: var(--gold-300);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(201, 162, 39, 0.12);
}

.btn-row {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2.2rem;
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--green-900);
}

.ornament {
  width: 72px;
  height: 8px;
  margin: 0.7rem auto 0.6rem;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.section-title p {
  color: var(--muted);
}

.grid-3,
.grid-2,
.grid-4,
.grid-5 {
  display: grid;
  gap: 1.2rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(18, 84, 63, 0.08);
}

.card h3 {
  font-family: var(--font-display);
  color: var(--green-800);
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-900);
  color: var(--gold-300);
  margin-bottom: 0.9rem;
  font-family: var(--font-ar);
  font-size: 1.2rem;
}

.ayah-card {
  text-align: center;
  background: linear-gradient(180deg, var(--green-900), var(--green-800));
  color: var(--cream);
}

.ayah-ar {
  font-family: var(--font-ar);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 2;
  color: var(--gold-300);
  margin-bottom: 0.8rem;
}

.ayah-en {
  font-style: italic;
  opacity: 0.92;
}

.ayah-ref {
  margin-top: 0.8rem;
  color: var(--gold-400);
  font-size: 0.9rem;
}

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
}

.prayer-item {
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid rgba(18, 84, 63, 0.1);
}

.prayer-item.next {
  background: var(--green-900);
  color: var(--cream);
  border-color: var(--gold-500);
}

.prayer-item strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 0.25rem;
}

.page-hero {
  padding: 3.2rem 0 2.2rem;
  background: var(--green-900);
  color: var(--cream);
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
}

.search-bar,
.toolbar {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1.2rem 0 1.5rem;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(18, 84, 63, 0.2);
  background: var(--white);
  color: var(--ink);
  min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--gold-500);
  outline-offset: 1px;
}

.search-bar input {
  flex: 1;
}

.surah-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}

.surah-btn {
  text-align: left;
  background: var(--white);
  border: 1px solid rgba(18, 84, 63, 0.1);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 20px rgba(6, 37, 28, 0.06);
}

.surah-btn:hover {
  border-color: var(--gold-500);
}

.surah-num {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green-900);
  color: var(--gold-300);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.surah-meta {
  flex: 1;
}

.surah-meta small {
  color: var(--muted);
}

.ar-name {
  font-family: var(--font-ar);
  font-size: 1.15rem;
}

.reader {
  display: none;
  scroll-margin-top: 96px;
}

.reader.visible {
  display: block;
}

.ayah-row {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(18, 84, 63, 0.1);
}

.ayah-row .ar {
  font-family: var(--font-ar);
  font-size: 1.55rem;
  line-height: 2.1;
  direction: rtl;
  text-align: right;
}

.ayah-row .en {
  color: var(--muted);
  margin-top: 0.4rem;
}

.ayah-n {
  color: var(--gold-500);
  font-size: 0.8rem;
}

.hadith-ar {
  font-family: var(--font-ar);
  font-size: 1.4rem;
  direction: rtl;
  text-align: right;
  line-height: 2;
  margin-bottom: 0.8rem;
}

.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}

.name-card {
  background: var(--white);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
  border: 1px solid rgba(18, 84, 63, 0.1);
}

.name-card .ar {
  font-family: var(--font-ar);
  font-size: 1.3rem;
  color: var(--green-800);
}

.name-card small {
  color: var(--muted);
}

.site-footer {
  background: var(--green-950);
  color: var(--cream);
  padding: 2.2rem 0;
  text-align: center;
  border-top: 1px solid rgba(201, 162, 39, 0.3);
}

.site-footer p {
  opacity: 0.85;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

.social-links a {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--gold-300);
  border: 1px solid rgba(240, 217, 138, 0.45);
  border-radius: 50%;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.social-links svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--white);
  background: rgba(201, 162, 39, 0.18);
  border-color: var(--gold-300);
  outline: none;
}

.muted {
  color: var(--muted);
}

.status {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}

.error {
  color: #9b2c2c;
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4,
  .grid-5,
  .prayer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    inset: 76px 1rem auto;
    background: var(--green-950);
    flex-direction: column;
    padding: 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 162, 39, 0.3);
  }

  .nav.open {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .prayer-grid {
    grid-template-columns: 1fr;
  }
}
