@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/vazirmatn-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3efe4;
  --cream: #fbf8f1;
  --ink: #15241c;
  --muted: #5a6b62;
  --faint: #8a9790;
  --primary: #146b4a;
  --primary-hover: #0e563b;
  --primary-fg: #f7fbf8;
  --primary-soft: #e4f0e9;
  --line: #ddd4c4;
  --danger: #8f2d2d;
  --danger-soft: #f6e8e6;
  --radius: 12px;
  --phone-radius: 2.35rem;
  --shadow: 0 0 0 1px rgba(21, 36, 28, 0.06), 0 8px 24px -12px rgba(21, 36, 28, 0.12);
  --shadow-phone: 0 0 0 1px rgba(21, 36, 28, 0.18), 0 24px 48px -20px rgba(21, 36, 28, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Vazirmatn, Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
}
a { color: inherit; }
button, [role="button"], .btn { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; margin: 0; }
p { text-wrap: pretty; }

.wrap { width: min(72rem, calc(100% - 2.5rem)); margin-inline: auto; }
.site-header, .site-footer { position: relative; z-index: 2; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; }
.chip {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.brand { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 600; text-decoration: none; }
.brand-mark {
  width: 2.25rem; height: 2.25rem; border-radius: 8px;
  background: var(--primary); color: var(--primary-fg);
  display: grid; place-items: center;
}
.icon-sm { width: 1.15rem; height: 1.15rem; display: block; }
.icon { width: 1.25rem; height: 1.25rem; }

.hero {
  position: relative;
  display: grid;
  gap: 3rem;
  padding: 1rem 0 3rem;
}
.hero-copy .eyebrow { color: var(--primary); font-size: 0.9rem; font-weight: 500; margin: 0; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; margin-top: 0.75rem; max-width: 20ch; }
.hero .support { color: var(--muted); font-size: 1.05rem; max-width: 36rem; }
.hero-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.75rem; }
.hero-actions p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.pattern {
  position: absolute; inset: 0 0 auto; height: 40rem; pointer-events: none;
  background-image: url("../images/pattern.svg");
  background-size: 220px; opacity: 0.07;
}
.pattern::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgb(243 239 228 / 0.4), var(--paper));
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.25rem; border-radius: 8px; border: 0;
  font: inherit; font-weight: 500; text-decoration: none;
  background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.96); }
.btn-block { width: 100%; }
.btn-inverse { background: var(--cream); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn:disabled { opacity: 0.55; pointer-events: none; }

.section { padding: 3.5rem 0; }
.section h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 0.75rem; }
.values { list-style: none; padding: 0; margin: 2.5rem 0 0; border-block: 1px solid var(--line); }
.values li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.values li:last-child { border-bottom: 0; }
.value-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
}

.visual { background: rgb(251 248 241 / 0.7); }
.center { text-align: center; max-width: 36rem; margin-inline: auto; }
.phones { display: flex; flex-direction: column; align-items: center; gap: 3rem; margin-top: 3rem; }
.phone { width: 232px; margin: 0; }
.phone-shell {
  background: var(--ink); border-radius: var(--phone-radius); padding: 0.65rem;
  box-shadow: var(--shadow-phone);
}
.phone-screen { background: var(--cream); border-radius: 1.7rem; min-height: 460px; position: relative; overflow: hidden; padding: 2rem 0.9rem 1rem; }
.notch { position: absolute; top: 0.5rem; left: 50%; transform: translateX(-50%); width: 5rem; height: 1rem; background: rgb(21 36 28 / 0.8); border-radius: 999px; }
.phone figcaption { margin-top: 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.phone-float { animation: float 6.5s var(--ease) infinite; }
.glow {
  position: absolute; width: 16rem; height: 16rem; border-radius: 999px;
  background: rgb(20 107 74 / 0.1); filter: blur(48px); right: 50%; top: 2.5rem; transform: translateX(50%);
}
.hero-visual { position: relative; width: min(24rem, 100%); margin-inline: auto; }

.surah { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.25rem; }
.num { width: 1.75rem; height: 1.75rem; border-radius: 6px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 0.75rem; font-weight: 500; }
.ayah { border-bottom: 1px solid rgb(221 212 196 / 0.7); padding-bottom: 0.75rem; margin-bottom: 0.85rem; }
.ayah p { margin: 0; }
.ayah .ar { font-size: 0.95rem; line-height: 2; }
.ayah .fa { margin-top: 0.4rem; font-size: 0.7rem; color: var(--muted); }
.verse { display: inline-flex; width: 1rem; height: 1rem; border-radius: 999px; border: 1px solid rgb(20 107 74 / 0.3); color: var(--primary); font-size: 9px; align-items: center; justify-content: center; margin-right: 0.2rem; }
.juz { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.juz span { aspect-ratio: 1; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); border-radius: 8px; font-size: 0.8rem; font-weight: 500; }

.free { text-align: center; max-width: 40rem; margin-inline: auto; }
.check {
  width: 3rem; height: 3rem; margin-inline: auto; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); display: grid; place-items: center;
}
.final {
  background: var(--ink); color: var(--cream); border-radius: 20px;
  padding: 3rem 1.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.final p { color: rgb(251 248 241 / 0.75); max-width: 28rem; margin: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; }
.footer-row { display: flex; flex-direction: column; gap: 1rem; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { text-decoration: underline; }

.card { background: var(--cream); border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow); }
.page { min-height: 100dvh; padding: 2.5rem 0; }
.narrow { width: min(32rem, calc(100% - 2.5rem)); margin-inline: auto; }
label { display: block; font-size: 0.9rem; font-weight: 500; }
input[type="text"], input[type="password"], input[type="url"], input[type="date"], input[type="search"] {
  width: 100%; height: 3rem; margin-top: 0.4rem; border: 0; border-radius: 8px;
  background: var(--paper); padding: 0 0.75rem; font: inherit; box-shadow: var(--shadow);
}
.alert { border-radius: 8px; padding: 0.6rem 0.75rem; font-size: 0.9rem; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--primary-soft); color: var(--primary); }
.cred code { display: block; background: var(--paper); padding: 0.6rem 0.75rem; border-radius: 8px; direction: ltr; text-align: left; }

.admin-top { background: rgb(251 248 241 / 0.8); border-bottom: 1px solid var(--line); }
.admin-top .row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0 0.25rem; }
.admin-nav { display: flex; gap: 0.25rem; }
.admin-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-radius: 8px 8px 0 0;
}
.admin-nav a.active { background: var(--paper); color: var(--primary); }
.ghost { background: none; border: 0; font: inherit; color: var(--muted); min-height: 2.75rem; padding: 0 0.75rem; }
.stats { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.stat { background: var(--cream); border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.75rem; margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 11rem; direction: ltr; margin-top: 1.25rem; }
.bars i { flex: 1; background: rgb(20 107 74 / 0.8); border-radius: 2px 2px 0 0; display: block; min-height: 0; }
.platform { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.25rem; }
.track { height: 0.5rem; background: var(--paper); border-radius: 999px; overflow: hidden; margin-bottom: 0.75rem; }
.track b { display: block; height: 100%; background: var(--primary); }
.table-wrap { overflow-x: auto; background: var(--cream); border-radius: 20px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 44rem; }
th, td { text-align: start; padding: 0.75rem 1rem; border-bottom: 1px solid rgb(221 212 196 / 0.7); }
th { color: var(--muted); font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.filters .btn { min-height: 2.75rem; }

.surah-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--cream); border-radius: 12px; padding: 0.75rem 1rem;
  text-decoration: none; box-shadow: var(--shadow);
}
.surah-card:hover { box-shadow: 0 0 0 1px rgba(21,36,28,0.1), 0 12px 28px -12px rgba(21,36,28,0.16); }
.surah-grid { display: grid; gap: 0.75rem; }
.surah-names { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.surah-meta { flex: 1; min-width: 0; }
.surah-meta b { font-weight: 500; }
.ayat-card { background: var(--cream); border-radius: 20px; padding: 1.5rem 2rem; box-shadow: var(--shadow); }
.ayat-card .ayah-block { border-bottom: 1px solid rgb(221 212 196 / 0.7); padding-bottom: 1rem; margin-bottom: 1.1rem; }
.ayat-card .ayah-block:last-of-type { border: 0; margin: 0; padding: 0; }
.reader { max-width: 46rem; margin-inline: auto; }
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 0.75rem;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-radius: 8px;
}
.site-nav a:hover { background: var(--primary-soft); color: var(--primary); }

.reveal { animation: reveal 700ms var(--ease) both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (min-width: 640px) {
  .hero-actions { flex-direction: row; align-items: center; }
  .btn-block { width: auto; }
  .footer-row { flex-direction: row; justify-content: space-between; align-items: center; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .surah-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding-top: 2rem; }
  .phones { flex-direction: row; justify-content: center; align-items: end; gap: 2.5rem; }
  .phone.shift { transform: translateY(1.5rem); }
  .surah-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1280px) {
  .surah-grid.wide { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .phone-float { animation: none; }
}
