:root { color-scheme: dark; --bg: #101112; --surface: #1b1d1e; --text: #f3f2ed; --muted: #c6cacb; --divider: #494b4c; --arabic-size: 30px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.65; min-height: 100svh; }
button, input, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 48px; border: 1px solid transparent; border-radius: 26px; padding: 10px 18px; background: transparent; color: var(--text); cursor: pointer; line-height: 1.4; }
button:hover:not(:disabled) { background: #f3f2ed14; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--text); color: var(--bg); font-weight: 550; }
button.primary:hover { background: #dcdcd6; }
button.outline { border-color: var(--divider); }
a { color: var(--text); text-underline-offset: 4px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
h1 { font-weight: 350; font-size: clamp(32px, 4vw, 40px); line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-weight: 500; font-size: 22px; line-height: 1.4; }
h3 { font-size: 16px; font-weight: 550; }
[hidden] { display: none !important; }
#landscape { position: fixed; inset: 0; z-index: -1; background: var(--bg); }
#poster, #background-video { width: 100%; height: 100%; position: absolute; object-fit: cover; object-position: 50% 50%; }
.scrim { position: absolute; inset: 0; background: linear-gradient(to bottom, #101112a1 0%, #101112ad 45%, #101112c7 100%); }
body[data-screen="reading"] .scrim { background: linear-gradient(to bottom, #101112ad, #101112ad 65%, #101112b8); }
#app { max-width: 800px; margin: auto; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 24px; font-size: 14px; }
.wordmark { letter-spacing: .015em; font-weight: 500; }
.topbar button { padding-inline: 12px; }
.home-header { justify-content: space-between; }
.home-logo { display: block; width: 72px; height: 37.5px; object-fit: contain; flex-shrink: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.home-header .icon-button { display: grid; place-items: center; width: 48px; min-width: 48px; height: 48px; padding: 12px; border-radius: 50%; }
.icon-button svg { width: 22px; height: 22px; }
.home, .rest { min-height: calc(100svh - 48px); display: flex; flex-direction: column; }
.home-intro { margin: auto 0; padding: 64px 0 56px; max-width: 520px; }
.home-intro p { margin-top: 24px; max-width: 380px; color: var(--text); }
.home-controls { width: 100%; max-width: 520px; }
.scene-button { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 100%; text-align: left; }
.scene-button .arrow { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -4px 2px 0 auto; flex-shrink: 0; }
.glass-control { border: 1px solid #f3f2ed66; background: linear-gradient(135deg, #f3f2ed18, #f3f2ed04), #10111266; box-shadow: inset 0 1px 0 #ffffff24, 0 4px 16px #00000024; -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15); padding: 12px 18px; }
.glass-control:hover:not(:disabled) { border-color: #f3f2eda6; background: linear-gradient(135deg, #f3f2ed24, #f3f2ed0a), #10111280; }
.glass-control:active:not(:disabled) { background-color: #10111299; }
.icon-control { display: grid; place-items: center; width: 48px; min-width: 48px; height: 48px; padding: 12px; border-radius: 50%; flex-shrink: 0; }
.icon-control svg { width: 22px; height: 22px; }
.home-controls .media-bar { margin: 0; flex-wrap: nowrap; }
.home-controls .scene-button { flex: 1; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 12px 0; cursor: pointer; }
.toggle-row small { display: block; font-size: 14px; color: var(--muted); }
input[type="checkbox"] { appearance: none; width: 44px; height: 26px; border-radius: 18px; border: 1px solid #94999a; background: #1b1d1e; position: relative; flex-shrink: 0; cursor: pointer; }
input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); }
input[type="checkbox"]:checked { background: var(--text); border-color: var(--text); }
input[type="checkbox"]:checked::before { left: 21px; background: var(--bg); }
.start { width: 100%; margin-top: 24px; padding: 16px 20px; }
.home-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; font-size: 14px; }
.adab-button { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; border-color: #f3f2ed66; background: #10111233; text-align: center; transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease; }
.adab-button .arrow { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); justify-self: end; }
.adab-button:hover { border-color: #f3f2ed99; }
.adab-button:active { background: #f3f2ed1a; transform: translateY(1px); }
.asset-note, .muted { color: var(--muted); font-size: 14px; }
.asset-note { margin-top: 8px; }
.reading-heading { margin: 40px 0 24px; }
.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.arabic { font-family: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif; font-size: var(--arabic-size); line-height: 1.9; text-align: right; overflow-wrap: break-word; white-space: pre-line; }
.transliteration { margin-top: 32px; color: var(--muted); }
.translation { margin-top: 24px; }
.translation .eyebrow { margin-bottom: 8px; }
.reading-copy p { white-space: pre-line; }
.guidance { margin-top: 32px; font-size: 15px; color: var(--muted); }
.reader .eyebrow, .reader .transliteration, .reader .guidance, .reader .muted { color: #dde0db; }
.counter-wrap { display: flex; align-items: center; justify-content: center; gap: 20px; text-align: center; margin: 32px 0; }
.counter { border: 1px solid var(--muted); border-radius: 50%; width: 128px; height: 128px; display: block; margin: 0; font-size: 24px; font-variant-numeric: tabular-nums; padding: 8px; flex-shrink: 0; }
.counter-wrap + .guidance { margin-top: 24px; }
.reader-footer { margin-top: 40px; padding-bottom: 8px; }
.media-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 20px 0; font-size: 14px; }
.media-bar .scene-button { width: auto; }
.navigation { display: flex; gap: 16px; }
.navigation button { flex: 1; }
.skip { display: block; margin: 12px auto 0; color: var(--muted); font-size: 14px; }
.rest-message { margin: auto; text-align: center; padding: 64px 0; max-width: 540px; }
.rest-controls { text-align: center; }
.rest-controls > button { margin: 8px; }
.timer-select { display: flex; justify-content: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.timer-select button[aria-pressed="true"] { border-color: var(--text); }
.dim-wake { display: block; width: 100%; flex: 1; border-radius: 0; color: var(--muted); }
body.dimmed .scrim { background: #101112ed; }
.loading { padding: 30vh 0; text-align: center; }
#notice { max-width: 760px; margin: 0 auto; padding: 12px 20px max(20px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; text-align: center; }
dialog { border: 1px solid var(--divider); border-radius: 22px; background: var(--surface); color: var(--text); padding: 24px; width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 48px); overflow-y: auto; }
dialog::backdrop { background: #0009; }
.panel-header { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: 0 -24px 0 var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-header button { flex-shrink: 0; }
.exit-actions { display: grid; gap: 12px; }
.media-credits { margin-bottom: 24px; }
.media-credits summary { cursor: pointer; min-height: 48px; padding: 12px 0; }
.media-credits p { margin: 8px 0 16px; color: var(--muted); font-size: 14px; }
#panel-body > p, .source-field, .guide-item { margin-bottom: 24px; }
.source-field p, .guide-item p { white-space: pre-line; margin-top: 8px; }
.source-links { display: flex; flex-wrap: wrap; gap: 16px; }
.preset-option { width: 100%; border-radius: 0; text-align: left; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; }
.preset-option[aria-pressed="true"] { border-bottom-color: var(--muted); }
.preset-check { width: 8px; height: 14px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); align-self: center; flex-shrink: 0; margin-right: 6px; }
.preset-option small { display: block; font-size: 14px; color: var(--muted); }
.select-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
select { max-width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--divider); border-radius: 12px; padding: 12px; min-height: 48px; }
input[type="range"] { accent-color: var(--text); max-width: 100%; }
@media (min-width: 768px) { #app { padding-inline: 32px; } .home-controls { margin-bottom: 16px; } }
@media (min-width: 480px) { .exit-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { #app { padding-inline: 16px; } .wordmark { max-width: 130px; } .topbar { gap: 4px; } .topbar button { padding-inline: 8px; } }
@media (max-width: 767px) { dialog { margin: auto auto 12px; padding: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (prefers-reduced-motion: reduce) { .adab-button:active { transform: none; } }
