/* ─────────────────────────────────────────────────────────────────
   MyRawda — Sacred & Cinematic
   ───────────────────────────────────────────────────────────────── */

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
input, button, textarea, select { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
img, picture, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Palette — drawn from the MyRawda app icon */
  --ink-0:        #07090A;
  --ink-1:        #0B0F0D;
  --ink-2:        #101512;
  --ink-3:        #161C19;
  --ink-4:        #1F2722;

  --emerald:      #0E3B2C;
  --emerald-2:    #155742;
  --emerald-glow: rgba(21, 87, 66, 0.4);

  --gold:         #C9A961;
  --gold-light:   #E0BE74;
  --gold-deep:    #8C7740;
  --gold-faint:   rgba(201, 169, 97, 0.12);

  --cream:        #EDE6D6;
  --cream-dim:    #B8B0A0;
  --cream-faint:  rgba(237, 230, 214, 0.06);

  --sage:         #8FA89A;

  --hairline:     rgba(201, 169, 97, 0.14);
  --hairline-2:   rgba(237, 230, 214, 0.08);

  /* Type */
  --font-display: 'Cormorant Garamond', 'EB Garamond', 'Times New Roman', serif;
  --font-body:    'Fraunces', 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-arabic:  'Amiri Quran', 'Amiri', 'Scheherazade New', serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  /* Motion */
  --ease-soft:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-slow:    cubic-bezier(0.16, 0.84, 0.44, 1);

  /* Layout */
  --max-page:     1280px;
  --gutter:       clamp(1.25rem, 4vw, 3.5rem);
  --section-y:    clamp(6rem, 14vh, 10rem);

  --radius:       2px;
  --radius-lg:    8px;
}

/* ─── Quran fonts (local for the Mushaf renderings) ─── */
/* Amiri Quran (SIL OFL) is the only bundled Arabic face, and it renders every
   Arabic character on this page. A KFGQPC Uthmanic Script HAFS @font-face used
   to sit above it: the file was a saved GitHub 404 page rather than a font,
   and even once replaced with the genuine v0.09 the browser fetched ~246KB and
   rendered nothing from it — Amiri Quran wins the chain for all Arabic, and the
   few characters that do fall past Amiri (⏮ ⏭ in the player mock, ā ī ṭ in the
   romanized tafsir names) are absent from KFGQPC too, so they land on serif
   either way. Dropped: no glyph regressed. If the site should ever match the
   app's Madani mushaf exactly, add it back FIRST in --font-arabic, not third,
   and mind the KFGQPC license — it forbids reproduction without written
   approval, which self-hosting a webfont arguably is. */
@font-face {
  font-family: 'Amiri Quran';
  src: url('../fonts/AmiriQuran-Regular.ttf') format('truetype');
  font-display: swap;
}

/* ─── Body ───────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 380, 'SOFT' 50;
  color: var(--cream);
  background: var(--ink-1);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  cursor: none;
}

@media (hover: none) {
  body { cursor: auto; }
}

/* Atmospheric background — layered gradient mesh */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(14, 59, 44, 0.35) 0%, rgba(14, 59, 44, 0) 60%),
    radial-gradient(ellipse 60% 40% at 90% 50%, rgba(21, 87, 66, 0.15) 0%, rgba(21, 87, 66, 0) 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(201, 169, 97, 0.06) 0%, rgba(201, 169, 97, 0) 60%);
  z-index: -2;
  pointer-events: none;
}

/* Film grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Cursor companion ──────────────────────────────────────────── */
.cursor, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor {
  width: 6px; height: 6px;
  background: var(--gold-light);
  border-radius: 50%;
  transition: width .25s var(--ease-soft), height .25s var(--ease-soft), background-color .2s;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid var(--gold-faint);
  border-radius: 50%;
  transition: width .35s var(--ease-soft), height .35s var(--ease-soft), border-color .25s;
}
.cursor.is-link { width: 10px; height: 10px; background: var(--gold); }
.cursor-ring.is-link { width: 56px; height: 56px; border-color: var(--gold); }

@media (hover: none), (prefers-reduced-motion: reduce) {
  .cursor, .cursor-ring { display: none; }
}

/* ─── Scroll progress thread ─────────────────────────────────────── */
.scroll-thread {
  position: fixed;
  top: 0; right: 14px;
  width: 4px; height: 100vh;
  z-index: 50;
  color: var(--gold);
  opacity: 0.5;
  pointer-events: none;
}
.scroll-thread svg { width: 100%; height: 100%; }
.scroll-thread path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 80ms linear;
}
@media (max-width: 720px) {
  .scroll-thread { right: 6px; opacity: 0.3; }
}

/* ─── Common section utilities ──────────────────────────────────── */
section, .hero, .site-footer {
  position: relative;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.section-eyebrow span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0;
  color: var(--gold);
  text-transform: none;
  padding-right: 0.8rem;
  border-right: 1px solid var(--hairline);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--cream);
  margin-bottom: 1.5rem;
  max-width: 18ch;
}
.section-lede {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--cream-dim);
  max-width: 56ch;
}
.section-lede a {
  color: var(--gold-light);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: color .25s, border-color .25s;
}
.section-lede a:hover { color: var(--gold); border-color: var(--gold); }

/* ─── HERO ──────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 2rem;
  position: relative;
}

.hero::before {
  /* center vignette to focus eye on Bismillah */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 50% 45%, rgba(201, 169, 97, 0.04), transparent 70%);
  pointer-events: none;
}

.hero__ornament {
  color: var(--gold);
  opacity: 0.5;
  width: clamp(180px, 30vw, 280px);
  margin-inline: auto;
}
.hero__ornament svg { width: 100%; height: auto; }
.hero__ornament--top { padding-top: 1rem; }

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

/* Bismillah — the moment */
.bismillah {
  position: relative;
  display: inline-block;
  padding: 0.4em 0.6em;
  overflow: visible;
}
.bismillah__text {
  font-family: var(--font-arabic);
  font-size: clamp(2.4rem, 7.5vw, 5.5rem);
  line-height: 1.6;
  color: var(--cream);
  letter-spacing: 0;
  white-space: nowrap;
  display: inline-block;
  position: relative;
  text-shadow: 0 0 60px rgba(201, 169, 97, 0.15);
}
/* The veil that reveals the bismillah from right to left */
.bismillah__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--ink-1) 0%,
    var(--ink-1) 30%,
    rgba(11, 15, 13, 0.85) 60%,
    transparent 100%);
  transform-origin: left center;
  animation: revealRTL 2.4s var(--ease-slow) 0.4s forwards;
  pointer-events: none;
}
@keyframes revealRTL {
  0%   { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0); opacity: 0; }
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cream);
  padding-left: 0.42em;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease-soft) 2.6s forwards;
}
@keyframes fadeUp {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tagline {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 12, 'wght' 320, 'SOFT' 100;
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--cream-dim);
  margin-top: -1rem;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease-soft) 3s forwards;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease-soft) 3.4s forwards;
}
.hero__meta-pill { white-space: nowrap; }
.hero__meta-sep { color: var(--gold); }

.hero__ornament--bottom {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease-soft) 3.8s forwards;
}
.hero__descend {
  color: var(--gold);
  opacity: 0.8;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: opacity .25s, transform .4s var(--ease-soft);
}
.hero__descend:hover { opacity: 1; transform: translateY(4px); }
.hero__descend-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.hero__descend svg {
  width: 12px; height: 28px;
  animation: descend 2.6s ease-in-out infinite;
}
@keyframes descend {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ─── MANIFESTO ─────────────────────────────────────────────────── */
.manifesto {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.manifesto__list {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-top: 2rem;
  max-width: 14ch;
}
.manifesto__line {
  position: relative;
  padding-left: 0;
}
.js-on .manifesto__line {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-soft);
}
.js-on .manifesto__line.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.manifesto__no {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.manifesto__close {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 380, 'SOFT' 60;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  line-height: 1.6;
  color: var(--cream-dim);
  margin-top: 3rem;
  max-width: 38ch;
}
.manifesto__close em {
  color: var(--cream);
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 400;
}

/* ─── MUSHAF ────────────────────────────────────────────────────── */
.mushaf {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.mushaf__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.featurelets {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.featurelets li {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 360, 'SOFT' 80;
  font-size: 1rem;
  color: var(--cream-dim);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.featurelets__dot {
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Device mockup */
.mushaf__device {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 700px;
}

.device {
  width: 320px;
  height: 660px;
  background: linear-gradient(180deg, #1a1a1c, #0a0a0c);
  border-radius: 44px;
  padding: 12px;
  position: relative;
  box-shadow:
    0 0 0 1.5px rgba(201, 169, 97, 0.22),
    0 0 0 6px rgba(0, 0, 0, 0.4),
    0 50px 100px -20px rgba(0, 0, 0, 0.6),
    0 30px 60px -30px rgba(14, 59, 44, 0.4),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  transform: perspective(1400px) rotateY(-8deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-soft);
}
.device:hover {
  transform: perspective(1400px) rotateY(-4deg) rotateX(1deg);
}
.device__notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 28px;
  background: #000;
  border-radius: 14px;
  z-index: 5;
}
.device__screen {
  background: var(--ink-2);
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Page image fits the screen width with no horizontal clipping. Any extra
   vertical space is filled by the paper-dark backdrop, blending seamlessly.
   Matches the real reader, which renders the page at screen width and lets
   the dark background fill the remainder. */
.device__page-wrap {
  position: absolute;
  inset: 0;                /* full screen */
  background: #1A1510;     /* paperDark — matches app night mode */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.device__page-img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
  filter: invert(1);       /* same trick the app uses for night mode */
  opacity: 0.94;
}
.device__screen { background: #1A1510; }

/* Floating top toolbar — semi-transparent over the page */
.device__toolbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: rgba(33, 33, 33, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 168, 76, 0.25);
  z-index: 5;
}
.device__toolbar-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 2px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #F5F0E8;
  height: 30px;
}
.device__toolbar-status-right {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #F5F0E8;
}
.device__toolbar-status-right svg { fill: currentColor; }

.device__toolbar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 4px 6px;
}
.device__tbtn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4A84C;
  flex-shrink: 0;
}
.device__tbtn svg { width: 18px; height: 18px; }
.device__tbtn--active { color: #E6A817; }

.device__toolbar-title {
  flex: 1;
  text-align: center;
  padding: 0 4px;
}
.device__toolbar-surah {
  font-family: var(--font-arabic);
  font-size: 0.98rem;
  font-weight: 700;
  color: #F5F0E8;
  line-height: 1.1;
}
.device__toolbar-sub {
  font-family: var(--font-arabic);
  font-size: 0.62rem;
  color: #DFC06A;
  margin-top: 1px;
}

/* Bottom audio control bar — matches the real component */
.device__audiobar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(33, 33, 33, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(212, 168, 76, 0.25);
  padding: 8px 12px 14px;
  z-index: 5;
}
.device__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.device__progress-time {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #8A857D;
  min-width: 26px;
  text-align: center;
}
.device__progress-track {
  flex: 1;
  height: 3px;
  background: rgba(212, 168, 76, 0.12);
  border-radius: 1.5px;
  overflow: hidden;
}
.device__progress-fill {
  width: 20%;
  height: 100%;
  background: #D4A84C;
  border-radius: 1.5px;
  position: relative;
}
.device__progress-fill::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: #D4A84C;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 168, 76, 0.6);
}

.device__audiobar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.device__nowplaying {
  flex: 1;
  min-width: 0;
}
.device__nowplaying-name {
  font-family: var(--font-arabic);
  font-size: 0.92rem;
  font-weight: 700;
  color: #F5F0E8;
  white-space: nowrap;
  text-align: right;
}
.device__nowplaying-sub {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: #9E9A93;
  margin-top: 1px;
}

.device__transport {
  display: flex;
  align-items: center;
  gap: 2px;
}
.device__speed {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.15);
  padding: 3px 6px;
  border-radius: 8px;
  margin-right: 4px;
  font-weight: 600;
}
.device__ctl {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F5F0E8;
}
.device__ctl svg { width: 16px; height: 16px; }
.device__play {
  width: 36px; height: 36px;
  background: #4CAF50;            /* real app uses green primary, not gold */
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.35);
  margin: 0 2px;
}
.device__play svg { width: 16px; height: 16px; }

/* Floating decorative text around the device */
.device__floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.floater {
  position: absolute;
  font-family: var(--font-arabic);
  color: var(--gold-faint);
  font-size: 4rem;
  user-select: none;
}
.floater--1 { top: 10%;  left: -5%;  font-size: 5rem; }
.floater--2 { top: 50%;  right: -3%; font-size: 8rem; color: rgba(237, 230, 214, 0.04); }
.floater--3 { bottom: 12%; left: 0%; font-size: 4rem; }
.floater--4 { top: 25%; right: 5%; font-size: 3rem; font-family: var(--font-display); color: rgba(201, 169, 97, 0.18); }

/* ─── LISTEN ────────────────────────────────────────────────────── */
.listen {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.listen__panel {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  margin-top: 3rem;
  align-items: stretch;
}

.listen__reciters {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.reciter {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 0.2rem;
  border-bottom: 1px solid var(--hairline-2);
  color: var(--cream-dim);
  transition: color .3s, padding .4s var(--ease-soft);
  text-align: left;
  width: 100%;
}
.reciter:last-child { border-bottom: 0; }
.reciter:hover { color: var(--cream); padding-left: 0.8rem; }
.reciter--active {
  color: var(--gold-light);
  position: relative;
}
.reciter--active::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 50%;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 12px var(--gold);
}
.reciter__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.reciter__ar {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--cream-dim);
  margin-left: 1rem;
}

.listen__player {
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.listen__player::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(14, 59, 44, 0.25), transparent 70%);
  pointer-events: none;
}
.listen__waveform {
  height: 80px;
  position: relative;
  z-index: 1;
}
.listen__waveform svg {
  width: 100%; height: 100%;
}

.listen__controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 1;
}
.listen__btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-dim);
  font-size: 1.1rem;
  transition: color .25s, background .25s;
}
.listen__btn:hover { color: var(--cream); background: var(--cream-faint); }
.listen__btn--play {
  width: 56px; height: 56px;
  background: var(--gold);
  color: var(--ink-1);
  box-shadow: 0 0 32px rgba(201, 169, 97, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.listen__btn--play:hover { background: var(--gold-light); color: var(--ink-1); }
.listen__btn--play svg { width: 18px; height: 18px; }
.listen__time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cream-dim);
  letter-spacing: 0.05em;
  margin-left: auto;
}
.listen__speed {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--gold);
}

/* ─── HIFZ ──────────────────────────────────────────────────────── */
.hifz {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.hifz__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.hifz__card {
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .5s var(--ease-soft), border-color .4s, background .4s;
  position: relative;
  overflow: hidden;
}
.hifz__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0;
  transition: opacity .4s;
}
.hifz__card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-faint);
  background: var(--ink-3);
}
.hifz__card:hover::before { opacity: 0.6; }

.hifz__card-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.hifz__card-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: -0.005em;
}
.hifz__card-body {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--cream-dim);
}
.hifz__card-art {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--gold);
  opacity: 0.7;
}
.hifz__card-art svg { width: 100%; height: 80px; }

.hifz__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: var(--cream-dim);
  text-align: center;
  margin-top: 4rem;
  max-width: 50ch;
  margin-inline: auto;
  line-height: 1.55;
  position: relative;
}
.hifz__quote em { color: var(--cream); font-style: italic; }
.hifz__quote-mark {
  color: var(--gold);
  font-size: 2.2em;
  line-height: 0;
  vertical-align: -0.4em;
  margin-right: 0.2em;
  font-family: var(--font-display);
}

/* ─── HIFZ — Khatma + Tasbih small-tools strip ──────────────────── */
.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.tools__card {
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.9rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .5s var(--ease-soft), border-color .35s, background .35s;
  position: relative;
  overflow: hidden;
}
.tools__card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0;
  transition: opacity .4s;
}
.tools__card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-faint);
  background: var(--ink-3);
}
.tools__card:hover::before { opacity: 0.55; }

.tools__head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed var(--hairline);
}
.tools__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.55rem;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.tools__ar {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  color: var(--gold-light);
}

.tools__body {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--cream-dim);
}

.tools__meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--hairline-2);
}
.tools__meta li {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ─── PRAYER & QIBLA ────────────────────────────────────────────── */
.prayer {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.prayer__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  margin-top: 3rem;
}

.prayer__compass {
  display: flex;
  justify-content: center;
}
.compass {
  position: relative;
  width: clamp(280px, 100%, 460px);
  aspect-ratio: 1;
}
.compass__svg {
  width: 100%; height: 100%;
  color: var(--gold);
}
.compass__cardinal {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  fill: var(--cream);
}
.compass__cardinal--minor { fill: var(--cream-dim); font-size: 16px; }
.compass__rose {
  transform-origin: 200px 200px;
  animation: roseDrift 60s linear infinite;
}
@keyframes roseDrift {
  to { transform: rotate(360deg); }
}
.compass__needle {
  transform-origin: 200px 200px;
  animation: needleSeek 6s ease-in-out infinite alternate;
}
@keyframes needleSeek {
  0%   { transform: rotate(-7deg); }
  50%  { transform: rotate(0deg);  }
  100% { transform: rotate(5deg);  }
}
.compass__kaaba {
  transform-origin: 200px 200px;
  animation: needleSeek 6s ease-in-out infinite alternate;
}
.compass__bismillah {
  font-family: var(--font-arabic);
  font-size: 28px;
  fill: var(--gold-light);
  opacity: 0.8;
}

.compass__readout {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 60px));
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  pointer-events: none;
}
.compass__deg {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--cream);
  letter-spacing: 0.04em;
}
.compass__sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.compass__dist {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cream-dim);
  margin-top: 0.4rem;
}

.prayer__times {
  display: flex;
  flex-direction: column;
}
.prayer__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}
.prayer__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline-2);
  position: relative;
  color: var(--cream-dim);
  transition: color .3s;
}
.prayer__row:hover { color: var(--cream); }
.prayer__row--next {
  color: var(--cream);
}
.prayer__row--next::before {
  content: '';
  position: absolute;
  left: -1rem; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--gold);
}
.prayer__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}
.prayer__row--next .prayer__name { color: var(--gold-light); }
.prayer__ar {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  color: var(--cream-dim);
}
.prayer__time {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  text-align: right;
  letter-spacing: 0.05em;
}
.prayer__badge {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 0.3rem;
}
.prayer__caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-top: 1.5rem;
  line-height: 1.7;
}

/* ─── TAFSIR & REFLECTION ───────────────────────────────────────── */
.tafsir {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.tafsir__pair {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  margin-top: 3rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.tafsir__panel {
  padding: 2.5rem;
  position: relative;
}
.tafsir__panel--source {
  border-right: 1px solid var(--hairline);
}
.tafsir__panel--note {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  background-image:
    radial-gradient(circle at 20% 0%, rgba(201, 169, 97, 0.04), transparent 50%),
    repeating-linear-gradient(180deg, transparent, transparent 28px, var(--hairline-2) 28px, var(--hairline-2) 29px);
}
.tafsir__panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.5rem;
}
.tafsir__panel-label { color: var(--gold); }

.tafsir__ayah {
  font-family: var(--font-arabic);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 2;
  color: var(--cream);
  text-align: right;
  margin-bottom: 1.5rem;
  letter-spacing: 0;
}
.tafsir__translation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cream-dim);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--hairline);
}
.tafsir__body {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 360, 'SOFT' 100;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--cream-dim);
}
.tafsir__body em { color: var(--cream); font-style: italic; }

.tafsir__note-body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--cream);
}
.tafsir__note-body em { color: var(--gold-light); font-style: italic; }
.tafsir__tags {
  margin-top: 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tafsir__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

/* ─── THEMES ────────────────────────────────────────────────────── */
.themes {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.themes__rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.theme-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  transition: transform .6s var(--ease-soft), border-color .3s;
  background: var(--ink-2);
}
.theme-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
}

.theme-card__app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 400, 'SOFT' 60;
}

.theme-card__statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.9rem 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}
.theme-card__statusbar-right {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.theme-card__statusbar-right svg { fill: currentColor; }

.theme-card__header {
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  padding: 0.5rem 0.9rem 0.6rem;
  font-family: var(--font-display);
  border-bottom: 1px solid currentColor;
  border-color: rgba(0, 0, 0, 0.08);
}
.theme-card__back {
  font-size: 1.05rem;
  font-weight: 400;
  text-align: left;
  opacity: 0.8;
}
.theme-card__title {
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
.theme-card__cog { text-align: right; opacity: 0.7; }
.theme-card__cog svg { display: inline-block; stroke: currentColor; fill: currentColor; }

.theme-card__rows {
  display: flex;
  flex-direction: column;
  margin-top: 0.2rem;
}
.theme-card__row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid;
  border-color: rgba(0, 0, 0, 0.06);
}
.theme-card__row:last-child { border-bottom: 0; }
.theme-card__num {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  opacity: 0.6;
}
.theme-card__sname {
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.005em;
}
.theme-card__sar {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  opacity: 0.8;
}

.theme-card__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--hairline-2);
  text-align: left;
}

/* — Per-theme palettes — */
/* Light */
.theme-card--light .theme-card__app    { background: #FBF8F3; color: #1A1A1A; }
.theme-card--light .theme-card__header { border-bottom-color: rgba(26, 26, 26, 0.10); }
.theme-card--light .theme-card__row    { border-bottom-color: rgba(26, 26, 26, 0.07); }
.theme-card--light .theme-card__title  { color: #C9A961; }
.theme-card--light .theme-card__back   { color: #C9A961; }
.theme-card--light .theme-card__label  { background: #FBF8F3; color: #6B6B6B; border-color: #E8E2D9; }

/* Sepia — warmer paper */
.theme-card--sepia .theme-card__app    { background: #F4EAD5; color: #362312; }
.theme-card--sepia .theme-card__header { border-bottom-color: rgba(54, 35, 18, 0.14); }
.theme-card--sepia .theme-card__row    { border-bottom-color: rgba(54, 35, 18, 0.08); }
.theme-card--sepia .theme-card__title  { color: #8C6A3A; }
.theme-card--sepia .theme-card__back   { color: #8C6A3A; }
.theme-card--sepia .theme-card__label  { background: #F4EAD5; color: #8B7355; border-color: #E8DCC2; }

/* Dark */
.theme-card--dark .theme-card__app    { background: #1A1A1E; color: #F5F0E8; }
.theme-card--dark .theme-card__header { border-bottom-color: rgba(245, 240, 232, 0.10); }
.theme-card--dark .theme-card__row    { border-bottom-color: rgba(245, 240, 232, 0.08); }
.theme-card--dark .theme-card__title  { color: #D4A84C; }
.theme-card--dark .theme-card__back   { color: #D4A84C; }
.theme-card--dark .theme-card__label  { background: #252529; color: #9E9A93; border-color: #3A3A3E; }

/* OLED — pure black */
.theme-card--oled .theme-card__app    { background: #000000; color: #FFFFFF; }
.theme-card--oled .theme-card__header { border-bottom-color: rgba(255, 255, 255, 0.10); }
.theme-card--oled .theme-card__row    { border-bottom-color: rgba(255, 255, 255, 0.07); }
.theme-card--oled .theme-card__title  { color: #E6A817; }
.theme-card--oled .theme-card__back   { color: #E6A817; }
.theme-card--oled .theme-card__label  { background: #000000; color: #8A8A8A; border-color: #1A1A1A; }

.themes__note {
  margin-top: 2.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cream-dim);
  max-width: 60ch;
}

/* ─── CRAFT (Built with Care) ───────────────────────────────────── */
.craft {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}
.craft__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 3rem;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.craft__cell {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--ink-1);
  transition: background .3s;
}
.craft__cell:hover { background: var(--ink-2); }
.craft__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.craft__cell h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--cream);
}
.craft__cell p {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--cream-dim);
}

/* ─── DOWNLOAD ──────────────────────────────────────────────────── */
.download {
  padding-top: calc(var(--section-y) * 1.2);
  padding-bottom: calc(var(--section-y) * 1.2);
  max-width: var(--max-page);
  margin: 0 auto;
  text-align: center;
}
.download__ornament {
  color: var(--gold);
  width: clamp(180px, 30vw, 280px);
  margin: 0 auto 2.5rem;
  opacity: 0.6;
}
.download__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cream);
  margin-bottom: 1rem;
  font-style: italic;
}
.download__lede {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-size: 1.15rem;
  color: var(--cream-dim);
  margin-bottom: 3rem;
}

.download__buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.dlbtn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.7rem;
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  color: var(--cream);
  transition: all .35s var(--ease-soft);
  position: relative;
  overflow: hidden;
}
.dlbtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(201, 169, 97, 0.10), transparent);
  transform: translateX(-100%);
  transition: transform .8s var(--ease-soft);
}
.dlbtn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.dlbtn:hover::before { transform: translateX(100%); }

.dlbtn__icon {
  width: 28px; height: 28px;
  fill: var(--gold-light);
  flex-shrink: 0;
}
.dlbtn__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
  display: block;
  text-align: left;
}
.dlbtn__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  display: block;
  text-align: left;
  margin-top: -2px;
  color: var(--cream);
}

/* Primary "coming soon" button — emerald-tinted with a quiet pulse */
.dlbtn--primary {
  background: linear-gradient(135deg, var(--emerald), var(--ink-2));
  border-color: var(--gold-faint);
}
.dlbtn--primary .dlbtn__icon { fill: var(--gold); }
.dlbtn--primary .dlbtn__name { color: var(--cream); }
.dlbtn--primary .dlbtn__tag  { color: var(--gold); }

.dlbtn__pulse {
  position: absolute;
  top: 8px; right: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.dlbtn__pulse::before, .dlbtn__pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--gold);
  animation: pulse 2.4s ease-out infinite;
}
.dlbtn__pulse::after { animation-delay: 1.2s; }
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(3.4); opacity: 0;   }
}

/* Ghost "iOS to follow" — not clickable, no hover lift */
.dlbtn--ghost {
  background: transparent;
  border-style: dashed;
  border-color: var(--hairline);
  opacity: 0.7;
}
.dlbtn--ghost::before { display: none; }
.dlbtn--ghost:hover { transform: none; border-color: var(--hairline); }
.dlbtn--ghost .dlbtn__icon { fill: var(--cream-dim); opacity: 0.7; }
.dlbtn--ghost .dlbtn__tag  { color: var(--gold-deep); }
.dlbtn--ghost .dlbtn__name { color: var(--cream-dim); font-style: italic; }

/* Quiet note below the buttons */
.download__note {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 12, 'wght' 340, 'SOFT' 100;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cream-dim);
  max-width: 48ch;
  margin: 0 auto 4rem;
  text-align: center;
  opacity: 0.85;
}

.download__finale {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--cream-dim);
  max-width: 40ch;
  margin: 0 auto;
  line-height: 1.6;
}
.download__finale span[lang="ar"] {
  font-family: var(--font-arabic);
  font-style: normal;
  font-size: 1.5em;
  color: var(--cream);
  display: block;
  margin-bottom: 0.5rem;
}
.download__finale em { color: var(--gold-light); }

/* ─── FOOTER ────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-top: 4rem;
  padding-bottom: 2rem;
  background: var(--ink-0);
  position: relative;
}
.site-footer__inner {
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.5fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--hairline-2);
}
.site-footer__brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.site-footer__icon {
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(14, 59, 44, 0.5);
}
.site-footer__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
  letter-spacing: 0.04em;
}
/* Arabic companion to the wordmark. Static in both languages — the name,
   not a translated string, so no data-i18n key. letter-spacing must stay 0:
   Arabic is cursive and any tracking pries the joins apart. Sized larger than
   the Latin name's 1.5rem would suggest — Amiri sits small on the em. */
.site-footer__name-ar {
  font-family: var(--font-arabic);
  font-size: 1.45rem;
  line-height: 1.5;
  color: var(--cream-dim);
  letter-spacing: 0;
  margin-top: 0.15rem;
}
.site-footer__tag {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 340, 'SOFT' 100;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--cream-dim);
  margin-top: 0.35rem;
}

.site-footer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.site-footer__nav ul { display: flex; flex-direction: column; gap: 0.7rem; }
.site-footer__nav a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--cream-dim);
  transition: color .25s;
  position: relative;
  padding-left: 0;
}
.site-footer__nav a:hover { color: var(--gold-light); }

.site-footer__greeting {
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--cream);
  line-height: 1.6;
}
.site-footer__greeting-en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--cream-dim);
  margin-top: 0.5rem;
}

.site-footer__base {
  max-width: var(--max-page);
  margin: 1.5rem auto 0;
  display: flex;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer__dot { opacity: 0.5; }

/* ─── Scroll-revealed sections (progressive enhancement) ────────── */
.js-on .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.1s var(--ease-soft),
    transform 1.1s var(--ease-soft);
}
.js-on .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.js-on .reveal--stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s var(--ease-soft),
    transform 0.9s var(--ease-soft);
}
.js-on .reveal--stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal--stagger.is-visible > *:nth-child(1)  { transition-delay: 0.00s; }
.reveal--stagger.is-visible > *:nth-child(2)  { transition-delay: 0.07s; }
.reveal--stagger.is-visible > *:nth-child(3)  { transition-delay: 0.14s; }
.reveal--stagger.is-visible > *:nth-child(4)  { transition-delay: 0.21s; }
.reveal--stagger.is-visible > *:nth-child(5)  { transition-delay: 0.28s; }
.reveal--stagger.is-visible > *:nth-child(6)  { transition-delay: 0.35s; }
.reveal--stagger.is-visible > *:nth-child(7)  { transition-delay: 0.42s; }
.reveal--stagger.is-visible > *:nth-child(8)  { transition-delay: 0.49s; }
.reveal--stagger.is-visible > *:nth-child(9)  { transition-delay: 0.56s; }
.reveal--stagger.is-visible > *:nth-child(10) { transition-delay: 0.63s; }
.reveal--stagger.is-visible > *:nth-child(n+11) { transition-delay: 0.70s; }

/* ─── Selection ─────────────────────────────────────────────────── */
::selection {
  background: var(--gold);
  color: var(--ink-1);
}

/* ─── Focus visible ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Language switch (top corner pill) ─────────────────────────── */
.langswitch {
  position: fixed;
  top: 18px;
  right: 30px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(7, 9, 10, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.langswitch__btn {
  color: var(--cream-dim);
  padding: 2px 4px;
  transition: color .25s var(--ease-soft), text-shadow .25s var(--ease-soft);
  font: inherit;
  letter-spacing: inherit;
}
.langswitch__btn[lang="ar"] {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  padding-bottom: 4px;
}
.langswitch__btn.is-active {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(201, 169, 97, 0.4);
}
.langswitch__btn:hover { color: var(--cream); }
.langswitch__sep { color: var(--gold-deep); opacity: 0.6; }

/* On the right-edge scroll thread the switch must not overlap */
html[dir="rtl"] .langswitch { right: auto; left: 30px; }
html[dir="rtl"] .scroll-thread { right: auto; left: 14px; }

@media (max-width: 720px) {
  .langswitch { top: 14px; right: 14px; padding: 6px 12px; font-size: 0.65rem; }
  html[dir="rtl"] .langswitch { right: auto; left: 14px; }
}

/* ─── RTL — directional tweaks for Arabic mode ──────────────────── */
html[dir="rtl"] body { font-family: var(--font-arabic), var(--font-display), serif; }

/* Restore Latin display fonts only where the design relies on them */
html[dir="rtl"] .section-eyebrow,
html[dir="rtl"] .hero__meta,
html[dir="rtl"] .compass__sub,
html[dir="rtl"] .compass__dist,
html[dir="rtl"] .prayer__caption,
html[dir="rtl"] .prayer__badge,
html[dir="rtl"] .craft__num,
html[dir="rtl"] .hifz__card-num,
html[dir="rtl"] .offline__panel-sub,
html[dir="rtl"] .offline__row-state,
html[dir="rtl"] .offline__row-size,
html[dir="rtl"] .offline__pill,
html[dir="rtl"] .offline__toggle,
html[dir="rtl"] .offline__row-meta,
html[dir="rtl"] .adhkar__featured-count,
html[dir="rtl"] .adhkar__featured-cite,
html[dir="rtl"] .adhkar__featured-reps,
html[dir="rtl"] .adhkar__sidebar-eyebrow,
html[dir="rtl"] .tafsir__panel-head,
html[dir="rtl"] .listen__more-eyebrow,
html[dir="rtl"] .listen__providers,
html[dir="rtl"] .theme-card__label,
html[dir="rtl"] .site-footer__base,
html[dir="rtl"] .device__nowplaying-sub,
html[dir="rtl"] .device__toolbar-sub,
html[dir="rtl"] .hero__descend-label {
  font-family: var(--font-mono);
}

/* Wordmark stays Latin "MyRawda" in both languages — no RTL override. */

html[dir="rtl"] .section-title,
html[dir="rtl"] .download__title,
html[dir="rtl"] .adhkar__featured-when,
html[dir="rtl"] .hifz__card-title,
html[dir="rtl"] .reciter__name,
html[dir="rtl"] .prayer__name,
html[dir="rtl"] .offline__row-name,
html[dir="rtl"] .offline__panel-title,
html[dir="rtl"] .tafsir__source-en,
html[dir="rtl"] .craft__cell h3,
html[dir="rtl"] .site-footer__name,
html[dir="rtl"] .site-footer__nav a,
html[dir="rtl"] .featurelets li,
html[dir="rtl"] .listen__more-name,
html[dir="rtl"] .listen .section-lede,
html[dir="rtl"] .mushaf .section-lede,
html[dir="rtl"] .hifz .section-lede,
html[dir="rtl"] .prayer .section-lede,
html[dir="rtl"] .adhkar .section-lede,
html[dir="rtl"] .tafsir .section-lede,
html[dir="rtl"] .offline .section-lede,
html[dir="rtl"] .themes .section-lede,
html[dir="rtl"] .download__lede,
html[dir="rtl"] .download__note,
html[dir="rtl"] .download__finale,
html[dir="rtl"] .manifesto__close,
html[dir="rtl"] .hifz__card-body,
html[dir="rtl"] .craft__cell p,
html[dir="rtl"] .adhkar__sidebar-note,
html[dir="rtl"] .adhkar__featured-tr,
html[dir="rtl"] .tafsir__note-body,
html[dir="rtl"] .tafsir__body-en,
html[dir="rtl"] .offline__caption,
html[dir="rtl"] .hifz__quote,
html[dir="rtl"] .studio-sibling__name,
html[dir="rtl"] .studio-sibling__tag,
html[dir="rtl"] .studio-strip__title,
html[dir="rtl"] .studio-strip__brand,
html[dir="rtl"] .site-footer__greeting-en,
html[dir="rtl"] .site-footer__tag {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  font-style: normal;
}

/* Arabic body needs a touch more line-height to breathe */
html[dir="rtl"] .section-lede,
html[dir="rtl"] .hifz__card-body,
html[dir="rtl"] .craft__cell p,
html[dir="rtl"] .adhkar__featured-tr,
html[dir="rtl"] .manifesto__close,
html[dir="rtl"] .download__lede,
html[dir="rtl"] .download__note,
html[dir="rtl"] .offline__caption,
html[dir="rtl"] .tafsir__note-body {
  line-height: 1.85;
}

/* The featured adhkar Arabic translation no longer needs italic styling */
html[dir="rtl"] .adhkar__featured-tr em,
html[dir="rtl"] .download__finale em,
html[dir="rtl"] .hifz__quote em,
html[dir="rtl"] .manifesto__close em,
html[dir="rtl"] .craft__cell em,
html[dir="rtl"] .tafsir__note-body em,
html[dir="rtl"] .tafsir__body em {
  font-style: normal;
}

/* Section titles get a soft accent flip — break long Arabic titles wider */
html[dir="rtl"] .section-title { max-width: 22ch; }

/* Mushaf: keep the device on the right (the visual side that flipped) */
html[dir="rtl"] .mushaf__copy { text-align: right; }
html[dir="rtl"] .featurelets li { flex-direction: row-reverse; }

/* Prayer row grid still works in RTL (CSS grid auto-flips columns visually) */
html[dir="rtl"] .prayer__time { text-align: left; direction: ltr; }
html[dir="rtl"] .compass__deg { direction: ltr; }

/* Listen reciter rows */
html[dir="rtl"] .reciter { text-align: right; flex-direction: row-reverse; }
html[dir="rtl"] .reciter__ar { margin-left: 0; margin-right: 1rem; }
html[dir="rtl"] .reciter--active::before { left: auto; right: -1rem; }
html[dir="rtl"] .prayer__row--next::before { left: auto; right: -1rem; }
html[dir="rtl"] .reciter:hover { padding-left: 0; padding-right: 0.8rem; }

/* Offline row alignment */
html[dir="rtl"] .offline__row-size,
html[dir="rtl"] .offline__row-state { text-align: left; direction: ltr; }

/* Tafsir sources strip — keep grid borders consistent */
html[dir="rtl"] .tafsir__sources {
  border-left: 0; border-right: 1px solid var(--hairline);
}
html[dir="rtl"] .tafsir__sources li {
  border-right: 0; border-left: 1px solid var(--hairline);
}

/* Adhkar chips have a vertical divider that should mirror */
html[dir="rtl"] .adhkar__chips li:nth-child(odd)  { padding-right: 0; border-right: 0; padding-left: 1.1rem; border-left: 1px solid var(--hairline-2); }
html[dir="rtl"] .adhkar__chips li:nth-child(even) { padding-left: 0; padding-right: 1.1rem; }

/* Sibling apps arrow flips */
html[dir="rtl"] .studio-sibling__arrow { transform: scaleX(-1); }

/* Hifz quote mark — keep on the leading edge */
html[dir="rtl"] .hifz__quote-mark { margin-right: 0; margin-left: 0.2em; }

/* Bismillah veil — when in RTL the reveal animation reads right-to-left already, leave as-is */

/* Hero meta pills look better wrapped neatly in Arabic */
html[dir="rtl"] .hero__meta { direction: rtl; }

/* Numbers in Arabic context should keep digits but in a mono face when appropriate */
html[dir="rtl"] .hifz__card-num,
html[dir="rtl"] .craft__num { direction: ltr; }

/* The download CTA tag — preserve direction so "Google Play" sits naturally */
html[dir="rtl"] .dlbtn { direction: rtl; }
html[dir="rtl"] .dlbtn__tag,
html[dir="rtl"] .dlbtn__name { text-align: right; }

/* Footer base center stays clean */
html[dir="rtl"] .site-footer__base { direction: rtl; }
html[dir="rtl"] .site-footer__greeting { text-align: left; }
@media (max-width: 960px) {
  html[dir="rtl"] .site-footer__greeting { text-align: right; }
}

/* Tafsir note panel — flip the head row */
html[dir="rtl"] .tafsir__panel-head { direction: rtl; }

/* The pulse on the primary download button sits in the top-right — flip in RTL */
html[dir="rtl"] .dlbtn__pulse { right: auto; left: 10px; }

/* In Arabic mode, suppress the duplicate-text siblings.
   - prayer__ar, adhkar__chip-ar, featured-when-ar: i18n already translates
     the primary span; the always-Arabic sibling would just duplicate.
   - reciter__name, listen__more-name, tafsir__source-en: these are NOT
     translated by i18n (proper nouns / scholar names). In Arabic mode we
     hide the Latin label and let the always-Arabic sibling carry the row. */
html[dir="rtl"] .prayer__ar,
html[dir="rtl"] .adhkar__chip-ar,
html[dir="rtl"] .adhkar__featured-when-ar,
html[dir="rtl"] .tools__ar { display: none; }

html[dir="rtl"] .reciter__name,
html[dir="rtl"] .listen__more-name,
html[dir="rtl"] .tafsir__source-en,
html[dir="rtl"] .tafsir__translation,
html[dir="rtl"] .tafsir__body-en { display: none; }

/* Promote the Arabic sibling to the primary visual weight in RTL mode */
html[dir="rtl"] .reciter__ar {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--cream-dim);
  margin: 0;
  letter-spacing: 0;
}
html[dir="rtl"] .reciter--active .reciter__ar { color: var(--gold-light); }
html[dir="rtl"] .listen__more-ar {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  color: var(--cream);
  opacity: 1;
}
html[dir="rtl"] .tafsir__source-ar {
  font-size: 1.55rem;
  margin-top: 0;
}

/* Custom cursor stays where the mouse is — no change. */


/* ─── LISTEN — extras (provider strip + "more reciters" grid) ───── */
.listen__providers {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--hairline);
  z-index: 1;
}
.listen__providers span:nth-child(even) { color: var(--gold); }

.listen__more {
  margin-top: 3rem;
  border-top: 1px dashed var(--hairline);
  padding-top: 2rem;
}
.listen__more-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.4rem;
}
.listen__more-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem 1.6rem;
}
.listen__more-grid li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--hairline-2);
  transition: color .25s, transform .35s var(--ease-soft);
  color: var(--cream-dim);
}
.listen__more-grid li:hover { color: var(--cream); transform: translateY(-1px); }
.listen__more-name {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.005em;
}
.listen__more-ar {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: var(--cream-dim);
  opacity: 0.85;
}

.reciter__name em {
  font-style: italic;
  color: var(--gold-deep);
  font-size: 0.85em;
  margin-left: 0.3em;
}

/* ─── ADHKAR ────────────────────────────────────────────────────── */
.adhkar {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}
.adhkar__layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 3rem;
  align-items: stretch;
}

.adhkar__featured {
  background:
    radial-gradient(ellipse 80% 50% at 30% 0%, rgba(201, 169, 97, 0.07), transparent 60%),
    linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 2.6rem 2.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  position: relative;
  overflow: hidden;
}
.adhkar__featured::before {
  /* a quiet gold rule at the top */
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.55;
}
.adhkar__featured::after {
  /* a quiet, decorative sun for "morning" */
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(201, 169, 97, 0.10), transparent 60%);
  pointer-events: none;
}
.adhkar__featured-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px dashed var(--hairline);
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}
.adhkar__featured-when {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.adhkar__featured-when-ar {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  color: var(--gold-light);
}
.adhkar__featured-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.adhkar__featured-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  line-height: 2.05;
  color: var(--cream);
  text-align: right;
  letter-spacing: 0;
  position: relative;
}
.adhkar__featured-tr {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--cream-dim);
  padding-top: 0.4rem;
  border-top: 1px dashed var(--hairline);
}
.adhkar__featured-tr em { color: var(--cream); font-style: italic; }
.adhkar__featured-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-top: 0.5rem;
  margin-top: auto;
}
.adhkar__featured-cite { color: var(--gold); }

.adhkar__sidebar {
  padding: 0.4rem 0 0 0;
  display: flex;
  flex-direction: column;
}
.adhkar__sidebar-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--hairline);
}
.adhkar__chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
}
.adhkar__chips li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hairline-2);
  transition: color .25s, padding-left .35s var(--ease-soft);
  color: var(--cream-dim);
}
.adhkar__chips li:nth-child(odd)  { padding-right: 1.1rem; border-right: 1px solid var(--hairline-2); }
.adhkar__chips li:nth-child(even) { padding-left: 1.1rem; }
.adhkar__chips li:hover { color: var(--cream); }
.adhkar__chip-ar {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--gold-light);
  line-height: 1.4;
}
.adhkar__chip-en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--cream);
}
.adhkar__sidebar-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cream-dim);
}

/* ─── TAFSIR — sources strip & extras ──────────────────────────── */
.tafsir__sources {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-top: 2.4rem;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.tafsir__sources li {
  padding: 1.3rem 1.1rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--ink-1);
  transition: background .3s, color .3s;
}
.tafsir__sources li:hover { background: var(--ink-2); }
.tafsir__source-ar {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--gold-light);
  line-height: 1.2;
  letter-spacing: 0;
}
.tafsir__source-en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--cream);
  margin-top: 0.1rem;
}
.tafsir__source-au {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: 0.2rem;
}

.tafsir__body-en {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 350, 'SOFT' 100;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--cream-dim);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--hairline);
}

/* keep the worked example panel comfortable */
.tafsir__panel { padding-block: 2.5rem; }

/* ─── OFFLINE / DOWNLOADS ───────────────────────────────────────── */
.offline {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  max-width: var(--max-page);
  margin: 0 auto;
}

.offline__panel {
  margin-top: 3rem;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.45);
  position: relative;
}
.offline__panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.4;
}

.offline__panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.4rem 1.8rem;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
}
.offline__panel-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.offline__panel-sub {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.offline__rows {
  display: flex;
  flex-direction: column;
}
.offline__row {
  display: grid;
  grid-template-columns: 16px 1.6fr 1.3fr 1.1fr 0.9fr;
  align-items: center;
  gap: 1.2rem;
  padding: 1.1rem 1.8rem;
  border-bottom: 1px solid var(--hairline-2);
  color: var(--cream-dim);
  transition: background .3s, color .25s;
  position: relative;
}
.offline__row:last-child { border-bottom: 0; }
.offline__row:hover { background: rgba(201, 169, 97, 0.025); color: var(--cream); }

.offline__row-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cream-faint);
  border: 1px solid var(--hairline);
}
.offline__row--done .offline__row-dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.offline__row--active .offline__row-dot {
  background: #4CAF50;
  border-color: #4CAF50;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.7);
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.82); }
}

.offline__row-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
  letter-spacing: 0.005em;
}
.offline__row-name em {
  font-style: italic;
  color: var(--gold-deep);
  font-size: 0.82em;
  margin-left: 0.4em;
}
.offline__row--done .offline__row-name { color: var(--cream); }

.offline__row-meta {
  font-family: var(--font-body);
  font-variation-settings: 'opsz' 14, 'wght' 360, 'SOFT' 100;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--cream-dim);
}

.offline__row-size {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  text-align: right;
}
.offline__bar {
  display: inline-block;
  width: 100%;
  height: 6px;
  background: rgba(201, 169, 97, 0.10);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  vertical-align: middle;
}
.offline__bar-fill {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
  border-radius: 3px;
  position: relative;
  animation: barShimmer 2.4s ease-in-out infinite;
}
.offline__bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: -4px;
  width: 6px; height: 100%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  border-radius: 3px;
}
@keyframes barShimmer {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.78; }
}

.offline__row-state {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: right;
  color: var(--gold-deep);
}
.offline__row--done .offline__row-state { color: var(--gold); }
.offline__row--active .offline__row-state { color: #6FD37A; }

.offline__panel-foot {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 1.2rem 1.8rem;
  border-top: 1px solid var(--hairline);
  background: rgba(0,0,0,0.18);
}

.offline__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  padding: 0.4rem 0.7rem 0.4rem 0.45rem;
  border: 1px solid var(--gold-faint);
  border-radius: 999px;
  background: rgba(201, 169, 97, 0.08);
}
.offline__toggle-dot {
  width: 22px; height: 12px;
  background: var(--ink-3);
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
}
.offline__toggle-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 1px;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: var(--cream-dim);
  border-radius: 50%;
  transition: left .3s var(--ease-soft), background .3s;
}
.offline__toggle--on .offline__toggle-dot {
  background: rgba(201, 169, 97, 0.25);
  border-color: var(--gold);
}
.offline__toggle--on .offline__toggle-dot::after {
  left: calc(100% - 9px);
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.offline__toggle--on .offline__toggle-label { color: var(--gold-light); }

.offline__pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.offline__caption {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: var(--cream-dim);
  max-width: 60ch;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .mushaf { grid-template-columns: 1fr; }
  .mushaf__device { min-height: 600px; order: -1; }
  .listen__panel { grid-template-columns: 1fr; }
  .listen__more-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem 1.4rem; }
  .hifz__grid { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr; }
  .prayer__grid { grid-template-columns: 1fr; }
  .adhkar__layout { grid-template-columns: 1fr; }
  .tafsir__sources { grid-template-columns: repeat(3, 1fr); }
  .tafsir__pair { grid-template-columns: 1fr; }
  .tafsir__panel--source { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .offline__row {
    grid-template-columns: 14px 1fr auto;
    grid-template-areas:
      "dot name state"
      "dot meta size";
    gap: 0.4rem 1rem;
  }
  .offline__row-dot { grid-area: dot; }
  .offline__row-name { grid-area: name; }
  .offline__row-meta { grid-area: meta; font-size: 0.85rem; }
  .offline__row-size { grid-area: size; text-align: right; }
  .offline__row-state { grid-area: state; }
  .themes__rail { grid-template-columns: repeat(2, 1fr); }
  .craft__grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .site-footer__greeting { text-align: left; }
  .device { transform: none; }
  .device:hover { transform: none; }
}

@media (max-width: 560px) {
  .themes__rail { grid-template-columns: 1fr; }
  .craft__grid { grid-template-columns: 1fr; }
  .hero__meta { flex-wrap: wrap; justify-content: center; }
  .device { width: 280px; height: 580px; }
  .listen__controls { flex-wrap: wrap; }
  .listen__time { width: 100%; text-align: center; margin: 0; order: 10; }
  .listen__more-grid { grid-template-columns: 1fr; }
  .tafsir__sources { grid-template-columns: repeat(2, 1fr); }
  .adhkar__chips { grid-template-columns: 1fr; }
  .adhkar__chips li:nth-child(odd)  { padding-right: 0; border-right: 0; }
  .adhkar__chips li:nth-child(even) { padding-left: 0; }
  .offline__panel-head { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .offline__panel-foot { padding: 1rem; }
}

/* ─── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bismillah__veil { display: none; }
  .wordmark, .tagline, .hero__meta, .hero__ornament--bottom {
    opacity: 1;
    animation: none;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal--stagger > * { opacity: 1; transform: none; }
  .compass__rose, .compass__needle, .compass__kaaba { animation: none; }
  .device__waveform span { animation: none; transform: scaleY(0.7); }
}

/* ─── Studio strip (Rokswave) ───────────────────────────────────── */
.studio-strip {
  border-top: 1px solid var(--hairline);
  background: var(--ink-1);
  padding: 56px var(--gutter);
  font-family: var(--font-body);
}
.studio-strip__inner {
  max-width: var(--max-page);
  margin: 0 auto;
}
.studio-strip__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 1rem;
  transition: color .25s var(--ease-soft);
}
.studio-strip__brand:hover { color: var(--cream); }
.studio-strip__mark {
  width: 20px; height: 20px;
  opacity: 0.6;
  transition: opacity .25s var(--ease-soft);
}
.studio-strip__brand:hover .studio-strip__mark { opacity: 1; }
.studio-strip__brand strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}
.studio-strip__sep {
  margin: 0 10px;
  color: var(--gold-deep);
}
.studio-strip__tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--sage);
}
.studio-strip__title {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.studio-siblings {
  margin-top: 18px;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .studio-siblings { grid-auto-flow: column; grid-auto-columns: 1fr; }   /* one column per sibling app */
}
.studio-sibling__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--hairline);
  background: transparent;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: border-color .25s var(--ease-soft), background .25s var(--ease-soft);
}
.studio-sibling__link:hover {
  border-color: var(--gold-deep);
  background: var(--gold-faint);
}
.studio-sibling__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.studio-sibling__body {
  min-width: 0;
  flex: 1;
}
.studio-sibling__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-sibling__tag {
  display: block;
  font-size: 0.82rem;
  color: var(--cream-dim);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-sibling__arrow {
  color: var(--gold-deep);
  transition: color .25s var(--ease-soft);
}
.studio-sibling__link:hover .studio-sibling__arrow {
  color: var(--gold-light);
}
.studio-strip__see-all {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
}
.studio-strip__see-all a {
  color: inherit;
  text-decoration: none;
  transition: color .25s var(--ease-soft);
}
.studio-strip__see-all a:hover { color: var(--cream); }
