.exp {
    --green-900: #00382c; --green-700: #004d3c; --green-500: #0b6b55; --gold: #c5a038; --gold-soft: #f3e7bd;
    --paper: #f4f7f3; --ink: #14302a; --muted: #5a6f69; --card: #ffffff;
}
.exp.kids { --green-500: #0e8a6a; --gold: #f08a24; --gold-soft: #ffe2b8; --paper: #fff8ea; }
.exp * { box-sizing: border-box; }
.exp { margin: 0; background: var(--paper); color: var(--ink); font-family: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tajawal, "Segoe UI", sans-serif; line-height: 1.8; }
.exp.kids { font-size: 1.06rem; }

/* Adults mode: dignified, scholarly, classical Islamic aesthetic */
.exp:not(.kids) {
    --green-900: #0d2822;
    --green-700: #143e35;
    --green-500: #1c584b;
    --gold: #d4af37;
    --gold-soft: #fbf7ee;
    --paper: #f7f9f6;
    --ink: #162621;
    --muted: #4e635c;
    --card: #ffffff;
}
.exp:not(.kids) .top {
    background: linear-gradient(170deg, #091f1a 0%, #13382f 50%, #1c5245 100%);
    border-bottom: 2px solid rgba(212, 175, 55, 0.35);
}
.exp:not(.kids) .top h1 {
    font-family: "Amiri", "Scheherazade New", serif;
    font-weight: 700;
}
.exp:not(.kids) .node .outer {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.45) 0%, rgba(20, 62, 53, 0.25) 100%);
    padding: 1.5px;
    box-shadow: 0 4px 18px rgba(9, 31, 26, 0.06);
    transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s ease;
}
.exp:not(.kids) .node:hover .outer {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(9, 31, 26, 0.12);
    background: linear-gradient(135deg, #d4af37 0%, #1c584b 100%);
}
.exp:not(.kids) .num {
    background: #0d2822;
    border: 1.5px solid #d4af37;
    color: #f7e7b4;
    font-family: "Amiri", serif;
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.exp:not(.kids) .node h2 {
    font-family: "Amiri", "Scheherazade New", serif;
    font-size: 1.32rem;
    font-weight: 700;
    color: #0d2822;
    line-height: 1.4;
}
.exp:not(.kids) .node p {
    font-size: 0.94rem;
    line-height: 1.85;
    color: #3d524b;
}
.exp:not(.kids) .sheet {
    border-top: 4px solid #d4af37;
    box-shadow: 0 20px 48px rgba(0, 20, 16, 0.4);
}
.exp:not(.kids) .sheet h3 {
    font-family: "Amiri", serif;
    font-size: 1.55rem;
    color: #0d2822;
}
.exp .top { background: linear-gradient(160deg, var(--green-900), var(--green-500)); color: #fff; padding: 20px 16px 56px; text-align: center; }
.exp .draft { display: inline-block; background: #ffd9d4; color: #7a1d12; padding: 4px 14px; font-size: .85rem; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.exp .top h1 { margin: 14px 0 4px; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.exp .top p { margin: 0 0 14px; opacity: .85; font-size: .95rem; }
.exp .tabs { display: inline-flex; gap: 8px; }
.exp .tabs a { color: #fff; text-decoration: none; padding: 6px 18px; border: 1px solid rgba(255,255,255,.5); font-size: .95rem; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .tabs a.on { background: var(--gold); border-color: var(--gold); color: #1b1300; font-weight: 700; }
.exp .wrap { max-width: 1100px; margin: -36px auto 40px; padding: 0 16px; }
.exp .map { position: relative; display: grid; gap: 18px; grid-template-columns: 1fr; }
.exp .lines { display: none; }
.exp .map.ring .hub { display: none; }
/* ring layout (8 nodes) on wide screens; any other count: hub on top, nodes in an even grid */
@media (min-width: 820px) {
    .exp .map.ring { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, auto); gap: 26px; }
    .exp .map.ring .lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
    .exp .map.ring .hub { display: flex; grid-column: 2; grid-row: 2; z-index: 1; align-items: center; justify-content: center; }
    .exp .map.ring .node[data-pos="1"] { grid-column: 1; grid-row: 1; }
    .exp .map.ring .node[data-pos="2"] { grid-column: 2; grid-row: 1; }
    .exp .map.ring .node[data-pos="3"] { grid-column: 3; grid-row: 1; }
    .exp .map.ring .node[data-pos="4"] { grid-column: 3; grid-row: 2; }
    .exp .map.ring .node[data-pos="5"] { grid-column: 3; grid-row: 3; }
    .exp .map.ring .node[data-pos="6"] { grid-column: 2; grid-row: 3; }
    .exp .map.ring .node[data-pos="7"] { grid-column: 1; grid-row: 3; }
    .exp .map.ring .node[data-pos="8"] { grid-column: 1; grid-row: 2; }
    .exp .map.flat { grid-template-columns: repeat(var(--cols), 1fr); gap: 26px; max-width: calc(var(--cols) * 360px); margin-inline: auto; }
    .exp .map.flat .hub { display: flex; grid-column: 1 / -1; justify-content: center; padding-bottom: 6px; }
    .exp .map.flat .hub .hub-ring { width: 150px; height: 150px; }
    .exp .map.flat .hub .hub-ring span { width: 136px; height: 136px; padding: 10px; font-size: 1.2rem; }
    .exp .map.flat .hub .ring { width: 190px; height: 190px; }
}
@media (max-width: 819px) {
    .exp .map.flat .hub { display: flex; justify-content: center; }
    .exp .map.ring .hub { display: none; }
}
.exp .hub-ring { width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-weight: 800; font-size: 1.5rem; line-height: 1.3; background: conic-gradient(from 20deg, var(--green-900), var(--green-500), var(--green-700), var(--gold), var(--green-700), var(--green-900)); clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%); }
.exp .hub-ring span { background: var(--green-900); padding: 38px 20px; clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%); display: block; width: 172px; height: 172px; display: flex; align-items: center; justify-content: center; }
.exp .node { position: relative; z-index: 1; border: 0; padding: 0; text-align: inherit; font: inherit; color: inherit; cursor: pointer; background: transparent; }
.exp .cut { clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px); }
.exp .node .outer { background: linear-gradient(135deg, var(--gold), var(--green-500)); padding: 2px; transition: transform .18s ease, filter .18s ease; }
.exp .node:hover .outer, .exp .node:focus-visible .outer { transform: translateY(-4px); filter: drop-shadow(0 10px 14px rgba(0, 56, 44, .25)); }
.exp .node:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.exp .node .inner { background: var(--card); display: block; }
.exp .art { display: block; aspect-ratio: 8 / 5; position: relative; }
.exp .art svg { width: 100%; height: 100%; display: block; }
.exp .num { position: absolute; top: 10px; inset-inline-start: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; background: var(--green-900); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border: 0; }
.exp .node .txt { display: block; padding: 12px 14px 16px; }
.exp .node h2 { margin: 0 0 4px; font-size: 1.12rem; color: var(--green-900); }
.exp .node .range { font-size: .8rem; color: var(--gold); font-weight: 700; }
.exp .node p { margin: 6px 0 0; font-size: .92rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.exp .more { margin-top: 8px; font-size: .85rem; color: var(--green-500); font-weight: 700; }
@media (max-width: 819px) {
    .exp .node:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 50%; bottom: -18px; width: 2px; height: 18px; background: var(--gold); }
}
.exp .foot { text-align: center; color: var(--muted); font-size: .85rem; margin: 30px 0 10px; }
.exp .scrim { position: fixed; inset: 0; background: rgba(0, 20, 16, .62); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
@media (min-width: 820px) {
    .exp .scrim { align-items: center; padding: 24px; }
}
.exp .sheet { background: var(--card); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-top: 5px solid var(--gold); padding: 22px 20px 20px; }
@media (min-width: 820px) {
    .exp .sheet { clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px); border-top: 0; }
}
.exp .sheet .art { width: 100%; max-width: 660px; margin: 0 auto 16px; aspect-ratio: 16 / 10; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.exp .sheet .num { background: var(--green-900); }
@media (max-width: 819px) {
}
.exp .sheet .art > span:first-child { display: block; height: 100%; }
.exp .sheet .art svg { height: 100%; }
.exp .sheet h3 { margin: 0 0 8px; font-size: 1.35rem; color: var(--green-900); }
.exp .ayat { background: var(--gold-soft); padding: 14px 16px; margin: 12px 0; font-family: "Amiri Quran", "Scheherazade New", "Amiri", serif; font-size: 1.45rem; line-height: 2.2; color: #20170a; }
.exp .ayat .n { font-family: inherit; font-size: .9rem; color: var(--green-700); margin-inline: 4px; }
.exp .body { font-size: 1.05rem; }
.exp .src { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #cbd6d1; font-size: .8rem; color: var(--muted); }
.exp .nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.exp .btn { background: var(--green-700); color: #fff; border: 0; padding: 9px 20px; font: inherit; cursor: pointer; font-weight: 700; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .btn.ghost { background: #e3ebe7; color: var(--green-900); }
.exp .btn[disabled] { opacity: .4; cursor: default; }
.exp .x { position: absolute; }
.exp.kids .wrap { padding-bottom: 150px; }
@media (max-width: 819px) {
    .exp.kids .sheet { padding-bottom: 150px; }
}
.exp .tw { animation: exp-tw 2.4s ease-in-out infinite; }
.exp .tw.d2 { animation-delay: .8s; }
.exp .tw.d3 { animation-delay: 1.6s; }
@keyframes exp-tw { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.exp .fl { animation: exp-fl 3.6s ease-in-out infinite; }
@keyframes exp-fl { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.exp .gl { animation: exp-gl 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes exp-gl { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.1); opacity: .7; } }
.exp .sw { animation: exp-sw 3s ease-in-out infinite; }
.exp .sw.d2 { animation-delay: 1s; }
@keyframes exp-sw { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.exp .rn { animation: exp-rn 1.1s linear infinite; }
.exp .rn.d2 { animation-delay: .55s; }
@keyframes exp-rn { 0% { transform: translateY(-10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.exp .st { animation: exp-st 3.2s ease-in infinite; }
.exp .st.d2 { animation-delay: 1.1s; }
.exp .st.d3 { animation-delay: 2.1s; }
@keyframes exp-st { 0% { transform: translate(40px, -28px); opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-60px, 40px); opacity: 0; } }
.exp .spin { animation: exp-spin 24s linear infinite; }
@keyframes exp-spin { to { transform: rotate(360deg); } }
.exp.kids .node:hover .art svg, .exp.kids .node:focus-visible .art svg { animation: exp-pop .5s ease; }
@keyframes exp-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06) rotate(-1deg); } 100% { transform: scale(1); } }
/* kids palette: bright and varied */
.exp.kids { --green-900: #3a2a7a; --green-700: #5b3fd1; --green-500: #12b5cb; --gold: #ffb300; --gold-soft: #fff0b3; --paper: #fff4d6; --ink: #2a1f5c; --muted: #5d5a86; }
.exp.kids .top { background: linear-gradient(160deg, #7c4dff 0%, #12b5cb 60%, #4cd9a0 100%); }
.exp.kids .top h1 { text-shadow: 0 3px 0 rgba(42, 31, 92, .35); }
.exp.kids .tabs a.on { background: #ffb300; border-color: #ffb300; color: #2a1f5c; }
.exp.kids .hub-ring { background: conic-gradient(from 20deg, #ff6b6b, #ffb300, #4cd9a0, #12b5cb, #8f6bff, #ff6fa5, #ff6b6b); }
.exp.kids .hub-ring span { background: #3a2a7a; }
.exp.kids .lines line { stroke: #8f6bff; }
.exp.kids .node[data-pos="1"] { --c: #ff6b6b; }
.exp.kids .node[data-pos="2"] { --c: #ffb300; }
.exp.kids .node[data-pos="3"] { --c: #12b5cb; }
.exp.kids .node[data-pos="4"] { --c: #8f6bff; }
.exp.kids .node[data-pos="5"] { --c: #45c46b; }
.exp.kids .node[data-pos="6"] { --c: #ff6fa5; }
.exp.kids .node[data-pos="7"] { --c: #4d9bff; }
.exp.kids .node[data-pos="8"] { --c: #ff9a3c; }
.exp.kids .node .outer { background: var(--c); padding: 3px; }
.exp.kids .num { background: var(--c); color: #fff; font-size: 1.15rem; text-shadow: 0 2px 0 rgba(42, 31, 92, .45); }
.exp.kids .node h2 { color: var(--c); filter: brightness(.72); }
.exp.kids .node .range { color: var(--c); filter: brightness(.8); }
.exp.kids .more { color: #fff; background: var(--c); display: inline-block; padding: 1px 12px; margin-top: 10px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.exp.kids .ayat { background: #fff0b3; }
.exp.kids .btn { background: #5b3fd1; }
.exp.kids .btn.ghost { background: #ece6ff; color: #3a2a7a; }
.exp.kids .sheet { border-top-color: #ffb300; }
/* kids card: ayah fragment headline, one short line, picture that explains the meaning */
.exp .kid-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 4px; min-height: 78px; }
.exp .kid-head .num { position: static; flex: none; width: 40px; height: 40px; }
.exp .kid-head .frag { flex: 1; font-family: "Amiri Quran", "Scheherazade New", "Amiri", serif; font-size: 1.35rem; line-height: 1.8; color: #3a2a1a; background: var(--gold-soft); border: 2px solid var(--c); padding: 2px 10px; }
.exp .kid-head .frag::before { content: "﴿"; color: var(--c); margin-inline-end: 4px; }
.exp .kid-head .frag::after { content: "﴾"; color: var(--c); margin-inline-start: 4px; }
.exp .short { display: block; font-weight: 700; color: var(--ink); font-size: 1.02rem; line-height: 1.6; }
.exp.kids .node .txt { padding: 4px 14px 8px; }
.exp .bobwrap { animation: exp-fl 3.4s ease-in-out infinite; transform-box: fill-box; }
.exp .hub { position: relative; }
.exp .hub .ring { position: absolute; width: 250px; height: 250px; animation: exp-ringspin 40s linear infinite reverse; }
@keyframes exp-ringspin { to { transform: rotate(360deg); } }
.exp .node .start { position: absolute; top: -14px; inset-inline-end: 14px; z-index: 3; background: var(--gold); color: #2a1f5c; font-weight: 800; font-size: .8rem; padding: 1px 14px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.exp .node { overflow: visible; }
.exp .snd { position: absolute; top: 16px; inset-inline-start: 16px; width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.18); cursor: pointer; display: flex; align-items: center; justify-content: center; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .snd:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }
.exp .snd .x { display: none; }
.exp .snd.off .x { display: inline; }
.exp .snd.off .w { display: none; }
.exp .top { position: relative; }
.exp [x-cloak] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .exp *, .exp *::before, .exp *::after { transition: none !important; animation: none !important; }
}
/* animated parts of the shared picture library (see SceneComposer): origins are per element */
.exp .fl, .exp .sw, .exp .gl, .exp .rn, .exp .st, .exp .spin, .exp .bobwrap { transform-box: fill-box; }
.exp .fl, .exp .gl, .exp .rn, .exp .st, .exp .spin, .exp .bobwrap { transform-origin: center; }
.exp .sw { transform-origin: 50% 100%; }

/* ---- page shell: inside the site layout (fixed header), surah sidebar, surah navigation, brand ---- */
.exp { padding-top: 64px; min-height: 100vh; }
@media (min-width: 768px) { .exp { padding-top: 80px; } }
.exp .shell { max-width: 1320px; margin: -36px auto 40px; padding: 0 16px; display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .exp .shell { grid-template-columns: 250px minmax(0, 1fr); } .exp .side-col { position: sticky; top: 92px; align-self: start; } }
.exp .shell .wrap { margin: 0; padding: 0; max-width: none; }
.exp .side { background: var(--card); border: 2px solid var(--gold); padding: 14px; max-height: calc(100vh - 190px); overflow: auto; clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.exp .side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--green-900); font-weight: 800; }
.exp .side-x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--green-900); }
.exp .sections { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.exp .sections a { display: block; padding: 6px 12px; font-weight: 700; color: var(--green-900); text-decoration: none; background: var(--gold-soft); border-inline-start: 4px solid var(--gold); }
.exp .side details { border-top: 1px dashed #cbd6d1; padding: 6px 0; }
.exp .side summary { cursor: pointer; font-weight: 800; color: var(--green-700); padding: 4px 2px; }
.exp .side ul { list-style: none; margin: 4px 0 0; padding: 0; }
.exp .side li a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.exp .side li a:hover, .exp .side li a:focus-visible { background: var(--gold-soft); }
.exp .side li a.cur { background: var(--green-700); color: #fff; font-weight: 800; }
.exp .dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a92a; flex: none; }
.exp .dot.published { background: #2bc47a; }

@media (max-width: 1023px) {
    .exp .side { position: fixed; inset-block-start: 0; inset-block-end: 60px; inset-inline-start: 0; width: min(320px, 88vw); max-height: none; overflow-y: auto; overscroll-behavior: contain; z-index: 70; transform: translateX(110%); transition: transform .25s ease; clip-path: none; border-width: 0 0 0 3px; }
    [dir="rtl"] .exp .side { transform: translateX(110%); }
    [dir="ltr"] .exp .side { transform: translateX(-110%); }
    .exp .side.open { transform: none !important; }
    /* the scrim must stay below .side-col (z 60 on small screens, it holds the drawer) or it greys the list out */
    .exp .side-scrim { position: fixed; inset: 0 0 60px 0; background: rgba(0, 20, 16, .55); z-index: 55; }
}
.exp .surah-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.exp .surah-nav a { background: var(--green-700); color: #fff; padding: 9px 22px; font-weight: 800; text-decoration: none; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .surah-nav a.off { visibility: hidden; }
.exp .brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 8px; color: var(--muted); font-size: .9rem; }
.exp .brand img { width: 44px; height: 44px; object-fit: contain; }
.exp .brand b { color: var(--green-900); display: block; font-size: 1rem; }
.exp .mbrand { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.exp .mbrand img { width: 26px; height: 26px; object-fit: contain; }

/* the site stylesheet colours headings and links; keep the hero readable */
.exp .top h1, .exp .top p { color: #fff; }
.exp .top a { color: #fff; }
.exp .top .tabs a.on { color: #2a1f5c; }
/* leave the site's floating WhatsApp button (bottom start) free */

/* audio buttons in the card modal */
.exp .audio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.exp .abtn { border: 0; background: var(--green-700); color: #fff; padding: 8px 18px; font: inherit; font-weight: 800; cursor: pointer; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .abtn.on { background: #e0a92a; color: #2a1f5c; }
.exp .abtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .audio .credit { flex-basis: 100%; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.exp .abtn.alt { background: #e9e4f7; color: var(--green-900); }
.exp .abtn.alt.on { background: var(--green-700); color: #fff; }
.exp .audio .phase { color: var(--green-700); font-weight: 700; }

/* index page: the surahs of a juz */
.exp .index .juz h2 { color: var(--green-900); margin: 8px 0 14px; }
.exp .surah-grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.exp .surah-card { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 2px solid var(--gold); text-decoration: none; color: var(--ink); position: relative; min-height: 104px; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.exp .surah-card.ready:hover, .exp .surah-card.ready:focus-visible { background: var(--gold-soft); }
.exp .surah-card.soon { border-color: #cfd6d3; color: #8a9692; background: #f3f5f4; }
.exp .surah-card .sn { position: absolute; top: 8px; inset-inline-end: 12px; font-weight: 800; color: var(--gold); }
.exp .surah-card.soon .sn { color: #b4bdb9; }
.exp .surah-card .nm { font-weight: 800; font-size: 1.15rem; color: var(--green-900); }
.exp .surah-card.soon .nm { color: #8a9692; }
.exp .surah-card .meta { font-size: .85rem; color: var(--muted); }
.exp .surah-card .chip { justify-self: start; margin-top: 4px; font-size: .78rem; font-weight: 700; padding: 1px 10px; background: var(--green-700); color: #fff; }
.exp .surah-card.soon .chip { background: #dfe5e2; color: #7a8682; }
.exp .side .soon { display: flex; align-items: center; gap: 8px; padding: 5px 8px; color: #8a9692; font-size: .95rem; }
.exp .side .soon small { margin-inline-start: auto; font-size: .72rem; }
.exp .dot.soon { background: #d0d7d4; }
.exp .all-link { display: block; margin-top: 10px; text-align: center; font-weight: 800; color: var(--green-700); text-decoration: none; border-top: 1px dashed #cbd6d1; padding-top: 10px; }
.exp .shell.index { margin-top: 0; padding-top: 22px; }

/* hide the sidebar on wide screens: the lesson takes the whole width */
@media (min-width: 1024px) {
    .exp .shell.no-side { grid-template-columns: 52px minmax(0, 1fr); }
    .exp .shell.no-side .side { display: none; }
    .exp .side-x { display: none; }
}

/* the toggle is part of the sidebar column and always visible: a bar above the list, a narrow tab when the list is hidden */
.exp .side-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 9px 12px; border: 2px solid var(--gold); background: var(--green-700); color: #fff; font: inherit; font-weight: 800; cursor: pointer; clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); }
.exp .side-toggle:hover { background: var(--green-900); }
.exp .side-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .side-toggle .chev::before { content: "\25B8"; }          /* points to the edge the list slides to: right in RTL */
[dir="ltr"] .exp .side-toggle .chev::before { content: "\25C2"; }
.exp .side-toggle:not(.is-open) .chev::before { content: "\25C2"; }
[dir="ltr"] .exp .side-toggle:not(.is-open) .chev::before { content: "\25B8"; }
@media (min-width: 1024px) {
    .exp .shell.no-side .side-toggle { writing-mode: vertical-rl; width: 44px; margin: 0; padding: 16px 8px; clip-path: none; border-radius: 0; }
}
@media (max-width: 1023px) {
    .exp .side-col { position: static; }
}

/* guide mascots live in the hero, never over the lesson */
.exp .top { overflow: hidden; }
.exp .top .mascots { position: absolute; inset-inline-end: clamp(8px, 3vw, 40px); bottom: 0; width: clamp(104px, 12vw, 168px); pointer-events: none; }
.exp .top .mascots svg { display: block; width: 100%; height: auto; overflow: visible; }
.exp .top .bubble { position: absolute; inset-inline-end: clamp(120px, 15vw, 210px); bottom: clamp(110px, 12vw, 150px); max-width: 190px; background: #fff; color: var(--green-900); border: 3px solid #2b2140; padding: 6px 28px 6px 12px; font-weight: 700; font-size: .92rem; line-height: 1.5; border-radius: 16px; z-index: 2; }
.exp .top .bubble-x { position: absolute; top: 2px; inset-inline-end: 6px; border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; line-height: 1; color: var(--green-900); }
@media (max-width: 819px) { .exp .top .bubble { display: none; } .exp .top .mascots { width: 92px; } }

/* progress: a star on every opened card, the count on the hub, a cheer when all are opened */
.exp .node { position: relative; }
.exp .seen-star { position: absolute; top: -10px; inset-inline-start: -6px; z-index: 4; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; color: #2a1f5c; background: #ffd23f; border: 2px solid #2b2140; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.exp .hub-ring span { flex-direction: column; gap: 2px; text-align: center; }
.exp .hub-ring b { font-weight: 800; }
.exp .hub-ring .progress { font-style: normal; font-size: .85rem; color: var(--gold-soft); font-weight: 700; }

/* arrows follow the reading direction: "previous" points to the start side, "next" to the end side */
.exp .surah-nav a.prev::before { content: "\2192\00a0"; }
.exp .surah-nav a.next::after { content: "\00a0\2190"; }
[dir="ltr"] .exp .surah-nav a.prev::before { content: "\2190\00a0"; }
[dir="ltr"] .exp .surah-nav a.next::after { content: "\00a0\2192"; }

/* contrast, readable body text and visible focus */
.exp.kids .more, .exp.kids .num { color: #2a1f5c; text-shadow: none; }
.exp .node p { color: #3d4a46; font-size: 1rem; }
.exp a:focus-visible, .exp button:focus-visible, .exp summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .surah-card.soon { color: #5f6b67; border-color: #bcc6c2; }
.exp .surah-card.soon .nm, .exp .surah-card.soon .meta { color: #5f6b67; }
.exp .surah-card.soon .chip { background: #dfe5e2; color: #46524e; }
.exp .snd { width: 48px; height: 48px; }

/* mobile: the sidebar toggle is a slim bar under the site header, never over the cards */
@media (max-width: 1023px) {
    .exp .side-col { position: sticky; top: 64px; z-index: 60; margin: 0 -16px; }
    .exp .side-toggle { position: static; writing-mode: horizontal-tb; width: 100%; margin: 0; padding: 10px 12px; min-height: 44px; border-width: 0 0 2px 0; border-radius: 0; box-shadow: 0 4px 12px rgba(0,20,16,.18); }
    .exp .side-toggle.is-open { display: flex; }
}
/* hanging props swing from the top of their string */
.exp .swh { transform-box: fill-box; transform-origin: 50% 0; animation: exp-sw 3.4s ease-in-out infinite; }

/* listening settings: what to play, how many times, which reciter */
.exp .aset { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; background: #fff; color: var(--green-900); border-radius: 18px; padding: 14px 16px; margin: 14px auto 0; max-width: 760px; font-size: .95rem; text-align: center; }
.exp .aset-modes { grid-column: 1 / -1; display: flex; gap: 4px; background: #e9e4f7; border-radius: 999px; padding: 4px; }
.exp .aset-modes button { flex: 1; border: 0; background: transparent; color: var(--green-900); font: inherit; font-weight: 800; padding: 9px 8px; border-radius: 999px; cursor: pointer; }
.exp .aset-modes button.on { background: var(--green-700); color: #fff; }
.exp .aset-box { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; }
.exp .aset-label { font-weight: 800; font-size: .85rem; color: var(--muted); }
.exp .aset-step { display: inline-flex; align-items: center; gap: 12px; }
.exp .aset-step button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e9e4f7; color: var(--green-900); font: inherit; font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer; }
.exp .aset-step b { min-width: 1.6em; text-align: center; font-size: 1.3rem; }
.exp .aset-box select { font: inherit; font-weight: 700; padding: 7px 10px; border-radius: 10px; border: 1px solid #c9c1e6; background: #fff; color: var(--green-900); max-width: 100%; }
.exp .aset-hint { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
.exp .aset button:focus-visible, .exp .aset select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .exp .aset { grid-template-columns: 1fr 1fr; } .exp .aset-box:last-of-type { grid-column: 1 / -1; } }

/* Seerah section: lesson covers, sidebar list, and the section tabs of the seerah index */
.exp .seerah-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.exp .surah-card.cover { padding: 0; overflow: hidden; align-content: start; }
.exp .surah-card.cover .cover-art { display: block; aspect-ratio: 240 / 150; }
.exp .surah-card.cover .cover-art svg { display: block; width: 100%; height: 100%; }
.exp .surah-card.cover .nm, .exp .surah-card.cover .meta, .exp .surah-card.cover .chip { margin-inline: 14px; }
.exp .surah-card.cover .nm { margin-top: 8px; }
.exp .surah-card.cover .chip { margin-bottom: 12px; }
.exp .surah-card.cover .sn { z-index: 1; background: var(--card); padding: 0 8px; }
.exp .seerah-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.exp .seerah-list a { display: block; padding: 6px 12px; color: var(--green-900); text-decoration: none; font-weight: 600; }
.exp .seerah-list a.cur { background: var(--gold-soft); font-weight: 800; }
.exp .sections-tabs { display: flex; gap: 8px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.exp .sections-tabs a { padding: 4px 16px; font-weight: 700; color: var(--green-900); text-decoration: none; background: var(--gold-soft); border-bottom: 3px solid transparent; }
.exp .sections-tabs a.on { border-bottom-color: var(--gold); }

/* Motion for the seerah props: walking in, flapping wings, drifting dust and leaves, a travelling dotted arrow */
.exp .wk { animation: exp-wk 9s linear infinite; }
@keyframes exp-wk { 0% { transform: translateX(-34px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(34px); opacity: 0; } }
.exp .bb { animation: exp-bb .9s ease-in-out infinite; }
@keyframes exp-bb { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.exp .fy { animation: exp-fy 7s linear infinite; }
@keyframes exp-fy { 0% { transform: translateX(-10px); } 100% { transform: translateX(330px); } }
.exp .flap { animation: exp-flap .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes exp-flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
.exp .dr { animation: exp-dr 7s ease-in-out infinite alternate; }
@keyframes exp-dr { from { transform: translateX(-10px); } to { transform: translateX(12px); } }
.exp .lf { animation: exp-lf 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes exp-lf { 0% { transform: translate(-30px, -8px) rotate(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(40px, 34px) rotate(200deg); opacity: 0; } }
.exp .dsh path { stroke-dasharray: 4 6; animation: exp-dsh 1s linear infinite; }
@keyframes exp-dsh { to { stroke-dashoffset: -20; } }
.exp .surah-card.soon.cover .cover-art { filter: saturate(.55) brightness(1.02); opacity: .92; }
.exp .seerah-list .soon { display: block; padding: 6px 12px; color: #5f6b67; }

/* small screens: the site has a fixed 60px bottom bar, so the card sheet and its scrim end above it */
@media (max-width: 1023px) {
    .exp .scrim { inset: 0 0 60px 0; z-index: 62; } /* above the sticky list toggle (z 60) */
    .exp .sheet { max-height: calc(100vh - 60px - 12px); overflow-y: auto; }
    .exp .seerah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .exp .surah-card.cover .nm { font-size: 1rem; }
    .exp .seerah-grid { gap: 8px; }
}

/* ==========================================================================
   الرِّواق (Al-Riwaq) Luxury Animated Hub Styles
   ========================================================================== */
.exp.riwaq-hub .top {
    position: relative;
    background: radial-gradient(circle at 50% 20%, var(--green-700), var(--green-900) 80%);
    padding: 36px 20px 70px;
    overflow: hidden;
    border-bottom: 2px solid rgba(197, 160, 56, .35);
}
.exp.riwaq-hub.kids .top {
    background: radial-gradient(circle at 50% 20%, #0e8a6a, #004d3c 85%);
}
.exp.riwaq-hub .top::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(197, 160, 56, .12) 0%, transparent 70%);
    pointer-events: none;
    animation: riwaq-glow 6s ease-in-out infinite alternate;
}
@keyframes riwaq-glow {
    0% { opacity: .6; transform: scale(.96); }
    100% { opacity: 1; transform: scale(1.04); }
}

.exp .riwaq-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(197, 160, 56, .25), rgba(197, 160, 56, .1));
    border: 1px solid var(--gold);
    color: var(--gold-soft);
    padding: 6px 18px;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .5px;
    border-radius: 99px;
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
    margin-bottom: 12px;
}
.exp .riwaq-badge span.gem {
    color: var(--gold);
    animation: exp-bb 1.5s ease-in-out infinite;
}

.exp.riwaq-hub .top h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin: 8px 0 10px;
    background: linear-gradient(135deg, #ffffff 45%, var(--gold-soft) 80%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35));
}
.exp.riwaq-hub .top p.lead {
    max-width: 680px;
    margin: 0 auto 20px;
    font-size: clamp(.98rem, 2vw, 1.15rem);
    color: #e2ede8;
    line-height: 1.8;
}

/* Stats Ribbon */
.exp .riwaq-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
}
.exp .riwaq-stat-pill {
    background: rgba(0, 35, 27, .65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(197, 160, 56, .35);
    color: #fff;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: .86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: transform .2s ease, border-color .2s ease;
}
.exp .riwaq-stat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}
.exp .riwaq-stat-pill i {
    color: var(--gold);
}

/* Three Portals (Arches) */
.exp .riwaq-portals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 28px;
    margin: 20px 0 44px;
}
.exp .riwaq-portal-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(197, 160, 56, .22);
    box-shadow: 0 8px 24px rgba(0, 56, 44, .08);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
    position: relative;
}
.exp .riwaq-portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 36px rgba(0, 56, 44, .16);
    border-color: var(--gold);
}
.exp .riwaq-portal-card .portal-scene {
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--green-900);
}
.exp .riwaq-portal-card .portal-scene svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform .4s ease;
}
.exp .riwaq-portal-card:hover .portal-scene svg {
    transform: scale(1.04);
}
.exp .riwaq-portal-card .portal-arch-header {
    background: linear-gradient(135deg, var(--green-900), var(--green-700));
    color: #fff;
    padding: 16px 20px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
}
.exp.kids .riwaq-portal-card .portal-arch-header {
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
}
.exp .riwaq-portal-card .portal-arch-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}
.exp .riwaq-portal-card .portal-badge {
    background: var(--gold);
    color: #1b1300;
    font-weight: 800;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 99px;
}
.exp .riwaq-portal-card .portal-content {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.exp .riwaq-portal-card .portal-content p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.7;
    flex: 1;
}
.exp .riwaq-portal-card .portal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(0,0,0,.1);
    padding-top: 14px;
    margin-top: auto;
}
.exp .riwaq-portal-card .portal-footer .counter {
    color: var(--green-700);
    font-size: .88rem;
    font-weight: 800;
}
.exp .riwaq-portal-card .portal-footer .enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-soft);
    color: var(--green-900);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: .88rem;
    font-weight: 800;
    transition: background .2s ease, transform .2s ease;
}
.exp .riwaq-portal-card:hover .enter-btn {
    background: var(--gold);
    color: #1b1300;
    transform: translateX(-4px);
}

/* Ready stations section */
.exp .riwaq-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 36px 0 18px;
}
.exp .riwaq-section-title h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--green-900);
    margin: 0;
}
.exp .riwaq-section-title .glow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: exp-bb 1s infinite alternate;
}

/* Core Pillars Grid */
.exp .riwaq-pillars {
    background: linear-gradient(135deg, rgba(255,255,255,.9), var(--card));
    border-radius: 20px;
    padding: 34px 28px;
    margin: 36px 0;
    border: 1px solid rgba(197, 160, 56, .25);
    box-shadow: 0 6px 20px rgba(0, 56, 44, .04);
}
.exp .riwaq-pillars h3 {
    text-align: center;
    color: var(--green-900);
    font-size: 1.35rem;
    margin: 0 0 28px;
    font-weight: 800;
    position: relative;
}
.exp .riwaq-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.exp .pillar-card {
    background: var(--paper);
    border-radius: 14px;
    padding: 20px 18px;
    text-align: center;
    border: 1px solid rgba(0, 56, 44, .06);
    transition: transform .2s ease, border-color .2s ease;
}
.exp .pillar-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
}
.exp .pillar-card .pillar-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold-soft), #fff);
    border: 2px solid var(--gold);
    color: var(--green-900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(197, 160, 56, .2);
}
.exp .pillar-card h4 {
    margin: 0 0 8px;
    font-size: 1.08rem;
    color: var(--green-900);
    font-weight: 800;
}
.exp .pillar-card p {
    margin: 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.65;
}

@media (max-width: 640px) {
    .exp.riwaq-hub .top { padding: 24px 14px 50px; }
    .exp .riwaq-stats { gap: 8px; }
    .exp .riwaq-stat-pill { font-size: .78rem; padding: 4px 12px; }
    .exp .riwaq-portals { grid-template-columns: 1fr; gap: 20px; }
}


/* ==========================================================================
   Interactive FX: Background Motion, 3D Mouse Tilt, Mobile Touch & Audio
   ========================================================================== */
.exp.riwaq-hub {
    position: relative;
    overflow-x: hidden;
}

/* Floating Background Particles Layer */
.riwaq-bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.riwaq-particle {
    position: absolute;
    color: var(--gold);
    opacity: .35;
    will-change: transform, opacity;
    animation: riwaq-float var(--dur, 8s) ease-in-out infinite alternate;
}
@keyframes riwaq-float {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: .2; }
    50% { opacity: .6; transform: translateY(-30px) rotate(90deg) scale(1.15); }
    100% { transform: translateY(-60px) rotate(180deg) scale(1); opacity: .2; }
}

/* Interactive Cursor Glow (Lantern Effect) */
.riwaq-cursor-glow {
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 160, 56, .14) 0%, rgba(14, 138, 106, .06) 40%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity .3s ease;
    opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
    .riwaq-cursor-glow.active { opacity: 1; }
}

/* 3D Tilt Card Base & Glare */
.exp .riwaq-portal-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform .15s ease-out, box-shadow .25s ease, border-color .25s ease;
}
.exp .riwaq-portal-card .card-glare {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, .3) 0%, rgba(197, 160, 56, .12) 40%, transparent 70%);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 2;
}
.exp .riwaq-portal-card:hover .card-glare {
    opacity: 1;
}

/* Mobile Touch & Press Interaction */
.exp .riwaq-portal-card:active,
.exp .surah-card:active,
.exp .sections-tabs a:active,
.exp .tabs a:active {
    transform: scale(.97) !important;
    transition: transform .1s ease !important;
}

/* Sound Control Button */
.riwaq-sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 35, 27, .75);
    border: 1px solid var(--gold);
    color: var(--gold-soft);
    padding: 5px 14px;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .2s ease, transform .2s ease;
    margin-top: 6px;
}
.riwaq-sound-toggle:hover {
    background: var(--green-900);
    transform: scale(1.04);
}
.riwaq-sound-toggle.muted {
    opacity: .6;
    border-color: rgba(255,255,255,.3);
    color: #cbd5e1;
}

/* Flat-vector covers (adab): pop in, then everything breathes, floats and drifts. Motion is switched off for reduced-motion users above. */
.exp svg.flat * { transform-box: fill-box; }
.exp svg.flat .blob { transform-origin: center; animation: exp-blob 6s ease-in-out infinite alternate; }
@keyframes exp-blob { from { transform: scale(.96); } to { transform: scale(1.05); } }
.exp svg.flat .pp { transform-origin: 50% 100%; animation: exp-pop .7s cubic-bezier(.3, 1.7, .5, 1) backwards; animation-delay: calc(var(--i, 0) * .09s); }
.exp svg.flat .pp.pd { animation: none; }
.exp svg.flat .pp.pg { animation: exp-pop .7s cubic-bezier(.3, 1.7, .5, 1) backwards, exp-breathe var(--t, 3.4s) ease-in-out var(--d, 0s) infinite; animation-delay: calc(var(--i, 0) * .09s), var(--d, 0s); }
.exp svg.flat .pp.pf { transform-origin: center; animation: exp-pop .7s cubic-bezier(.3, 1.7, .5, 1) backwards, exp-bob var(--t, 3.4s) ease-in-out var(--d, 0s) infinite; animation-delay: calc(var(--i, 0) * .09s), var(--d, 0s); }
@keyframes exp-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06) rotate(-1deg); } 100% { transform: scale(1); } }
/* kids palette: bright and varied */
.exp.kids { --green-900: #3a2a7a; --green-700: #5b3fd1; --green-500: #12b5cb; --gold: #ffb300; --gold-soft: #fff0b3; --paper: #fff4d6; --ink: #2a1f5c; --muted: #5d5a86; }
.exp.kids .top { background: linear-gradient(160deg, #7c4dff 0%, #12b5cb 60%, #4cd9a0 100%); }
.exp.kids .top h1 { text-shadow: 0 3px 0 rgba(42, 31, 92, .35); }
.exp.kids .tabs a.on { background: #ffb300; border-color: #ffb300; color: #2a1f5c; }
.exp.kids .hub-ring { background: conic-gradient(from 20deg, #ff6b6b, #ffb300, #4cd9a0, #12b5cb, #8f6bff, #ff6fa5, #ff6b6b); }
.exp.kids .hub-ring span { background: #3a2a7a; }
.exp.kids .lines line { stroke: #8f6bff; }
.exp.kids .node[data-pos="1"] { --c: #ff6b6b; }
.exp.kids .node[data-pos="2"] { --c: #ffb300; }
.exp.kids .node[data-pos="3"] { --c: #12b5cb; }
.exp.kids .node[data-pos="4"] { --c: #8f6bff; }
.exp.kids .node[data-pos="5"] { --c: #45c46b; }
.exp.kids .node[data-pos="6"] { --c: #ff6fa5; }
.exp.kids .node[data-pos="7"] { --c: #4d9bff; }
.exp.kids .node[data-pos="8"] { --c: #ff9a3c; }
.exp.kids .node .outer { background: var(--c); padding: 3px; }
.exp.kids .num { background: var(--c); color: #fff; font-size: 1.15rem; text-shadow: 0 2px 0 rgba(42, 31, 92, .45); }
.exp.kids .node h2 { color: var(--c); filter: brightness(.72); }
.exp.kids .node .range { color: var(--c); filter: brightness(.8); }
.exp.kids .more { color: #fff; background: var(--c); display: inline-block; padding: 1px 12px; margin-top: 10px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.exp.kids .ayat { background: #fff0b3; }
.exp.kids .btn { background: #5b3fd1; }
.exp.kids .btn.ghost { background: #ece6ff; color: #3a2a7a; }
.exp.kids .sheet { border-top-color: #ffb300; }
/* kids card: ayah fragment headline, one short line, picture that explains the meaning */
.exp .kid-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 4px; min-height: 78px; }
.exp .kid-head .num { position: static; flex: none; width: 40px; height: 40px; }
.exp .kid-head .frag { flex: 1; font-family: "Amiri Quran", "Scheherazade New", "Amiri", serif; font-size: 1.35rem; line-height: 1.8; color: #3a2a1a; background: var(--gold-soft); border: 2px solid var(--c); padding: 2px 10px; }
.exp .kid-head .frag::before { content: "﴿"; color: var(--c); margin-inline-end: 4px; }
.exp .kid-head .frag::after { content: "﴾"; color: var(--c); margin-inline-start: 4px; }
.exp .short { display: block; font-weight: 700; color: var(--ink); font-size: 1.02rem; line-height: 1.6; }
.exp.kids .node .txt { padding: 4px 14px 8px; }
.exp .bobwrap { animation: exp-fl 3.4s ease-in-out infinite; transform-box: fill-box; }
.exp .hub { position: relative; }
.exp .hub .ring { position: absolute; width: 250px; height: 250px; animation: exp-ringspin 40s linear infinite reverse; }
@keyframes exp-ringspin { to { transform: rotate(360deg); } }
.exp .node .start { position: absolute; top: -14px; inset-inline-end: 14px; z-index: 3; background: var(--gold); color: #2a1f5c; font-weight: 800; font-size: .8rem; padding: 1px 14px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.exp .node { overflow: visible; }
.exp .snd { position: absolute; top: 16px; inset-inline-start: 16px; width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.18); cursor: pointer; display: flex; align-items: center; justify-content: center; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .snd:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }
.exp .snd .x { display: none; }
.exp .snd.off .x { display: inline; }
.exp .snd.off .w { display: none; }
.exp .top { position: relative; }
.exp [x-cloak] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .exp *, .exp *::before, .exp *::after { transition: none !important; animation: none !important; }
}
/* animated parts of the shared picture library (see SceneComposer): origins are per element */
.exp .fl, .exp .sw, .exp .gl, .exp .rn, .exp .st, .exp .spin, .exp .bobwrap { transform-box: fill-box; }
.exp .fl, .exp .gl, .exp .rn, .exp .st, .exp .spin, .exp .bobwrap { transform-origin: center; }
.exp .sw { transform-origin: 50% 100%; }

/* ---- page shell: inside the site layout (fixed header), surah sidebar, surah navigation, brand ---- */
.exp { padding-top: 64px; min-height: 100vh; }
@media (min-width: 768px) { .exp { padding-top: 80px; } }
.exp .shell { max-width: 1320px; margin: -36px auto 40px; padding: 0 16px; display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .exp .shell { grid-template-columns: 250px minmax(0, 1fr); } .exp .side-col { position: sticky; top: 92px; align-self: start; } }
.exp .shell .wrap { margin: 0; padding: 0; max-width: none; }
.exp .side { background: var(--card); border: 2px solid var(--gold); padding: 14px; max-height: calc(100vh - 190px); overflow: auto; clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.exp .side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--green-900); font-weight: 800; }
.exp .side-x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--green-900); }
.exp .sections { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.exp .sections a { display: block; padding: 6px 12px; font-weight: 700; color: var(--green-900); text-decoration: none; background: var(--gold-soft); border-inline-start: 4px solid var(--gold); }
.exp .side details { border-top: 1px dashed #cbd6d1; padding: 6px 0; }
.exp .side summary { cursor: pointer; font-weight: 800; color: var(--green-700); padding: 4px 2px; }
.exp .side ul { list-style: none; margin: 4px 0 0; padding: 0; }
.exp .side li a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.exp .side li a:hover, .exp .side li a:focus-visible { background: var(--gold-soft); }
.exp .side li a.cur { background: var(--green-700); color: #fff; font-weight: 800; }
.exp .dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a92a; flex: none; }
.exp .dot.published { background: #2bc47a; }

@media (max-width: 1023px) {
    .exp .side { position: fixed; inset-block-start: 0; inset-block-end: 60px; inset-inline-start: 0; width: min(320px, 88vw); max-height: none; overflow-y: auto; overscroll-behavior: contain; z-index: 70; transform: translateX(110%); transition: transform .25s ease; clip-path: none; border-width: 0 0 0 3px; }
    [dir="rtl"] .exp .side { transform: translateX(110%); }
    [dir="ltr"] .exp .side { transform: translateX(-110%); }
    .exp .side.open { transform: none !important; }
    /* the scrim must stay below .side-col (z 60 on small screens, it holds the drawer) or it greys the list out */
    .exp .side-scrim { position: fixed; inset: 0 0 60px 0; background: rgba(0, 20, 16, .55); z-index: 55; }
}
.exp .surah-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.exp .surah-nav a { background: var(--green-700); color: #fff; padding: 9px 22px; font-weight: 800; text-decoration: none; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .surah-nav a.off { visibility: hidden; }
.exp .brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 8px; color: var(--muted); font-size: .9rem; }
.exp .brand img { width: 44px; height: 44px; object-fit: contain; }
.exp .brand b { color: var(--green-900); display: block; font-size: 1rem; }
.exp .mbrand { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.exp .mbrand img { width: 26px; height: 26px; object-fit: contain; }

/* the site stylesheet colours headings and links; keep the hero readable */
.exp .top h1, .exp .top p { color: #fff; }
.exp .top a { color: #fff; }
.exp .top .tabs a.on { color: #2a1f5c; }
/* leave the site's floating WhatsApp button (bottom start) free */

/* audio buttons in the card modal */
.exp .audio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.exp .abtn { border: 0; background: var(--green-700); color: #fff; padding: 8px 18px; font: inherit; font-weight: 800; cursor: pointer; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.exp .abtn.on { background: #e0a92a; color: #2a1f5c; }
.exp .abtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .audio .credit { flex-basis: 100%; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.exp .abtn.alt { background: #e9e4f7; color: var(--green-900); }
.exp .abtn.alt.on { background: var(--green-700); color: #fff; }
.exp .audio .phase { color: var(--green-700); font-weight: 700; }

/* index page: the surahs of a juz */
.exp .index .juz h2 { color: var(--green-900); margin: 8px 0 14px; }
.exp .surah-grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.exp .surah-card { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 2px solid var(--gold); text-decoration: none; color: var(--ink); position: relative; min-height: 104px; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.exp .surah-card.ready:hover, .exp .surah-card.ready:focus-visible { background: var(--gold-soft); }
.exp .surah-card.soon { border-color: #cfd6d3; color: #8a9692; background: #f3f5f4; }
.exp .surah-card .sn { position: absolute; top: 8px; inset-inline-end: 12px; font-weight: 800; color: var(--gold); }
.exp .surah-card.soon .sn { color: #b4bdb9; }
.exp .surah-card .nm { font-weight: 800; font-size: 1.15rem; color: var(--green-900); }
.exp .surah-card.soon .nm { color: #8a9692; }
.exp .surah-card .meta { font-size: .85rem; color: var(--muted); }
.exp .surah-card .chip { justify-self: start; margin-top: 4px; font-size: .78rem; font-weight: 700; padding: 1px 10px; background: var(--green-700); color: #fff; }
.exp .surah-card.soon .chip { background: #dfe5e2; color: #7a8682; }
.exp .side .soon { display: flex; align-items: center; gap: 8px; padding: 5px 8px; color: #8a9692; font-size: .95rem; }
.exp .side .soon small { margin-inline-start: auto; font-size: .72rem; }
.exp .dot.soon { background: #d0d7d4; }
.exp .all-link { display: block; margin-top: 10px; text-align: center; font-weight: 800; color: var(--green-700); text-decoration: none; border-top: 1px dashed #cbd6d1; padding-top: 10px; }
.exp .shell.index { margin-top: 0; padding-top: 22px; }

/* hide the sidebar on wide screens: the lesson takes the whole width */
@media (min-width: 1024px) {
    .exp .shell.no-side { grid-template-columns: 52px minmax(0, 1fr); }
    .exp .shell.no-side .side { display: none; }
    .exp .side-x { display: none; }
}

/* the toggle is part of the sidebar column and always visible: a bar above the list, a narrow tab when the list is hidden */
.exp .side-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 9px 12px; border: 2px solid var(--gold); background: var(--green-700); color: #fff; font: inherit; font-weight: 800; cursor: pointer; clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); }
.exp .side-toggle:hover { background: var(--green-900); }
.exp .side-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .side-toggle .chev::before { content: "\25B8"; }          /* points to the edge the list slides to: right in RTL */
[dir="ltr"] .exp .side-toggle .chev::before { content: "\25C2"; }
.exp .side-toggle:not(.is-open) .chev::before { content: "\25C2"; }
[dir="ltr"] .exp .side-toggle:not(.is-open) .chev::before { content: "\25B8"; }
@media (min-width: 1024px) {
    .exp .shell.no-side .side-toggle { writing-mode: vertical-rl; width: 44px; margin: 0; padding: 16px 8px; clip-path: none; border-radius: 0; }
}
@media (max-width: 1023px) {
    .exp .side-col { position: static; }
}

/* guide mascots live in the hero, never over the lesson */
.exp .top { overflow: hidden; }
.exp .top .mascots { position: absolute; inset-inline-end: clamp(8px, 3vw, 40px); bottom: 0; width: clamp(104px, 12vw, 168px); pointer-events: none; }
.exp .top .mascots svg { display: block; width: 100%; height: auto; overflow: visible; }
.exp .top .bubble { position: absolute; inset-inline-end: clamp(120px, 15vw, 210px); bottom: clamp(110px, 12vw, 150px); max-width: 190px; background: #fff; color: var(--green-900); border: 3px solid #2b2140; padding: 6px 28px 6px 12px; font-weight: 700; font-size: .92rem; line-height: 1.5; border-radius: 16px; z-index: 2; }
.exp .top .bubble-x { position: absolute; top: 2px; inset-inline-end: 6px; border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; line-height: 1; color: var(--green-900); }
@media (max-width: 819px) { .exp .top .bubble { display: none; } .exp .top .mascots { width: 92px; } }

/* progress: a star on every opened card, the count on the hub, a cheer when all are opened */
.exp .node { position: relative; }
.exp .seen-star { position: absolute; top: -10px; inset-inline-start: -6px; z-index: 4; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; color: #2a1f5c; background: #ffd23f; border: 2px solid #2b2140; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.exp .hub-ring span { flex-direction: column; gap: 2px; text-align: center; }
.exp .hub-ring b { font-weight: 800; }
.exp .hub-ring .progress { font-style: normal; font-size: .85rem; color: var(--gold-soft); font-weight: 700; }

/* arrows follow the reading direction: "previous" points to the start side, "next" to the end side */
.exp .surah-nav a.prev::before { content: "\2192\00a0"; }
.exp .surah-nav a.next::after { content: "\00a0\2190"; }
[dir="ltr"] .exp .surah-nav a.prev::before { content: "\2190\00a0"; }
[dir="ltr"] .exp .surah-nav a.next::after { content: "\00a0\2192"; }

/* contrast, readable body text and visible focus */
.exp.kids .more, .exp.kids .num { color: #2a1f5c; text-shadow: none; }
.exp .node p { color: #3d4a46; font-size: 1rem; }
.exp a:focus-visible, .exp button:focus-visible, .exp summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp .surah-card.soon { color: #5f6b67; border-color: #bcc6c2; }
.exp .surah-card.soon .nm, .exp .surah-card.soon .meta { color: #5f6b67; }
.exp .surah-card.soon .chip { background: #dfe5e2; color: #46524e; }
.exp .snd { width: 48px; height: 48px; }

/* mobile: the sidebar toggle is a slim bar under the site header, never over the cards */
@media (max-width: 1023px) {
    .exp .side-col { position: sticky; top: 64px; z-index: 60; margin: 0 -16px; }
    .exp .side-toggle { position: static; writing-mode: horizontal-tb; width: 100%; margin: 0; padding: 10px 12px; min-height: 44px; border-width: 0 0 2px 0; border-radius: 0; box-shadow: 0 4px 12px rgba(0,20,16,.18); }
    .exp .side-toggle.is-open { display: flex; }
}
/* hanging props swing from the top of their string */
.exp .swh { transform-box: fill-box; transform-origin: 50% 0; animation: exp-sw 3.4s ease-in-out infinite; }

/* listening settings: what to play, how many times, which reciter */
.exp .aset { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; background: #fff; color: var(--green-900); border-radius: 18px; padding: 14px 16px; margin: 14px auto 0; max-width: 760px; font-size: .95rem; text-align: center; }
.exp .aset-modes { grid-column: 1 / -1; display: flex; gap: 4px; background: #e9e4f7; border-radius: 999px; padding: 4px; }
.exp .aset-modes button { flex: 1; border: 0; background: transparent; color: var(--green-900); font: inherit; font-weight: 800; padding: 9px 8px; border-radius: 999px; cursor: pointer; }
.exp .aset-modes button.on { background: var(--green-700); color: #fff; }
.exp .aset-box { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; }
.exp .aset-label { font-weight: 800; font-size: .85rem; color: var(--muted); }
.exp .aset-step { display: inline-flex; align-items: center; gap: 12px; }
.exp .aset-step button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e9e4f7; color: var(--green-900); font: inherit; font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer; }
.exp .aset-step b { min-width: 1.6em; text-align: center; font-size: 1.3rem; }
.exp .aset-box select { font: inherit; font-weight: 700; padding: 7px 10px; border-radius: 10px; border: 1px solid #c9c1e6; background: #fff; color: var(--green-900); max-width: 100%; }
.exp .aset-hint { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
.exp .aset button:focus-visible, .exp .aset select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .exp .aset { grid-template-columns: 1fr 1fr; } .exp .aset-box:last-of-type { grid-column: 1 / -1; } }

/* Seerah section: lesson covers, sidebar list, and the section tabs of the seerah index */
.exp .seerah-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.exp .surah-card.cover { padding: 0; overflow: hidden; align-content: start; }
.exp .surah-card.cover .cover-art { display: block; aspect-ratio: 240 / 150; }
.exp .surah-card.cover .cover-art svg { display: block; width: 100%; height: 100%; }
.exp .surah-card.cover .nm, .exp .surah-card.cover .meta, .exp .surah-card.cover .chip { margin-inline: 14px; }
.exp .surah-card.cover .nm { margin-top: 8px; }
.exp .surah-card.cover .chip { margin-bottom: 12px; }
.exp .surah-card.cover .sn { z-index: 1; background: var(--card); padding: 0 8px; }
.exp .seerah-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.exp .seerah-list a { display: block; padding: 6px 12px; color: var(--green-900); text-decoration: none; font-weight: 600; }
.exp .seerah-list a.cur { background: var(--gold-soft); font-weight: 800; }
.exp .sections-tabs { display: flex; gap: 8px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.exp .sections-tabs a { padding: 4px 16px; font-weight: 700; color: var(--green-900); text-decoration: none; background: var(--gold-soft); border-bottom: 3px solid transparent; }
.exp .sections-tabs a.on { border-bottom-color: var(--gold); }

/* Motion for the seerah props: walking in, flapping wings, drifting dust and leaves, a travelling dotted arrow */
.exp .wk { animation: exp-wk 9s linear infinite; }
@keyframes exp-wk { 0% { transform: translateX(-34px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(34px); opacity: 0; } }
.exp .bb { animation: exp-bb .9s ease-in-out infinite; }
@keyframes exp-bb { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.exp .fy { animation: exp-fy 7s linear infinite; }
@keyframes exp-fy { 0% { transform: translateX(-10px); } 100% { transform: translateX(330px); } }
.exp .flap { animation: exp-flap .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes exp-flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
.exp .dr { animation: exp-dr 7s ease-in-out infinite alternate; }
@keyframes exp-dr { from { transform: translateX(-10px); } to { transform: translateX(12px); } }
.exp .lf { animation: exp-lf 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes exp-lf { 0% { transform: translate(-30px, -8px) rotate(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(40px, 34px) rotate(200deg); opacity: 0; } }
.exp .dsh path { stroke-dasharray: 4 6; animation: exp-dsh 1s linear infinite; }
@keyframes exp-dsh { to { stroke-dashoffset: -20; } }
.exp .surah-card.soon.cover .cover-art { filter: saturate(.55) brightness(1.02); opacity: .92; }
.exp .seerah-list .soon { display: block; padding: 6px 12px; color: #5f6b67; }

/* small screens: the site has a fixed 60px bottom bar, so the card sheet and its scrim end above it */
@media (max-width: 1023px) {
    .exp .scrim { inset: 0 0 60px 0; z-index: 62; } /* above the sticky list toggle (z 60) */
    .exp .sheet { max-height: calc(100vh - 60px - 12px); overflow-y: auto; }
    .exp .seerah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .exp .surah-card.cover .nm { font-size: 1rem; }
    .exp .seerah-grid { gap: 8px; }
}

/* ==========================================================================
   الرِّواق (Al-Riwaq) Luxury Animated Hub Styles
   ========================================================================== */
.exp.riwaq-hub .top {
    position: relative;
    background: radial-gradient(circle at 50% 20%, var(--green-700), var(--green-900) 80%);
    padding: 36px 20px 70px;
    overflow: hidden;
    border-bottom: 2px solid rgba(197, 160, 56, .35);
}
.exp.riwaq-hub.kids .top {
    background: radial-gradient(circle at 50% 20%, #0e8a6a, #004d3c 85%);
}
.exp.riwaq-hub .top::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(197, 160, 56, .12) 0%, transparent 70%);
    pointer-events: none;
    animation: riwaq-glow 6s ease-in-out infinite alternate;
}
@keyframes riwaq-glow {
    0% { opacity: .6; transform: scale(.96); }
    100% { opacity: 1; transform: scale(1.04); }
}

.exp .riwaq-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(197, 160, 56, .25), rgba(197, 160, 56, .1));
    border: 1px solid var(--gold);
    color: var(--gold-soft);
    padding: 6px 18px;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .5px;
    border-radius: 99px;
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
    margin-bottom: 12px;
}
.exp .riwaq-badge span.gem {
    color: var(--gold);
    animation: exp-bb 1.5s ease-in-out infinite;
}

.exp.riwaq-hub .top h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin: 8px 0 10px;
    background: linear-gradient(135deg, #ffffff 45%, var(--gold-soft) 80%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35));
}
.exp.riwaq-hub .top p.lead {
    max-width: 680px;
    margin: 0 auto 20px;
    font-size: clamp(.98rem, 2vw, 1.15rem);
    color: #e2ede8;
    line-height: 1.8;
}

/* Stats Ribbon */
.exp .riwaq-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
}
.exp .riwaq-stat-pill {
    background: rgba(0, 35, 27, .65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(197, 160, 56, .35);
    color: #fff;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: .86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: transform .2s ease, border-color .2s ease;
}
.exp .riwaq-stat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}
.exp .riwaq-stat-pill i {
    color: var(--gold);
}

/* Three Portals (Arches) */
.exp .riwaq-portals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 28px;
    margin: 20px 0 44px;
}
.exp .riwaq-portal-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(197, 160, 56, .22);
    box-shadow: 0 8px 24px rgba(0, 56, 44, .08);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
    position: relative;
}
.exp .riwaq-portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 36px rgba(0, 56, 44, .16);
    border-color: var(--gold);
}
.exp .riwaq-portal-card .portal-scene {
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--green-900);
}
.exp .riwaq-portal-card .portal-scene svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform .4s ease;
}
.exp .riwaq-portal-card:hover .portal-scene svg {
    transform: scale(1.04);
}
.exp .riwaq-portal-card .portal-arch-header {
    background: linear-gradient(135deg, var(--green-900), var(--green-700));
    color: #fff;
    padding: 16px 20px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
}
.exp.kids .riwaq-portal-card .portal-arch-header {
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
}
.exp .riwaq-portal-card .portal-arch-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}
.exp .riwaq-portal-card .portal-badge {
    background: var(--gold);
    color: #1b1300;
    font-weight: 800;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 99px;
}
.exp .riwaq-portal-card .portal-content {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.exp .riwaq-portal-card .portal-content p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.7;
    flex: 1;
}
.exp .riwaq-portal-card .portal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(0,0,0,.1);
    padding-top: 14px;
    margin-top: auto;
}
.exp .riwaq-portal-card .portal-footer .counter {
    color: var(--green-700);
    font-size: .88rem;
    font-weight: 800;
}
.exp .riwaq-portal-card .portal-footer .enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-soft);
    color: var(--green-900);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: .88rem;
    font-weight: 800;
    transition: background .2s ease, transform .2s ease;
}
.exp .riwaq-portal-card:hover .enter-btn {
    background: var(--gold);
    color: #1b1300;
    transform: translateX(-4px);
}

/* Ready stations section */
.exp .riwaq-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 36px 0 18px;
}
.exp .riwaq-section-title h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--green-900);
    margin: 0;
}
.exp .riwaq-section-title .glow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: exp-bb 1s infinite alternate;
}

/* Core Pillars Grid */
.exp .riwaq-pillars {
    background: linear-gradient(135deg, rgba(255,255,255,.9), var(--card));
    border-radius: 20px;
    padding: 34px 28px;
    margin: 36px 0;
    border: 1px solid rgba(197, 160, 56, .25);
    box-shadow: 0 6px 20px rgba(0, 56, 44, .04);
}
.exp .riwaq-pillars h3 {
    text-align: center;
    color: var(--green-900);
    font-size: 1.35rem;
    margin: 0 0 28px;
    font-weight: 800;
    position: relative;
}
.exp .riwaq-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.exp .pillar-card {
    background: var(--paper);
    border-radius: 14px;
    padding: 20px 18px;
    text-align: center;
    border: 1px solid rgba(0, 56, 44, .06);
    transition: transform .2s ease, border-color .2s ease;
}
.exp .pillar-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
}
.exp .pillar-card .pillar-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold-soft), #fff);
    border: 2px solid var(--gold);
    color: var(--green-900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(197, 160, 56, .2);
}
.exp .pillar-card h4 {
    margin: 0 0 8px;
    font-size: 1.08rem;
    color: var(--green-900);
    font-weight: 800;
}
.exp .pillar-card p {
    margin: 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.65;
}

@media (max-width: 640px) {
    .exp.riwaq-hub .top { padding: 24px 14px 50px; }
    .exp .riwaq-stats { gap: 8px; }
    .exp .riwaq-stat-pill { font-size: .78rem; padding: 4px 12px; }
    .exp .riwaq-portals { grid-template-columns: 1fr; gap: 20px; }
}


/* ==========================================================================
   Interactive FX: Background Motion, 3D Mouse Tilt, Mobile Touch & Audio
   ========================================================================== */
.exp.riwaq-hub {
    position: relative;
    overflow-x: hidden;
}

/* Floating Background Particles Layer */
.riwaq-bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.riwaq-particle {
    position: absolute;
    color: var(--gold);
    opacity: .35;
    will-change: transform, opacity;
    animation: riwaq-float var(--dur, 8s) ease-in-out infinite alternate;
}
@keyframes riwaq-float {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: .2; }
    50% { opacity: .6; transform: translateY(-30px) rotate(90deg) scale(1.15); }
    100% { transform: translateY(-60px) rotate(180deg) scale(1); opacity: .2; }
}

/* Interactive Cursor Glow (Lantern Effect) */
.riwaq-cursor-glow {
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 160, 56, .14) 0%, rgba(14, 138, 106, .06) 40%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity .3s ease;
    opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
    .riwaq-cursor-glow.active { opacity: 1; }
}

/* 3D Tilt Card Base & Glare */
.exp .riwaq-portal-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform .15s ease-out, box-shadow .25s ease, border-color .25s ease;
}
.exp .riwaq-portal-card .card-glare {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, .3) 0%, rgba(197, 160, 56, .12) 40%, transparent 70%);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 2;
}
.exp .riwaq-portal-card:hover .card-glare {
    opacity: 1;
}

/* Mobile Touch & Press Interaction */
.exp .riwaq-portal-card:active,
.exp .surah-card:active,
.exp .sections-tabs a:active,
.exp .tabs a:active {
    transform: scale(.97) !important;
    transition: transform .1s ease !important;
}

/* Sound Control Button */
.riwaq-sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 35, 27, .75);
    border: 1px solid var(--gold);
    color: var(--gold-soft);
    padding: 5px 14px;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .2s ease, transform .2s ease;
    margin-top: 6px;
}
.riwaq-sound-toggle:hover {
    background: var(--green-900);
    transform: scale(1.04);
}
.riwaq-sound-toggle.muted {
    opacity: .6;
    border-color: rgba(255,255,255,.3);
    color: #cbd5e1;
}

/* Flat-vector covers (adab): pop in, then everything breathes, floats and drifts. Motion is switched off for reduced-motion users above. */
.exp svg.flat * { transform-box: fill-box; }
.exp svg.flat .blob { transform-origin: center; animation: exp-blob 6s ease-in-out infinite alternate; }
@keyframes exp-blob { from { transform: scale(.96); } to { transform: scale(1.05); } }
.exp svg.flat .pp { transform-origin: 50% 100%; animation: exp-pop .7s cubic-bezier(.3, 1.7, .5, 1) backwards, exp-breathe var(--t, 3.4s) ease-in-out var(--d, 0s) infinite; animation-delay: calc(var(--i, 0) * .09s), var(--d, 0s); }
.exp svg.flat .pp.pf { transform-origin: center; animation-name: exp-pop, exp-bob; }
@keyframes exp-pop { from { transform: scale(0) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes exp-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, 1.06); } }
@keyframes exp-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
.exp svg.flat .fx { transform-origin: center; }
.exp svg.flat .fx1 { animation: exp-fx1 4.2s ease-in-out infinite; }
.exp svg.flat .fx2 { animation: exp-fx2 5s ease-in-out infinite; }
.exp svg.flat .fx3 { animation: exp-fx3 2.6s ease-in-out infinite; }
.exp svg.flat .fx4 { animation: exp-fx4 3.6s ease-in-out infinite; }
.exp svg.flat .fx.d2 { animation-delay: -1.7s; }
@keyframes exp-fx1 { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(1.2); } }
@keyframes exp-fx2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4px, -6px); } }
@keyframes exp-fx3 { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.7); opacity: .55; } }
@keyframes exp-fx4 { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
/* characters of the flat covers: each one has its own rhythm (--t / --d come from the picture), so they never move together */
.exp .bl { transform-box: fill-box; transform-origin: center; animation: exp-bl calc(var(--t, 3s) * 1.15) ease-in-out var(--d, 0s) infinite; }
@keyframes exp-bl { 0%, 86%, 100% { transform: scaleY(1); } 91%, 94% { transform: scaleY(.08); } }
.exp .hd { transform-box: fill-box; transform-origin: 50% 92%; animation: exp-hd calc(var(--t, 3s) * 1.9) ease-in-out var(--d, 0s) infinite; }
@keyframes exp-hd { 0%, 100% { transform: rotate(-2.5deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-1px); } }
.exp svg.flat .bb { animation-duration: calc(var(--t, 3s) * .8); animation-delay: var(--d, 0s); }
.exp .surah-card.soon.cover .cover-art:has(> svg.flat) { filter: none; opacity: 1; }
/* follow-along reading: the voice lights up the words of the card while it speaks */
.exp .body .w { border-radius: 5px; transition: background .18s, color .18s, opacity .18s; }
.exp .body.follow .w { opacity: .5; }
.exp .body.follow .w.said { opacity: 1; }
.exp .body.follow .w.now { opacity: 1; background: #ffe07a; color: #2b2140; box-shadow: 0 0 0 2px #ffe07a; }
/* a fixed scale group of a character keeps its pivot at the local 0 0; the group of a moving forearm sits at the elbow */
.exp svg.flat .xf { transform-box: view-box; transform-origin: 0 0; }
.exp svg.flat .elb { transform-box: view-box; transform-origin: 0 0; animation: exp-elb calc(var(--t, 3s) * .4) ease-in-out var(--d, 0s) infinite alternate; }
.exp svg.flat .elb.up { animation-duration: calc(var(--t, 3s) * 1.2); animation-name: exp-elb-up; }
@keyframes exp-elb { from { transform: rotate(-18deg); } to { transform: rotate(16deg); } }
@keyframes exp-elb-up { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }

/* landscape of the seerah: clouds drift slowly (they stop with reduced motion) */
.exp svg.flat .cl { animation: exp-cl 30s ease-in-out infinite alternate; }
.exp svg.flat .cl2 { animation-duration: 38s; animation-delay: -12s; }
@keyframes exp-cl { from { transform: translateX(-9px); } to { transform: translateX(11px); } }
@media (prefers-reduced-motion: reduce) { .exp svg.flat .cl { animation: none; } }

/* in a flat picture an animal that walks only sways a little (the outlined walk fades it in and out) */
.exp svg.flat .wk { animation: exp-wk-flat 6s ease-in-out infinite alternate; }
@keyframes exp-wk-flat { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .exp svg.flat .wk { animation: none; } }

/* Riwaq hub in the theme of the main home page: gold-framed arches, deep green, faceted shadows */
.exp.riwaq-hub .top { background: radial-gradient(70% 90% at 22% 45%, #1f5f4b 0%, #0f3d31 64%); border-bottom: 3px solid #b8964a; }
.exp .riwaq-portals { gap: 34px; margin-top: 34px; }
.exp .riwaq-portal-card { background: #fff; border: 0; border-radius: 0; box-shadow: none; clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px)); outline: 0; filter: drop-shadow(0 14px 22px rgba(15,61,49,.18)); }
.exp .riwaq-portal-card::before { content: ""; position: absolute; inset: 0; border: 2px solid #b8964a; clip-path: inherit; pointer-events: none; z-index: 3; opacity: .55; transition: opacity .3s; }
.exp .riwaq-portal-card:hover::before { opacity: 1; }
.exp .riwaq-portal-card .portal-scene { aspect-ratio: 4 / 4.2; background: radial-gradient(70% 90% at 50% 40%, #1f5f4b, #0f3d31); display: flex; justify-content: center; padding-top: 14px; }
.exp .riwaq-portal-card .portal-scene img { height: 100%; width: auto; max-width: 100%; display: block; object-fit: contain; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.exp .riwaq-portal-card:hover .portal-scene img { transform: translateY(-6px) scale(1.03); }
.exp .riwaq-portal-card .portal-arch-header { background: #0f3d31; border-bottom: 2px solid #b8964a; flex-wrap: wrap; gap: 8px; }
.exp .riwaq-portal-card .portal-arch-header h2 { font-size: 1.25rem; }
.exp .riwaq-portal-card .portal-badge { background: linear-gradient(118deg, #f3e8c9 0 30%, #d9c089 30% 62%, #c7a45a 62% 100%); white-space: nowrap; border-radius: 0; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding: 4px 16px; }
.exp .riwaq-portal-card .portal-footer .enter-btn { background: #0f3d31; color: #f3e8c9; border-radius: 0; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding: 7px 20px; }
.exp .riwaq-portal-card:hover .enter-btn { background: #b8964a; color: #1b1300; }

/* Inside an open lesson the picture title shows for a few seconds, then fades away so the scene is clear (covers keep it) */
.exp .scrim svg.flat .ttl { animation: exp-ttl-out 1.2s ease-in-out 3s forwards; }
@keyframes exp-ttl-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .exp .scrim svg.flat .ttl { animation: none; } }

/* guide characters of the kids hero: a short hop on lesson events */
.exp .top .mascots svg.guides { width: 100%; }
.exp .top .mascots.hop svg.guides { animation: exp-guide-hop .6s ease-out 2; }
@keyframes exp-guide-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .exp .top .mascots.hop svg.guides { animation: none; } }
.exp .top .mascots { width: clamp(150px, 17vw, 230px); bottom: 64px; }
@media (max-width: 819px) { .exp .top .mascots { width: 120px; bottom: 56px; } }
