/* Fahm Quran website. Palette and type follow the app (app/lib/src/ui/theme.dart):
   a night-sky shell, parchment for Quranic text, gold for reward, emerald for mastery. */

@font-face { font-family: 'Fraunces'; src: url(../fonts/Fraunces.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'SourceSans3'; src: url(../fonts/SourceSans3.ttf) format('truetype'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'AmiriQuran'; src: url(../fonts/AmiriQuran-Regular.ttf) format('truetype'); font-display: block; }

:root {
  --night: #0B1517;
  --night-raised: #11211F;
  --night-high: #173029;
  --night-line: #24403A;
  --moon: #E9EFEC;
  --moon-muted: #A5B7B1;
  --parchment: #F5EDDD;
  --parchment-deep: #EADFC8;
  --ink: #241C14;
  --ink-muted: #5E5141;
  --gold: #D4AE55;
  --gold-hi: #EBCB7E;
  --gold-deep: #76591A;
  --emerald: #46B08F;
  --emerald-deep: #1E6B55;
  --correct: #3DA866;
  --incorrect: #E0685F;

  --display: 'Fraunces', 'Times New Roman', serif;
  --body: 'SourceSans3', system-ui, sans-serif;
  --arabic: 'AmiriQuran', 'Amiri', serif;
  --gutter: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
[lang="ar"] { font-family: var(--arabic); font-weight: 400; }
::selection { background: rgba(212, 174, 85, .35); color: var(--moon); }

/* ---------- fixed layers ---------- */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(5, 10, 11, .75) 100%);
}
.veil::after { /* darkens the scene under the content sections */
  content: ''; position: absolute; inset: 0; background: var(--night);
  opacity: var(--dim, 0); transition: opacity .2s linear;
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100; background: var(--night);
  display: grid; place-items: center; transition: opacity 1.2s var(--ease), visibility 1.2s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; padding: 0 24px; }
.loader-ar {
  font-family: var(--arabic); font-size: clamp(30px, 6vw, 56px); color: var(--gold); margin: 0 0 28px;
  line-height: 2; opacity: 0; animation: rise 1.6s var(--ease) .2s forwards;
  text-shadow: 0 0 40px rgba(212, 174, 85, .35);
}
.loader-bar { width: 180px; height: 1px; margin: 0 auto; background: var(--night-line); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--gold); transition: width .4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- cursor ---------- */
#cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; mix-blend-mode: screen; }
#cursor .c-dot, #cursor .c-ring { position: fixed; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
#cursor .c-dot { width: 5px; height: 5px; background: var(--gold-hi); }
#cursor .c-ring { width: 34px; height: 34px; border: 1px solid rgba(212, 174, 85, .55); transition: width .35s var(--ease), height .35s var(--ease), border-color .35s; }
#cursor.hover .c-ring { width: 64px; height: 64px; border-color: rgba(235, 203, 126, .9); }
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; } }

/* star tooltip (galaxy) */
#star-tip {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; opacity: 0;
  transform: translate(-50%, calc(-100% - 22px)); transition: opacity .25s;
  background: rgba(11, 21, 23, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 174, 85, .35); border-radius: 14px; padding: 10px 16px 12px; text-align: center; min-width: 150px;
}
#star-tip.on { opacity: 1; }
#star-tip .t-ar { font-family: var(--arabic); font-size: 30px; color: var(--gold-hi); line-height: 1.9; display: block; }
#star-tip .t-tr { font-size: 13px; color: var(--moon-muted); display: block; margin-top: -4px; }
#star-tip .t-en { font-family: var(--display); font-size: 18px; display: block; }
#star-tip .t-n { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); display: block; margin-top: 4px; }

/* exploded-view callouts */
#labels { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.wl { position: absolute; left: 0; top: 0; text-align: center; width: 150px; margin-left: -75px; opacity: 0; will-change: transform, opacity; }
.wl::before { content: ''; display: block; width: 1px; height: var(--lead, 26px); margin: 0 auto 6px; background: linear-gradient(to bottom, rgba(212, 174, 85, 0), rgba(212, 174, 85, .8)); }
.wl::after { content: ''; position: absolute; top: calc(var(--lead, 26px) - 2px); left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold); }
.wl .tr { display: block; font-size: 12.5px; color: var(--moon-muted); letter-spacing: .02em; }
.wl .en { display: block; font-family: var(--display); font-size: 17px; line-height: 1.2; color: var(--moon); }
@media (max-width: 600px) {
  .wl { width: 104px; margin-left: -52px; --lead: 18px; }
  .wl .tr { font-size: 10.5px; }
  .wl .en { font-size: 13px; }
}
.al { position: absolute; left: 0; top: 0; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); opacity: 0; white-space: nowrap; }
.al i { font-style: normal; font-family: var(--arabic); font-size: 20px; letter-spacing: 0; margin-right: 8px; vertical-align: -2px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter); transition: background .5s, padding .5s, transform .6s var(--ease);
}
.nav.solid { background: linear-gradient(to bottom, rgba(11, 21, 23, .85), rgba(11, 21, 23, 0)); }
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-ar { font-family: var(--arabic); color: var(--gold); font-size: 26px; line-height: 1; }
.brand-en { font-family: var(--display); font-size: 21px; font-weight: 500; letter-spacing: .01em; }
.nav nav { display: flex; gap: 30px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--moon-muted); }
.nav nav a { position: relative; padding: 6px 0; transition: color .3s; }
.nav nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--gold); transition: right .45s var(--ease); }
.nav nav a:hover { color: var(--moon); }
.nav nav a:hover::after { right: 0; }
@media (max-width: 860px) { .nav nav { display: none; } }

.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 22px; border-radius: 999px;
  border: 1px solid rgba(212, 174, 85, .45); color: var(--moon); font-size: 14px; font-weight: 600; letter-spacing: .04em;
  background: rgba(17, 33, 31, .4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s, background .3s, color .3s;
}
.pill:hover { border-color: var(--gold); background: rgba(212, 174, 85, .12); }
.pill-gold { background: var(--gold); color: #231A05; border-color: var(--gold); padding: 15px 30px; font-size: 16px; }
.pill-gold:hover { background: var(--gold-hi); color: #231A05; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--emerald), var(--gold)); }

.chapters {
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 16px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--moon-muted); transition: opacity .6s; text-align: right;
}
.chapters span { opacity: .35; transition: opacity .5s, color .5s; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.chapters span i { font-style: normal; font-family: var(--arabic); font-size: 18px; letter-spacing: 0; order: 2; width: 18px; text-align: center; }
.chapters span.on { opacity: 1; color: var(--gold); }
.chapters.off { opacity: 0; }
@media (max-width: 860px) { .chapters { display: none; } }

/* ---------- story ---------- */
#story { position: relative; height: 1300vh; z-index: 5; }
.beats { position: sticky; top: 0; height: 100vh; height: 100svh; pointer-events: none; }
.beat {
  position: absolute; opacity: 0; visibility: hidden; will-change: opacity, transform;
  max-width: 520px; text-shadow: 0 2px 30px rgba(5, 10, 11, .9);
}
.beat.live { pointer-events: auto; }
.beat:not(.beat-hero)::before { content: ''; position: absolute; inset: -70px -90px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(8, 15, 16, .78), rgba(8, 15, 16, 0)); }
.beat h2 { font-family: var(--display); font-weight: 300; font-size: clamp(32px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -.015em; margin: 0 0 18px; font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.beat p { color: var(--moon-muted); margin: 0 0 10px; font-size: clamp(16px, 1.3vw, 19px); }
.eyebrow { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin: 0 0 18px; font-weight: 600; }
.beat-left { left: var(--gutter); top: 50%; transform: translateY(-50%); }
.beat-right { right: calc(var(--gutter) + 170px); top: 50%; transform: translateY(-50%); text-align: right; }
@media (max-width: 860px) { .beat-right { right: var(--gutter); } }
.beat-center-low { left: 50%; bottom: 9vh; transform: translateX(-50%); text-align: center; max-width: 640px; width: calc(100% - 2 * var(--gutter)); }
.beat-big { left: var(--gutter); bottom: 10vh; max-width: 640px; }
.beat-big h2 { font-size: clamp(24px, 2.6vw, 36px); }
.beat .big-num { font-family: var(--display); font-weight: 200; font-size: clamp(110px, 16vw, 230px); line-height: .85; color: var(--gold) !important; margin: 0 0 18px !important; letter-spacing: -.04em; text-shadow: 0 0 80px rgba(212, 174, 85, .35); }
.big-num small { font-size: .38em; letter-spacing: 0; vertical-align: top; margin-left: 6px; }
.ar-inline { font-family: var(--arabic); color: var(--gold); font-size: 1.25em; margin-right: 8px; }

.beat-hero { left: 50%; top: 0; height: 100%; width: 100%; max-width: none; transform: translateX(-50%); text-align: center; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 var(--gutter) 5vh; }
.beat-hero .eyebrow { margin-bottom: 4px; }
.beat-hero h1 { margin: 0; font-weight: 300; }
.hero-ar { display: block; font-family: var(--arabic); color: var(--gold); font-size: clamp(36px, 5vw, 64px); line-height: 1.8; text-shadow: 0 0 50px rgba(212, 174, 85, .4); }
.hero-en { display: block; font-family: var(--display); font-size: clamp(44px, 6.6vw, 100px); line-height: .98; letter-spacing: -.03em; font-weight: 300; font-variation-settings: 'opsz' 144, 'SOFT' 100; }
.beat-hero .lede { max-width: 560px; margin: 16px auto 0; color: var(--moon-muted); }
.scroll-cue { margin-top: 26px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--moon-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scroll-cue span { width: 1px; height: 46px; background: linear-gradient(to bottom, transparent, var(--gold)); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.stats { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 4px; }
.stats li { display: flex; align-items: baseline; gap: 14px; justify-content: flex-end; }
.stats b { font-family: var(--display); font-weight: 300; font-size: clamp(42px, 5vw, 72px); line-height: 1.05; color: var(--moon); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.stats span { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); min-width: 150px; text-align: left; }

.beat-reading { left: 50%; bottom: 6vh; transform: translateX(-50%); text-align: center; max-width: 760px; width: calc(100% - 2 * var(--gutter)); }
.reading-en { font-family: var(--display); font-weight: 300; color: var(--moon) !important; font-size: clamp(20px, 2.1vw, 30px) !important; line-height: 1.3; margin: 0 0 10px !important; min-height: 2.6em; transition: opacity .35s; }
.reading-src { font-size: 12px !important; letter-spacing: .04em; opacity: .7; }
.hint { display: inline-flex; align-items: center; gap: 10px; font-size: 13px !important; letter-spacing: .12em; text-transform: uppercase; margin-top: 14px !important; }
.hint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 14px var(--moon); animation: pulse 2s infinite; }
.hint-dot.gold { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .6; } }

@media (max-width: 700px) {
  .beat-left, .beat-right { top: auto; bottom: 8vh; transform: none; left: var(--gutter); right: var(--gutter); text-align: left; max-width: none; }
  .stats li { justify-content: flex-start; flex-direction: row-reverse; }
  .stats span { min-width: 0; }
  .beat-big { bottom: 8vh; right: var(--gutter); }
}

/* ---------- content sections ---------- */
main > .sec { position: relative; z-index: 5; padding: clamp(110px, 16vh, 200px) var(--gutter); }
.sec-head { max-width: 760px; margin-bottom: clamp(48px, 8vh, 90px); }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.nw { white-space: nowrap; }
.display { font-family: var(--display); font-weight: 300; font-size: clamp(42px, 6vw, 88px); line-height: 1; letter-spacing: -.025em; margin: 0 0 26px; font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.sec-lede { color: var(--moon-muted); font-size: clamp(17px, 1.35vw, 20px); max-width: 560px; margin: 0; }
.center .sec-lede { margin: 0 auto; }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* levels */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 110px); max-width: 1240px; margin: 0 auto; }
.level { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; position: relative; opacity: .25; transition: opacity .7s var(--ease); max-width: 470px; }
.level.on { opacity: 1; }
.level h3 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3vw, 44px); margin: 0 0 16px; line-height: 1.1; }
.level p { color: var(--moon-muted); margin: 0; }
.level .eyebrow { margin-bottom: 12px; }
.level-n { font-family: var(--arabic); font-size: 96px; color: transparent; -webkit-text-stroke: 1px rgba(212, 174, 85, .5); line-height: 1; position: absolute; left: -10px; top: calc(50% - 170px); opacity: .7; }
.levels-stage { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; perspective: 1400px; }

.phone {
  width: min(330px, 78vw); aspect-ratio: 9 / 19; border-radius: 46px; position: relative;
  background: linear-gradient(145deg, #2a3a36, #0d1615 40%, #1c2a27);
  padding: 11px; box-shadow: 0 60px 120px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(212, 174, 85, .25), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 0 120px -20px rgba(70, 176, 143, .25);
  transform: rotateY(-14deg) rotateX(6deg); transform-style: preserve-3d; transition: transform .9s var(--ease);
}
.phone-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; background: linear-gradient(115deg, rgba(255, 255, 255, .09) 0%, transparent 35%, transparent 70%, rgba(255, 255, 255, .04) 100%); }
.phone-screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: var(--night); }
.screen { position: absolute; inset: 0; padding: 44px 16px 20px; display: flex; flex-direction: column; opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.screen.is-on { opacity: 1; transform: none; }
.s-label { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--moon-muted); margin: 0 0 12px 4px; font-weight: 700; }
.card { background: var(--parchment); color: var(--ink); border-radius: 18px; padding: 22px 16px 18px; text-align: center; box-shadow: 0 10px 24px rgba(0, 0, 0, .33); }
.card-ar { font-family: var(--arabic); font-size: 60px; margin: 8px 0 0; line-height: 1.5; }
.card-tr { font-style: italic; color: var(--ink-muted); margin: 2px 0 14px; font-size: 14px; }
.card-k { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin: 0 0 4px; }
.card-en { font-family: var(--display); font-size: 26px; margin: 0 0 14px; font-weight: 600; }
.chips { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; flex-wrap: wrap; }
.chips span { background: var(--parchment-deep); border-radius: 10px; font-size: 10.5px; padding: 5px 9px; color: var(--ink-muted); display: inline-flex; gap: 6px; align-items: center; }
.chips b { color: var(--ink); font-size: 15px; font-weight: 400; }
.chips b:not([lang]) { font-size: 11px; font-weight: 700; }
.card-ayah { font-family: var(--arabic); font-size: 25px; line-height: 2.1; margin: 0 0 8px; }
.card-ayah mark { background: rgba(212, 174, 85, .4); color: var(--ink); border-radius: 4px; padding: 0 2px; }
.card-line { font-size: 14px; margin: 0 0 10px; }
.card-line span { font-family: var(--arabic); font-size: 18px; }
.card-audio { color: var(--gold-deep); font-weight: 700; font-size: 13px; margin: 0 0 10px; }
.card-audio::before { content: '◖ '; }
.card-src { font-size: 10px; color: var(--ink-muted); text-align: left; margin: 0; }
.wbw { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-bottom: 12px; }
.wbw span { display: flex; flex-direction: column; align-items: center; }
.wbw b { font-family: var(--arabic); font-size: 28px; font-weight: 400; line-height: 1.8; }
.wbw i { font-style: normal; font-size: 10px; color: var(--ink-muted); margin-top: -6px; }
.card-trans { font-size: 13.5px; margin: 0; }
.s-btn { margin-top: auto; background: var(--gold); color: #231A05; font-weight: 700; text-align: center; border-radius: 12px; padding: 12px; font-size: 14px; }
.review { text-align: center; padding: 10px 6px; }
.ring { position: relative; width: 120px; height: 120px; margin: 4px auto 14px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--night-high); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 46; transition: stroke-dashoffset 1.6s var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 28px; }
.review-title { font-family: var(--display); font-size: 24px; margin: 0; }
.review-ar { color: var(--gold); margin: 0 0 16px; font-size: 14px; }
.rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.rewards div { background: var(--night-raised); border: 1px solid var(--night-line); border-radius: 12px; padding: 10px; text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.rewards small { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--moon-muted); }
.rewards b { grid-column: 1 / -1; font-family: var(--display); font-size: 22px; font-weight: 400; }
.ico { width: 1em; height: 1em; vertical-align: -0.12em; display: inline-block; }
.ico-star, .ico-moon { color: var(--gold); font-size: 12px; }
.review-note { font-size: 11px; color: var(--moon-muted); margin: 0; }

@media (max-width: 860px) {
  /* the phone stays pinned at the top; the steps scroll up beneath it */
  .levels { grid-template-columns: 1fr; gap: 0; }
  .levels-stage {
    position: sticky; top: 60px; height: 392px; z-index: 3; order: -1; display: block; perspective: none;
    background: linear-gradient(to bottom, var(--night) 0%, var(--night) 86%, rgba(11, 21, 23, 0) 100%);
    margin: 0 calc(-1 * var(--gutter)); padding-top: 8px;
  }
  .phone { width: 290px; transform: scale(.6) !important; transform-origin: top center; margin: 0 auto; }
  .level { min-height: 62vh; justify-content: flex-start; padding-top: 4vh; position: relative; z-index: 1; }
  .level-n { display: none; }
}

/* quiz */
.quiz {
  max-width: 760px; margin: 0 auto; border-radius: 28px; padding: clamp(22px, 4vw, 44px);
  background: linear-gradient(160deg, rgba(23, 48, 41, .75), rgba(11, 21, 23, .85)); border: 1px solid var(--night-line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .9);
}
.quiz-top { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.quiz-step { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--moon-muted); white-space: nowrap; }
.quiz-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--night-high); overflow: hidden; }
.quiz-bar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 4px; transition: width .6s var(--ease); }
.q-word { background: var(--parchment); color: var(--ink); border-radius: 20px; text-align: center; padding: 18px 16px 16px; margin-bottom: 22px; }
.q-word .ar { font-family: var(--arabic); font-size: clamp(54px, 9vw, 84px); line-height: 1.7; display: block; }
.q-word .tr { font-style: italic; color: var(--ink-muted); display: block; margin-top: 2px; min-height: 1.5em; transition: opacity .3s; }
.q-ask { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0 0 12px; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .q-opts { grid-template-columns: 1fr; } }
.q-opt {
  font: inherit; color: var(--moon); background: var(--night-raised); border: 1.5px solid var(--night-line); border-radius: 14px;
  padding: 16px 18px; text-align: left; font-size: 17px; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color .25s, background .25s, transform .25s;
}
.q-opt:hover:not([disabled]) { border-color: var(--gold); transform: translateY(-2px); }
.q-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-opt.ok { border-color: var(--correct); background: rgba(61, 168, 102, .14); }
.q-opt.bad { border-color: var(--incorrect); background: rgba(224, 104, 95, .12); }
.q-opt .mk { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.q-opt.ok .mk { color: var(--correct); }
.q-opt.bad .mk { color: var(--incorrect); }
.q-feedback { margin-top: 22px; min-height: 110px; }
.q-feedback .fb-head { font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.q-feedback .fb-ayah { font-family: var(--arabic); font-size: 26px; line-height: 2; direction: rtl; text-align: right; margin: 0; color: var(--moon); }
.q-feedback .fb-ayah mark { background: rgba(212, 174, 85, .3); color: var(--gold-hi); border-radius: 4px; padding: 0 3px; }
.q-feedback .fb-en { color: var(--moon-muted); font-size: 15px; margin: 0; }
.q-next { margin-top: 18px; }
button.pill { font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.q-done { text-align: center; padding: 16px 0; }
.q-done .moon { font-size: 44px; color: var(--gold); line-height: 1; }
.q-done h3 { font-family: var(--display); font-weight: 400; font-size: 36px; margin: 8px 0; }
.q-done p { color: var(--moon-muted); }

/* paths */
#paths { overflow: hidden; }
.surah-orbit { position: absolute; left: 50%; top: clamp(260px, 34vh, 360px); width: 0; height: 0; pointer-events: none; opacity: .5; }
.surah-orbit span { position: absolute; left: 0; top: 0; font-family: var(--arabic); white-space: nowrap; color: var(--moon-muted); font-size: 15px; transform-origin: 0 0; }
.surah-orbit span.g { color: var(--gold); }
.surah-orbit-inner { position: absolute; left: 0; top: 0; animation: spin 240s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.path-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .path-grid { grid-template-columns: 1fr; } }
.path {
  border-radius: 26px; padding: 34px 30px 36px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, rgba(23, 48, 41, .7), rgba(11, 21, 23, .8)); border: 1px solid var(--night-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .4s, transform .6s var(--ease);
}
.path:hover { border-color: rgba(212, 174, 85, .6); transform: translateY(-6px); }
.path:nth-child(2) { transition-delay: .1s; }
.path:nth-child(3) { transition-delay: .2s; }
.path h3 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0 0 12px; }
.path p:not(.eyebrow) { color: var(--moon-muted); margin: 0; }
.path .eyebrow { margin-bottom: 10px; }
.path-art { height: 150px; margin-bottom: 26px; display: flex; align-items: center; justify-content: center; position: relative; }
.art-b { gap: 12px; flex-wrap: wrap; align-content: center; }
.art-b span { font-family: var(--arabic); font-size: 22px; padding: 2px 14px; border-radius: 999px; border: 1px solid var(--night-line); color: var(--moon); }
.art-b span:first-child { border-color: var(--gold); color: var(--gold); }
.art-a svg { width: 130px; height: 130px; transform: rotate(-90deg); }
.art-a .ring-fg { stroke-dasharray: 314; stroke-dashoffset: 314; }
.path.in .art-a .ring-fg { stroke-dashoffset: 141; transition-delay: .5s; }
.art-a b { position: absolute; font-family: var(--display); font-size: 30px; font-weight: 300; color: var(--gold); }
.art-c { gap: 8px; }
.art-c i { font-style: normal; font-family: var(--display); font-size: 20px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--night-line); color: var(--moon-muted); }
.art-c i:first-child { border-color: var(--emerald); color: var(--emerald); }

/* science */
.science { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 6vw, 100px); align-items: center; max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .science { grid-template-columns: 1fr; } }
.curve { margin: 0; }
.curve svg { width: 100%; height: auto; overflow: visible; }
.curve .axis { stroke: var(--night-line); stroke-width: 1.5; }
.curve .ax-t { fill: var(--moon-muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--body); }
.curve .c-ghost { fill: none; stroke: var(--moon-muted); stroke-width: 1.5; stroke-dasharray: 4 6; opacity: .45; }
.curve .c-main { fill: none; stroke: url(#gl-gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset 3s var(--ease) .3s; filter: drop-shadow(0 0 8px rgba(212, 174, 85, .5)); }
.curve.in .c-main { stroke-dashoffset: 0; }
.curve .c-dots circle { fill: var(--night); stroke: var(--emerald); stroke-width: 2.5; opacity: 0; transition: opacity .6s; }
.curve.in .c-dots circle { opacity: 1; }
.curve.in .c-dots circle:nth-child(1) { transition-delay: 1.1s; }
.curve.in .c-dots circle:nth-child(2) { transition-delay: 1.7s; }
.curve.in .c-dots circle:nth-child(3) { transition-delay: 2.3s; }
.curve .c-t { fill: var(--emerald); font-size: 12px; font-family: var(--body); letter-spacing: .1em; text-transform: uppercase; }
.curve figcaption { color: var(--moon-muted); font-size: 14px; margin-top: 18px; max-width: 520px; }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; max-width: 1240px; margin: clamp(60px, 10vh, 120px) auto 0; background: var(--night-line); border: 1px solid var(--night-line); border-radius: 22px; overflow: hidden; }
@media (max-width: 1000px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }
.principles article { background: rgba(11, 21, 23, .92); padding: 30px 26px; }
.principles h4 { font-family: var(--display); font-weight: 500; font-size: 21px; margin: 0 0 10px; }
.principles p { color: var(--moon-muted); font-size: 15px; margin: 0 0 16px; }
.principles cite { font-style: normal; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }

/* family */
.family { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: center; max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .family { grid-template-columns: 1fr; } }
.fam-cards { display: grid; gap: 14px; }
.fam-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 18px;
  background: rgba(17, 33, 31, .8); border: 1px solid var(--night-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: translateX(calc(var(--i, 0) * 18px));
}
.fam-card:nth-child(2) { --i: 1; } .fam-card:nth-child(3) { --i: 2; } .fam-card:nth-child(4) { --i: 1; }
@media (max-width: 560px) { .fam-card { transform: none; } }
.fam-card .av { width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #1a1408; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.fam-card b { display: block; font-size: 17px; }
.fam-card small { display: block; color: var(--moon-muted); font-size: 13px; margin-bottom: 8px; }
.fam-card .bar { height: 5px; border-radius: 5px; background: var(--night-high); overflow: hidden; }
.fam-card .bar span { display: block; height: 100%; background: var(--c); border-radius: 5px; transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease) .4s; }
.fam-cards.in .bar span { transform: scaleX(1); }
.fam-card em { font-style: normal; color: var(--gold); font-family: var(--display); font-size: 18px; }
.fam-note { color: var(--moon-muted); font-size: 13px; margin: 6px 0 0; letter-spacing: .04em; }

/* trust */
.sources { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 1240px; margin: 0 auto; }
@media (max-width: 1000px) { .sources { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sources { grid-template-columns: 1fr; } }
.src { border-top: 1px solid var(--gold); padding: 22px 4px 0; }
.src-k { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--moon-muted); display: block; min-height: 2.6em; }
.src b { font-family: var(--display); font-weight: 400; font-size: 26px; display: block; margin: 10px 0 8px; }
.src p { color: var(--moon-muted); font-size: 15px; margin: 0; }
.trust-note { text-align: center; color: var(--moon-muted); font-size: 14px; max-width: 620px; margin: 56px auto 0; padding: 14px 20px; border: 1px solid var(--night-line); border-radius: 14px; background: rgba(11, 21, 23, .7); }

/* free */
.free { text-align: center; max-width: 980px; margin: 0 auto; }
.free-ar { font-family: var(--arabic); font-size: clamp(40px, 6vw, 80px); color: var(--gold); margin: 0 0 6px; line-height: 1.7; text-shadow: 0 0 60px rgba(212, 174, 85, .3); }
.free .display { font-size: clamp(60px, 10vw, 150px); }
.free .sec-lede { margin: 0 auto; }
.free-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 70px 0 0; text-align: left; }
@media (max-width: 800px) { .free-list { grid-template-columns: 1fr; } }
.free-list li { border-left: 1px solid var(--emerald); padding-left: 20px; }
.free-list b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; margin-bottom: 6px; }
.free-list span { color: var(--moon-muted); font-size: 15px; }

/* get */
#get { min-height: 100vh; display: grid; place-items: center; }
.get { text-align: center; }
.get-ar { font-family: var(--arabic); font-size: clamp(50px, 9vw, 120px); color: var(--gold); line-height: 1.7; margin: 0; text-shadow: 0 0 80px rgba(212, 174, 85, .4); }
.get .sec-lede { margin: 0 auto 40px; }
.stores { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.store {
  display: inline-flex; flex-direction: column; align-items: flex-start; padding: 12px 26px 13px; border-radius: 14px; min-width: 200px;
  border: 1px solid var(--night-line); background: rgba(17, 33, 31, .7); font-family: var(--display); font-size: 22px; line-height: 1.1; color: var(--moon);
}
.store small { font-family: var(--body); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }

.foot { position: relative; z-index: 5; padding: 40px var(--gutter) 46px; border-top: 1px solid var(--night-line); background: rgba(11, 21, 23, .92); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-row p { color: var(--moon-muted); margin: 0; font-size: 14px; }
.foot-small { color: var(--moon-muted); opacity: .7; font-size: 12px; margin: 18px 0 0; max-width: 900px; }

/* no WebGL / reduced motion fallbacks */
body.no-gl #story { height: auto; }
body.no-gl .beats { position: relative; height: auto; display: grid; gap: 22vh; padding: 20vh var(--gutter); }
body.no-gl .beat { position: relative; inset: auto; transform: none; opacity: 1; visibility: visible; max-width: 640px; }
body.no-gl .beat-hero { height: 80vh; width: auto; left: auto; }
body.no-gl .beat-reading, body.no-gl #chapters { display: none; }
@media (prefers-reduced-motion: reduce) {
  .grain, .surah-orbit-inner, .scroll-cue span, .hint-dot { animation: none; }
  .reveal { transition-duration: .01s; }
}
