:root {
    --green-950: #032d27;
    --green-900: #063f36;
    --green-800: #075547;
    --green-700: #0b6a59;
    --green-100: #eaf4ef;
    --gold-700: #a36b13;
    --gold-600: #b98022;
    --gold-500: #d5a64b;
    --gold-300: #ead4a0;
    --ivory: #f7f2e8;
    --ivory-2: #fffdf8;
    --ink: #14231f;
    --muted: #66726d;
    --line: #e7dfd1;
    --white: #ffffff;
    --shadow: 0 16px 44px rgba(24, 42, 37, .10);
    --shadow-soft: 0 8px 28px rgba(24, 42, 37, .07);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --container: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--ivory-2);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.container { width: min(var(--container), calc(100% - 48px)); margin-inline: auto; }
.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; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 253, 248, .94);
    border-bottom: 1px solid rgba(218, 205, 184, .6);
    backdrop-filter: blur(16px);
    transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: 0 10px 30px rgba(21, 44, 37, .08); }
.nav-wrap { min-height: 78px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 192px; }
.brand img { width: 56px; height: 56px; object-fit: cover; object-position: center 62%; border-radius: 12px; }
.brand span { font-family: "Libre Baskerville", Georgia, serif; font-size: 1.2rem; font-weight: 700; color: var(--green-900); }
.main-nav { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 1.35vw, 25px); }
.main-nav a { position: relative; font-size: .86rem; font-weight: 600; color: #31443e; padding: 30px 0 27px; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 20px; height: 2px; background: var(--gold-600); transition: .2s ease; }
.main-nav a:hover::after, .main-nav a.active::after { left: 0; right: 0; }
.main-nav a.active { color: var(--green-900); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--green-900); display: grid; place-items: center; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 9px; }
.nav-toggle span { display: block; height: 2px; background: var(--green-900); margin: 4px 0; }

.btn { min-height: 46px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-small { min-height: 40px; padding-inline: 18px; font-size: .86rem; }
.btn-dark { background: var(--green-900); color: var(--white); box-shadow: 0 8px 18px rgba(6, 63, 54, .18); }
.btn-dark:hover { background: var(--green-800); }
.btn-gold { background: linear-gradient(135deg, #ead39a, #c99535); color: #2d260f; border-color: #c99535; box-shadow: 0 10px 24px rgba(179, 126, 36, .20); }
.btn-outline-light { background: rgba(4, 57, 48, .45); color: var(--white); border-color: rgba(239, 214, 158, .72); }
.btn-soft { background: #fbf8f0; color: var(--green-900); border-color: var(--line); }

.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(3, 45, 39, .98) 0%, rgba(4, 58, 48, .96) 42%, rgba(5, 76, 62, .72) 68%, rgba(245, 230, 195, .54) 100%),
        radial-gradient(circle at 78% 44%, rgba(255, 223, 159, .88), rgba(255,255,255,0) 24%),
        #0a5b4a;
    color: var(--white);
    min-height: 430px;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .25;
    background-image:
        linear-gradient(30deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%, rgba(255,255,255,.08)),
        linear-gradient(150deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%, rgba(255,255,255,.08));
    background-size: 58px 100px;
    pointer-events: none;
}
.hero-pattern { position: absolute; inset: 0 54% 0 0; background: radial-gradient(circle at 26% 50%, rgba(224, 180, 83, .16), transparent 42%); }
.hero-orb { position: absolute; border: 1px solid rgba(239, 214, 158, .22); border-radius: 50%; }
.hero-orb-one { width: 380px; height: 380px; right: 18%; top: -110px; }
.hero-orb-two { width: 250px; height: 250px; right: 9%; bottom: -70px; }
.hero-grid { position: relative; z-index: 2; min-height: 430px; display: grid; grid-template-columns: 1.35fr .85fr .42fr; gap: 48px; align-items: center; padding-top: 42px; padding-bottom: 54px; }
.eyebrow, .section-kicker { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .13em; font-size: .73rem; font-weight: 800; color: var(--gold-300); }
.eyebrow span { margin: 0 5px; color: var(--gold-500); }
.hero h1 { margin: 0; max-width: 780px; font-family: "Libre Baskerville", Georgia, serif; font-size: clamp(2.5rem, 4vw, 4.55rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 400; }
.hero h1 em { color: #e6bf6b; font-style: normal; }
.hero-lead { max-width: 740px; margin: 22px 0 0; color: rgba(255,255,255,.86); font-family: "Libre Baskerville", Georgia, serif; line-height: 1.72; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-brand { position: relative; justify-self: center; width: min(100%, 350px); aspect-ratio: 1; display: grid; place-items: center; }
.hero-brand img { position: relative; z-index: 2; width: 92%; border-radius: 50%; mix-blend-mode: screen; filter: saturate(.85) contrast(1.06); box-shadow: 0 20px 70px rgba(0,0,0,.18); }
.brand-halo { position: absolute; inset: 6%; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle, rgba(255,247,224,.96), rgba(236,205,143,.6) 50%, rgba(255,255,255,0) 72%); filter: blur(7px); }
.hero-ayah { border-left: 1px solid rgba(235, 208, 151, .5); padding: 20px 0 20px 24px; color: rgba(255,255,255,.78); font-family: "Libre Baskerville", Georgia, serif; line-height: 1.55; }
.hero-ayah span, .hero-ayah small { display: block; font-size: .76rem; }
.hero-ayah strong { display: block; margin: 7px 0 9px; color: #f1d496; font-size: 1rem; font-weight: 400; }

.search-dock { position: relative; z-index: 6; margin-top: -32px; }
.search-card { background: rgba(255,255,255,.98); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px 13px; }
.search-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 10px; }
.search-tab { border: 1px solid var(--line); background: #fbfaf6; color: #344740; border-radius: 10px; min-height: 36px; padding: 0 20px; font-size: .82rem; font-weight: 700; }
.search-tab.active { background: var(--green-900); color: var(--white); border-color: var(--green-900); }
.search-form { display: grid; grid-template-columns: 1fr 160px 120px 164px; gap: 10px; }
.search-input-wrap { position: relative; }
.search-input-wrap svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #83918c; }
.search-form input, .search-form select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
.search-form input { padding: 0 16px 0 45px; }
.search-form select { padding: 0 12px; }
.search-form input:focus, .search-form select:focus { border-color: #a8c9bd; box-shadow: 0 0 0 3px rgba(11, 106, 89, .08); }
.search-submit { border-radius: 10px; }
.search-form .btn-soft { border-radius: 10px; }
.search-status { min-height: 18px; margin: 8px 4px 0; font-size: .78rem; color: var(--muted); }

.section { padding: 70px 0; }
.section-features { padding-top: 48px; padding-bottom: 12px; }
.feature-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.feature-card { position: relative; min-height: 136px; background: linear-gradient(180deg, #fff, #fdfbf6); border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; box-shadow: var(--shadow-soft); transition: transform .2s ease, border .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-3px); border-color: #d5c39c; box-shadow: var(--shadow); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--green-900); background: linear-gradient(135deg, #f4e5b9, #d1a34d); box-shadow: inset 0 0 0 1px rgba(120,78,10,.18); }
.feature-icon svg { width: 24px; height: 24px; }
.feature-card strong { display: block; font-family: "Libre Baskerville", Georgia, serif; font-size: .96rem; line-height: 1.35; color: #1f312b; }
.feature-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.round-arrow { align-self: center; color: var(--gold-700); font-weight: 800; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 26px; margin-bottom: 24px; }
.section-kicker { color: var(--gold-700); }
.section h2 { margin: 0; font-family: "Libre Baskerville", Georgia, serif; font-size: clamp(1.7rem, 2.5vw, 2.45rem); line-height: 1.2; color: #1c332c; }
.section-head p:not(.section-kicker), .split-panel > div > p:not(.section-kicker) { margin: 8px 0 0; color: var(--muted); line-height: 1.65; }
.filter-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.filter-pills button { border: 1px solid var(--line); background: #fff; color: #53635e; border-radius: 999px; min-height: 34px; padding: 0 16px; font-size: .78rem; font-weight: 700; }
.filter-pills button.active { background: var(--green-900); color: #fff; border-color: var(--green-900); }

.book-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.book-card { display: grid; grid-template-columns: 105px 1fr; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; box-shadow: var(--shadow-soft); min-width: 0; transition: .2s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-card.is-hidden { display: none; }
.book-cover { min-height: 145px; border-radius: 9px; border: 3px double rgba(238, 204, 127, .8); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #f6e7be; text-align: center; box-shadow: inset 0 0 0 5px rgba(255,255,255,.06); }
.book-cover::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(240, 205, 127, .48); border-radius: 4px; }
.book-cover::after { content: ""; position: absolute; width: 90px; height: 90px; border: 1px solid rgba(240,205,127,.25); transform: rotate(45deg); }
.book-cover strong, .book-cover small, .cover-crescent { position: relative; z-index: 2; }
.book-cover strong { font-family: "Libre Baskerville", serif; font-size: 1.45rem; letter-spacing: .06em; }
.book-cover small { margin-top: 8px; font-size: .52rem; letter-spacing: .04em; }
.cover-crescent { font-size: 1.1rem; margin-bottom: 5px; color: #f0cd7b; }
.cover-emerald { background: linear-gradient(150deg, #0b5c46, #062e28); }
.cover-charcoal { background: linear-gradient(150deg, #34312b, #171714); }
.cover-burgundy { background: linear-gradient(150deg, #773b31, #321714); }
.cover-navy { background: linear-gradient(150deg, #183b58, #091b2a); }
.cover-forest { background: linear-gradient(150deg, #396548, #173224); }
.cover-royal { background: linear-gradient(150deg, #315884, #142841); }
.book-body { min-width: 0; padding-top: 4px; }
.book-body h3 { margin: 0; font-family: "Libre Baskerville", serif; font-size: .9rem; line-height: 1.35; }
.book-body p { margin: 5px 0 10px; color: var(--muted); font-size: .72rem; }
.book-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { border-radius: 999px; padding: 4px 7px; background: #f2f3f1; color: #62706b; font-size: .63rem; font-weight: 700; }
.tag.shia { background: #fff0ec; color: #a94631; }
.tag.sunni { background: #edf4ff; color: #2f66a3; }
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 10px; border-top: 1px solid #eee9df; color: #7d877f; font-size: .68rem; }
.book-meta a { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #f0ddb3; color: #614919; font-weight: 800; }

.section-riwayat { background: linear-gradient(180deg, #f0f5f1, #f8f6ef); border-top: 1px solid #e3e9e4; border-bottom: 1px solid #e3e9e4; }
.split-panel { display: grid; grid-template-columns: 1fr .8fr; gap: 70px; align-items: center; }
.split-panel h2 { max-width: 680px; font-size: clamp(2rem, 3.3vw, 3.2rem); }
.text-link { display: inline-flex; margin-top: 18px; color: var(--green-800); font-weight: 800; }
.riwayat-sample { position: relative; background: var(--green-950); color: white; border-radius: var(--radius-xl); padding: 34px; overflow: hidden; box-shadow: var(--shadow); }
.riwayat-sample::after { content: ""; position: absolute; width: 250px; height: 250px; border: 1px solid rgba(226, 194, 122, .14); border-radius: 50%; right: -75px; top: -110px; }
.sample-label { display: inline-block; color: #e3c985; text-transform: uppercase; letter-spacing: .13em; font-size: .67rem; font-weight: 800; }
.arabic-sample { margin: 18px 0 8px; font-family: "Times New Roman", serif; font-size: 1.75rem; color: #f1deae; }
.riwayat-sample h3 { margin: 0 0 18px; font-family: "Libre Baskerville", serif; font-size: 1.45rem; }
.riwayat-sample dl { margin: 0; display: grid; gap: 10px; }
.riwayat-sample dl div { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid rgba(255,255,255,.09); padding-top: 10px; font-size: .8rem; }
.riwayat-sample dt { color: rgba(255,255,255,.55); }
.riwayat-sample dd { margin: 0; text-align: right; color: rgba(255,255,255,.88); }
.verified-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #5ad39e; margin-right: 5px; }

.topic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.topic-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px; box-shadow: var(--shadow-soft); transition: .2s ease; }
.topic-card:hover { transform: translateY(-2px); border-color: #d7c390; }
.topic-symbol { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #f5ead0; color: var(--green-900); font-size: 1.2rem; }
.topic-card strong { display: block; font-family: "Libre Baskerville", serif; font-size: .85rem; }
.topic-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; line-height: 1.4; }

.section-contribute { padding-top: 18px; }
.contribution { background: linear-gradient(100deg, #f5f0e4, #fbf8f0); border: 1px solid #e4d7bd; border-radius: var(--radius-xl); padding: 26px 30px; display: grid; grid-template-columns: 1.15fr 1.7fr auto; gap: 28px; align-items: center; box-shadow: var(--shadow-soft); }
.contribution-intro { display: flex; gap: 16px; align-items: center; }
.contribution-icon { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 50%; background: var(--green-900); color: #f0d797; font-size: 1.5rem; }
.contribution h2 { font-size: 1.45rem; }
.contribution p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.contribution-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.contribution-items div { min-width: 0; padding-left: 14px; border-left: 1px solid #d9cbae; }
.contribution-items strong { display: block; font-size: .78rem; }
.contribution-items small { display: block; margin-top: 5px; color: var(--muted); font-size: .65rem; line-height: 1.4; }

.site-footer { position: relative; overflow: hidden; margin-top: 70px; background: var(--green-950); color: rgba(255,255,255,.72); border-top: 3px solid #c5973e; }
.footer-pattern { position: absolute; inset: 0; opacity: .13; background-image: radial-gradient(circle at 10px 10px, #e0bb6a 1px, transparent 1.3px); background-size: 28px 28px; }
.footer-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.7fr repeat(4, .75fr); gap: 38px; padding: 54px 0 34px; }
.footer-brand { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding-right: 28px; border-right: 1px solid rgba(255,255,255,.13); }
.footer-brand img { width: 120px; height: 88px; object-fit: cover; object-position: center 62%; border-radius: 12px; }
.footer-brand p { margin: 0; font-size: .8rem; line-height: 1.65; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h3 { margin: 0 0 5px; color: #f2db9f; font-size: .82rem; }
.footer-col a { font-size: .74rem; transition: color .2s ease; }
.footer-col a:hover { color: #fff; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: white; font-weight: 700; }
.footer-bottom { position: relative; z-index: 2; min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .69rem; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1320px) {
    .main-nav { gap: 14px; }
    .main-nav a { font-size: .8rem; }
    .feature-grid, .book-grid, .topic-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-grid { grid-template-columns: 1.25fr .7fr; }
    .hero-ayah { display: none; }
    .contribution { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
    .nav-wrap { grid-template-columns: auto auto 1fr; }
    .nav-toggle { display: block; justify-self: start; }
    .main-nav { position: absolute; left: 24px; right: 24px; top: calc(100% + 8px); padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--ivory-2); box-shadow: var(--shadow); display: none; flex-direction: column; align-items: stretch; gap: 0; }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 10px; }
    .main-nav a::after { display: none; }
    .nav-actions { justify-self: end; }
    .search-form { grid-template-columns: 1fr 150px 110px; }
    .search-form .btn-soft { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: 1.5fr repeat(2, 1fr); }
    .footer-social { grid-column: auto; }
}

@media (max-width: 780px) {
    .container { width: min(100% - 28px, var(--container)); }
    .nav-wrap { min-height: 68px; gap: 12px; }
    .brand { min-width: auto; }
    .brand img { width: 44px; height: 44px; }
    .brand span { display: none; }
    .nav-actions .icon-btn { display: none; }
    .hero-grid { grid-template-columns: 1fr; gap: 16px; min-height: auto; padding-top: 44px; padding-bottom: 70px; }
    .hero h1 { font-size: clamp(2.2rem, 12vw, 3.6rem); }
    .hero-brand { width: 220px; justify-self: start; }
    .search-dock { margin-top: -28px; }
    .search-form { grid-template-columns: 1fr; }
    .search-form .btn-soft { grid-column: auto; }
    .feature-grid, .book-grid, .topic-grid { grid-template-columns: 1fr; }
    .book-card { grid-template-columns: 92px 1fr; }
    .book-cover { min-height: 128px; }
    .section { padding: 52px 0; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .filter-pills { justify-content: flex-start; }
    .split-panel { grid-template-columns: 1fr; gap: 28px; }
    .contribution { padding: 22px; }
    .contribution-items { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); padding: 0 0 24px; }
    .footer-bottom { flex-direction: column; justify-content: center; text-align: center; padding: 16px 0; }
}

@media (max-width: 480px) {
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .search-tabs { display: grid; grid-template-columns: repeat(2, 1fr); }
    .search-tab { padding-inline: 10px; }
    .feature-card { grid-template-columns: 44px 1fr; }
    .feature-card .round-arrow { display: none; }
    .contribution-items, .footer-grid { grid-template-columns: 1fr; }
    .footer-brand { grid-template-columns: 92px 1fr; }
    .footer-brand img { width: 92px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .reveal { opacity: 1; transform: none; }
}
