/* Mizan on the web: tokens copied from https://claude.ai/artifact/GiJH6fcgLqNXa1Qj1g78vi (project/tokens.json).
   Black, white and greys, in both themes. Every direction is logical, so i18n.js flipping dir is enough.
   `pnpm fonts` copies Thmanyah's files to fonts/thmanyah, unmodified. */
@font-face { font-family: "Scheherazade New"; src: url("fonts/ScheherazadeNew-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("fonts/thmanyah/thmanyahserifdisplay-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("fonts/thmanyah/thmanyahserifdisplay-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("fonts/thmanyah/thmanyahserifdisplay-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("fonts/thmanyah/thmanyahserifdisplay-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("fonts/thmanyah/thmanyahserifdisplay-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url("fonts/thmanyah/thmanyahseriftext-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url("fonts/thmanyah/thmanyahseriftext-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url("fonts/thmanyah/thmanyahseriftext-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url("fonts/thmanyah/thmanyahseriftext-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url("fonts/thmanyah/thmanyahseriftext-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah/thmanyahsans-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah/thmanyahsans-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah/thmanyahsans-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah/thmanyahsans-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah/thmanyahsans-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --surface: #fff; --surface-raised: #fff; --surface-sunken: #f5f5f5; --feature: #f2f2f2;
  --line: #e5e5e5; --line-strong: #8a8a8a;
  --ink: #0a0a0a; --ink-muted: #595959;
  --primary: #0a0a0a; --primary-hover: #2e2e2e; --primary-soft: #ededed; --on-primary: #fff;
  --primary-deep: #0a0a0a; --deep-hover: #262626; --on-deep: #fafafa; --on-deep-muted: #b3b3b3;
  --ornament: #a3a3a3; --ornament-strong: #525252; --ornament-soft: #f5f5f5;
  --app-ring: #0a0a0a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px #0a0a0a;

  --font-head: "Thmanyah Serif Display", "thmanyah serif display", "Noto Naskh Arabic", Georgia, serif;
  --font-text: "Thmanyah Serif Text", "thmanyah serif text", "Noto Naskh Arabic", Georgia, serif;
  --font-digital: "Thmanyah Sans", "thmanyah sans", Almarai, Tahoma, system-ui, sans-serif;
  --font-quran: "Scheherazade New", "Noto Naskh Arabic", serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --radius-xs: 4px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 999px; --radius-icon: 22.5%;
  --control-sm: 36px; --control-md: 44px; --content-max: 1200px; --sitebar: 72px;
}
/* dark: the system choice unless the visitor picked light; data-theme is set by the theme button (i18n.js) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --surface: #0a0a0a; --surface-raised: #141414; --surface-sunken: #000; --feature: #171717;
  --line: #262626; --line-strong: #737373;
  --ink: #fafafa; --ink-muted: #a3a3a3;
  --primary: #fafafa; --primary-hover: #d4d4d4; --primary-soft: #262626; --on-primary: #0a0a0a;
  --primary-deep: #1f1f1f; --deep-hover: #2e2e2e;
  --ornament: #595959; --ornament-strong: #b3b3b3; --ornament-soft: #1c1c1c;
  --app-ring: #404040;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 8px 28px rgba(0,0,0,.6);
  --focus-ring: 0 0 0 2px #0a0a0a, 0 0 0 4px #fafafa;
} }
:root[data-theme="dark"] {
  --surface: #0a0a0a; --surface-raised: #141414; --surface-sunken: #000; --feature: #171717;
  --line: #262626; --line-strong: #737373;
  --ink: #fafafa; --ink-muted: #a3a3a3;
  --primary: #fafafa; --primary-hover: #d4d4d4; --primary-soft: #262626; --on-primary: #0a0a0a;
  --primary-deep: #1f1f1f; --deep-hover: #2e2e2e;
  --ornament: #595959; --ornament-strong: #b3b3b3; --ornament-soft: #1c1c1c;
  --app-ring: #404040;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 8px 28px rgba(0,0,0,.6);
  --focus-ring: 0 0 0 2px #0a0a0a, 0 0 0 4px #fafafa;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 16px/28px var(--font-digital); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 720px) { .wrap { padding-inline: var(--space-5); } }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.mz-mursala { font-feature-settings: "salt" 1; }

/* star-and-cross tile (PatternPanel), coloured through a mask so it follows the theme. Never behind Qur'an text. */
.khatam { position: absolute; inset: 0; background: currentColor; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpolygon fill='none' stroke='black' points='24,0 31,7 41,7 41,17 48,24 41,31 41,41 31,41 24,48 17,41 7,41 7,31 0,24 7,17 7,7 17,7'/%3E%3C/svg%3E") 0 0/48px 48px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpolygon fill='none' stroke='black' points='24,0 31,7 41,7 41,17 48,24 41,31 41,41 31,41 24,48 17,41 7,41 7,31 0,24 7,17 7,7 17,7'/%3E%3C/svg%3E") 0 0/48px 48px; }

/* SiteHeader */
.nav { background: var(--surface); border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; } }
.nav .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-6); min-height: var(--sitebar); padding-block: var(--space-3); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: var(--radius-icon); box-shadow: 0 0 0 1px var(--app-ring); }
.brand .names { display: flex; flex-direction: column; }
.brand .app { font: 700 19px/28px var(--font-head); }
.brand .org { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-5); list-style: none; margin: 0; padding: 0; }
.nav ul a { display: block; padding-block: var(--space-2); color: var(--ink); text-decoration: none; font: 500 15px/24px var(--font-digital); }
.nav ul a:hover { color: var(--ink-muted); }
.lang, .theme { height: var(--control-sm); padding-inline: var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--primary); font: 500 14px/24px var(--font-digital); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.lang:hover, .theme:hover { background: var(--primary-soft); border-color: var(--primary); }
.theme { display: grid; place-items: center; width: var(--control-sm); padding: 0; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md); padding-inline: var(--space-5); border: 1px solid transparent; border-radius: var(--radius-md);
  font: 500 15px/24px var(--font-digital); text-decoration: none; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface-raised); color: var(--primary); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-invert { position: relative; background: var(--on-deep); color: #0a0a0a; }
.btn-invert:hover { background: var(--on-deep-muted); }

/* Hero */
.hero .wrap { display: grid; gap: var(--space-6); align-items: center; padding-block: var(--space-6); }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.2fr 1fr; gap: var(--space-7); padding-block: var(--space-8); } }
.eyebrow { font: 700 15px/24px var(--font-digital); color: var(--primary); }
.hero h1 { font: 700 34px/52px var(--font-head); margin-block: var(--space-2) 0; }
@media (min-width: 601px) { .hero h1 { font-size: 52px; line-height: 80px; } }
.lead { margin-top: var(--space-4); max-width: 34em; font: 300 21px/38px var(--font-text); color: var(--ink-muted); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: var(--space-6) 0 0; padding: 0; list-style: none; font-size: 15px; line-height: 24px; color: var(--ink-muted); }
.facts b { color: var(--ink); font: 700 24px/32px var(--font-digital); margin-inline-end: 6px; }
.panel { position: relative; overflow: hidden; isolation: isolate; display: grid; place-items: center; align-content: center; gap: var(--space-5); min-height: 320px; margin: 0; padding: var(--space-6); border-radius: var(--radius-xl); background: var(--feature); color: var(--ink); }
.panel .khatam { z-index: -1; color: var(--ornament); opacity: .45; }
.panel img { width: 112px; height: 112px; border-radius: var(--radius-icon); box-shadow: 0 0 0 1px var(--app-ring); }
.panel figcaption { font: 500 20px/32px var(--font-head); text-align: center; }

/* app pages: icon beside the eyebrow, phone frame in the hero */
.app-id { display: flex; align-items: center; gap: var(--space-4); }
.app-id img { width: 72px; height: 72px; border-radius: var(--radius-icon); box-shadow: 0 0 0 1px var(--app-ring); }
.phone { display: grid; width: 100%; max-width: 300px; aspect-ratio: 9 / 18; justify-self: center; border-radius: 40px; padding: 10px; background: #000; box-shadow: var(--shadow-md), 0 0 0 1px var(--app-ring); }

/* VerseCard: the calmest block on the page, no ornament */
.ayah { padding-block: var(--space-6); }
.ayah figure { margin: 0; padding: var(--space-5) var(--space-4) var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); text-align: center; }
.ayah blockquote { margin: 0; font: 400 23px/50px var(--font-quran); }
@media (min-width: 720px) { .ayah blockquote { font-size: 30px; line-height: 66px; } }
.ayah figcaption { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); font: 500 13px/20px var(--font-digital); color: var(--ornament-strong); }
.ayah > p { margin: var(--space-5) auto 0; max-width: 36em; text-align: center; font: 400 19px/36px var(--font-text); color: var(--ink-muted); }

/* sections */
section { padding-block: var(--space-6); }
@media (min-width: 860px) { section { padding-block: var(--space-7); } }
.sec-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); max-width: 68ch; }
.sec-head h1, .sec-head h2 { font: 700 34px/54px var(--font-head); }
.sec-head p { font: 400 19px/36px var(--font-text); color: var(--ink-muted); }

/* FeatureGrid */
.principles { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.principle { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.principle svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: var(--radius-md); background: var(--primary-soft); stroke: var(--primary); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.principle h3 { margin-top: var(--space-2); font: 500 19px/30px var(--font-head); }
.principle p { font: 400 17px/30px var(--font-text); color: var(--ink-muted); }

/* apps */
.apps-bg { background: var(--surface-sunken); }
.group { display: grid; gap: var(--space-4); }
.group + .group { margin-top: var(--space-7); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.group-head h3 { font: 500 26px/42px var(--font-head); }
.group-head span { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .15s ease; }
.card:hover { border-color: var(--line-strong); }
.card h4 { margin-top: var(--space-2); font: 500 20px/32px var(--font-head); }
.card h4 a { color: var(--ink); text-decoration: none; }
.card h4 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.card p { flex: 1; font: 400 17px/30px var(--font-text); color: var(--ink-muted); }
.app-logo { width: 64px; height: 64px; border-radius: var(--radius-icon); box-shadow: 0 0 0 1px var(--app-ring); }

/* Badge */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding-inline: var(--space-3); border-radius: var(--radius-full); background: var(--surface-sunken); color: var(--ink); font: 500 13px/20px var(--font-digital); }
.chip.p1 { background: var(--primary-soft); color: var(--primary); }
.chip.lead { margin: 0; max-width: none; background: var(--primary); color: var(--on-primary); font: 500 13px/20px var(--font-digital); }
.chip.plat { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); }

/* numbered runs: plain cards, with a raised "now" */
.road, .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
@media (min-width: 860px) { .road { grid-template-columns: repeat(4, 1fr); } }
.road > li, .steps > li { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.road > li.now { background: var(--feature); border-color: var(--ink); }
.ph { font: 700 15px/24px var(--font-digital); color: var(--ornament-strong); }
.road h3, .steps h3 { font: 500 20px/32px var(--font-head); }
.road p, .steps p { font: 400 17px/30px var(--font-text); color: var(--ink-muted); }
.road .names { font: 500 17px/30px var(--font-head); color: var(--ink); }
.steps .ref { font: 400 23px/50px var(--font-quran); color: var(--ink); }

/* inverse band: at most one per page */
.closing { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: var(--space-3); justify-items: center; padding: var(--space-7) var(--space-5); border-radius: var(--radius-xl); background: var(--primary-deep); color: var(--on-deep); text-align: center; }
.closing .khatam { z-index: -1; color: var(--on-deep); opacity: .16; }
.closing h2 { font: 700 34px/54px var(--font-head); }
.closing p { max-width: 34em; font: 400 19px/36px var(--font-text); color: var(--on-deep-muted); }
.closing p.note { font: 400 16px/28px var(--font-digital); }
.closing .chip { background: transparent; color: var(--on-deep); box-shadow: inset 0 0 0 1px var(--on-deep-muted); }
.closing .btn { margin-top: var(--space-3); }

/* FamilyFooter */
.family { background: var(--surface-sunken); border-top: 1px solid var(--line); }
.family .wrap { padding-block: var(--space-7) var(--space-5); }
.family h2 { font: 700 24px/38px var(--font-head); }
.family ul { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-3); }
.family ul a { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); height: 100%; padding: var(--space-2); border-radius: var(--radius-lg); color: var(--ink); text-decoration: none; text-align: center; font: 500 14px/20px var(--font-head); }
.family ul a:hover { background: var(--surface-raised); }
.family ul a[aria-current] { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
.family ul a:focus-visible { box-shadow: var(--focus-ring); }
.family img { width: 56px; height: 56px; border-radius: var(--radius-icon); box-shadow: 0 0 0 1px var(--app-ring); }
.family-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.family-bar a { color: var(--ink-muted); }

/* blog: list of posts, and a single post as a reading column */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: var(--space-5) 0 0; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--line-strong); }
.crumbs a { color: var(--ink-muted); }
.posts { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); list-style: none; margin: 0; padding: 0; }
.post-card { position: relative; display: grid; gap: var(--space-2); align-content: start; height: 100%; padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .15s ease; }
.post-card:hover { border-color: var(--line-strong); }
.post-card h2 { font: 500 26px/42px var(--font-head); }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.post-card p { font: 400 17px/30px var(--font-text); color: var(--ink-muted); }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.post { max-width: 68ch; margin-inline: auto; padding-block: var(--space-6) var(--space-8); }
.post > header { display: grid; gap: var(--space-3); padding-bottom: var(--space-5); margin-bottom: var(--space-6); border-bottom: 1px solid var(--line); }
.post h1 { font: 700 34px/54px var(--font-head); }
.post .lead { margin-top: 0; }
.prose { font: 400 19px/36px var(--font-text); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font: 500 26px/42px var(--font-head); margin-top: 1.6em; }
.prose h3 { font: 500 20px/32px var(--font-head); margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose blockquote { margin-inline: 0; padding: var(--space-4) var(--space-5); background: var(--surface-sunken); border-radius: var(--radius-md); font: 400 20px/38px var(--font-text); }
.prose blockquote.quran { background: none; padding-inline: 0; font: 400 30px/66px var(--font-quran); text-align: center; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.post > footer { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
