/* muslimist: dark glass over a blurred page photo (--bg-img set on <body>) */

/* dark is the base; html[data-scheme] is resolved from the saved mode or the system in each page's head; data-glass="solid" drops the photo + frost */
:root {
  --fg: #fff; --mute: rgba(255,255,255,.68); --card: rgba(255,255,255,.07); --field: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.14); --accent: #fff; --on-accent: #111; --radius: 24px;
  --tint: #161618; --base-a: 45%; --k: 1; --blur: 22px;
  --page: #111; --solid: #1c1c1e; --sheet: rgba(28,28,30,.92); --hilite: rgba(255,255,255,.16);
  --veil: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.8)); --tone: brightness(.7) saturate(.75);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "me_quran", "Geeza Pro", "Noto Naskh Arabic", serif;
  color-scheme: dark;
}
/* light: full-screen photo, lightly darkened (white header/footer text on it), with warm cream cards */
[data-scheme="light"] {
  --fg: #1f1b16; --mute: rgba(31,27,22,.66); --card: rgba(60,40,20,.06); --field: #ece6db;
  --line: rgba(60,40,20,.12); --accent: #1f1b16; --on-accent: #f6f1e7;
  --tint: #fdfcf9; --base-a: 70%; --lift: 1.7;
  --page: #e6dfd2; --solid: #f6f1e7; --sheet: rgba(246,241,231,.97); --hilite: rgba(60,40,20,.08);
  --veil: linear-gradient(rgba(0,0,0,.52), rgba(0,0,0,.3) 70%); --tone: saturate(.7);
  color-scheme: light;
}
[data-scheme="light"]:not([data-glass="solid"]) :is(.top, .hero, .foot) { --fg: #fff; --mute: rgba(255,255,255,.85); --card: rgba(255,255,255,.18); color: var(--fg) }
[data-scheme="light"]:not([data-glass="solid"]) .hero { text-shadow: 0 1px 24px rgba(0,0,0,.45) }
[data-scheme="light"] .links:popover-open { --fg: #1f1b16; --mute: rgba(31,27,22,.66); --card: rgba(60,40,20,.08); color: var(--fg) }
[data-scheme="light"] .glass { box-shadow: 0 1px 2px rgba(60,40,20,.06), 0 10px 30px rgba(60,40,20,.1) }

@font-face { font-family: me_quran; src: url(/quran/fonts/me_quran.woff2) format('woff2'), url(/quran/fonts/me_quran.ttf) format('truetype'); font-display: swap } /* woff2: 66KB instead of 460KB */

* { box-sizing: border-box; margin: 0 }
html { background: var(--page); touch-action: manipulation } /* no double-tap zoom: quick taps (the adhkar counter) register right away; pinch zoom still works */
body { color: var(--fg); font: 16px/1.5 var(--font); min-height: 100vh; min-height: 100dvh; -webkit-text-size-adjust: 100%; display: flex; flex-direction: column }
/* page photo, sharp; a veil keeps text readable */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--sky), var(--veil), var(--bg-img) center/cover; filter: var(--tone); animation: drift 40s ease-in-out infinite alternate; pointer-events: none }
/* the next photo waits on ::after and fades in over the current one (site.js swaps them) */
body::after { background: var(--sky), var(--veil), var(--bg-next, none) center/cover; opacity: 0 }
/* the page photo fades in once it has loaded (site.js adds .bg-ready) */
body::before { transition: opacity .9s ease }
html:not(.bg-ready) body::before { opacity: 0 }
.swap body::after { opacity: 1; transition: opacity 2.5s ease }
/* gold accent, and a sky wash over the photo that follows the time of day (pages set html[data-sky]) */
:root { --gold: #e3bd74; --sky: linear-gradient(transparent, transparent) }
[data-scheme="light"] { --gold: #b58a3c }
[data-sky="fajr"] { --sky: linear-gradient(#ff9a8b66, #6a5acd33 60%, transparent) }
[data-sky="sunrise"] { --sky: linear-gradient(#ffb36b66, #ffd8a033 55%, transparent) }
[data-sky="duha"] { --sky: linear-gradient(#7ec8ff4d, #bfe6ff22 55%, transparent) }
[data-sky="dhuhr"] { --sky: linear-gradient(#a8dcff4d, #fff4d022 55%, transparent) }
[data-sky="asr"] { --sky: linear-gradient(#ffc76b55, #ffe2a822 55%, transparent) }
[data-sky="maghrib"] { --sky: linear-gradient(#ff6f6166, #c0469a40 50%, #3b2a6b33) }
[data-sky="isha"] { --sky: linear-gradient(#3a4aa066, #1b1f5a40 60%, transparent) }
[data-sky="night"] { --sky: linear-gradient(#141a4a66, #0a0d2a44 70%, transparent) }
[data-sky="lastthird"] { --sky: linear-gradient(#4b2e8a66, #1a145044 70%, transparent) }
@keyframes drift { from { transform: scale(1.03) translate(.5%, .3%) } to { transform: scale(1.07) translate(-.8%, -.5%) } }
/* phones: no drift; every glass card re-blurs the moving photo behind it each frame, which made scrolling lag */
/* phones: no blur anywhere. Live glass blur and a blurred full-screen photo both made iPhones freeze and drop tall cards
   (Safari runs out of graphics memory). A still photo with slightly more solid cards looks close and costs nothing. */
@media (pointer: coarse) {
  body::before, body::after { animation: none; filter: none }
  :root { --base-a: 80% }
  [data-scheme="light"] { --base-a: 90% }
  :is(.glass, .links, .pop, .subnav, .sheet::backdrop, .now a, .nudge a) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important }
}
a { color: inherit; text-decoration: none }
button, input, select { font: inherit; color: inherit }
button { cursor: pointer; border: 0; background: none }
img { display: block; max-width: 100% }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.mute { color: var(--mute) }
.center { text-align: center }
.glass { background: color-mix(in srgb, var(--tint) min(calc(var(--base-a) * var(--k)), 94%), transparent); border: 1px solid var(--line); backdrop-filter: blur(var(--blur)) saturate(1.4) brightness(var(--lift, 1)); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4) brightness(var(--lift, 1)) }
[data-glass="clear"] { --k: .35; --blur: 3px }
[data-glass="frosted"] { --k: 1.7; --blur: 50px }
/* light glass brightens what is behind it (dark text needs a light backing), so clear stays readable too */
[data-scheme="light"][data-glass="clear"] { --k: .55; --blur: 8px; --lift: 1.9 }
[data-scheme="light"][data-glass="frosted"] { --k: 1.4; --lift: 1.7 }
[data-scheme="light"] .glass { border-color: rgba(255,255,255,.55) }

/* header */
.top, .hero, .layout, .foot { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 16px }
.foot { margin-top: auto } /* short pages: footer sits at the bottom of the screen */
/* header: just the menu button, top right, floating over the page title; the menu opens as a popup with every page */
.top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end; align-items: center; height: calc(2 * clamp(44px, 7vh, 76px) + 1.05 * clamp(34px, 6vw, 64px)); /* buttons line up with the page title */ pointer-events: none; z-index: 5 }
.top > * { pointer-events: auto }
.brand { display: none }
.menu { display: grid; place-items: center; width: 40px; height: 40px; padding: 0 }
.links[popover] { margin: 0; border: 0; color: inherit; overflow: visible }
.links[popover]:not(:popover-open) { display: none }
.links[popover]:popover-open { position: fixed; top: calc(clamp(44px, 7vh, 76px) + .525 * clamp(34px, 6vw, 64px) + 30px); inset-inline: auto max(16px, calc((100vw - 1040px) / 2 + 16px)); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: min(340px, calc(100vw - 32px)); padding: 8px; border-radius: 20px;
  background: var(--sheet); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.35); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); animation: menu-in .18s ease-out }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98) } }
.links a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: 15.5px; font-weight: 600; color: var(--fg) }
.links a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round }
.links a:hover { background: var(--hilite) }
.links a[aria-current] { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent) }
.pill { padding: 6px 12px; border-radius: 99px; font-size: 14px; white-space: nowrap; color: var(--fg); background: var(--card) }
/* small popover (privacy note) */
.pop { margin: auto auto 24px; max-width: min(92vw, 420px); padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--sheet); color: var(--fg); font-size: 14px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px) }
.pop a { text-decoration: underline }
.foot { align-items: baseline }
.foot button, .foot select { font: inherit; color: inherit; text-transform: inherit; line-height: inherit; margin: 0; padding: 0; border: 0; background: none; cursor: pointer }
.foot select { appearance: none; -webkit-appearance: none; field-sizing: content; padding-inline-end: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='gray' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right center / 8px 5px }
[dir="rtl"] .foot select { padding-inline: 14px 0; background-position: left center }
.foot button:hover { color: var(--fg) }

/* page title */
.hero { padding-block: clamp(44px, 7vh, 76px) clamp(36px, 6vh, 64px); padding-inline-end: 64px }
.home .hero { padding-block: clamp(44px, 7vh, 76px) clamp(36px, 6vh, 64px) }
.landing .top { display: none }
.hero { text-shadow: 0 1px 24px color-mix(in srgb, var(--page) 70%, transparent) }
.hero h1 { font-size: clamp(34px, 6vw, 64px); letter-spacing: -.035em; line-height: 1.05 }
.hero p { color: var(--mute); margin-top: 4px; font-size: 16px }
.hero h1.title-btn { cursor: pointer; width: 100%; user-select: none; transition: color .3s ease, text-shadow .3s ease }
/* hover hint: the title warms to gold with a faint glow; only color changes, so nothing moves */
.hero h1.title-btn:is(:hover, :focus-visible) { color: color-mix(in srgb, var(--gold) 70%, var(--fg)); text-shadow: 0 0 28px color-mix(in srgb, var(--gold) 35%, transparent) }
.title-row { display: flex; align-items: center; gap: 16px }
.title-list, .title-row .title-x, .title-home, .title-open .title-row h1 { display: none }
.title-open .title-home { display: block; font-size: clamp(34px, 6vw, 64px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--mute) }
.title-open .title-home:hover { color: var(--fg) }
.title-open .title-row .title-x { display: grid; flex: none }
.title-open .title-list { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px }
.title-open body > :not(.top, .hero), .title-open .hero > :not(.title-row, .title-list) { display: none !important }
.hero h1, .title-list a, .title-home, .tile h2, .links a, .menu-settings { text-transform: lowercase }
.title-list a { font-size: clamp(34px, 6vw, 64px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--mute) }
.title-list a:hover, .title-list a[aria-current] { color: var(--fg) }

/* cards */
.layout { display: grid; gap: 16px; margin-block: 0 16px }
.card { border-radius: var(--radius); padding: 24px; min-width: 0 }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px }
.title { font-weight: 600; font-size: 17px; margin-inline-end: auto; text-align: start }
.icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 99px; color: var(--mute) }
.icon:hover { background: var(--field); color: var(--gold) }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

/* buttons */
.btn { padding: 10px 16px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-size: 14px }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
/* shared gold hover: cards, tiles and plain buttons get a gold edge */
.btn { transition: border-color .2s }
.btn:not(.primary):hover, :is(a.card, .tile):hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent) }
.btns { display: flex; flex-wrap: wrap; gap: 8px }
.wide { width: 100% }

/* home */
.next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px }
.next .label { flex-basis: 100%; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute) }
.next b, .next .big { font-size: 28px; letter-spacing: -.02em }
.next .big { font-weight: 400; margin-inline-end: auto }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 760px }
.tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1 }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr } }
/* compact card: title + description; the card itself is .glass so the glass level applies */
.tile { display: block; padding: 16px 20px; border-radius: 20px; transition: transform .2s }
.tile:hover { transform: translateY(-2px) }
.tile h2 { font-size: 18px; letter-spacing: -.01em }
.tile p { color: var(--mute); font-size: 13px; line-height: 1.35 }

/* quran */
.ayah { font: 2.2em/2.1 var(--qfont, var(--arabic)); text-align: center; direction: rtl; padding: 12px 0; overflow-wrap: anywhere }
.trans { text-align: center; font-size: 1.1em }
.whole { font: inherit; text-align: start; direction: ltr; padding: 0 }
.whole [data-v] { cursor: pointer; padding: 12px 10px; border-top: 1px solid var(--line); border-radius: 12px }
.whole [data-v].on { background: color-mix(in srgb, var(--gold) 9%, transparent) }
/* reading progress: a thin gold line along the top of the reader */
.reader { position: relative }
.reader::before { content: ""; position: absolute; top: 0; inset-inline-start: 24px; width: calc((100% - 48px) * var(--qp, 0)); height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold)); transition: width .4s ease; pointer-events: none }
[dir="rtl"] .reader::before { background: linear-gradient(-90deg, transparent, var(--gold)) }
.whole .ar { font: var(--asize, 2.2em)/2.1 var(--qfont, var(--arabic)); direction: rtl; text-align: right }
.whole .tr { font-size: var(--tsize, 1.1em) }
.num { font: .5em var(--font); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 99px; padding: 0 .5em; margin: 0 .3em; vertical-align: middle }
.player { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px }
.whole ~ .player { position: sticky; bottom: 16px }
.player .icon { background: var(--sheet) }
.play { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 99px; background: var(--accent); color: var(--on-accent) }
.play svg { width: 22px; height: 22px; fill: currentColor }
.status { text-align: center; font-size: 13px; color: var(--mute); min-height: 20px; margin-top: 8px }
/* tajweed colours: mid tones that read on light and dark */
.idghaam_shafawi, .idghaam_mutajaanisain, .idghaam_mutaqaaribain, .idghaam_ghunnah { color: #e04848 }
.idghaam_no_ghunnah { color: #c47070 } .ghunnah { color: #2fb34f } .qalqalah { color: #3d8fe8 } .iqlab { color: #b55ce0 }
.ikhfa, .ikhfa_shafawi, .madd_2 { color: #1fb3a0 } .madd_6, .madd_muttasil { color: #e53935 } .madd_246 { color: #ee9a1e }
.madd_munfasil { color: #19b383 } .hamzat_wasl { color: #84b82c } .lam_shamsiyyah { color: #c050e8 } .silent { color: #999 }

/* quran full screen: the reader card fills the window, everything else hides */
:root.vt-focus .reader { view-transition-name: reader }
:root.vt-focus .reader .card-head { view-transition-name: qhead }
:root.vt-focus #text { view-transition-name: qtext }
:root.vt-focus #trans { view-transition-name: qtrans }
:root.vt-focus .reader .player { view-transition-name: qplayer }
/* each piece glides to its new place; text swaps with a quick fade instead of stretching */
:root.vt-focus::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1) }
:root.vt-focus::view-transition-old(qtext), :root.vt-focus::view-transition-old(qtrans) { animation: .18s ease-out both vt-fade-out }
:root.vt-focus::view-transition-new(qtext), :root.vt-focus::view-transition-new(qtrans) { animation: .3s .22s ease-in both vt-fade-in; height: 100%; object-fit: none; object-position: top }
:root.vt-focus::view-transition-old(root) { animation: .25s ease-out both vt-fade-out }
:root.vt-focus::view-transition-new(root) { animation: .25s ease-in both vt-fade-in }
@keyframes vt-fade-out { to { opacity: 0 } }
@keyframes vt-fade-in { from { opacity: 0 } }
.focus .top, .focus .hero, .focus .foot { display: none }
.focus .reader { --side: clamp(16px, 8vw, 120px); position: fixed; inset: 0; z-index: 5; margin: 0; border-radius: 0; border: 0; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: safe center; padding: calc(132px + env(safe-area-inset-top)) var(--side) calc(132px + env(safe-area-inset-bottom)); font-size: 1.35em }
.focus .reader .card-head { position: fixed; top: 0; inset-inline: 0; z-index: 6; margin: 0; font-size: 16px; padding: calc(12px + env(safe-area-inset-top)) var(--side) 24px;
  background: linear-gradient(color-mix(in srgb, var(--page) 70%, transparent), transparent) }
.focus .reader .card-head > * { opacity: .7 }
.focus .reader .card-head > :hover { opacity: 1 }
.focus #trans { max-width: 60ch; align-self: center; color: var(--mute) }
.focus .player { position: fixed; bottom: 0; inset-inline: 0; z-index: 6; margin: 0; padding: 40px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 16px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--page) 88%, transparent) 55%) }
.focus .status { position: fixed; inset: auto 0 6px; margin: 0; min-height: 0; font-size: 12px; z-index: 6 }
.focus .status:empty { display: none }

/* times */
.prayers b, .next .big, #where .mute, #where-coords { direction: ltr; unicode-bidi: isolate }
.prayers { list-style: none; padding: 0 }
.prayers li { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px; border-top: 1px solid var(--line); font-size: 18px; color: var(--mute) }
.prayers li:first-child { border: 0 }
.prayers b { font-variant-numeric: tabular-nums; font-weight: 500 }
.prayers .now { color: var(--fg); font-weight: 700; background: color-mix(in srgb, var(--gold) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 12px; border-color: transparent; padding-inline: 12px }
.prayers .now > span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 10px; vertical-align: middle; border-radius: 99px; background: var(--gold); box-shadow: 0 0 10px var(--gold) }
.prayers .now b { color: var(--gold) }
.prayers .now + li { border-color: transparent }
.prayers .past { opacity: .4 }
/* times: next prayer up top */
.next-up { text-align: center; padding: 6px 0 20px }
.next-up .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute) }
.next-time { font-size: clamp(40px, 7vw, 56px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0; direction: ltr; unicode-bidi: isolate }
/* hijri date as a small gold pill */
.hj { display: inline-block; margin-inline-start: 8px; padding: 1px 10px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--gold); font-size: 14px; text-shadow: none; white-space: nowrap }
/* the day's prayers as dots on one line (showPrayers fills .day-line) */
/* day timeline: replaces the plain progress bar */
.day-line { position: relative; height: 3px; margin: 34px 12px 32px; border-radius: 99px; background: var(--line) }
.day-line .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--gold)) }
[dir="rtl"] .day-line .fill { background: linear-gradient(-90deg, transparent, var(--gold)) }
.day-line span { position: absolute; top: 50%; translate: -50% -50%; display: grid; justify-items: center }
[dir="rtl"] .day-line span, [dir="rtl"] .day-line em { translate: 50% -50% }
.day-line b { width: 9px; height: 9px; border-radius: 99px; background: var(--solid); border: 1.5px solid var(--mute) }
.day-line .past b { background: var(--gold); border-color: var(--gold) }
.day-line .next b { width: 13px; height: 13px; border-color: var(--gold); background: transparent; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent), 0 0 16px var(--gold) }
.day-line small { position: absolute; top: 15px; font-size: 10.5px; letter-spacing: .04em; color: var(--mute); white-space: nowrap }
.day-line span:nth-of-type(even) small { top: auto; bottom: 15px }
.day-line .next small { color: var(--fg); font-weight: 600 }
.day-line em { position: absolute; top: 50%; translate: -50% -50%; width: 2px; height: 15px; border-radius: 2px; background: var(--fg); box-shadow: 0 0 10px var(--fg) }
@media (max-width: 640px) { .day-line small { display: none } .day-line { margin: 18px 4px 14px } }
/* 9. last ten minutes: the next dot pulses */
.soon .next-in { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600 }
.soon .day-line .next b { animation: pulse 1.6s ease-in-out infinite }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--gold) 10%, transparent), 0 0 22px var(--gold) } }
@media (prefers-reduced-motion: reduce) { .soon .day-line .next b { animation: none } }
.next-up .bar { height: 4px; max-width: 280px; margin: 14px auto 0; border-radius: 99px; background: var(--line); overflow: hidden }
.next-up .bar i { display: block; height: 100%; background: var(--fg); border-radius: 99px; transition: width .6s ease }
.prayers .now b { font-weight: 700 }
.prayers small { font-size: 13px; color: var(--mute); font-weight: 400; margin-inline-start: 8px }

/* qibla */
.compass { width: min(300px, 76vw); margin: 4px auto 8px; display: block; overflow: visible }
.compass .ring { fill: var(--field); stroke: var(--line); stroke-width: 1.5 }
.compass .ticks { stroke: var(--mute); stroke-width: 1.2; stroke-linecap: round }
.compass text { fill: var(--mute); font: 600 13px var(--font); text-anchor: middle }
.compass .north { fill: var(--fg) }
.compass .kaaba { font-size: 22px }
.compass .needle { fill: var(--fg); transition: fill .3s }
.compass.facing .needle { fill: var(--gold) }
.compass.facing .ring { stroke: var(--gold); stroke-width: 3 }
/* gold north, kaaba and hub; the needle swings into place on load */
.compass .north { fill: var(--gold) }
.compass .ticks line:first-child { stroke: var(--gold); stroke-width: 2.5 }
.compass .hub { fill: var(--gold) }
#needle { transform-box: view-box; transform-origin: 100px 100px; transform: rotate(var(--deg, 0deg)) }
.ready #needle { animation: swing 1.4s .3s cubic-bezier(.3, 1.35, .5, 1) both }
@keyframes swing { from { transform: rotate(calc(var(--deg, 0deg) - 140deg)) } }
@media (prefers-reduced-motion: reduce) { .ready #needle { animation: none } }
.compass .hub { fill: var(--fg) }
.qibla-deg { font-size: 15px }
.qibla-deg b { font-size: 44px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums }
.qibla-msg { color: var(--mute); font-size: 14px; min-height: 21px; margin: 6px 0 14px }
.compass.facing ~ .qibla-msg { color: var(--gold); font-weight: 600 }
#dial { transition: transform .15s ease-out; transform-origin: 100px 100px }

/* duaa */
.search { flex: 1; min-width: 0; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px 50% / 17px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 38px; transition: border-color .2s, box-shadow .2s }
[dir="rtl"] .search { background-position: calc(100% - 12px) 50%; padding: 10px 38px 10px 14px }
.search:focus { outline: none; border-color: color-mix(in srgb, var(--gold) 65%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 15%, transparent) }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 4px; scrollbar-width: none }
.chips button { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 14px; white-space: nowrap; color: var(--mute); transition: border-color .2s, color .2s }
.chips button:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--fg) }
.chips button[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 60%, transparent) }

/* settings sheet */
.sheet { margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88vh; padding: 0; border: 0; background: var(--sheet); color: var(--fg); border-radius: var(--radius) var(--radius) 0 0; overscroll-behavior: contain }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: var(--radius) } }
.sheet::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(4px) }
.sheet form { display: grid; gap: 14px; padding: 0 24px calc(28px + env(safe-area-inset-bottom)) }
/* header stays put while the sheet scrolls, so the close button is always in reach */
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0 -24px; padding: 18px 16px 12px 24px; background: var(--sheet); border-bottom: 1px solid var(--line) }
[dir="rtl"] .sheet-head { padding: 18px 24px 12px 16px }
.sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--line) }
@media (min-width: 640px) { .sheet-head::before { display: none } }
.sheet h2 { font-size: 18px; outline: none }
.close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; background: var(--field); border: 1px solid var(--line); color: var(--fg) }
.close:hover { background: var(--hilite) }
.close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round }
[data-glass="solid"] .sheet-head { background: var(--solid) }
.sheet label { display: grid; gap: 4px; font-size: 12px; color: var(--mute) }
.sheet select, .sheet input:not([type=checkbox]) { width: 100%; font-size: 15px; color: var(--fg); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px }
select option { background: var(--page) }
.sheet .check { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--fg) }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.note { color: var(--mute); font-size: 13px }
.sheet-sub { font-size: 15px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line) }

/* solid: no photo, no frost, plain cards */
[data-glass="solid"] body::before, [data-glass="solid"] body::after { display: none }
[data-glass="solid"] .glass, [data-glass="solid"] .sheet { background: var(--solid); backdrop-filter: none; -webkit-backdrop-filter: none }
[data-glass="solid"] { --field: var(--page) }

/* footer */
.foot { text-transform: lowercase; display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; color: var(--mute); font-size: 12px; padding-block: 24px 28px; opacity: .55; transition: opacity .2s }
.foot:hover, .foot:focus-within { opacity: 1 }
.foot a:hover { color: var(--fg) }
.heart { color: #e25555 }

@media (max-width: 640px) {
  .card { padding: 18px }
  .ayah { font-size: 1.8em }
  .checks { grid-template-columns: 1fr 1fr }
}
.search::placeholder { color: var(--mute) }

/* pages fill in by script after load: title and content stay hidden until html.ready, then fade up in order */
html:not(.ready) :is(.hero > :not(h1, .title-row), main, .foot) { opacity: 0 }
.ready :is(.hero > :not(h1, .title-row), main > *) { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both } /* the title stays still: it is the anchor between pages */
.ready main > :nth-child(2) { animation-delay: .06s }
.ready main > :nth-child(3) { animation-delay: .12s }
.ready main > :nth-child(4) { animation-delay: .18s }
.ready .foot { animation: rise .5s .2s cubic-bezier(.2, .8, .2, 1) both }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } }

/* animated page changes (browsers without support just navigate normally) */
@view-transition { navigation: auto }
.top { view-transition-name: top }
::view-transition-old(root) { animation: .18s ease-in both page-out }
::view-transition-new(root) { animation: .28s ease-out both page-in }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px) } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px) } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none } body::before, body::after, .ready :is(.hero > *, main > *, .foot) { animation: none } }

/* prayer alert banner */
.athan-toast { position: fixed; z-index: 50; inset: auto auto calc(16px + env(safe-area-inset-bottom)) 50%; margin: 0; border: 1px solid var(--line); color: var(--fg); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 18px; max-width: calc(100vw - 24px); box-shadow: 0 12px 40px rgba(0,0,0,.3); animation: rise .4s both }
.athan-toast a { flex: 1; font-size: 15px }
.athan-toast .btn { padding: 8px 12px }

/* sub-pages switch (Quran: Read | Progress) */
.subnav { display: flex; width: fit-content; max-width: calc(100% - 32px); margin: 0 auto 14px; margin-inline-start: max(16px, calc((100% - 1040px) / 2 + 16px)); padding: 3px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px) }
.subnav a { padding: 7px 16px; border-radius: 99px; font-size: 14.5px; color: var(--mute) }
.subnav a[aria-current] { background: var(--fg); color: var(--page) }
.focus .subnav { display: none }

/* sliding between sub-pages: the card area slides, the header, title and switch stay; the pill moves across */
.subnav { view-transition-name: subnav }
.subnav a[aria-current] { view-transition-name: subnav-pill }
main.layout { view-transition-name: page-main }
html:active-view-transition-type(slide-fwd, slide-back)::view-transition-old(root),
html:active-view-transition-type(slide-fwd, slide-back)::view-transition-new(root) { animation: none }
html:active-view-transition-type(slide-fwd, slide-back)::view-transition-group(subnav-pill) { animation-duration: .35s; animation-timing-function: cubic-bezier(.3, .8, .2, 1) }
html:active-view-transition-type(slide-fwd)::view-transition-old(page-main) { animation: .32s cubic-bezier(.4, 0, .2, 1) both slide-out-left }
html:active-view-transition-type(slide-fwd)::view-transition-new(page-main) { animation: .32s cubic-bezier(.4, 0, .2, 1) both slide-in-right }
html:active-view-transition-type(slide-back)::view-transition-old(page-main) { animation: .32s cubic-bezier(.4, 0, .2, 1) both slide-out-right }
html:active-view-transition-type(slide-back)::view-transition-new(page-main) { animation: .32s cubic-bezier(.4, 0, .2, 1) both slide-in-left }
@keyframes slide-out-left { to { transform: translateX(-30%); opacity: 0 } }
@keyframes slide-in-right { from { transform: translateX(30%); opacity: 0 } }
@keyframes slide-out-right { to { transform: translateX(30%); opacity: 0 } }
@keyframes slide-in-left { from { transform: translateX(-30%); opacity: 0 } }
.no-rise :is(.hero > *, main > *, .foot) { animation: none !important }
.title-quiet :is(main > *, .foot, .title-row h1, .hero > p) { animation: none !important }

/* site settings popup */
.sheet .field { display: grid; gap: 4px; font-size: 12px; color: var(--mute) }
.seg2 { display: flex; padding: 3px; border-radius: 12px; background: var(--field); border: 1px solid var(--line) }
.seg2 button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 14px; color: var(--mute) }
.seg2 button[aria-pressed="true"] { background: var(--fg); color: var(--page) }
.menu-settings { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; padding: 11px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; font-size: 15px; font-weight: 600; color: var(--mute) }
.menu-settings:hover { color: var(--fg) }

/* title menu: a tapped page name flies into the next page's title; the list rises in, the page fades back on close */
.hero h1, .title-home { view-transition-name: page-title }
::view-transition-group(page-title) { animation-duration: .4s; animation-timing-function: cubic-bezier(.2, .8, .2, 1) }
::view-transition-old(page-title), ::view-transition-new(page-title) { height: 100%; object-fit: none; object-position: left center }
[dir="rtl"]::view-transition-old(page-title), [dir="rtl"]::view-transition-new(page-title) { object-position: right center }
@media (prefers-reduced-motion: no-preference) {
  .title-open :is(.title-list a, .title-home) { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, -1) * 25ms + 25ms) }
  .hero:has(.title-btn) > p { animation: vt-fade-in .3s ease-out both }
}
/* homepage: its header is hidden, so show it for the X */
.title-open .landing .top { display: flex }
/* header buttons (menu and the title menu's X): bigger, bolder */
.top :is(.menu, .title-x) { width: 48px; height: 48px; border: 1.5px solid var(--line) }
.top :is(.menu, .title-x) svg { width: 22px; height: 22px; stroke-width: 2.4 }
/* homepage: the title and the menu's first entry are the same word, so it stays put (no fade, no dimming) */
.title-open .landing .title-home { color: var(--fg); animation: none !important }
/* the X sits on top of the menu button; they crossfade when the title menu opens and closes */
.top .title-x { position: absolute; inset-inline-end: 16px; top: 50%; margin-top: -24px }
.top :is(.menu, .title-x) { transition: opacity .25s ease, visibility .25s }
.top .title-x, .title-open .top .menu { opacity: 0; visibility: hidden }
.title-open .top .title-x { opacity: 1; visibility: visible }
@starting-style { .title-open .top .title-x { opacity: 0 } } /* homepage: its header only appears when the menu opens */
/* settings popups fade (and rise a little) in and out */
.sheet, .sheet::backdrop { opacity: 0; transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1), display .25s allow-discrete, overlay .25s allow-discrete }
.sheet { transform: translateY(12px) }
.sheet[open], .sheet[open]::backdrop { opacity: 1 }
.sheet[open] { transform: none }
@starting-style { .sheet[open], .sheet[open]::backdrop { opacity: 0 } .sheet[open] { transform: translateY(12px) } }
@media (prefers-reduced-motion: reduce) { .sheet { transform: none } }
