/* aqdam.app shared stylesheet
   Tokens mirror aqdam-mobile/lib/design_system/tokens/colors.dart (light + dark).
   Fonts are self-hosted subsets (SIL OFL 1.1, licences in /assets/fonts/).
   No inline styles anywhere: the Content-Security-Policy is style-src 'self'. */

@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caprasimo"; src: url("fonts/Caprasimo-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("fonts/Amiri-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  color-scheme: light dark;
  --bg: #F5EAD8;
  --surface: #EBDDC5;
  --quiet: #F9F4ED;
  --text: #201E1D;
  --body: #474238;
  --text-2: #645C50;
  --accent: #C67139;
  --accent-fill: #9F5624;      /* AA fill behind cream text (4.61:1) */
  --accent-ink: #8C491A;       /* accent text on bg (5.1:1+) */
  --accent-100: #FFF2EB;
  --accent-200: #FFE1D0;
  --accent-300: #FFC6A5;
  --on-accent: #F5EAD8;
  --sage: #7A8A5E;
  --sage-100: #F0FAE1;
  --sage-200: #E1EECC;
  --sage-300: #CCDBB2;
  --sage-700: #56633F;
  --sage-ink: #3D472B;
  --band-dark: #2B2722;        /* night band */
  --band-dark-text: #F5EAD8;
  --band-dark-muted: #DCD3C4;
  --band-dark-accent: #FFC6A5;
  --divider: rgba(32,30,29,.16);
  --hairline: rgba(32,30,29,.10);
  --ill-line: rgba(32,30,29,.28);
  --ill-faint: rgba(32,30,29,.10);
  --shadow-md: 0 3px 10px rgba(46,43,37,.10);
  --shadow-lg: 0 14px 36px rgba(46,43,37,.16);
  --mark-s1: #CCDBB2; --mark-s2: #7A8A5E; --mark-s3: #56633F; --mark-star: #C67139; --mark-dot: #F5EAD8;
  --danger: #A3321F; --danger-bg: #FBE4DE;
  /* illustration palette: desert dawn */
  --sky-1: #F7E4CB; --sky-2: #FBCFA6; --sun: #EE9A5E; --sun-glow: #FFD9BC;
  --dune-far: #E9C59B; --dune-mid: #DDAE7E; --dune-near: #D29C68; --dune-front: #C68C5A;
  --ridge: rgba(255,246,232,.55); --step: #9C6539; --step-soft: rgba(156,101,57,.35);
  --star: rgba(255,255,255,0); --crescent: rgba(255,250,240,.9);
  --stone: #CDBBA0; --stone-dark: #B29C7C; --water: #8FB4B8; --palm: #6E7D52;
  --lamp: #C67139; --flame: #F6B26B; --flame-core: #FFF1D6;
  --radius: 22px;
  --maxw: 1120px;
  --gutter: 16px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1916; --surface: #272420; --quiet: #2A2723;
    --text: #F1E9DC; --body: #DCD3C4; --text-2: #C0B6A5;
    --accent: #D67F48; --accent-fill: #D67F48; --accent-ink: #F6A06B;
    --accent-100: #3A2214; --accent-200: #55301A; --accent-300: #7A4421; --on-accent: #1B1916;
    --sage: #8FA073; --sage-100: #242B1A; --sage-200: #323B24; --sage-300: #46522F; --sage-700: #AEBF92; --sage-ink: #CCDBB2;
    --band-dark: #121110; --band-dark-text: #F1E9DC; --band-dark-muted: #CFC6B6; --band-dark-accent: #F6A06B;
    --divider: rgba(241,233,220,.14); --hairline: rgba(241,233,220,.09);
    --ill-line: rgba(241,233,220,.30); --ill-faint: rgba(241,233,220,.10);
    --shadow-md: 0 3px 12px rgba(0,0,0,.45); --shadow-lg: 0 14px 36px rgba(0,0,0,.55);
    --mark-s1: #56633F; --mark-s2: #8FA073; --mark-s3: #CCDBB2; --mark-star: #F6A06B; --mark-dot: #8C491A;
    --danger: #FF9A85; --danger-bg: #3A1A14;
    --sky-1: #161A26; --sky-2: #3B2C2C; --sun: #D67F48; --sun-glow: #5A3220;
    --dune-far: #3A2F28; --dune-mid: #312821; --dune-near: #29221C; --dune-front: #211B16;
    --ridge: rgba(246,160,107,.18); --step: #0F0D0B; --step-soft: rgba(15,13,11,.6);
    --star: rgba(241,233,220,.85); --crescent: #F1E9DC;
    --stone: #4A4036; --stone-dark: #3A322A; --water: #4E7478; --palm: #56633F;
    --lamp: #D67F48; --flame: #F6A06B; --flame-core: #FFE7C2;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1916; --surface: #272420; --quiet: #2A2723;
  --text: #F1E9DC; --body: #DCD3C4; --text-2: #C0B6A5;
  --accent: #D67F48; --accent-fill: #D67F48; --accent-ink: #F6A06B;
  --accent-100: #3A2214; --accent-200: #55301A; --accent-300: #7A4421; --on-accent: #1B1916;
  --sage: #8FA073; --sage-100: #242B1A; --sage-200: #323B24; --sage-300: #46522F; --sage-700: #AEBF92; --sage-ink: #CCDBB2;
  --band-dark: #121110; --band-dark-text: #F1E9DC; --band-dark-muted: #CFC6B6; --band-dark-accent: #F6A06B;
  --divider: rgba(241,233,220,.14); --hairline: rgba(241,233,220,.09);
  --ill-line: rgba(241,233,220,.30); --ill-faint: rgba(241,233,220,.10);
  --shadow-md: 0 3px 12px rgba(0,0,0,.45); --shadow-lg: 0 14px 36px rgba(0,0,0,.55);
  --mark-s1: #56633F; --mark-s2: #8FA073; --mark-s3: #CCDBB2; --mark-star: #F6A06B; --mark-dot: #8C491A;
  --danger: #FF9A85; --danger-bg: #3A1A14;
  --sky-1: #161A26; --sky-2: #3B2C2C; --sun: #D67F48; --sun-glow: #5A3220;
  --dune-far: #3A2F28; --dune-mid: #312821; --dune-near: #29221C; --dune-front: #211B16;
  --ridge: rgba(246,160,107,.18); --step: #0F0D0B; --step-soft: rgba(15,13,11,.6);
  --star: rgba(241,233,220,.85); --crescent: #F1E9DC;
  --stone: #4A4036; --stone-dark: #3A322A; --water: #4E7478; --palm: #56633F;
  --lamp: #D67F48; --flame: #F6A06B; --flame-core: #FFE7C2;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 400 17px/1.6 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
@supports (overflow-x: clip) { body { overflow-x: clip; } }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3 { font-family: "Caprasimo", Georgia, serif; font-weight: 400; color: var(--text); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.005em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
strong { color: var(--text); font-weight: 700; }
.ar { font-family: "Amiri", "Geeza Pro", serif; font-weight: 400; line-height: 1.9; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 780px; }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .8rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--body); max-width: 40em; }
.muted { color: var(--text-2); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--hairline); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand .name { font-family: "Caprasimo", serif; font-size: 1.45rem; }
.brand .name-ar { font-family: "Amiri", serif; font-size: 1.15rem; color: var(--sage-700); }
@media (max-width: 400px) { .site-header .brand .name-ar { display: none; } }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav ul { list-style: none; display: none; gap: 2px; margin: 0 6px 0 0; padding: 0; }
.nav ul a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 999px; color: var(--body); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav ul a:hover, .nav ul a[aria-current="page"] { background: var(--surface); color: var(--text); }
@media (min-width: 980px) { .nav ul { display: flex; } .nav .nav-sahaba { display: none; } }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; }
.pill-solid { background: var(--accent-fill); color: var(--on-accent); }
.pill-solid:hover { filter: brightness(1.06); }
.pill-ghost { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.nav .pill { min-height: 40px; padding: 0 14px; font-size: .95rem; }
.nav .pill-solid { color: var(--on-accent); }
@media (max-width: 360px) { .nav .pill { padding: 0 11px; } }

/* ---------- sections ---------- */
main { position: relative; }
section { position: relative; padding: clamp(64px, 10vw, 120px) 0; }
.band-surface { background: var(--surface); }
.band-sage { background: var(--sage-100); }
.band-dark { background: var(--band-dark); color: var(--band-dark-muted); }
.band-dark h2, .band-dark h3, .band-dark strong { color: var(--band-dark-text); }
.band-dark .eyebrow, .band-dark a { color: var(--band-dark-accent); }
.band-dark .lede { color: var(--band-dark-muted); }

.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

.grid-2 { display: grid; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1.05fr .95fr; } .grid-2.flip > :first-child { order: 2; } }

figure { margin: 0; }
figcaption { margin-top: 14px; font-size: .9rem; color: var(--text-2); text-align: center; }
.band-dark figcaption { color: var(--band-dark-muted); }
.art svg { width: 100%; height: auto; display: block; }

/* ---------- hadith quote (shared with the Sahaba pages) ----------
   <figure class="hadith">
     <p class="ar" lang="ar" dir="rtl">…</p>
     <blockquote><p>English rendering</p></blockquote>
     <figcaption><cite><a href="https://sunnah.com/bukhari:1">Sahih al-Bukhari 1</a></cite> · narrated by …</figcaption>
   </figure> */
.hadith { margin: 1.6em 0; padding: clamp(20px, 3.5vw, 30px); background: var(--quiet); border-radius: var(--radius); border: 1px solid var(--hairline); position: relative; }
.hadith::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hadith .ar { font-size: clamp(1.45rem, 3.6vw, 1.9rem); color: var(--text); text-align: right; margin: 0 0 .35em; }
.hadith blockquote { margin: 0; }
.hadith blockquote p { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--text); margin: 0; }
.hadith figcaption { text-align: left; margin-top: 12px; font-size: .9rem; color: var(--text-2); }
.hadith cite { font-style: normal; font-weight: 700; }
.band-dark .hadith { background: color-mix(in srgb, var(--band-dark-text) 7%, transparent); border-color: color-mix(in srgb, var(--band-dark-text) 12%, transparent); }
.band-dark .hadith .ar, .band-dark .hadith blockquote p { color: var(--band-dark-text); }
.band-dark .hadith figcaption { color: var(--band-dark-muted); }
.hadith.big { background: none; border: 0; padding: 0; }
.hadith.big::before { display: none; }
.hadith.big .ar { font-size: clamp(1.9rem, 5.4vw, 3rem); text-align: center; line-height: 1.7; }
.hadith.big blockquote p { font-family: "Caprasimo", Georgia, serif; font-size: clamp(1.35rem, 3.4vw, 2rem); line-height: 1.3; text-align: center; text-wrap: balance; }
.hadith.big figcaption { text-align: center; }

/* ---------- hero: desert dawn ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 0; overflow: hidden; }
.hero-copy { position: relative; z-index: 1; text-align: center; }
.hero-copy h1 { max-width: 15em; margin-left: auto; margin-right: auto; }
.hero-copy .lede { margin: 0 auto 1.6rem; }
.hero .ar-word { display: block; font-family: "Amiri", serif; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--accent-ink); line-height: 1.4; margin-bottom: .2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .cta-row { justify-content: center; }
.hero-art { position: relative; height: clamp(250px, 44vw, 580px); margin-top: clamp(-24px, -2vw, 0px); }
.hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art .sun { transform-box: fill-box; transform-origin: center; animation: sunrise 2.8s cubic-bezier(.2,.7,.2,1) both; }
.hero-art .glow { animation: glow 3.2s ease both; }
.hero-art .fp { fill: var(--step); opacity: 0; animation: step-in .5s ease forwards; }
.hero-art .fp-soft { fill: var(--step-soft); }
.star { fill: var(--star); }
@keyframes sunrise { from { transform: translateY(60px); } to { transform: none; } }
@keyframes glow { from { opacity: 0; } to { opacity: 1; } }
@keyframes step-in { from { opacity: 0; } to { opacity: 1; } }
.hero-art .fp:nth-of-type(1) { animation-delay: .6s; } .hero-art .fp:nth-of-type(2) { animation-delay: .75s; }
.hero-art .fp:nth-of-type(3) { animation-delay: .9s; } .hero-art .fp:nth-of-type(4) { animation-delay: 1.05s; }
.hero-art .fp:nth-of-type(5) { animation-delay: 1.2s; } .hero-art .fp:nth-of-type(6) { animation-delay: 1.35s; }
.hero-art .fp:nth-of-type(7) { animation-delay: 1.5s; } .hero-art .fp:nth-of-type(8) { animation-delay: 1.65s; }
.hero-art .fp:nth-of-type(9) { animation-delay: 1.8s; } .hero-art .fp:nth-of-type(10) { animation-delay: 1.95s; }
.hero-art .fp:nth-of-type(11) { animation-delay: 2.1s; } .hero-art .fp:nth-of-type(12) { animation-delay: 2.25s; }
.hero-art .fp:nth-of-type(13) { animation-delay: 2.4s; } .hero-art .fp:nth-of-type(14) { animation-delay: 2.55s; }
.hero-art .fp:nth-of-type(15) { animation-delay: 2.7s; } .hero-art .fp:nth-of-type(16) { animation-delay: 2.85s; }
.hero-art .fp:nth-of-type(17) { animation-delay: 3s; } .hero-art .fp:nth-of-type(18) { animation-delay: 3.15s; }
.hero-art .fp:nth-of-type(n+19) { animation-delay: 3.3s; }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text); font-weight: 700; font-size: .9rem; text-decoration: none; }
.scroll-cue svg { width: 16px; height: 16px; }

/* ---------- idea: drops on stone ---------- */
.idea .art { max-width: 460px; margin: 0 auto; }
.drop { fill: var(--water); }
.drop-anim { animation: drip 4.8s ease-in infinite; }
.drop-anim.d2 { animation-delay: 1.6s; } .drop-anim.d3 { animation-delay: 3.2s; }
@keyframes drip { 0% { transform: translateY(-40px); opacity: 0; } 12% { opacity: 1; } 34% { transform: translateY(150px); opacity: 1; } 36%, 100% { transform: translateY(150px); opacity: 0; } }
.ripple { fill: none; stroke: var(--water); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ripple 4.8s ease-out infinite; opacity: 0; }
.ripple.d2 { animation-delay: 1.6s; } .ripple.d3 { animation-delay: 3.2s; }
@keyframes ripple { 0%, 33% { opacity: 0; transform: scale(.3); } 36% { opacity: .9; } 60%, 100% { opacity: 0; transform: scale(1.4); } }
.pull { font-family: "Caprasimo", Georgia, serif; font-size: clamp(1.25rem, 2.8vw, 1.6rem); color: var(--text); line-height: 1.3; margin: 1.2em 0; }

/* ---------- their days: day arc ---------- */
.day-arc { margin: 0 0 clamp(28px, 4vw, 44px); }
.day-arc svg { width: 100%; height: auto; display: block; overflow: visible; }
.day-arc text { font-family: "Figtree", sans-serif; }
.day-arc .arc-line { fill: none; stroke: var(--accent-300); stroke-width: 3; stroke-linecap: round; }
.day-arc .pin circle { fill: var(--accent-fill); }
.day-arc .pin text { fill: var(--on-accent); font-weight: 700; font-size: 17px; text-anchor: middle; }
.day-arc .prayer circle { fill: var(--bg); stroke: var(--sage-700); stroke-width: 4; }
.day-arc .prayer text { fill: var(--text); font-weight: 700; font-size: 16px; text-anchor: middle; }
.js .day-arc .pin, .js .day-arc .prayer { opacity: 0; transition: opacity .5s ease; }
.js .day-arc.is-visible .pin, .js .day-arc.is-visible .prayer { opacity: 1; }
.day-arc.is-visible g:nth-of-type(2) { transition-delay: .2s; } .day-arc.is-visible g:nth-of-type(3) { transition-delay: .4s; }
.day-arc.is-visible g:nth-of-type(4) { transition-delay: .6s; } .day-arc.is-visible g:nth-of-type(5) { transition-delay: .8s; }
.day-arc.is-visible g:nth-of-type(6) { transition-delay: 1s; } .day-arc.is-visible g:nth-of-type(7) { transition-delay: 1.2s; }
.day-arc.is-visible g:nth-of-type(8) { transition-delay: 1.4s; } .day-arc.is-visible g:nth-of-type(9) { transition-delay: 1.6s; }
.day-arc.is-visible g:nth-of-type(10) { transition-delay: 1.8s; } .day-arc.is-visible g:nth-of-type(n+11) { transition-delay: 2s; }
.moments { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: m; }
@media (min-width: 720px) { .moments { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .moments { grid-template-columns: repeat(3, 1fr); } }
.moment { counter-increment: m; position: relative; background: var(--quiet); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 22px 22px 20px; display: flex; flex-direction: column; }
.moment::before { content: counter(m); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; margin-bottom: 12px; }
.moment .when { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-700); }
.moment h3 { font-size: 1.2rem; margin: .25em 0 .4em; }
.moment p { margin: 0 0 .8em; font-size: .98rem; }
.moment .src { margin-top: auto; font-size: .88rem; color: var(--text-2); }
.moment .who { font-weight: 700; }

/* ---------- sincerity: lamp at night ---------- */
.lamp-art { max-width: 420px; margin: 0 auto; }
.lamp-art .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 3.6s ease-in-out infinite; }
.lamp-art .halo { animation: breathe 5s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.94, 1.06) rotate(-2deg); } 60% { transform: scale(1.04, .96) rotate(1.5deg); } }
@keyframes breathe { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }

/* ---------- steady: the trail ---------- */
.trail-art svg { width: 100%; height: auto; display: block; }
.trail-art .t-step { fill: var(--sage-700); }
.trail-art .t-gap { fill: none; stroke: var(--sage-700); stroke-width: 2.5; stroke-dasharray: 4 4; }
.trail-art .t-path { fill: none; stroke: var(--sage-300); stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round; }
.trail-art text { font-family: "Figtree", sans-serif; font-size: 15px; font-weight: 700; fill: var(--sage-ink); }
.three-times { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .three-times { grid-template-columns: repeat(3, 1fr); } }
.three-times li { background: var(--bg); border-radius: 18px; padding: 16px 18px; }
.three-times b { display: block; color: var(--text); }
.three-times .ar { color: var(--sage-ink); font-size: 1.15rem; }

/* ---------- return ---------- */
.return-art { max-width: 520px; margin: 0 auto; }
.return-art .away { fill: var(--step-soft); }
.return-art .back { fill: var(--accent); }

/* ---------- Sahaba cards (landing preview + catalogue) ---------- */
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.sahaba-card { height: 100%; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: 24px; background: var(--quiet); border: 1px solid var(--hairline); color: var(--body); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
.sahaba-card::before { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; right: -54px; top: -64px; background: var(--accent-100); }
.card-grid > li:nth-child(even) .sahaba-card::before { background: var(--sage-200); }
.sahaba-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.sahaba-card .ar-name { position: relative; font-family: "Amiri", serif; font-size: 2.6rem; line-height: 1.35; color: var(--accent-ink); text-align: right; margin: 0 0 4px; }
.card-grid > li:nth-child(even) .sahaba-card .ar-name { color: var(--sage-ink); }
.sahaba-card h3 { position: relative; font-size: 1.2rem; margin: 0; }
.sahaba-card .honorific { font-family: "Amiri", serif; font-size: .95rem; color: var(--text-2); }
.sahaba-card p { position: relative; font-size: .94rem; color: var(--text-2); margin: 6px 0 12px; }
.sahaba-card .more { position: relative; margin-top: auto; font-weight: 700; color: var(--accent-ink); }
.sahaba-card:focus-visible { outline-offset: 4px; }
.card-grid + .muted { margin-top: 24px; }
.search-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; max-width: 560px; }
.search-row input { flex: 1 1 220px; }

/* ---------- the app (subtle) ---------- */
.app-intro { overflow: hidden; }
.phones { display: flex; justify-content: center; gap: 16px; }
.phone { width: min(250px, 62vw); padding: 9px; background: #1A1816; border-radius: 42px; box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #3a3631; flex: none; }
.phone img { border-radius: 34px; width: 100%; aspect-ratio: 600 / 1304; object-fit: cover; background: var(--surface); }
.phones .phone + .phone { margin-top: 48px; }
@media (max-width: 599px) { .phones .phone + .phone { display: none; } }
.soon { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700; }
.soon svg { width: 18px; height: 18px; flex: none; }
.quiet-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.quiet-list li { position: relative; padding-left: 30px; }
.quiet-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 18px; height: 11px; border-radius: 6px; transform: rotate(-32deg); background: var(--sage); }
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .light-only { display: none; } :root:not([data-theme="light"]) .dark-only { display: block; } }

/* ---------- closing ---------- */
.closing { text-align: center; overflow: hidden; }
.closing .cta-row { justify-content: center; margin-top: 28px; }
.closing .mini-steps { width: 120px; height: 60px; margin: 0 auto 12px; display: block; }

/* ---------- FAQ (support) ---------- */
.faq { max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--divider); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0; min-height: 44px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: "Caprasimo", serif; font-size: 1.5rem; color: var(--accent-ink); line-height: 1; flex: none; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 18px; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
.form-card { background: var(--quiet); border: 1px solid var(--hairline); border-radius: 26px; padding: clamp(20px, 4vw, 36px); margin: 1.6em 0 3em; box-shadow: var(--shadow-md); }
.form-card h2 { margin-top: 0; }
.field { margin: 0 0 20px; }
.field label { display: block; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.field .optional { font-weight: 400; color: var(--text-2); }
.field .hint { font-size: .9rem; color: var(--text-2); margin: -2px 0 8px; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid color-mix(in srgb, var(--text) 45%, transparent);
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.field-error { color: var(--danger); font-weight: 700; font-size: .92rem; margin: 6px 0 0; }
.field-error::before { content: "! "; }
.form-alert { background: var(--danger-bg); color: var(--danger); border-radius: 14px; padding: 12px 16px; font-weight: 700; margin-bottom: 20px; }
.form-alert:focus { outline: 3px solid var(--danger); outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.form-actions p { margin: 0; flex: 1 1 220px; }
button[disabled] { opacity: .65; cursor: progress; }
.form-success { background: var(--sage-100); color: var(--sage-ink); border-radius: 18px; padding: 20px 22px; }
.form-success h3 { color: var(--sage-ink); margin-bottom: .3em; }
.form-success p { margin: 0; }
.form-success:focus { outline: 3px solid var(--sage); outline-offset: 2px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- document pages (privacy / terms / support / Sahaba) ---------- */
.doc { padding: clamp(40px, 7vw, 80px) 0; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.doc h2 { font-size: 1.55rem; margin-top: 2em; }
.doc h3 { font-size: 1.15rem; margin-top: 1.5em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.doc .meta { color: var(--text-2); font-size: .92rem; }
.doc .card-grid, .doc .moments { padding-left: 0; }
.callout { background: var(--sage-100); color: var(--sage-ink); border-radius: 18px; padding: 18px 20px; margin: 1.4em 0; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: inherit; }
.toc { background: var(--quiet); border-radius: 18px; padding: 16px 20px; margin: 1.4em 0; }
.toc ol { margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1em 0; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { color: var(--text); }
.table-scroll { overflow-x: auto; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0; margin: 0 0 20px; font-size: .9rem; color: var(--text-2); }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--divider); }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 700; }
.lost-trail { width: 240px; height: auto; margin-bottom: 12px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--divider); padding: 48px 0 32px; font-size: .92rem; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-family: "Figtree", sans-serif; font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer ul a { display: inline-flex; align-items: center; min-height: 32px; }
.legal-line { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--hairline); color: var(--text-2); font-size: .82rem; }


/* ---------- landing details ---------- */
.static-drop { display: none; }
.idea .art, .lamp-art, .trail-art, .return-art { width: 100%; }
.lamp-art svg, .return-art svg { width: 100%; height: auto; display: block; }
.moment-cta { counter-increment: none; background: transparent; border-style: dashed; justify-content: center; }
.moment-cta::before { content: none; }
.arc-scroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 12px; }
@media (max-width: 680px) { .arc-scroll svg { width: 680px; max-width: none; } }
.sahaba-card .ar-name { display: block; }
.closing .lede { margin-left: auto; margin-right: auto; }
.three-times li { color: var(--body); }

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-group > * { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal-group.is-visible > * { opacity: 1; transform: none; }
.reveal-group.is-visible > :nth-child(2) { transition-delay: .1s; } .reveal-group.is-visible > :nth-child(3) { transition-delay: .2s; }
.reveal-group.is-visible > :nth-child(4) { transition-delay: .3s; } .reveal-group.is-visible > :nth-child(5) { transition-delay: .4s; }
.reveal-group.is-visible > :nth-child(n+6) { transition-delay: .5s; }
.js .draw .trail { stroke-dasharray: 2000; stroke-dashoffset: 2000; transition: stroke-dashoffset 2.4s ease; }
.js .draw.is-visible .trail { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .reveal-group > * { opacity: 1; transform: none; }
  .js .draw .trail { stroke-dashoffset: 0; }
  .js .day-arc .pin, .js .day-arc .prayer, .hero-art .fp { opacity: 1; }
  .drop-anim, .ripple { display: none; }
  .static-drop { display: inline; }
  .sahaba-card:hover { transform: none; }
}

@media print { .site-header, .skip, .scroll-cue { display: none; } body { background: #fff; color: #000; } }
.doc .form-card h2 { margin-top: 0; }

/* ---------- Sahaba profile + catalogue (generated by scripts/build_sahaba.py) ---------- */
.profile-head { position: relative; overflow: hidden; padding: 8px 0 8px; }
.profile-head .motif { position: absolute; right: -40px; top: -30px; width: 220px; height: 220px; opacity: .55; pointer-events: none; }
.profile-head > *:not(.motif) { position: relative; }
.profile-head .ar-title { font-family: "Amiri", "Geeza Pro", serif; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--accent-ink); margin: 0 0 .1em; line-height: 1.5; }
.profile-head h1 { margin: 0 0 .3em; }
.profile-head .full-name { color: var(--text-2); margin: 0 0 .6em; }
.title-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; margin: 14px 0 0; }
.title-list li, .tag { margin: 0 !important; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--sage-100); color: var(--sage-ink); font-size: .88rem; font-weight: 600; }
.facts { display: grid; gap: 0; margin: 1.6em 0; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--quiet); overflow: hidden; }
.facts div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--hairline); }
.facts div:first-child { border-top: 0; }
.facts dt { font-weight: 700; color: var(--text-2); font-size: .9rem; }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }
.doc .moments { grid-template-columns: 1fr; }
.cites { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: .4em 0 0; padding: 0; list-style: none; }
.doc .cites li { margin: 0; }
.cite-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--divider); background: var(--bg); color: var(--accent-ink); font-size: .84rem; font-weight: 600; text-decoration: none; }
.cite-chip:hover { background: var(--accent-100); }
.cite-chip .grade { font-weight: 700; color: var(--sage-700); }
.cite-chip .grade::before { content: "·"; margin-right: 6px; color: var(--text-2); }
.excerpts { margin: .6em 0 0; font-size: .9rem; color: var(--text-2); }
.excerpts summary { cursor: pointer; font-weight: 600; }
.excerpts blockquote { margin: .5em 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--accent-200); }
.excerpts blockquote p { margin: 0 0 .2em; font-size: .9rem; }
.moment .lesson { font-weight: 600; color: var(--sage-ink); }
.timeline { list-style: none; padding: 0 !important; margin: 1em 0; border-left: 2px solid var(--divider); }
.timeline li { position: relative; padding: 0 0 18px 22px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline .when { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-700); }
.plain-list { list-style: none; padding: 0 !important; }
.plain-list > li { padding: 14px 0; border-top: 1px solid var(--hairline); margin: 0; }
.plain-list > li:first-child { border-top: 0; }
.related-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0 !important; }
.related-list li { margin: 0; }
.related-list a { display: inline-flex; flex-direction: column; padding: 10px 16px; border-radius: 16px; background: var(--quiet); border: 1px solid var(--hairline); text-decoration: none; }
.related-list a:hover { background: var(--accent-100); }
.related-list .ar { font-size: 1.15rem; color: var(--accent-ink); line-height: 1.5; }
.sources-list { font-size: .95rem; }
.sources-list a { overflow-wrap: anywhere; }
.catalogue-tools { margin: 0 0 24px; }
.catalogue-tools .search-row { margin-bottom: 14px; max-width: 640px; }
.no-js .js-only { display: none !important; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.filter-chips button { font: inherit; font-size: .9rem; font-weight: 600; padding: 6px 14px; min-height: 36px; border-radius: 999px; border: 1px solid var(--divider); background: var(--quiet); color: var(--body); cursor: pointer; }
.filter-chips button:hover { background: var(--accent-100); }
.filter-chips button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.result-count { color: var(--text-2); font-size: .95rem; margin: 6px 0 0; }
.az { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; padding: 0 !important; margin: 0 0 8px; }
.az li { margin: 0; }
.az a { display: inline-block; min-width: 34px; text-align: center; padding: 4px 8px; border-radius: 10px; font-weight: 700; text-decoration: none; background: var(--quiet); }
.letter-group > h2 { font-family: "Caprasimo", Georgia, serif; font-size: 1.8rem; color: var(--accent-ink); margin: 1.4em 0 .5em; }
.letter-group[hidden], .card-grid > li[hidden], .az a[hidden] { display: none; }
.empty-state { padding: 24px; border-radius: var(--radius); background: var(--sage-100); color: var(--sage-ink); }
.catalogue .doc .wrap, .doc.wide .wrap { max-width: var(--maxw); }
