/* Khatmly — khatmly.com
   Tokens mirror the app's theme (CLAUDE.md §6 in the app repo).
   Never hard-code hex outside this :root block. */

:root {
  --cream: #FAF7F0;
  --card: #FFFFFF;
  --emerald: #0E5A43;
  --emerald-2: #0B4A37;
  --emerald-soft: #E8EFEA;
  --ink: #1A241F;
  --muted: #6E776F;
  --gold: #C2A35B;
  --sage: #8FAA9E;
  --border: #ECE6DA;
  --reader-bg: #FBF7EC;
  --reading-bg: #FCF8EE;
  --reading-border: #E7D3A6;
  --reading-text: #9A6B16;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --quran: "Amiri", serif;

  --radius-card: 20px;
  --shadow-card: 0 10px 26px -18px rgba(20, 36, 31, 0.25);
  --measure: 62ch;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--emerald-soft); color: var(--emerald-2); }

a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-2); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.01em;
  color: var(--emerald);
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.wordmark .mark-ar {
  font-family: var(--quran);
  font-size: 17px;
  color: var(--gold);
  transform: translateY(-1px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

/* Scoped to .nav-quiet so it can never out-specify .btn colors. */
.site-nav .nav-quiet {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
}

.site-nav .nav-quiet:hover { color: var(--emerald); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15.5px;
  border-radius: 15px;
  padding: 15px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, color 0.18s ease;
}

.btn:active { transform: scale(0.985); }

.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-2); color: #fff; }

.btn-outline {
  background: var(--card);
  color: var(--emerald);
  border-color: var(--emerald);
}
.btn-outline:hover { background: var(--emerald-soft); color: var(--emerald-2); }

.btn-small { padding: 10px 18px; font-size: 14px; border-radius: 12px; }

/* ---------- hero ---------- */

.hero {
  padding: 84px 0 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero-ar {
  font-family: var(--quran);
  font-size: 26px;
  color: var(--gold);
  direction: rtl;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 5.2vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--emerald);
}

.hero-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 13.5px;
  color: var(--sage);
  margin-top: 16px;
}

/* ---------- khatam card (hero illustration) ---------- */

.khatam-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 26px 26px 22px;
}

.khatam-card-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.pill {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--emerald);
  background: var(--emerald-soft);
  border-radius: 999px;
  padding: 5px 12px;
  text-transform: uppercase;
}

.khatam-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}

.khatam-dedication {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}

.para-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.para-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--emerald);
  transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease;
}

.para-cell.reading {
  background: var(--reading-bg);
  border-color: var(--reading-border);
  color: var(--reading-text);
}

.para-cell.done {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.khatam-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.dot-done { background: var(--emerald); }
.dot-reading { background: var(--gold); }
.dot-open { background: transparent; border: 1.5px solid var(--sage); }

.khatam-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}

/* ---------- shared section scaffolding ---------- */

.section { padding: 76px 0; }

.section + .section { border-top: 1px solid var(--border); }

.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  max-width: 24ch;
}

.section-intro {
  color: var(--muted);
  font-size: 17px;
  max-width: var(--measure);
  margin-bottom: 44px;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 26px;
}

.step-num {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 14px;
}

.step h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 10px;
}

.step p { font-size: 15px; color: var(--muted); }

/* ---------- features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  background: var(--reader-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 24px;
}

.feature .f-ar {
  font-family: var(--quran);
  font-size: 24px;
  color: var(--emerald);
  direction: rtl;
  text-align: start;
  margin-bottom: 12px;
  display: block;
}

.feature h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  margin-bottom: 8px;
}

.feature p { font-size: 14.5px; color: var(--muted); }

/* ---------- refusals ---------- */

.refusals-section { background: var(--emerald); }
.refusals-section .section-eyebrow { color: var(--gold); }
.refusals-section h2 { color: #fff; }
.refusals-section .section-intro { color: var(--emerald-soft); }

.refusals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.refusal {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-card);
  padding: 24px 24px 22px;
}

.refusal h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: #fff;
  margin-bottom: 8px;
}

.refusal h3 s {
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}

.refusal p {
  font-size: 14.5px;
  color: var(--emerald-soft);
}

/* ---------- CTA ---------- */

.cta-section { text-align: center; }

.cta-section h2 { margin-inline: auto; }

.cta-section .section-intro {
  margin-inline: auto;
  margin-bottom: 34px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 44px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  color: var(--emerald);
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
}

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

.footer-fine {
  width: 100%;
  font-size: 12.5px;
  color: var(--sage);
  margin-top: 6px;
}

/* ---------- legal pages ---------- */

.legal {
  padding: 64px 0 90px;
}

.legal article {
  max-width: 70ch;
}

.legal h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.legal .legal-date {
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 38px;
}

.legal h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  margin: 40px 0 12px;
}

.legal p, .legal li {
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 12px;
}

.legal ul { padding-inline-start: 22px; margin-bottom: 12px; }
.legal li { margin-bottom: 8px; }

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

/* ---------- open-in-app page ---------- */

.open-page {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

.open-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 44px 38px;
  max-width: 420px;
}

.open-card .f-ar {
  font-family: var(--quran);
  font-size: 30px;
  color: var(--gold);
  display: block;
  margin-bottom: 16px;
}

.open-card h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  margin-bottom: 10px;
}

.open-card p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 26px;
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .hero { padding: 56px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero-sub { max-width: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .refusals { grid-template-columns: 1fr; }
  .section { padding: 58px 0; }
  .site-nav .nav-quiet { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .para-grid { gap: 6px; }
  .para-cell { border-radius: 10px; font-size: 12px; }
  .khatam-card { padding: 20px 18px 16px; }
  .legend { gap: 10px; font-size: 11px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .para-cell { transition: none; }
  .btn { transition: none; }
}
