:root {
    --accent: #50685f;
    --accent-dark: #354c44;
    --accent-soft: #e8eeeb;
    --warm: #ad9270;
    --bg: #f7f5ef;
    --surface: #fffefa;
    --surface-soft: #f1efe8;
    --text: #242722;
    --muted: #6e746d;
    --border: #dfded7;
    --shadow: 0 12px 38px rgba(35, 43, 38, .055);
    --radius: 16px;
    --quran-size: 33px;
    --header-height: 72px;
}

html[data-theme="dark"] {
    --accent: #a9c0b7;
    --accent-dark: #d1e0da;
    --accent-soft: #26322e;
    --warm: #c8ac85;
    --bg: #151815;
    --surface: #1c211e;
    --surface-soft: #222824;
    --text: #edf0eb;
    --muted: #aab1aa;
    --border: #343b36;
    --shadow: 0 12px 38px rgba(0, 0, 0, .18);
    color-scheme: dark;
}

html[data-theme="sepia"] {
    --accent: #6f6756;
    --accent-dark: #4f493c;
    --accent-soft: #ebe4d6;
    --bg: #eee6d6;
    --surface: #f8f0e0;
    --surface-soft: #e9decb;
    --text: #312c25;
    --muted: #746b5d;
    --border: #d9cdb8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
body.reading-mode .site-header,
body.reading-mode .site-footer,
body.reading-mode .mobile-nav,
body.reading-mode .surah-header { display: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.container { width: min(100% - 32px, 1160px); margin-inline: auto; }
.section { padding-block: clamp(44px, 7vw, 80px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 999; top: 8px; inset-inline-start: 8px; transform: translateY(-150%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { transform: none; }

.site-header {
    position: sticky;
    z-index: 80;
    top: 0;
    min-height: var(--header-height);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.header-inner { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark { display: block; width: 40px; height: 40px; border-radius: 11px; overflow: hidden; box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 16%, transparent); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 700; }
.brand small { margin-top: -3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.desktop-nav { display: flex; align-items: center; gap: 3px; }
.desktop-nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; transition: .18s ease; }
.desktop-nav a:hover { color: var(--text); background: var(--surface-soft); }
.header-actions { display: flex; align-items: center; gap: 7px; }
.language-select select { max-width: 118px; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 11px; outline: none; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.icon-button:hover { border-color: var(--accent); color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 95px; color: var(--muted); font-size: 11px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-inner p { margin: 0; }
.mobile-nav { position: fixed; z-index: 70; inset-inline: 10px; bottom: 10px; display: none; grid-template-columns: repeat(4,1fr); padding: 7px; border: 1px solid var(--border); border-radius: 15px; background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.mobile-nav a { display: grid; justify-items: center; gap: 1px; padding: 5px; color: var(--muted); font-size: 10px; }
.mobile-nav span { color: var(--accent); font-family: serif; font-size: 19px; line-height: 1; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border-radius: 11px; font-size: 13px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.secondary-button:hover { border-color: var(--accent); color: var(--accent); }
.text-link { color: var(--accent); font-size: 13px; font-weight: 700; }
.eyebrow { display: inline-block; margin-bottom: 9px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; }

@media (max-width: 820px) {
    .desktop-nav { display: none; }
    .brand small { display: none; }
}
@media (max-width: 680px) {
    :root { --header-height: 62px; --quran-size: 28px; }
    .container { width: min(100% - 22px, 1160px); }
    .brand strong { font-size: 13px; }
    .brand-mark { width: 36px; height: 36px; }
    .language-select select { width: 78px; }
    .reading-settings-button { display: none; }
    .mobile-nav { display: grid; }
    .site-footer { padding-bottom: 88px; }
    .footer-inner { display: block; }
    .footer-inner p + p { margin-top: 7px; }
}
