:root {
    --green-900: #064638;
    --green-800: #0b5d4b;
    --green-700: #0f7a5c;
    --gold: #d4af37;
    --gold-soft: #f4e7b7;
    --white: #ffffff;
    --cream: #f8f8f5;
    --ink: #153d34;
    --muted: #65736d;
    --line: #e6e2d8;
    --shadow: 0 16px 36px rgba(6, 70, 56, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-bottom: 150px;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 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: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--green-900);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--green-900);
    background: var(--gold-soft);
    border: 1px solid var(--gold);
    font-size: 1.45rem;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav a {
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--green-900);
    font-weight: 600;
    font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--white);
    background: var(--green-800);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--green-900);
}

.hero-section {
    background:
        linear-gradient(120deg, rgba(16, 61, 45, 0.96), rgba(33, 100, 71, 0.9)),
        url("../images/library-pattern.svg");
    background-size: cover;
    color: var(--white);
}

.hero-layout {
    min-height: 470px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    align-items: center;
    gap: 48px;
    padding: 72px 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 0.78rem;
}

.hero-content h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.7rem);
    line-height: 1.05;
}

.hero-subtitle {
    max-width: 650px;
    margin: 18px 0 30px;
    font-size: 1.18rem;
    color: rgba(255, 255, 255, 0.86);
}

.search-panel {
    display: flex;
    width: min(720px, 100%);
    padding: 8px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-panel input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 14px 16px;
    font-size: 1rem;
    outline: 0;
}

.search-panel button,
.audio-button {
    border: 0;
    border-radius: 6px;
    background: var(--gold);
    color: var(--green-900);
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}

.hero-note {
    padding: 28px;
    border: 1px solid rgba(243, 230, 189, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.arabic-mark {
    display: block;
    margin-bottom: 18px;
    color: var(--gold-soft);
    font-size: 3.4rem;
    text-align: right;
}

.section-block {
    padding: 64px 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 26px;
}

.section-heading h2,
.prose-block h2 {
    margin: 0;
    color: var(--green-900);
    font-size: 2rem;
}

.section-description {
    max-width: 440px;
    margin: 0;
    color: var(--muted);
}

.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.surah-card,
.ayah-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 26px rgba(16, 61, 45, 0.07);
}

.surah-card {
    position: relative;
    min-height: 168px;
    display: flex;
    flex-direction: column;
    padding: 18px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.surah-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow);
}

.surah-number,
.ayah-number {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--green-900);
    background: var(--gold-soft);
    font-weight: 700;
}

.surah-arabic {
    margin-top: 6px;
    color: var(--green-900);
    font-size: 2rem;
    text-align: right;
}

.surah-title {
    margin-top: 10px;
    color: var(--green-900);
    font-weight: 700;
    font-size: 1.1rem;
}

.surah-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.92rem;
}

.page-hero {
    padding: 58px 0;
    color: var(--white);
    background: linear-gradient(120deg, var(--green-900), var(--green-700));
}

.page-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.86);
}

.back-link {
    display: inline-flex;
    margin-bottom: 20px;
    color: var(--gold-soft);
    font-weight: 700;
}

.surah-detail-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.detail-arabic {
    color: var(--gold-soft);
    font-size: clamp(3rem, 9vw, 5.5rem);
    line-height: 1;
}

.ayah-list {
    display: grid;
    gap: 18px;
}

.ayah-card {
    padding: 24px;
}

.ayah-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ayah-arabic {
    margin: 0 0 18px;
    color: var(--green-900);
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    line-height: 2;
    text-align: right;
}

.ayah-translation {
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.alert,
.empty-state {
    padding: 16px 18px;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--line);
}

.alert-error {
    border-color: #e8b6a6;
    color: #8a2f1d;
    background: #fff6f3;
}

.alert-info,
.empty-state {
    color: var(--green-900);
}

.prose-block {
    max-width: 860px;
}

.prose-block p {
    color: var(--muted);
}

.site-footer {
    padding: 26px 0;
    color: rgba(255, 255, 255, 0.82);
    background: var(--green-900);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-inner p {
    margin: 0;
}

@media (max-width: 820px) {
    .header-inner {
        min-height: 68px;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px 20px;
        background: var(--white);
        border-bottom: 1px solid var(--line);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px 14px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 28px;
        padding: 56px 0;
    }

    .section-heading,
    .surah-detail-head {
        display: block;
    }

    .detail-arabic {
        display: block;
        margin-top: 22px;
        text-align: right;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .brand {
        font-size: 1rem;
    }

    .search-panel {
        display: grid;
    }

    .search-panel button {
        width: 100%;
    }

    .section-block {
        padding: 44px 0;
    }

    .ayah-card {
        padding: 18px;
    }
}

/* Competition-ready institutional polish */
.topbar {
    color: rgba(255, 255, 255, 0.88);
    background: var(--green-900);
    border-bottom: 1px solid rgba(214, 178, 83, 0.22);
    font-size: 0.88rem;
}

.topbar-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar p {
    margin: 0;
    font-weight: 600;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
}

.topbar-links a {
    color: rgba(255, 255, 255, 0.88);
}

.topbar-links a:hover {
    color: var(--gold-soft);
}

.site-header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(0, 63, 45, 0.08);
}

.header-inner {
    min-height: 88px;
}

.brand {
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    box-shadow: 0 10px 24px rgba(214, 178, 83, 0.24);
    font-size: 0;
}

.brand-mark::before {
    content: "AQ";
    color: var(--green-900);
    font-size: 1rem;
    font-weight: 800;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    color: var(--green-900);
    font-size: 1.16rem;
    line-height: 1.2;
}

.brand-copy small {
    max-width: 360px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
}

.site-nav {
    gap: 4px;
}

.site-nav a {
    border-radius: 8px;
    color: var(--green-900);
}

.site-nav a:hover,
.site-nav a.active {
    background: var(--green-800);
    box-shadow: 0 8px 18px rgba(6, 78, 59, 0.18);
}

.hero-section {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(110deg, rgba(0, 63, 45, 0.97) 0%, rgba(6, 78, 59, 0.9) 52%, rgba(0, 63, 45, 0.74) 100%),
        url("../images/library-pattern.svg");
    background-position: center;
    background-size: cover;
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 7px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.75;
}

.hero-layout {
    position: relative;
    z-index: 1;
    min-height: 520px;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.hero-content .eyebrow {
    color: var(--gold-soft);
}

.hero-content h1 {
    max-width: 780px;
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    max-width: 690px;
    color: rgba(255, 255, 255, 0.9);
}

.search-panel {
    border: 1px solid rgba(214, 178, 83, 0.34);
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

.search-panel input {
    color: var(--green-900);
}

.search-panel button,
.audio-button,
.outline-button {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-panel button:hover,
.audio-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(214, 178, 83, 0.28);
}

.hero-note {
    position: relative;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(214, 178, 83, 0.42);
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

.arabic-mark {
    display: none;
}

.hero-note-label {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--green-900);
    background: var(--gold-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.hero-note p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
}

.section-heading {
    align-items: flex-start;
}

.section-heading .eyebrow {
    color: var(--gold);
}

.section-actions {
    display: grid;
    justify-items: end;
    gap: 14px;
}

.outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--green-900);
    background: var(--white);
    font-weight: 800;
}

.outline-button:hover {
    color: var(--white);
    background: var(--green-800);
    border-color: var(--green-800);
    transform: translateY(-1px);
}

.surah-grid {
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 18px;
}

.surah-card {
    min-height: 190px;
    padding: 20px;
    border-color: rgba(6, 78, 59, 0.12);
    border-top: 4px solid transparent;
    border-radius: 10px;
}

.surah-card:hover {
    border-color: rgba(214, 178, 83, 0.8);
    border-top-color: var(--gold);
}

.surah-card .surah-number {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 42px;
    height: 42px;
    background: #f4e6b7;
    border: 1px solid rgba(214, 178, 83, 0.72);
}

.surah-card .surah-arabic {
    min-height: 52px;
    margin-top: 0;
    padding-left: 52px;
    color: var(--green-800);
}

.surah-title {
    margin-top: 14px;
    color: var(--green-900);
    font-size: 1.18rem;
}

.surah-meaning {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
}

.surah-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.surah-facts span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--green-900);
    background: rgba(6, 78, 59, 0.07);
    font-size: 0.84rem;
    font-weight: 700;
}

.surah-card > .surah-meta {
    display: none;
}

.site-footer {
    padding: 0;
    background: var(--green-900);
    border-top: 6px solid var(--gold);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.75fr 1fr;
    gap: 38px;
    padding: 46px 0 34px;
}

.footer-brand h2,
.footer-links h3,
.footer-contact h3 {
    margin: 0 0 14px;
    color: var(--white);
    line-height: 1.3;
}

.footer-brand h2 {
    max-width: 440px;
    font-size: 1.35rem;
}

.footer-brand p,
.footer-contact p,
.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

.footer-links {
    display: grid;
    align-content: start;
    gap: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.78);
}

.footer-links a:hover {
    color: var(--gold-soft);
}

.footer-contact {
    display: grid;
    align-content: start;
    gap: 8px;
}

.footer-contact h3 {
    font-weight: 800;
    text-transform: uppercase;
}

.footer-contact address {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.78);
    font-style: normal;
    line-height: 1.7;
}

.footer-contact-group {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    line-height: 1.7;
}

.footer-contact-group span {
    color: var(--white);
    font-weight: 700;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.2s ease;
}

.footer-contact a:hover {
    color: var(--gold-soft);
}

.footer-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 10px;
    line-height: 1.7;
}

.footer-bottom {
    padding: 18px 0 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.floating-player {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 60;
    width: min(920px, calc(100% - 28px));
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 0.42fr);
    grid-template-areas:
        "info progress volume"
        "info controls volume";
    align-items: center;
    gap: 12px 18px;
    padding: 16px 18px;
    border: 1px solid rgba(214, 178, 83, 0.35);
    border-radius: 22px;
    color: var(--white);
    background: rgba(0, 63, 45, 0.97);
    box-shadow: 0 22px 55px rgba(0, 36, 26, 0.34);
    transform: translateX(-50%);
    backdrop-filter: blur(14px);
}

.floating-player[hidden] {
    display: none;
}

.floating-player-info {
    grid-area: info;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.floating-progress-wrap {
    grid-area: progress;
    display: grid;
    gap: 6px;
    width: 100%;
}

.floating-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.floating-player-info strong {
    overflow: hidden;
    color: var(--white);
    font-size: 1rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floating-player-info span {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floating-player-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.floating-control-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.floating-play-button {
    width: 50px;
    height: 50px;
    border-color: var(--gold);
    color: var(--green-900);
    background: var(--gold);
    font-size: 1.05rem;
    box-shadow: 0 12px 24px rgba(214, 178, 83, 0.28);
}

.floating-control-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}

.floating-play-button:hover {
    background: var(--gold-soft);
}

.floating-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.floating-player > .floating-progress {
    display: none;
}

.floating-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--gold);
    transition: width 0.2s linear;
}

.floating-volume {
    grid-area: volume;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
    min-width: 0;
}

.volume-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 1rem;
}

.floating-volume input[type="range"] {
    width: 110px;
    accent-color: var(--gold);
    cursor: pointer;
}

.scroll-to-top {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 70;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(214, 178, 83, 0.55);
    border-radius: 50%;
    color: var(--green-900);
    background: var(--gold);
    box-shadow: 0 14px 32px rgba(0, 63, 45, 0.24);
    cursor: pointer;
    font-size: 1.35rem;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, bottom 0.2s ease;
}

.scroll-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-to-top.with-player {
    bottom: 150px;
}

.scroll-to-top:hover {
    color: var(--white);
    background: var(--green-800);
    transform: translateY(-2px);
}

.surah-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    padding: 18px;
    border: 1px solid rgba(214, 178, 83, 0.38);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.14);
}

.surah-player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.surah-play-button,
.surah-restart-button {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.surah-play-button {
    border: 1px solid var(--gold);
    color: var(--green-900);
    background: var(--gold);
}

.surah-restart-button {
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.surah-play-button:hover,
.surah-restart-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.surah-player-status {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    font-weight: 700;
}

.audio-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.95rem;
    line-height: 1;
}

@media (max-width: 980px) {
    .brand-copy small {
        max-width: 270px;
    }

    .site-nav a {
        padding: 9px 10px;
    }
}

@media (max-width: 820px) {
    .topbar-inner {
        min-height: auto;
        padding: 9px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .header-inner {
        min-height: 78px;
    }

    .brand-copy small {
        max-width: 230px;
    }

    .site-nav {
        top: 78px;
        box-shadow: 0 18px 30px rgba(0, 63, 45, 0.12);
    }

    .hero-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .section-actions {
        justify-items: start;
        margin-top: 14px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .surah-player {
        align-items: flex-start;
        flex-direction: column;
    }

    .floating-player {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info volume"
            "progress progress"
            "controls controls";
    }

    .floating-player-controls {
        justify-content: center;
    }

    .floating-volume {
        justify-content: end;
    }
}

@media (max-width: 560px) {
    .topbar {
        font-size: 0.8rem;
    }

    .topbar-links {
        gap: 14px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
    }

    .brand-copy strong {
        font-size: 1rem;
    }

    .brand-copy small {
        max-width: 210px;
        font-size: 0.74rem;
    }

    .site-nav {
        top: 78px;
    }

    .hero-note {
        padding: 22px;
    }

    .surah-card {
        min-height: 180px;
    }

    .footer-grid {
        padding: 36px 0 26px;
    }

    .surah-player-actions,
    .surah-play-button,
    .surah-restart-button {
        width: 100%;
    }

    main {
        padding-bottom: 230px;
    }

    .floating-player {
        bottom: 10px;
        width: calc(100% - 20px);
        grid-template-columns: 1fr;
        grid-template-areas:
            "info"
            "progress"
            "controls"
            "volume";
        justify-items: stretch;
        gap: 12px;
        padding: 14px;
        border-radius: 18px;
    }

    .floating-player-controls {
        justify-content: space-between;
        width: 100%;
    }

    .floating-volume {
        justify-content: space-between;
        width: 100%;
    }

    .floating-volume input[type="range"] {
        flex: 1;
        width: auto;
    }

    .scroll-to-top {
        right: 14px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    .scroll-to-top.with-player {
        bottom: 238px;
    }

    .floating-control-button {
        width: 42px;
        height: 42px;
    }

    .floating-play-button {
        width: 52px;
        height: 52px;
    }
}

/* STAIN Library / SITASI visual alignment */
.topbar,
.site-footer,
.floating-player {
    background: var(--green-900);
}

.site-header {
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 92px;
}

.brand {
    min-width: min(580px, 100%);
    gap: 14px;
}

.brand-mark {
    display: none;
}

.brand-logo-wrap {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    flex: 0 0 62px;
}

.brand-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    color: var(--green-900);
    font-size: 1.2rem;
    font-weight: 800;
}

.brand-copy small {
    max-width: none;
    color: var(--green-800);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-nav a {
    border-radius: 7px;
    color: var(--green-900);
}

.site-nav a:hover,
.site-nav a.active,
.outline-button:hover,
.search-panel button:hover {
    background: var(--green-800);
}

.hero-section,
.page-hero {
    background:
        linear-gradient(112deg, rgba(6, 70, 56, 0.98) 0%, rgba(11, 93, 75, 0.94) 55%, rgba(15, 122, 92, 0.78) 100%),
        url("../images/library-pattern.svg");
    background-position: center;
    background-size: cover;
}

.search-panel button,
.audio-button,
.surah-play-button,
.floating-play-button,
.scroll-to-top {
    background: var(--gold);
    color: var(--green-900);
}

.surah-card,
.ayah-card,
.search-panel,
.alert,
.empty-state {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(6, 70, 56, 0.08);
}

.surah-card:hover,
.ayah-card:hover {
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 16px 34px rgba(6, 70, 56, 0.14);
}

.floating-progress span {
    background: var(--gold);
}

.site-footer {
    color: rgba(255, 255, 255, 0.84);
    border-top-color: var(--gold);
}

.footer-grid {
    grid-template-columns: 1.25fr 0.75fr 1.15fr;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.footer-logos img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 6px;
    border-radius: 12px;
    background: var(--cream);
}

.footer-brand h2 {
    color: var(--white);
    font-size: 1.28rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.78);
}

.footer-links a,
.footer-contact p,
.footer-contact address,
.footer-contact a {
    color: rgba(255, 255, 255, 0.76);
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--gold-soft);
}

.footer-bottom {
    line-height: 1.55;
}

@media (max-width: 1040px) {
    .brand {
        min-width: 0;
    }

    .brand-copy small {
        font-size: 0.72rem;
    }
}

@media (max-width: 820px) {
    .header-inner {
        min-height: 82px;
    }

    .brand-logo-wrap,
    .brand-logo {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .brand-copy small {
        max-width: 320px;
        white-space: normal;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .brand {
        gap: 10px;
    }

    .brand-logo-wrap,
    .brand-logo {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

    .brand-copy strong {
        font-size: 1rem;
    }

    .brand-copy small {
        font-size: 0.68rem;
        line-height: 1.25;
    }
}

/* About page */
.about-page {
    padding-bottom: 120px;
}

.about-hero {
    color: var(--white);
    background:
        linear-gradient(112deg, rgba(6, 70, 56, 0.98) 0%, rgba(11, 93, 75, 0.95) 56%, rgba(15, 122, 92, 0.78) 100%),
        url("../images/library-pattern.svg");
    background-position: center;
    background-size: cover;
}

.about-hero-grid {
    min-height: 380px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    align-items: center;
    gap: 40px;
    padding: 60px 0;
}

.about-hero-copy h1 {
    margin: 0;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.08;
}

.about-hero-copy p:not(.eyebrow) {
    max-width: 680px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
}

.about-hero-visual {
    min-height: 270px;
    display: flex;
    align-items: end;
    justify-content: start;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(212, 175, 55, 0.36);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(6, 70, 56, 0.35), rgba(6, 70, 56, 0.9)),
        url("../images/library-pattern.svg");
    background-position: center;
    background-size: cover;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.about-hero-visual::before {
    content: "";
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(244, 231, 183, 0.34);
    border-radius: 16px;
}

.about-hero-visual div {
    position: relative;
    z-index: 1;
    padding: 30px;
}

.about-hero-visual span,
.about-hero-visual strong {
    display: block;
}

.about-hero-visual span {
    color: var(--gold-soft);
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
}

.about-hero-visual strong {
    max-width: 280px;
    margin-top: 8px;
    color: var(--white);
    font-size: 1.8rem;
    line-height: 1.16;
}

.about-section {
    padding-bottom: 34px;
}

.about-heading {
    margin-bottom: 22px;
}

.about-feature-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.about-feature-card {
    min-height: 180px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 12px 28px rgba(6, 70, 56, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.about-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.72);
    box-shadow: 0 18px 36px rgba(6, 70, 56, 0.13);
}

.about-feature-card h3 {
    margin: 0 0 10px;
    color: var(--green-900);
    font-size: 1.08rem;
    line-height: 1.25;
}

.about-feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.about-library-section {
    padding-top: 18px;
}

.library-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    gap: 30px;
    align-items: center;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 18px 42px rgba(6, 70, 56, 0.1);
}

.library-card-copy h2 {
    margin: 0;
    color: var(--green-900);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.16;
}

.library-card-copy p:not(.eyebrow) {
    max-width: 610px;
    margin: 16px 0 22px;
    color: var(--muted);
}

.library-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--green-800);
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(6, 70, 56, 0.16);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.library-button:hover {
    transform: translateY(-2px);
    background: var(--green-700);
    box-shadow: 0 14px 28px rgba(6, 70, 56, 0.2);
}

.library-card-media {
    min-height: 315px;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(6, 70, 56, 0.96), rgba(15, 122, 92, 0.76)),
        url("../images/library-pattern.svg");
    background-position: center;
    background-size: cover;
}

.library-card-media img {
    width: 100%;
    height: 100%;
    min-height: 315px;
    display: block;
    object-fit: cover;
    filter: saturate(0.9) contrast(0.95);
    opacity: 0.78;
}

.library-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 70, 56, 0.32), rgba(6, 70, 56, 0.06));
}

.library-card-media span {
    position: absolute;
    inset: auto 24px 24px 24px;
    z-index: 1;
    color: var(--gold-soft);
    font-weight: 800;
    line-height: 1.35;
}

@media (max-width: 1080px) {
    .about-feature-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .about-hero-grid,
    .library-card {
        grid-template-columns: 1fr;
    }

    .about-hero-grid {
        padding: 46px 0;
    }

    .about-hero-visual,
    .library-card-media,
    .library-card-media img {
        min-height: 250px;
    }

    .about-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .about-page {
        padding-bottom: 90px;
    }

    .about-hero-copy p:not(.eyebrow) {
        font-size: 1rem;
    }

    .about-feature-grid {
        grid-template-columns: 1fr;
    }

    .library-card {
        padding: 22px;
    }

    .library-button {
        width: 100%;
    }
}
