/* theduadiary.com — one stylesheet for every page (#344).
   Colours, fonts and easing are the app's own (Amal 2, constants/amal.ts),
   copied as values: the website has no build step that could read them. */

@font-face { font-family: "Fraunces"; src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/Fraunces-Italic-Variable.woff2") format("woff2"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/SchibstedGrotesk-Variable.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("/assets/fonts/Amiri-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --surface-page: #f5efe3;
  --surface-card: #efe3d1;
  --surface-raised: #fbf6ec;
  --text-display: #2a3324;
  --text-body: #3b4237;
  --text-muted: #50564b;
  --text-faint: #686c61;
  --ink-22: rgba(59, 66, 55, 0.20);
  --ink-40: rgba(59, 66, 55, 0.44);
  --hair: rgba(59, 66, 55, 0.12);
  --action: #6f5013;
  --action-fill: #d9b268;
  --action-fill-ink: #2a3324;
  --gold: #c79a3e;
  --gold-mark: #91680a;
  --sky-top: #eed3b0;
  --sky-mid: #f5e6ce;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-arabic: "Amiri", "Geeza Pro", serif;
  --font-system: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-page); color: var(--text-body); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-mark); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface-raised); padding: 10px 14px; border-radius: 10px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

/* ── Header and footer ─────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(245, 239, 227, 0.78); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--hair); }
.site-header .wrap { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.brand span { font-family: var(--font-display); font-size: 19px; color: var(--text-display); }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.pill { height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--text-display); color: var(--surface-page); font-weight: 600; }
.pill-lg { height: 50px; padding: 0 26px; font-size: 17px; }
.site-footer { border-top: 1px solid var(--hair); }
.site-footer .wrap { padding-top: 36px; padding-bottom: 44px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.site-footer nav { display: flex; gap: 10px; flex-wrap: wrap; }
.site-footer .dot { color: var(--text-faint); }
.site-footer .mail { color: var(--action); }

/* ── Type ──────────────────────────────────────────────────────────────── */
.kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-mark); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4vw, 54px); line-height: 1.05; letter-spacing: -0.03em; color: var(--text-display); text-wrap: balance; }
.lead { font-size: 20px; line-height: 30px; font-weight: 500; color: var(--gold-mark); max-width: 470px; }
.body { font-size: 19px; line-height: 30px; color: var(--text-body); max-width: 470px; }
.small { font-size: 17px; line-height: 27px; color: var(--text-muted); max-width: 470px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 46%, var(--surface-page) 100%); }
.hero .wrap { padding-top: 96px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-icon { width: 104px; height: 104px; border-radius: 23px; box-shadow: 0 12px 28px -10px rgba(42, 51, 36, 0.45), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
.hero h1 { margin-top: 36px; font-family: var(--font-display); font-weight: 380; font-size: clamp(46px, 6.4vw, 88px); line-height: 1; letter-spacing: -0.04em; color: var(--text-display); text-wrap: balance; }
.hero .intro { margin-top: 24px; max-width: 620px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; text-wrap: pretty; }
.get { margin-top: 34px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.badge img { height: 52px; width: auto; }
.get-note { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 15px; line-height: 20px; color: var(--text-muted); text-align: left; }
.fan { margin-top: 80px; margin-bottom: -300px; position: relative; display: flex; justify-content: center; align-items: flex-end; }
.fan .side { z-index: 1; margin-bottom: 40px; }
.fan .side.l { margin-right: -40px; }
.fan .side.r { margin-left: -40px; }
.fan .centre { z-index: 2; }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; z-index: 5; background: linear-gradient(180deg, rgba(245, 239, 227, 0) 0%, var(--surface-page) 92%); pointer-events: none; }

/* ── Phones ───────────────────────────────────────────────────────────── */
.phone { position: relative; flex: none; max-width: 100%; border-radius: calc(var(--w) * 0.16); padding: calc(var(--w) * 0.034); width: var(--w); background: #1c1c1e; box-shadow: 0 40px 80px -30px rgba(42, 51, 36, 0.45), 0 18px 30px -18px rgba(42, 51, 36, 0.35), inset 0 0 0 1.5px #48484a; }
.phone.hi { box-shadow: 0 50px 90px -30px rgba(42, 51, 36, 0.55), 0 20px 34px -18px rgba(42, 51, 36, 0.4), inset 0 0 0 1.5px #48484a; }
.phone > picture { display: block; }
.phone > picture > img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; border-radius: calc(var(--w) * 0.126); }
.phone .island { position: absolute; left: 50%; top: calc(var(--w) * 0.064); width: calc(var(--w) * 0.29); height: calc(var(--w) * 0.082); transform: translateX(-50%); border-radius: 999px; background: #000; }
/* A screen drawn as live markup at the app's 390 × 844, scaled to fit. */
.screen { position: relative; width: calc(var(--w) * 0.932); height: calc(var(--w) * 0.932 * 844 / 390); overflow: hidden; border-radius: calc(var(--w) * 0.126); }
.screen > .at390 { position: absolute; left: 0; top: 0; width: 390px; height: 844px; transform-origin: 0 0; transform: scale(var(--s)); }

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-top: 160px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 80px; align-items: center; }
.row.flip > :first-child { order: 2; }
.row .media { display: flex; justify-content: center; }
.hadith { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hadith .ar { max-width: 900px; font-family: var(--font-arabic); font-size: clamp(26px, 3vw, 38px); line-height: 1.9; color: var(--text-display); text-wrap: balance; }
.hadith .en { margin-top: 12px; max-width: 680px; font-family: var(--font-display); font-style: italic; font-size: clamp(20px, 2vw, 24px); line-height: 1.42; color: var(--text-display); text-wrap: balance; }
.hadith .src { margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* The features: one pinned phone on wide screens, a phone under each on narrow ones. */
.story { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 96px; align-items: start; timeline-scope: --b2, --b3; }
.story .blk { min-height: 680px; display: flex; flex-direction: column; justify-content: center; }
.story .blk2 { view-timeline-name: --b2; }
.story .blk3 { view-timeline-name: --b3; }
.story .pin { position: sticky; top: 96px; display: flex; justify-content: center; }
.story .stack { position: relative; width: 330px; }
.story .layer { position: absolute; inset: 0; }
.rows { display: none; }
@media (max-width: 980px) {
  .story { display: none; }
  .rows { display: block; }
  .row { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .row.flip > :first-child { order: 0; }
  .section { padding-top: 112px; }
  .fan .side { display: none; }
  .fan { margin-top: 56px; }
}

/* The privacy promise, floating over the Duas tab */
.air { position: absolute; left: -72px; top: 440px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 999px; background: rgba(251, 246, 236, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 14px 32px -12px rgba(40, 30, 10, 0.35), inset 0 0 0 1px rgba(120, 90, 50, 0.14); font-family: var(--font-system); }
.air .dot { width: 48px; height: 48px; border-radius: 50%; background: var(--action-fill); display: inline-flex; align-items: center; justify-content: center; }
.air b, .air i { display: block; font-family: var(--font-ui); font-style: normal; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text-display); }
@media (max-width: 980px) { .air { left: -8px; top: 470px; } }

/* FAQ, on the landing page and the support page */
.faq { border-top: 1px solid var(--ink-22); }
.faq details { border-bottom: 1px solid var(--ink-22); }
.faq summary { list-style: none; cursor: pointer; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; color: var(--text-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; transition: transform 200ms ease; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { padding: 0 48px 24px 0; font-size: 17px; line-height: 27px; color: var(--text-body); }
.faq details p + p { margin-top: -12px; }
.faq a { color: var(--action); text-decoration: underline; text-underline-offset: 3px; }

.closing { padding-top: 160px; padding-bottom: 140px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.closing img { width: 80px; height: 80px; border-radius: 18px; box-shadow: 0 10px 24px -10px rgba(42, 51, 36, 0.45); }
.closing h2 { margin-top: 28px; font-family: var(--font-display); font-weight: 380; font-size: clamp(40px, 4.8vw, 64px); line-height: 1.02; letter-spacing: -0.035em; color: var(--text-display); }
.closing .pill { margin-top: 30px; }

/* ── Reading pages: privacy, terms, support ───────────────────────────── */
.doc { padding-top: 56px; padding-bottom: 140px; display: flex; flex-direction: column; align-items: center; }
.doc .arch { position: relative; width: 104px; height: 140px; }
.doc .arch::before { content: ""; position: absolute; inset: 0; border-radius: 52px 52px 6px 6px; background: linear-gradient(180deg, #eadcc3 0%, #dcc8a6 100%); box-shadow: 0 10px 22px rgba(70, 50, 20, 0.18), inset 0 0 0 1px rgba(120, 90, 50, 0.22); }
.doc .arch span { position: absolute; left: 8px; top: 8px; right: 8px; bottom: 8px; border-radius: 44px 44px 3px 3px; overflow: hidden; }
.doc .arch img { position: absolute; left: -46px; top: -56px; width: 190px; max-width: none; }
.doc .eyebrow { margin-top: 32px; font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--gold-mark); }
.doc h1 { margin-top: 10px; font-family: var(--font-display); font-weight: 380; font-size: clamp(44px, 5.4vw, 72px); line-height: 1; letter-spacing: -0.035em; color: var(--text-display); text-align: center; text-wrap: balance; }
.doc .date { margin-top: 18px; font-size: 15px; color: var(--text-muted); }
.prose { margin-top: 32px; width: 100%; max-width: 680px; }
.prose h2 { margin-top: 72px; font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 38px; letter-spacing: -0.02em; color: var(--text-display); text-align: center; scroll-margin-top: 84px; }
.prose h3 { margin-top: 40px; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 22px; line-height: 28px; color: var(--gold-mark); }
.prose p, .prose li { font-size: 18px; line-height: 30px; color: var(--text-body); }
.prose p { margin-top: 16px; }
.prose ul, .prose ol { margin: 14px 0 0; padding-left: 22px; }
.prose li { margin-top: 8px; padding-left: 4px; }
.prose strong { font-weight: 600; color: var(--text-display); }
.prose a { color: var(--action); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose hr { margin: 64px auto 0; width: 48px; border: 0; height: 1px; background: var(--gold); }
.contact { margin-top: 72px; width: 100%; max-width: 680px; background: var(--surface-raised); border-radius: 22px; box-shadow: inset 0 0 0 1px var(--hair); padding: 32px; text-align: center; }
.contact h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--text-display); }
.contact p { margin-top: 10px; font-size: 17px; line-height: 27px; }
.contact .mail { display: inline-block; margin-top: 16px; font-family: var(--font-display); font-size: 24px; color: var(--action); border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.support-group { width: 100%; max-width: 680px; margin-top: 64px; }
.support-group h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--text-display); margin-bottom: 16px; }

/* ── Motion ───────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes phonesIn { from { opacity: 0; transform: translateY(80px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes show { from { opacity: 0; } to { opacity: 1; } }
.m-rise { animation: rise 700ms var(--ease) both; }
.m-rise.d1 { animation-delay: 90ms; } .m-rise.d2 { animation-delay: 180ms; } .m-rise.d3 { animation-delay: 270ms; }
.m-phones { animation: phonesIn 1100ms var(--ease) 420ms both; }
/* Scroll-led motion where the browser can do it in CSS; site.js does the rest. */
@supports (animation-timeline: view()) {
  .m-reveal { animation: fadeUp linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  .story .l2 { animation: show linear both; animation-timeline: --b2; animation-range: cover 36% cover 48%; }
  .story .l3 { animation: show linear both; animation-timeline: --b3; animation-range: cover 36% cover 48%; }
}
.js-motion .m-reveal { opacity: 0; transform: translateY(36px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js-motion .m-reveal.in { opacity: 1; transform: none; }
.js-motion .story .l2, .js-motion .story .l3 { opacity: 0; transition: opacity 500ms ease; }
.js-motion .story .layer.in { opacity: 1; }

/* Guided Du'a: rough words, the tap, the gold sweep, the du'a. */
@keyframes gwRough { 0%, 34% { opacity: 1; transform: none; } 40%, 94% { opacity: 0; transform: translateY(-8px); } 100% { opacity: 1; transform: none; } }
@keyframes gwDone { 0%, 38% { opacity: 0; transform: translateY(8px); } 46%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes gwSweep { 0%, 36% { transform: translateY(-110%); opacity: 0; } 38% { opacity: 1; } 46%, 100% { transform: translateY(110%); opacity: 0; } }
@keyframes gwTap { 0%, 26% { opacity: 0; transform: scale(0.7); } 30% { opacity: 1; transform: scale(1); } 36%, 100% { opacity: 0; transform: scale(1.35); } }
.gw-text { position: absolute; left: 24px; top: 203px; width: 342px; height: 276px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
.gw-text p { position: absolute; left: 0; top: 0; right: 0; font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 30px; color: #3b4237; }
.gw-rough { animation: gwRough 13s ease-in-out infinite; }
.gw-done { opacity: 0; animation: gwDone 13s ease-in-out infinite; }
.gw-sweep { position: absolute; left: -20px; right: -20px; top: 0; height: 120px; background: linear-gradient(180deg, rgba(217, 178, 104, 0), rgba(217, 178, 104, 0.42), rgba(217, 178, 104, 0)); animation: gwSweep 13s ease-in-out infinite; }
.gw-tap { position: absolute; left: 272px; top: 482px; width: 110px; height: 40px; border-radius: 999px; opacity: 0; box-shadow: 0 0 0 2px rgba(199, 154, 62, 0.9), 0 0 18px 4px rgba(217, 178, 104, 0.55); animation: gwTap 13s ease-out infinite; }

/* The lock screen: the newest arrives on top and the others slide down. */
.lock-bg { position: absolute; inset: 0; background: url("/assets/img/hope-scene.jpg") 50% 30% / cover; background-image: image-set(url("/assets/img/hope-scene.webp") type("image/webp"), url("/assets/img/hope-scene.jpg") type("image/jpeg")); }
.lock-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 25, 45, 0.38) 0%, rgba(15, 25, 45, 0.05) 38%, rgba(15, 25, 45, 0.1) 60%, rgba(15, 25, 45, 0.42) 100%); }
.lock-time { position: absolute; left: 0; right: 0; top: 84px; text-align: center; color: #fff; font-family: var(--font-system); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25); }
.lock-time .day { font-size: 21px; font-weight: 600; letter-spacing: 0.2px; }
.lock-time .clock { margin-top: 2px; font-size: 96px; font-weight: 600; line-height: 1; letter-spacing: -2px; }
.lock-list { position: absolute; left: 12px; right: 12px; top: 532px; height: 258px; }
.note { position: absolute; left: 0; right: 0; top: 0; border-radius: 22px; background: rgba(246, 243, 238, 0.78); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); padding: 12px 14px; display: flex; gap: 11px; align-items: flex-start; font-family: var(--font-system); animation: 9s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
/* Held on its first frame until the lock screen is on screen (site.js), so
   nobody scrolls in halfway through the loop. */
.lock-list.wait .note { animation-play-state: paused; }
.note img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.note .t { display: flex; justify-content: space-between; gap: 8px; }
.note .t b { font-size: 15px; font-weight: 600; line-height: 20px; color: #1c1c1e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note .t i { font-style: normal; font-size: 13px; line-height: 20px; color: #6e6e73; flex: none; }
.note .m { font-size: 15px; line-height: 20px; color: #1c1c1e; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note.a { height: 86px; transform: translateY(172px); animation-name: lsA; }
.note.b { height: 66px; transform: translateY(96px); animation-name: lsB; }
.note.c { height: 86px; animation-name: lsC; }
@keyframes lsA { 0% { opacity: 0; transform: translateY(-22px) scale(0.97); } 6%, 18% { opacity: 1; transform: translateY(0) scale(1); } 24%, 36% { opacity: 1; transform: translateY(76px); } 42%, 88% { opacity: 1; transform: translateY(172px); } 95%, 100% { opacity: 0; transform: translateY(172px); } }
@keyframes lsB { 0%, 18% { opacity: 0; transform: translateY(-22px) scale(0.97); } 24%, 36% { opacity: 1; transform: translateY(0) scale(1); } 42%, 88% { opacity: 1; transform: translateY(96px); } 95%, 100% { opacity: 0; transform: translateY(96px); } }
@keyframes lsC { 0%, 36% { opacity: 0; transform: translateY(-22px) scale(0.97); } 42%, 88% { opacity: 1; transform: translateY(0) scale(1); } 95%, 100% { opacity: 0; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .m-rise, .m-phones, .m-reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
  .js-motion .m-reveal { opacity: 1; transform: none; transition: none; }
  .gw-rough, .gw-sweep, .gw-tap { display: none; }
  .gw-done { animation: none; opacity: 1; transform: none; }
  .note { animation: none; opacity: 1; }
}
