:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-2: #7c3aed;
  --gold: #d97706;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  --topbar-bg: rgba(255, 255, 255, 0.72);
  --radius: 24px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: rgba(17, 24, 39, 0.76);
  --surface-strong: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #2dd4bf;
  --primary-2: #a78bfa;
  --gold: #fbbf24;
  --border: rgba(226, 232, 240, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --topbar-bg: rgba(11, 16, 32, 0.74);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(20, 184, 166, 0.16), transparent 30rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(45, 212, 191, 0.65);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand b {
  color: var(--primary);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.hero,
.panel {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  min-height: calc(100dvh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 48px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions,
.card-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.22);
}

.btn.ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn.small {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 14px;
}

.hero-card,
.panel,
.sholawat-card,
.playlist,
.asma-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: clamp(28px, 5vw, 46px);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.25), transparent 58%);
  pointer-events: none;
}

.hero-card > * {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  color: var(--primary);
  font-weight: 900;
}

.hero-card h2 {
  margin: 18px 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.mini-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.mini-stats span {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
}

.mini-stats strong {
  color: var(--text);
  font-size: 1.35rem;
}

.panel {
  scroll-margin-top: 90px;
  padding: 34px 0 56px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 300px);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
}

.search input,
select {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 13px;
  background: var(--surface-strong);
  color: var(--text);
}

.search input {
  width: 100%;
  border: 0;
  padding: 0;
  outline: 0;
}

select {
  min-width: 150px;
}

.stats {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.asma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.asma-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 20px;
  border-radius: var(--radius);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.asma-card:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 184, 166, 0.45);
}

.asma-card.is-fav {
  border-color: rgba(217, 119, 6, 0.55);
}

.asma-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -60px;
  bottom: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 65%);
}

.number {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-strong);
  color: var(--gold);
  font-size: 1.15rem;
}

.asma-card h3 {
  margin: 16px 0 6px;
  direction: rtl;
  font-family: "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 1.2;
}

.latin {
  margin: 0;
  color: var(--primary);
  font-weight: 900;
}

.arti {
  margin: 8px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.detail-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-weight: 900;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 18px;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.sholawat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.sholawat-card,
.playlist {
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
}

.arabic-text {
  margin: 18px 0;
  direction: rtl;
  font-family: "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 2.25;
}

.meaning {
  color: var(--muted);
  font-weight: 650;
}

.playlist h3 {
  margin: 0 0 14px;
}

.sholawat-list {
  display: grid;
  gap: 10px;
}

.sholawat-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
}

.sholawat-item.active {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.1);
}

.sholawat-item strong,
.sholawat-item span {
  display: block;
}

.sholawat-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 20px;
  align-items: start;
}

.about h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.about p {
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-list div {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 800;
}

.feature-list span {
  color: var(--primary);
  margin-right: 8px;
}

footer {
  padding: 34px 16px 46px;
  text-align: center;
  color: var(--muted);
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: min(86dvh, 760px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 900;
}

.modal-card h2 {
  margin: 0 44px 8px 0;
  direction: rtl;
  font-family: "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  line-height: 1.1;
}

.modal-latin {
  color: var(--primary);
  font-weight: 900;
}

.modal-meaning {
  margin: 18px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.13);
}

.meta-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
  margin: 18px 0;
}

.meta-list dt {
  color: var(--muted);
  font-weight: 900;
}

.meta-list dd {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .section-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .search,
  select,
  .btn.small {
    width: 100%;
  }

  .sholawat-layout,
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 10px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero,
  .panel {
    width: min(100% - 24px, 1180px);
  }

  .hero-actions,
  .card-actions,
  .modal-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}