/* NoorScroll app prototype, direction A: light through the mihrab. Light and dark, sky follows the time of day. */
@font-face { font-family: Grosa; src: url(/fonts/Grosa-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Grosa; src: url(/fonts/Grosa-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: KFGQPC; src: url(/fonts/kfgqpc-hafs.otf) format('opentype'); font-display: swap; }

:root {
  --sans: Grosa, 'Hanken Grotesk', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --quran: KFGQPC, 'Amiri Quran', serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
.app[data-theme=light] {
  --bg: #F7F1E6; --fg: #2A211C; --mute: #2A211CA8; --card: #FFFFFF; --card2: #EFE5D3; --line: #2A211C1A;
  --accent: #B4441C; --btn: #163F35; --btnFg: #F7F1E6; --track: #2A211C14; --jd: #163F35; --jdFg: #F7F1E6;
  --mine: #B4441C; --glass: #F7F1E6F2; --glassFg: #2A211C; --shadow: 0 30px 60px -32px #2A211C66; --sheet: #F7F1E6;
}
.app[data-theme=dark] {
  --bg: #0E1D18; --fg: #F1E7D3; --mute: #F1E7D3A8; --card: #16302A; --card2: #1B3A32; --line: #F1E7D326;
  --accent: #D9B88A; --btn: #F1E7D3; --btnFg: #163F35; --track: #F1E7D31F; --jd: #D9B88A; --jdFg: #163F35;
  --mine: #F1E7D3; --glass: #0E1D18EB; --glassFg: #F1E7D3; --shadow: 0 30px 60px -30px #000C; --sheet: #12261F;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: #E6DCCB; color: #2A211C; font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.q { font-family: var(--quran); direction: rtl; font-weight: 400; }
.tr { font-family: var(--serif); font-style: italic; font-weight: 500; }
.s { font-size: 13.5px; color: var(--mute); }
small { display: block; font-size: 13.5px; color: var(--mute); }

/* ---------- stage (desktop) ---------- */
.stage { min-height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 56px; padding: 32px; }
.notes { max-width: 290px; justify-self: end; font-size: 13.5px; color: #2A211CA8; }
.notes h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.025em; color: #2A211C; margin: 14px 0 6px; }
.notes p { margin: 0; line-height: 1.5; }
.notes ol { padding-left: 18px; margin: 18px 0; line-height: 1.9; }
.notes ol li { cursor: pointer; }
.notes ol li:hover, .notes ol li.on { color: #2A211C; }
.notes ol li.on { font-weight: 500; }
.notes .restart { margin-top: 18px; border-bottom: 1px solid currentColor; }
.ctl { background: #F7F1E6; border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; }
.ctl-h { display: flex; justify-content: space-between; color: #2A211C; }
.ctl-h b { font-weight: 500; font-variant-numeric: tabular-nums; }
.ctl input { width: 100%; accent-color: #B4441C; margin: 0; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ctl-row button, #ctlLive { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #2A211C0F; color: #2A211C; }
.ctl-row button.on, #ctlLive.on { background: #163F35; color: #F7F1E6; }
#ctlLive { justify-self: start; }
.side { max-width: 260px; font-size: 12.5px; line-height: 1.6; color: #2A211C80; }

.device { position: relative; width: 390px; height: 844px; border-radius: 56px; background: #111; padding: 11px; box-shadow: 0 50px 100px -40px #2A211C99; }
.app { position: relative; width: 100%; height: 100%; border-radius: 45px; overflow: hidden; background: var(--bg); color: var(--fg); isolation: isolate; --top: 54px; transition: background .5s; }
.status { position: absolute; top: 0; left: 0; right: 0; height: 50px; z-index: 60; display: flex; justify-content: space-between; align-items: center; padding: 6px 30px 0 34px; font-size: 14px; font-weight: 500; pointer-events: none; transition: color .4s; font-variant-numeric: tabular-nums; }
.status .isl { position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; background: #000; border-radius: 20px; }
.status .bat { display: flex; gap: 6px; align-items: center; font-size: 12px; }

@media (max-width: 900px) {
  body { background: #0E1D18; }
  .stage { display: block; padding: 0; height: 100%; }
  .notes, .side { display: none; }
  .device { width: 100%; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; }
  .app { border-radius: 0; --top: max(env(safe-area-inset-top), 20px); }
  .status { display: none; }
}
/* ?embed: inside the landing page's phone mock, which draws its own frame */
.embed .stage { display: block; padding: 0; height: 100%; }
.embed .notes, .embed .side { display: none; }
.embed .device { width: 100%; height: 100vh; border-radius: 0; padding: 0; box-shadow: none; }
.embed .app { border-radius: 0; --top: 50px; }
.embed .status { display: flex; }
.embed .status .isl { display: none; }

/* ---------- sky ---------- */
.sky { position: relative; overflow: hidden; display: block; }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky.fill { position: absolute; inset: 0; }
.sky.hero { height: 300px; }
.sky.hero.short { height: 236px; }
.sky.band { height: 224px; flex: none; }
.on-scene { color: var(--scene-fg, #2A211C); transition: color .4s; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .45s var(--ease), transform .55s var(--ease); background: var(--bg); }
.screen.on { opacity: 1; pointer-events: auto; transform: none; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; width: 100%; border-radius: 999px; background: var(--btn); color: var(--btnFg); font-weight: 500; font-size: 15px; transition: transform .15s, opacity .3s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .3; cursor: default; }
.btn.line { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sm { display: inline-flex; width: auto; height: 36px; padding: 0 18px; font-size: 13.5px; }
.link { display: block; margin: 14px auto 0; font-size: 14px; color: var(--mute); text-align: center; }

.panel { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 26px 22px 22px; border-radius: 34px; background: var(--glass); color: var(--glassFg); box-shadow: var(--shadow); text-align: center; }
.panel h2 { font-size: 30px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; margin: 0; }
.panel .btn + .btn { margin-top: 10px; }
.brand { position: absolute; top: calc(var(--top) + 14px); left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 19px; font-weight: 500; letter-spacing: -0.03em; }
.ayah-ar { font-size: 30px; line-height: 1.9; }
.panel .tr { font-size: 21px; line-height: 1.3; margin: 6px 0 0; }
.ref { font-size: 13px; color: var(--mute); margin: 12px 0 20px; }

/* ---------- ayah feed ---------- */
.feedtop { position: absolute; top: calc(var(--top) + 8px); left: 22px; right: 22px; z-index: 3; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; pointer-events: none; }
.steps { display: inline-flex; gap: 5px; }
.steps i { width: 18px; height: 4px; border-radius: 4px; background: currentColor; opacity: .25; }
.steps i.on { opacity: 1; }
.feed { position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }
.slide { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; align-items: center; padding: 70px 18px 120px; }
.acard { border-radius: 30px; padding: 30px 22px 22px; text-align: center; background: var(--glass); color: var(--glassFg); box-shadow: var(--shadow); }
.acard .q { font-size: 29px; line-height: 2; }
.acard .tr { font-size: 20px; line-height: 1.32; margin-top: 8px; }
.acard .ref { margin: 14px 0 0; }
.acard .acts { display: flex; justify-content: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.acard .acts button { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.acard .acts button.on { background: var(--btn); color: var(--btnFg); box-shadow: none; }
#v-scroll .slide { padding-bottom: 70px; }
.feedfoot { position: absolute; left: 18px; right: 18px; bottom: 26px; z-index: 3; transition: opacity .4s, transform .4s var(--ease); }
.feedfoot.hide { opacity: 0; transform: translateY(10px); pointer-events: none; }

/* ---------- onboarding pages ---------- */
.ob-head { padding: 22px 22px 0; }
.ob-head h2 { font-size: 30px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; margin: 14px 0 6px; text-wrap: balance; }
.ob-head p { margin: 0; color: var(--mute); }
.choices { display: grid; gap: 8px; padding: 20px 18px 0; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 20px; background: var(--card); transition: box-shadow .2s; }
.choice b { display: block; font-weight: 500; font-size: 16px; }
.choice span { font-size: 13px; color: var(--mute); }
.choice .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); transition: all .2s; }
.choice.on { box-shadow: inset 0 0 0 1.5px var(--fg); }
.choice.on .tick { box-shadow: inset 0 0 0 7px var(--btn); }
.foot { margin-top: auto; padding: 16px 18px 26px; }
.minutes { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 26px calc(50% - 36px) 4px; scrollbar-width: none; }
.minutes::-webkit-scrollbar { display: none; }
.minutes button { flex: none; width: 72px; height: 72px; border-radius: 22px; scroll-snap-align: center; text-align: center; font-size: 26px; font-weight: 500; letter-spacing: -0.03em; color: var(--mute); transition: all .25s var(--ease); }
.minutes button.on { background: var(--btn); color: var(--btnFg); }
.min-label { text-align: center; font-size: 13px; color: var(--mute); margin-top: 6px; }
.card { display: block; width: 100%; border-radius: 24px; padding: 18px 20px; background: var(--card); color: var(--fg); }
.card.alt { background: var(--card2); }
.plan { margin: 18px 18px 0; width: auto; }
.plan p { margin: 6px 0 0; font-size: 17px; line-height: 1.4; letter-spacing: -0.01em; }
.plan b { font-weight: 500; color: var(--accent); }

/* ---------- main ---------- */
#main { background: var(--bg); }
.view { position: absolute; inset: 0 0 84px; display: none; flex-direction: column; }
.view.on { display: flex; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.tabs { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 9px 12px 27px; background: var(--bg); box-shadow: 0 -1px 0 var(--line); z-index: 5; }
.tabs button { border-radius: 16px; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--mute); transition: background .25s, color .25s; }
.tabs button.on { background: var(--btn); color: var(--btnFg); }
.prayers { display: flex; justify-content: space-between; padding: 14px 22px 0; }
.prayers span { display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.prayers b { font-weight: 500; font-size: 13px; }
.prayers span.on { color: var(--accent); }
.greet { padding: 16px 22px 4px; }
.greet h2, .phead h2 { font-weight: 500; font-size: 28px; letter-spacing: -0.035em; line-height: 1.08; margin: 6px 0 0; text-wrap: balance; }
.phead { padding: calc(var(--top) + 14px) 22px 0; }
.stack { display: grid; gap: 10px; padding: 14px 16px 22px; }
.card .r { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 { font-weight: 500; font-size: 21px; letter-spacing: -0.025em; margin: 6px 0 2px; }
.prog { height: 6px; border-radius: 6px; background: var(--track); margin-top: 14px; overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.avs { display: flex; flex: none; }
.avs span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 500; margin-left: -8px; border: 2px solid var(--card2); }
.avs span:first-child { margin-left: 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big { font-size: 46px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; margin: 10px 0 4px; }
.dots { display: flex; gap: 5px; margin-top: 12px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.dots i.today { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.ayahday .q { font-size: 23px; line-height: 2; margin-top: 10px; text-align: center; }
.ayahday .tr { font-size: 18px; line-height: 1.3; text-align: center; margin-top: 4px; }
.fine { font-size: 12.5px; color: var(--mute); padding: 6px 22px 26px; margin: 0; line-height: 1.6; }

/* quran */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card2); margin-top: 16px; }
.seg button { height: 34px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--mute); }
.seg button.on { background: var(--btn); color: var(--btnFg); }
.seg.mini { margin: 0; }
.seg.mini button { height: 28px; padding: 0 11px; font-size: 12.5px; }
.list { padding: 12px 16px 0; }
.srow { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; width: 100%; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.srow b { font-weight: 500; }
.srow .ar { font-family: var(--quran); font-size: 20px; color: var(--mute); }
.tile { position: relative; width: 46px; height: 54px; border-radius: 12px; overflow: hidden; }
.jrow { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.jrow b { font-weight: 500; }
.tag { font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--track); }
.tag.done { background: var(--jd); color: var(--jdFg); }
.tag.mine { box-shadow: inset 0 0 0 1.5px var(--mine); background: none; color: var(--mine); }

/* khatm */
.kgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; }
.kgrid button { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 500; text-align: center; box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .15s, background .3s; }
.kgrid button:active { transform: scale(.94); }
.kgrid .done { background: var(--jd); color: var(--jdFg); box-shadow: none; }
.kgrid .mine { box-shadow: inset 0 0 0 2px var(--mine); color: var(--mine); }
.kgrid .reading { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--track) 5px 7px); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--mute); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--line); }
.legend i.done { background: var(--jd); box-shadow: none; }
.legend i.mine { box-shadow: inset 0 0 0 1.5px var(--mine); }
.legend i.reading { box-shadow: inset 0 0 0 1.5px var(--accent); }
.members { padding: 6px 20px; }
.mem { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; font-size: 14.5px; }
.mem + .mem { border-top: 1px solid var(--line); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 500; }
.mem .ok { color: var(--accent); font-size: 13px; font-weight: 500; }
.mem-more { padding: 12px 0; font-size: 13px; color: var(--mute); border-top: 1px solid var(--line); }

/* you */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: left; }
.stats b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -0.04em; }
.stats span { font-size: 12.5px; color: var(--mute); }
.set-card { padding: 4px 20px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; }
.set + .set { border-top: 1px solid var(--line); }
.set-note { margin: -6px 0 12px; font-size: 12.5px; }

/* intro */
.back { position: absolute; top: calc(var(--top) + 6px); left: 14px; z-index: 4; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.intro-panel small { margin-bottom: 4px; }
.in-ar { font-size: 40px; line-height: 1.5; }
.intro-panel h2 { margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.facts span { display: block; font-size: 12.5px; color: var(--mute); }
.facts b { font-weight: 500; font-size: 17px; }
.note { min-height: 18px; margin-top: 10px; }

/* reader */
.rhead { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: calc(var(--top) + 4px) 18px 10px 14px; }
.rhead .back { position: static; }
.rhead b { display: block; font-weight: 500; font-size: 17px; }
.rhead .s { font-size: 12.5px; }
.rprog { height: 2px; background: var(--track); }
.rprog i { display: block; height: 100%; width: 0; background: var(--accent); }
.bism { text-align: center; font-size: 26px; padding: 22px 0 6px; }
.verse { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.verse .n { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; background: var(--track); color: var(--mute); }
.verse .q { font-size: 26px; line-height: 2.05; margin-top: 6px; }
.verse .tr { font-size: 18.5px; line-height: 1.38; margin-top: 4px; }
.rend { display: grid; gap: 12px; justify-items: center; padding: 30px 22px 40px; }
.rend .btn { width: auto; padding: 0 26px; }

/* sheets */
.scrim { position: absolute; inset: 0; background: #0008; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.bsheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; padding: 10px 20px 26px; border-radius: 30px 30px 0 0; background: var(--sheet); color: var(--fg); transform: translateY(105%); transition: transform .5s var(--ease); }
.bsheet.on { transform: none; }
.bsheet .grab { width: 38px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 16px; }
.bsheet h3 { font-size: 26px; font-weight: 500; letter-spacing: -0.035em; margin: 4px 0 6px; }
.bsheet p { margin: 0 0 16px; }
.bsheet .btn + .btn { margin-top: 10px; }
.wa { background: #E9E1D2; border-radius: 20px; padding: 14px; margin-bottom: 16px; }
.app[data-theme=dark] .wa { background: #0B1713; }
.bub { background: #D9FDD3; color: #111B21; border-radius: 14px 14px 4px 14px; padding: 6px 6px 8px; font-size: 13.5px; line-height: 1.4; margin-left: 30px; }
.app[data-theme=dark] .bub { background: #005C4B; color: #E9EDEF; }
.bub .lnk { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; background: #0000000F; border-radius: 10px; padding: 6px; margin-bottom: 6px; font-size: 12.5px; }
.bub .lnk b { font-weight: 500; }
.bub .lnk span:not(.lnk-art) { opacity: .7; }
.lnk-art { width: 54px; height: 54px; border-radius: 8px; }
.bub .time { text-align: right; font-size: 11px; opacity: .6; margin-top: 2px; }
.toast { position: absolute; left: 50%; bottom: 104px; transform: translate(-50%, 10px); z-index: 70; padding: 10px 16px; border-radius: 999px; background: var(--btn); color: var(--btnFg); font-size: 13.5px; font-weight: 500; white-space: nowrap; opacity: 0; transition: all .3s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

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