:root {
    --ink: #173530;
    --muted: #697975;
    --forest: #0b302b;
    --forest-light: #17443d;
    --gold: #d2b47a;
    --paper: #f7f7f2;
    --card: #fff;
    --line: #e3e9e4;
    --shadow: 0 18px 60px rgba(16, 45, 39, .08);
    font-family: system-ui, 'Segoe UI', Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.6; }
a { color: inherit; }
button, select, input { font: inherit; }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { min-height: 82px; padding: 0 max(24px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; gap: 40px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--forest); color: var(--gold); font-family: 'Amiri', serif; font-size: 24px; }
.main-nav { display: flex; gap: 28px; margin-inline-start: auto; }
.main-nav a { color: #52645f; text-decoration: none; font-size: 14px; font-weight: 600; }
.main-nav a:hover { color: var(--forest); }
.language-form select { max-width: 190px; padding: 9px 34px 9px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }

.hero { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; min-height: 450px; margin-top: 34px; padding: 60px clamp(28px, 6vw, 78px); overflow: hidden; color: #fff; background: radial-gradient(circle at 78% 20%, rgba(46,103,89,.5), transparent 32%), linear-gradient(125deg, #092b28, #17443d); border-radius: 28px; }
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { margin: 0 0 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; }
.hero h1 { max-width: 600px; margin: 0; font-family: 'Amiri', 'Noto Naskh Arabic', Georgia, serif; font-size: clamp(34px, 4.5vw, 55px); line-height: 1.2; font-weight: 400; letter-spacing: -.035em; }
.hero-description { max-width: 480px; margin: 20px 0 0; color: #d1ded8; font-size: 16px; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 32px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(210,180,122,.75); outline-offset: 3px; }
.button:disabled { opacity: .65; cursor: progress; }
.button-light { background: #fff; color: var(--forest); }
.button-primary { color: #fff; background: var(--forest); }
.button-primary:hover { background: var(--forest-light); }
.text-link { color: #fff; font-size: 14px; font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 5px; }
.hero-art { position: relative; display: grid; place-items: center; width: min(310px, 100%); aspect-ratio: 1; justify-self: end; border: 1px solid rgba(211,189,143,.22); border-radius: 50%; }
.art-ring { position: absolute; inset: 12%; border: 1px solid rgba(211,189,143,.3); border-radius: 50%; }
.art-ring-two { inset: 24%; border-style: dashed; transform: rotate(22deg); }
.art-center { display: flex; align-items: center; flex-direction: column; gap: 8px; color: var(--gold); text-align: center; }
.art-center span { font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 76px; line-height: 1; }
.art-center small { color: #dce6df; font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 15px; }

.feature-row { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 24px; }
.feature-card { min-height: 122px; display: flex; align-items: center; gap: 18px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 4px 24px rgba(16,45,39,.025); }
a.feature-card { text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
a.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-icon { display: grid; place-items: center; flex: 0 0 54px; width: 54px; height: 54px; color: #a98543; background: #f4efdf; border-radius: 16px; font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 28px; }
.feature-darood .feature-icon { color: #287064; background: #e8f0ec; }
.feature-copy { display: grid; gap: 3px; }
.feature-copy strong { font-size: 17px; }
.feature-copy span { color: var(--muted); font-size: 14px; }
.feature-arrow { margin-inline-start: auto; color: #80918a; font-size: 22px; }

.counter-section { display: grid; grid-template-columns: 1fr .8fr; gap: 40px; align-items: center; padding: 86px 0 76px; }
.counter-intro h2, .about-section h2 { max-width: 540px; margin: 0; font-family: 'Amiri', 'Noto Naskh Arabic', Georgia, serif; font-size: clamp(30px, 3.3vw, 42px); line-height: 1.2; font-weight: 400; }
.counter-intro p:not(.eyebrow), .about-section p:not(.eyebrow) { max-width: 500px; color: var(--muted); }
.counter-panel { display: grid; justify-items: center; gap: 11px; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.counter-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.counter-number { color: var(--forest); font-variant-numeric: tabular-nums; font-size: clamp(42px, 6vw, 60px); font-weight: 700; line-height: 1.1; }
.counter-feedback { min-height: 20px; margin: 0; color: #9b4939; font-size: 13px; }
.about-section { display: grid; grid-template-columns: 180px 1fr; gap: 30px; align-items: center; padding: 40px; margin-bottom: 80px; background: #eef2ec; border: 1px solid #e1e9e1; border-radius: 22px; }
.about-symbol { display: grid; place-items: center; width: 120px; height: 120px; margin: auto; color: #b28c4d; border: 1px solid #cdb887; border-radius: 50%; font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 52px; }
.about-section h2 { font-size: clamp(28px, 3vw, 38px); }

.site-footer { display: grid; grid-template-columns: auto 1fr; gap: 10px 30px; align-items: center; padding: 30px max(24px, calc((100vw - 1160px) / 2)); background: #092b28; color: #dbe5df; }
.brand-footer { color: #fff; }
.site-footer p { margin: 0; color: #c2d0c8; font-size: 13px; }
.site-footer p a { color: #f0d8a7; }
.footer-note { grid-column: 2; color: #91a49a !important; }

.reader-heading { padding: 64px 0 26px; }
.reader-heading .eyebrow { color: #9a7740; }
.reader-heading h1 { margin: 0; font-family: 'Amiri', Georgia, serif; font-size: clamp(38px, 5vw, 58px); line-height: 1.15; font-weight: 400; }
.reader-heading > p:last-child { margin: 10px 0 0; color: var(--muted); }
.reader-tools { display: grid; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.reader-form { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto minmax(180px, 1fr) minmax(180px, 1.25fr) auto; gap: 12px; align-items: center; }
.reader-form label { color: var(--muted); font-size: 13px; font-weight: 600; }
.reader-form select, .reader-form input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.reader-content { min-height: 350px; padding: 34px 0 90px; }
.empty-state { max-width: 650px; margin: 34px auto; padding: 38px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.empty-state h2 { margin: 10px 0; font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-weight: 400; font-size: 32px; }
.empty-state p { color: var(--muted); }
.empty-icon { color: #b28c4d; font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 48px; }
.surah-title { margin: 20px 0 12px; padding: 30px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.surah-kicker { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .1em; }
.surah-title h2 { margin: 6px 0; color: var(--forest); font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 36px; }
.surah-title p { margin: 0; color: var(--muted); }
.verse-row { display: grid; grid-template-columns: 62px 1fr; gap: 18px; padding: 26px 18px; border-bottom: 1px solid var(--line); }
.verse-meta { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; }
.verse-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--forest); background: #e7eee9; font-size: 13px; font-weight: 700; }
.verse-meta a { color: #9a7740; text-decoration: none; }
.verse-copy { min-width: 0; }
.arabic-verse { margin: 0; color: #183b34; font-family: 'Amiri', 'Noto Naskh Arabic', 'Times New Roman', serif; font-size: clamp(27px, 4vw, 38px); line-height: 2; text-align: right; }
.translated-verse { margin: 15px 0 0; color: #52645f; font-size: 17px; line-height: 1.8; }
.empty-search { padding: 30px; color: var(--muted); text-align: center; }
.audio-panel { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.audio-panel audio { width: min(560px, 100%); }
.reader-options { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; color: var(--muted); font-size: 13px; }
.reader-options input[type="range"] { width: min(180px, 34vw); accent-color: var(--forest); }
.button-subtle { min-height: 38px; padding-inline: 14px; color: var(--forest); background: #e7eee9; font-size: 13px; }
.bookmark-button { padding: 0; border: 0; background: transparent; color: #9a7740; font-size: 20px; cursor: pointer; }
.bookmark-button.is-saved { color: #b68431; }
.verse-footnotes { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.verse-footnotes summary { cursor: pointer; font-weight: 600; }
.verse-footnotes p { white-space: pre-wrap; }
.content-attribution { padding: 24px 0; color: var(--muted); font-size: 12px; text-align: center; }
.content-attribution a { color: var(--forest); }
.arabic-verse { font-size: var(--arabic-size, clamp(27px, 4vw, 38px)); }

html[dir="rtl"] .main-nav { margin-inline-start: 0; margin-inline-end: auto; }
html[dir="rtl"] .language-form { order: 3; }
html[dir="rtl"] .hero { direction: rtl; }
html[dir="rtl"] .hero-art { justify-self: start; }
html[dir="rtl"] .reader-form { direction: rtl; }
html[dir="rtl"] .site-footer { direction: rtl; }

@media (max-width: 900px) {
    .site-header { gap: 22px; }
    .main-nav { gap: 15px; }
    .hero { grid-template-columns: 1fr .65fr; }
    .reader-form { grid-template-columns: auto 1fr auto 1fr; }
    .reader-form input[type="search"] { grid-column: 1 / span 3; }
}
@media (max-width: 680px) {
    .wrap { width: min(100% - 32px, 540px); }
    .site-header { min-height: 72px; padding: 12px 16px; flex-wrap: wrap; gap: 10px 14px; }
    .brand { gap: 8px; font-size: 14px; }
    .brand-mark { width: 36px; height: 36px; font-size: 21px; }
    .main-nav { order: 3; width: 100%; justify-content: space-around; gap: 8px; padding-top: 5px; }
    .main-nav a { font-size: 13px; }
    .language-form { margin-inline-start: auto; }
    .language-form select { max-width: 145px; font-size: 13px; }
    .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 16px; padding: 36px 25px; border-radius: 20px; }
    .hero-art { width: 195px; margin: 32px auto 0; justify-self: center !important; }
    .art-center span { font-size: 55px; }
    .feature-row, .counter-section { grid-template-columns: 1fr; }
    .feature-row { gap: 12px; margin-top: 14px; }
    .feature-card { min-height: 100px; padding: 18px; }
    .counter-section { gap: 22px; padding: 58px 0; }
    .counter-panel { padding: 25px 20px 16px; }
    .about-section { grid-template-columns: 1fr; gap: 20px; padding: 25px; margin-bottom: 42px; text-align: center; }
    .about-symbol { width: 90px; height: 90px; font-size: 42px; }
    .site-footer { grid-template-columns: 1fr; gap: 9px; padding: 26px 18px; }
    .footer-note { grid-column: 1; }
    .reader-heading { padding: 42px 0 20px; }
    .reader-tools { padding: 14px; }
    .reader-form { grid-template-columns: 1fr; }
    .reader-form input[type="search"] { grid-column: auto; }
    .reader-form .button { width: 100%; }
    .verse-row { grid-template-columns: 40px 1fr; gap: 10px; padding: 21px 0; }
    .verse-number { width: 32px; height: 32px; }
    .arabic-verse { font-size: 29px; }
    .translated-verse { font-size: 15px; }
}
