/* ===== FEATURES V2 — Editorial layout ===== */
.features-v2 {
  padding-block: clamp(5rem, 10vw, 10rem);
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.features-v2__grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15,77,42,.08) 1px, transparent 0);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 75%);
  opacity: .6;
}

.features-v2__head {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) {
  .features-v2__head { grid-template-columns: 1fr; gap: 1.5rem; }
}
.features-v2__title {
  font-family: var(--ff-ar-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: .95;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--fg);
  font-weight: 700;
}
.features-v2__title span { display: block; }
.features-v2__title em {
  display: block;
  font-style: normal;
  background: linear-gradient(135deg, var(--g-700), var(--y-700));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.features-v2__lede {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg-soft);
  max-width: 48ch;
  margin: 0;
}

.features-v2__chapters {
  display: grid;
  gap: 2rem;
}

/* Each chapter: alternating layout, with media + body */
.chapter {
  position: relative;
  display: grid;
  grid-template-columns: auto 1.1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
  padding: 2.5rem;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
  isolation: isolate;
}
.chapter:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: rgba(201,169,97,.4); }

/* Tone variants — accent strip on left + tinted bg */
.chapter::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--y-600);
  opacity: .9;
}
.chapter--emerald { background: linear-gradient(135deg, #fbf8f1 0%, #f5ede0 100%); }
.chapter--emerald::before { background: linear-gradient(180deg, var(--g-600), var(--g-800)); }
.chapter--gold { background: linear-gradient(135deg, #fdf6e3 0%, #f5e9cf 100%); }
.chapter--gold::before { background: linear-gradient(180deg, var(--y-500), var(--y-700)); }
.chapter--ink { background: linear-gradient(135deg, #1a1611 0%, #0f0d09 100%); color: #f3ece0; border-color: rgba(255,255,255,.08); }
.chapter--ink::before { background: linear-gradient(180deg, var(--y-400), var(--y-600)); }
.chapter--ink .chapter__desc { color: rgba(243,236,224,.7); }
.chapter--ink .chapter__chip { background: rgba(201,169,97,.15); color: var(--y-400); border-color: rgba(201,169,97,.3); }
.chapter--ink .chapter__num { color: rgba(201,169,97,.4); }
.chapter--ink .chapter__stat b { color: var(--y-400); }
.chapter--ink .chapter__stat span { color: rgba(243,236,224,.6); }
.chapter--ink .chapter__link { color: var(--y-400); }
.chapter--ink .chapter__media { background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.08); }
.chapter--sage { background: linear-gradient(135deg, #eff6f1 0%, #d9ebe1 100%); }
.chapter--sage::before { background: linear-gradient(180deg, var(--g-500), var(--g-700)); }
.chapter--cream { background: linear-gradient(135deg, #faf2e1 0%, #efdeb8 100%); }
.chapter--cream::before { background: linear-gradient(180deg, var(--y-600), var(--y-800)); }

[data-theme="dark"] .chapter:not(.chapter--ink) {
  background: linear-gradient(135deg, #142019 0%, #0d1812 100%);
  color: var(--fg);
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .chapter:not(.chapter--ink) .chapter__desc { color: rgba(243,236,224,.7); }
[data-theme="dark"] .chapter:not(.chapter--ink) .chapter__num { color: rgba(201,169,97,.25); }
[data-theme="dark"] .chapter:not(.chapter--ink) .chapter__stat b { color: var(--y-400); }
[data-theme="dark"] .chapter:not(.chapter--ink) .chapter__media { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.08); }

/* Big numbered marker */
.chapter__num {
  font-family: var(--ff-en-display);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -0.04em;
  color: rgba(15,77,42,.12);
  align-self: start;
  margin-top: -.3rem;
}
.chapter--gold .chapter__num,
.chapter--cream .chapter__num { color: rgba(120,80,20,.18); }
.chapter--sage .chapter__num { color: rgba(15,77,42,.2); }

/* Media column */
.chapter__media {
  position: relative;
  border-radius: 18px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(15,77,42,.08);
  padding: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
  overflow: hidden;
}
.chapter__media-corner {
  position: absolute;
  top: 1rem; inset-inline-end: 1rem;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--g-700);
  color: var(--y-400);
  display: grid; place-items: center;
  z-index: 5;
}
.chapter--gold .chapter__media-corner,
.chapter--cream .chapter__media-corner { background: var(--g-800); color: var(--y-400); }
.chapter--sage .chapter__media-corner { background: var(--g-700); color: var(--y-400); }
.chapter--ink .chapter__media-corner { background: var(--y-600); color: var(--g-900); }

/* Body column */
.chapter__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: center;
}
.chapter__chip {
  display: inline-flex;
  align-self: start;
  padding: .35rem .75rem;
  border-radius: var(--r-full);
  background: rgba(15,77,42,.08);
  border: 1px solid rgba(15,77,42,.15);
  font-family: var(--ff-en-ui);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g-800);
}
.chapter__title {
  font-family: var(--ff-ar-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  color: inherit;
  font-weight: 700;
}
.chapter__desc {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--fg-soft);
  margin: 0;
}
.chapter__stat {
  display: flex;
  align-items: baseline;
  gap: .85rem;
  padding: 1rem 1.25rem;
  background: rgba(15,77,42,.05);
  border-radius: 14px;
  border: 1px solid rgba(15,77,42,.08);
  margin-block: .5rem;
}
.chapter__stat b {
  font-family: var(--ff-en-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--g-700);
  line-height: 1;
}
.chapter__stat span {
  font-size: .9rem;
  color: var(--fg-soft);
  line-height: 1.3;
}
.chapter__link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  align-self: start;
  font-family: var(--ff-en-ui);
  font-weight: 600;
  font-size: .92rem;
  color: var(--g-800);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: gap .25s var(--ease);
}
.chapter__link:hover { gap: .65rem; }

/* Alternate every other chapter */
.chapter:nth-child(even) {
  grid-template-columns: 1fr 1.1fr auto;
}
.chapter:nth-child(even) .chapter__num { order: 3; text-align: end; }
.chapter:nth-child(even) .chapter__media { order: 2; }
.chapter:nth-child(even) .chapter__body { order: 1; }

@media (max-width: 860px) {
  .chapter, .chapter:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem;
  }
  .chapter__num, .chapter:nth-child(even) .chapter__num {
    order: 0;
    font-size: 3.5rem;
    text-align: start;
  }
  .chapter__media, .chapter:nth-child(even) .chapter__media {
    order: 1;
    min-height: 220px;
  }
  .chapter__body, .chapter:nth-child(even) .chapter__body {
    order: 2;
  }
}

/* ===== Feature Visualizations (FV) — designed inline graphics ===== */
.fv {
  position: relative;
  width: 100%; height: 100%;
  min-height: 240px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 1rem;
  color: var(--fg);
}
.chapter--ink .fv { color: var(--y-400); }

/* Quran viz */
.fv--quran { padding: 1rem; }
.fv__bg-arabesque {
  position: absolute; inset: 0; opacity: .15;
  color: var(--g-700);
}
.fv__quran-text {
  position: relative; z-index: 1;
  font-family: var(--ff-ar-quran);
  text-align: center;
  font-size: 2.5rem;
  color: var(--g-800);
  line-height: 1.4;
}
.chapter--ink .fv__quran-text { color: var(--y-400); }
.fv__quran-verse { font-size: 1.8rem; margin-top: .5rem; }
.fv__quran-meta {
  font-family: var(--ff-en-ui);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: .75rem;
  font-weight: 500;
}

/* Audio viz */
.fv--audio { gap: 1.25rem; padding: 1rem; align-items: stretch; justify-content: center; }
.fv__reciter {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem;
  background: rgba(255,255,255,.85);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.chapter--ink .fv__reciter { background: rgba(255,255,255,.06); }
.fv__reciter-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--g-700), var(--g-800));
  color: var(--y-400);
  display: grid; place-items: center;
  font-family: var(--ff-ar-display);
  font-size: .75rem;
  font-weight: 700;
  flex: none;
}
.fv__reciter-meta { flex: 1; min-width: 0; }
.fv__reciter-name {
  font-family: var(--ff-ar-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--g-900);
}
.chapter--ink .fv__reciter-name { color: var(--fg); }
.fv__reciter-sub {
  font-size: .75rem;
  color: var(--fg-muted);
  margin-top: 2px;
}
.fv__reciter-play {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--y-600);
  color: var(--g-900);
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .2s;
  flex: none;
}
.fv__reciter-play:hover { transform: scale(1.1); }
.fv__wave {
  display: flex; align-items: center; justify-content: center;
  gap: 3px;
  height: 50px;
  color: var(--g-700);
}
.chapter--ink .fv__wave { color: var(--y-500); }
.fv__wave span {
  display: block;
  width: 4px;
  background: currentColor;
  border-radius: 2px;
  animation: waveBar 1.4s ease-in-out infinite;
  opacity: .8;
}
@keyframes waveBar {
  0%, 100% { transform: scaleY(.5); }
  50% { transform: scaleY(1.1); }
}
.fv__audio-track {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--ff-en-ui);
  font-size: .8rem;
}
.fv__audio-time { color: var(--fg-muted); flex: none; min-width: 40px; }
.fv__audio-bar {
  flex: 1; height: 4px;
  background: rgba(15,77,42,.15);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.fv__audio-bar span {
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 38%;
  background: linear-gradient(90deg, var(--y-600), var(--g-700));
  border-radius: 999px;
}

/* Prayer viz */
.fv--prayer { flex-direction: row; gap: 1.25rem; padding: 1rem; align-items: stretch; }
.fv__prayer-clock {
  width: 110px; height: 110px;
  flex: none;
  align-self: center;
  color: var(--g-700);
}
.chapter--ink .fv__prayer-clock { color: var(--y-500); }
.fv__prayer-list { flex: 1; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.fv__prayer-list > div {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem .75rem;
  font-size: .85rem;
  font-family: var(--ff-ar-display);
  border-radius: 8px;
}
.fv__prayer-list time {
  font-family: var(--ff-en-ui);
  font-feature-settings: "tnum";
  font-weight: 600;
  color: var(--fg-soft);
}
.fv__prayer-list time em { font-style: normal; opacity: .8; font-size: .7rem; margin-inline-start: .25rem; }
.fv__prayer-list .is-next {
  background: var(--y-600);
  color: var(--g-900);
}
.fv__prayer-list .is-next time { color: var(--g-900); }

/* Qibla viz */
.fv--qibla { padding: .5rem; gap: .75rem; }
.fv__qibla-compass {
  width: 180px; height: 180px;
  color: var(--g-700);
}
.chapter--ink .fv__qibla-compass { color: var(--y-500); }
.fv__qibla-needle { transform-origin: 100px 100px; animation: qiblaSpin 8s ease-in-out infinite alternate; }
@keyframes qiblaSpin {
  0% { transform: rotate(-12deg); }
  100% { transform: rotate(15deg); }
}
.fv__qibla-coord {
  display: flex; gap: 1.5rem;
  font-family: var(--ff-en-ui);
  font-size: .7rem;
  letter-spacing: .1em;
}
.fv__qibla-coord > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fv__qibla-coord b { font-size: .85rem; color: var(--g-800); }
.chapter--ink .fv__qibla-coord b { color: var(--y-400); }
.fv__qibla-coord small { color: var(--fg-muted); text-transform: uppercase; }

/* Azkar viz */
.fv--azkar { padding: 1rem; gap: 1rem; }
.fv__azkar-card {
  background: rgba(255,255,255,.85);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.chapter--ink .fv__azkar-card { background: rgba(255,255,255,.06); }
.fv__azkar-label {
  font-family: var(--ff-en-ui);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: .5rem;
}
.fv__azkar-text {
  font-family: var(--ff-ar-quran);
  font-size: 1.4rem;
  color: var(--g-800);
  margin-bottom: .75rem;
  line-height: 1.5;
  text-align: center;
}
.chapter--ink .fv__azkar-text { color: var(--y-400); }
.fv__azkar-counter { display: flex; align-items: center; gap: .65rem; }
.fv__azkar-num {
  font-family: var(--ff-en-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--g-700);
  min-width: 2.5ch;
}
.chapter--ink .fv__azkar-num { color: var(--y-400); }
.fv__azkar-bar { flex: 1; height: 6px; background: rgba(15,77,42,.12); border-radius: 999px; overflow: hidden; }
.fv__azkar-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--y-600), var(--g-700)); border-radius: 999px; transition: width .5s; }
.fv__azkar-target { font-family: var(--ff-en-ui); font-size: .9rem; color: var(--fg-muted); }
.fv__azkar-beads {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  width: 100%;
}
.fv__azkar-beads span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(15,77,42,.12);
  transition: background .3s;
}
.fv__azkar-beads span.is-on { background: var(--y-600); animation: beadPop .4s var(--ease) backwards; }
@keyframes beadPop {
  0% { transform: scale(.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Tafsir viz */
.fv--tafsir { padding: 1rem; gap: 1rem; align-items: stretch; }
.fv__tafsir-quote {
  font-family: var(--ff-ar-quran);
  font-size: 1.5rem;
  text-align: center;
  color: var(--g-800);
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15,77,42,.12);
  line-height: 1.6;
}
.chapter--ink .fv__tafsir-quote { color: var(--y-400); border-bottom-color: rgba(255,255,255,.1); }
.fv__tafsir-sources { display: grid; gap: .35rem; }
.fv__tafsir-sources > div {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .75rem;
  border-radius: 8px;
  font-size: .8rem;
  background: rgba(255,255,255,.5);
}
.chapter--ink .fv__tafsir-sources > div { background: rgba(255,255,255,.04); }
.fv__tafsir-sources b {
  font-family: var(--ff-ar-display);
  font-weight: 700;
  color: var(--g-800);
  min-width: 5ch;
  flex: none;
}
.chapter--ink .fv__tafsir-sources b { color: var(--y-400); }
.fv__tafsir-sources span { color: var(--fg-soft); flex: 1; }
.fv__tafsir-sources .is-active {
  background: var(--y-600);
}
.fv__tafsir-sources .is-active b,
.fv__tafsir-sources .is-active span { color: var(--g-900); }

/* ===== DEEP DIVE — hand image + lottie ===== */
.deepdive__visual--hand { position: relative; min-height: 620px; }
.deepdive__hand-stack {
  position: relative;
  width: 100%; height: 100%;
  display: grid; place-items: center;
  z-index: 2;
}
.deepdive__hand-img {
  position: absolute;
  bottom: -40px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 110%;
  max-width: 600px;
  filter: drop-shadow(0 40px 50px rgba(0,0,0,.4));
  animation: handFloat 6s ease-in-out infinite;
  z-index: 3;
  pointer-events: none;
  opacity: .92;
}
.deepdive__hand-phone {
  position: relative;
  z-index: 2;
  transform: translateY(-30px) scale(.85);
  transition: transform .8s var(--ease), opacity .4s;
}
.deepdive__hand-phone.is-switching { transform: translateY(-30px) scale(.78); opacity: .7; }
@keyframes handFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-14px); }
}
@media (max-width: 860px) {
  .deepdive__visual--hand { min-height: 520px; }
  .deepdive__hand-img { max-width: 480px; }
}

/* Lottie player container */
.lottie-decor {
  position: absolute;
  width: 120px; height: 120px;
  pointer-events: none;
  opacity: .9;
  z-index: 2;
}
.lottie-decor--1 { top: 10%; inset-inline-start: 5%; }
.lottie-decor--2 { bottom: 12%; inset-inline-end: 6%; width: 90px; height: 90px; }

/* Hero ambient lottie/decor */
.hero__decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: .85;
}
.hero__decor--star1 {
  top: 18%; inset-inline-start: 8%;
  width: 60px; height: 60px;
  animation: starSpin 18s linear infinite;
}
.hero__decor--star2 {
  bottom: 22%; inset-inline-end: 10%;
  width: 80px; height: 80px;
  animation: starSpin 24s linear infinite reverse;
}
@keyframes starSpin {
  to { transform: rotate(360deg); }
}

/* Eyebrow gold variant */
.eyebrow--gold {
  color: var(--y-700) !important;
}
[data-theme="dark"] .eyebrow--gold { color: var(--y-400) !important; }
