:root,
html[data-theme="light"] {
    color-scheme: light;
    --page: #F6F3EA;
    --card: #ffffff;
    --card-active: #fffdf6;
    --green: #1F6B45;
    --green-soft: #E7F3EA;
    --gold: #E8B84A;
    --text: #1A2E22;
    --muted: #6B7C70;
    --shadow: 0 12px 30px rgba(26, 46, 34, 0.08);
    --nav-bg: rgba(246, 243, 234, 0.92);
    --input: #F6F3EA;
    --border: rgba(31, 107, 69, 0.08);
    --mini-bg: rgba(255, 255, 255, 0.92);
    --footer-bg: #15241C;
    --footer-text: #F3F0E7;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page: #101816;
    --card: #18241E;
    --card-active: #21332A;
    --green: #4CB87A;
    --green-soft: #1A3328;
    --gold: #E8B84A;
    --text: #F3F0E7;
    --muted: #9BB0A3;
    --shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
    --nav-bg: rgba(16, 24, 22, 0.9);
    --input: #121C18;
    --border: rgba(243, 240, 231, 0.08);
    --mini-bg: rgba(24, 36, 30, 0.94);
    --footer-bg: #0C1410;
    --footer-text: #F3F0E7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: Nunito, system-ui, sans-serif;
    line-height: 1.55;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 6vw;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}
.mark {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    border-radius: 0.7rem;
    font-size: 1rem;
}
.nav nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font-weight: 700; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover { color: var(--green); }

main { padding: 1.5rem 6vw 4rem; max-width: 1120px; margin: 0 auto; }

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem 0 2.5rem;
}
.kicker {
    color: var(--green);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: 1.6rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    border: 0;
}
.btn-primary { background: var(--green); color: white; }
.btn-ghost { background: var(--green-soft); color: var(--green); }
.btn-store { background: var(--text); color: var(--page); }
.nav-store {
    background: var(--green) !important;
    color: white !important;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
}
.theme-toggle {
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}
.theme-toggle svg { width: 1.05rem; height: 1.05rem; display: block; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.hero-card, .card {
    background: var(--card);
    border-radius: 1.4rem;
    box-shadow: var(--shadow);
    padding: 1.25rem 1.35rem;
}
.hero-card .arabic {
    font-size: 1.7rem;
    margin: 0.4rem 0 0.8rem;
}
.meta { color: var(--muted); font-size: 0.92rem; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 0.5rem 0 2.2rem;
}
.stat {
    background: var(--green-soft);
    border-radius: 1.1rem;
    padding: 1rem;
    text-align: center;
}
.stat b { display: block; font-size: 1.6rem; color: var(--green); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.feature h3 { margin-bottom: 0.3rem; }
.icon {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    background: var(--green-soft);
    color: var(--green);
    border-radius: 0.8rem;
    margin-bottom: 0.7rem;
    font-size: 1.1rem;
}

.section { margin: 2.6rem 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.list a.card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease;
}
.list a.card:hover { transform: translateY(-2px); text-decoration: none; }

.arabic, .urdu {
    font-family: Amiri, serif;
    direction: rtl;
    text-align: right;
    line-height: 1.9;
}
.arabic { font-size: 1.55rem; }
.urdu { font-size: 1.2rem; }
.lang-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.prose p { margin: 0 0 0.9rem; }
.lesson {
    background: var(--green-soft);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.group { margin: 1.8rem 0; }
.month-title, .group h2 { color: var(--green); }

details {
    background: var(--card);
    border-radius: 1rem;
    padding: 0.9rem 1.1rem;
    margin: 0.6rem 0;
    box-shadow: var(--shadow);
}
summary { cursor: pointer; font-weight: 800; }
details p { color: var(--muted); margin: 0.6rem 0 0; }

.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2.4rem 6vw;
    display: grid;
    gap: 1rem;
}
.footer a { color: #E8B84A; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.fine { color: #9BB0A3; margin: 0; }

.date-chip {
    display: inline-block;
    background: var(--gold);
    color: #1A2E22;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.82rem;
}

@media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .nav { flex-direction: column; align-items: flex-start; }
}
