/* Qasas ul-Huda — illuminated manuscript theme. Phase 1. */

:root {
  --parchment: #f7f1e3;
  --parchment-deep: #efe6d0;
  --ink: #2b2117;
  --ink-soft: #4a3d2c;
  --gold: #a8842f;
  --gold-deep: #8a6a24;
  --gold-light: #d9bd76;
  --rule: #d8c89a;
  --card: #fbf7ec;
  --shadow: rgba(74, 58, 32, 0.14);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--parchment);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255, 252, 240, 0.55), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(190, 160, 100, 0.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.28 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.arabic {
  font-family: 'Amiri', serif;
  direction: rtl;
  text-align: right;
  line-height: 2.1;
  font-size: 1.35em;
}

a { color: var(--gold-deep); }
a:hover { color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f7f1e3;
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  min-height: 44px;
}
.brand img { width: 26px; height: 26px; flex: none; }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--gold-deep); border-bottom-color: var(--gold); }

/* ---------- layout ---------- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 72px 0; }

.rule-star {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 34px auto;
  max-width: 420px;
}
.rule-star::before, .rule-star::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, transparent, var(--gold));
}
.rule-star::after {
  background: linear-gradient(to left, transparent, var(--gold));
}
.rule-star svg { width: 22px; height: 22px; flex: none; }

.kicker {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 0.95rem;
  text-align: center;
  margin: 0 0 10px;
}
.section-title {
  text-align: center;
  font-size: 2.6rem;
  margin: 0 0 8px;
}
.lede {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 10px;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 84px 20px 60px;
  position: relative;
}
.hero-frame {
  max-width: 1100px;
  margin: 0 auto;
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule);
  outline-offset: 6px;
  padding: 56px 24px 64px;
  background: rgba(255, 252, 243, 0.35);
}
.hero h1 {
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  letter-spacing: 0.18em;
  margin: 18px 0 6px;
  text-indent: 0.18em;
}
.hero .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
  text-indent: 0.28em;
}
.hero-banner {
  margin: 34px auto 0;
  max-width: 880px;
  border: 1px solid var(--gold-light);
  box-shadow: 0 18px 50px var(--shadow);
  overflow: hidden;
}
.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 40px;
  margin-top: 34px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fffdf6;
  background: linear-gradient(160deg, var(--gold) 0%, var(--gold-deep) 100%);
  border: 1px solid var(--gold-deep);
  border-radius: 2px;
  box-shadow: 0 8px 22px rgba(138, 106, 36, 0.35);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.btn:hover {
  color: #fffdf6;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(138, 106, 36, 0.45);
}

/* ---------- intro ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 40px;
}
.intro-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 30px 26px;
  text-align: center;
  box-shadow: 0 6px 20px var(--shadow);
}
.intro-card svg { width: 40px; height: 40px; margin-bottom: 8px; }
.intro-card h3 {
  font-size: 1.5rem;
  margin: 6px 0 10px;
  letter-spacing: 0.04em;
}
.intro-card p { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- timeline ---------- */
.timeline { overflow: hidden; }
.timeline-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 26px 20px 30px;
  margin: 20px -20px 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.timeline-rail::-webkit-scrollbar { height: 8px; }
.timeline-rail::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 4px; }
.timeline-rail::-webkit-scrollbar-track { background: rgba(168, 132, 47, 0.12); }

.prophet {
  flex: 0 0 auto;
  width: 128px;
  scroll-snap-align: start;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 4px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 44px;
}
.prophet .medallion {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #fdf9ee 0%, var(--parchment-deep) 70%);
  box-shadow: 0 6px 16px var(--shadow), inset 0 0 0 5px rgba(168, 132, 47, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}
.prophet .medallion svg { width: 46px; height: 46px; }
.prophet .pname {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.12rem;
  letter-spacing: 0.05em;
  display: block;
}
.prophet .pnum {
  font-size: 0.85rem;
  color: var(--gold-deep);
  letter-spacing: 0.2em;
}
a.prophet:hover .medallion,
a.prophet:focus-visible .medallion {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(138, 106, 36, 0.3), inset 0 0 0 5px rgba(168, 132, 47, 0.18);
}
.prophet.soon { cursor: default; opacity: 0.72; }
.prophet.soon .medallion { border-style: dashed; }
.prophet .soon-tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 3px 10px;
  margin-top: 6px;
}
.timeline-hint {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1rem;
  margin-top: 6px;
}

/* ---------- featured stories ---------- */
.story-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 40px;
}
.story-card {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}
.story-card:hover, .story-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(74, 58, 32, 0.22);
  color: var(--ink);
}
.story-card .thumb { overflow: hidden; }
.story-card .thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 1.4s ease;
}
.story-card:hover .thumb img { transform: scale(1.04); }
.story-card .card-body { padding: 28px 30px 32px; }
.story-card .chapter-label {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 0.92rem;
}
.story-card h3 { font-size: 2rem; margin: 8px 0 10px; }
.story-card p { margin: 0 0 16px; color: var(--ink-soft); }
.story-card .read-link {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 1.05rem;
}

/* ---------- story page ---------- */
.story-hero { text-align: center; padding: 64px 20px 20px; }
.story-hero .chapter-label {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 1rem;
  text-indent: 0.34em;
}
.story-hero h1 { font-size: clamp(2.4rem, 7vw, 3.8rem); margin: 12px 0 4px; }
.story-figure {
  max-width: 880px;
  margin: 34px auto 0;
  border: 1px solid var(--gold-light);
  box-shadow: 0 18px 50px var(--shadow);
  overflow: hidden;
}
.story-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.story-figure figcaption {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  padding: 12px 18px;
  background: var(--card);
  border-top: 1px solid var(--rule);
  text-align: center;
}
.narrative { max-width: 720px; margin: 0 auto; }
.narrative p.dropcap::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.4em;
  line-height: 0.82;
  float: left;
  padding: 6px 12px 0 0;
  color: var(--gold-deep);
}
.narrative h2 {
  font-size: 1.9rem;
  margin: 44px 0 6px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.narrative h2::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, var(--gold-light), transparent);
}

/* ---------- verse panel ---------- */
.verse {
  max-width: 760px;
  margin: 40px auto;
  background: var(--card);
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule);
  outline-offset: 5px;
  padding: 34px 36px 26px;
  box-shadow: 0 10px 30px var(--shadow);
}
.verse .verse-marker {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 0.95rem;
  margin-bottom: 14px;
  text-indent: 0.3em;
}
.verse .arabic { margin: 0 0 18px; }
.verse .translation { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 14px; }
.verse .citation {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin: 0;
}

.lesson {
  max-width: 720px;
  margin: 44px auto 0;
  padding: 26px 30px;
  border-left: 3px solid var(--gold);
  background: rgba(168, 132, 47, 0.07);
  font-size: 1.12rem;
}
.lesson strong {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 1rem;
  display: block;
  margin-bottom: 6px;
}

/* ---------- turn the page ---------- */
.turn-page {
  margin: 70px 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(160deg, rgba(168, 132, 47, 0.14), rgba(168, 132, 47, 0.05));
}
.turn-page a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 24px;
  min-height: 88px;
  text-decoration: none;
  color: var(--ink);
}
.turn-page .tp-label {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--gold-deep);
  display: block;
}
.turn-page .tp-title { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; }
.turn-page .tp-arrow { font-size: 2rem; color: var(--gold-deep); flex: none; }
.turn-page a:hover .tp-title { color: var(--gold-deep); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule);
  margin-top: 0;
  padding: 44px 20px 54px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
}
footer .fbrand {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.24em;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 10px;
}
footer p { margin: 6px 0; }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }
.reveal[data-delay="4"] { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 18px; }
  .section { padding: 52px 0; }
  .nav-links a { padding: 12px 10px; font-size: 1rem; }
  .brand { font-size: 1.25rem; }
  .intro-grid, .story-cards { grid-template-columns: 1fr; }
  .hero-frame { padding: 40px 16px 48px; }
  .hero { padding: 56px 12px 44px; }
  .verse { padding: 26px 22px 20px; margin: 32px 6px; }
  .prophet { width: 112px; }
  .prophet .medallion { width: 84px; height: 84px; }
  .turn-page a { padding: 24px 18px; }
  .turn-page .tp-title { font-size: 1.35rem; }
}

img { max-width: 100%; }

/* ================= Qasas ul-Huda Phase 2 — storybook chapters ================= */

/* Page fade (JS-gated: html.js added by script, so no-JS never hides content) */
html.js body { opacity: 0; }
html.js body.loaded { opacity: 1; transition: opacity 0.7s ease; }
html.js body.leaving { opacity: 0; transition: opacity 0.28s ease; }

/* Gold reading-progress bar */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 80;
  background: rgba(168, 132, 47, 0.14);
}
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light), var(--gold-deep));
}

/* Espresso chapter plaque */
.chapter-plaque {
  display: inline-block;
  background: linear-gradient(165deg, #33241a, #211710);
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.32em; text-indent: 0.32em; text-transform: uppercase;
  font-size: 1.02rem; font-weight: 600;
  padding: 12px 34px;
  border: 1px solid var(--gold);
  box-shadow: 0 8px 22px var(--shadow), inset 0 0 0 1px rgba(217, 189, 118, 0.25);
}
.hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; color: var(--ink-soft); font-style: italic;
  max-width: 640px; margin: 14px auto 0;
}

/* Antique gold display title — flat, muted, letterpress (no gradient text) */
.antique-gold { color: #93712c; text-shadow: 0 1px 0 rgba(255, 252, 240, 0.55), 0 -1px 1px rgba(74, 58, 32, 0.22); }
.honorific { font-size: 0.62em; letter-spacing: 0.08em; }

/* Story layout: sticky scene rail + body */
.story-layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  gap: 44px; max-width: 1140px; margin: 0 auto; padding: 0 22px;
  align-items: start;
}
.story-body { min-width: 0; }
.rail-title {
  font-family: 'Cormorant Garamond', serif; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold-deep); font-size: 0.92rem;
  margin: 6px 0 12px 18px;
}
.scene-rail { position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow-y: auto; padding-bottom: 20px; }
.scene-rail ol { list-style: none; margin: 0; padding: 0 0 0 2px; border-left: 1px solid var(--rule); }
.scene-rail li { margin: 0; }
.scene-rail a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 6px 8px 16px; margin-left: -1px;
  text-decoration: none; color: var(--ink-soft);
  font-family: 'Cormorant Garamond', serif; font-size: 1.06rem; line-height: 1.3;
  border-left: 2px solid transparent;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.scene-rail .dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--gold-deep); background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.scene-rail a:hover { color: var(--ink); }
.scene-rail a.active { color: var(--ink); border-left-color: var(--gold); font-weight: 600; }
.scene-rail a.active .dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(168, 132, 47, 0.18); }

/* Mobile chip rail */
.chip-rail { display: none; }
@media (max-width: 940px) {
  .story-layout { grid-template-columns: 1fr; }
  .scene-rail { display: none; }
  .chip-rail {
    display: flex; gap: 10px; overflow-x: auto;
    position: sticky; top: 65px; z-index: 40;
    background: rgba(247, 241, 227, 0.96);
    padding: 12px 4px; margin: 0 -4px 8px;
    border-bottom: 1px solid var(--rule);
    -webkit-overflow-scrolling: touch;
  }
  .chip-rail a {
    flex: 0 0 auto; text-decoration: none; color: var(--ink-soft);
    font-family: 'Cormorant Garamond', serif; font-size: 1rem;
    border: 1px solid var(--rule); border-radius: 22px; padding: 8px 16px;
    min-height: 44px; display: inline-flex; align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
  }
  .chip-rail a.active { background: var(--gold); border-color: var(--gold-deep); color: #fffdf6; }
}

/* Scenes */
.scene { padding-top: 14px; }
.scene-kicker {
  font-family: 'Cormorant Garamond', serif; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold-deep); font-size: 0.95rem;
  margin: 40px 0 4px;
}
.scene h2 { font-size: 2.15rem; margin: 0 0 10px; }
.scene > p { max-width: 700px; }
p.dropcap::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.4em; line-height: 0.82; float: left;
  padding: 6px 12px 0 0; color: var(--gold-deep);
}

/* Verse panel — midnight ink, gold Arabic */
.verse {
  background: linear-gradient(170deg, #1c1926 0%, #262134 100%);
  border: 1px solid var(--gold);
  outline: 1px solid rgba(168, 132, 47, 0.4); outline-offset: 5px;
  transition: box-shadow 0.8s ease;
}
.verse:hover { box-shadow: 0 16px 44px rgba(24, 19, 38, 0.4); }
.verse .ref-chip {
  display: inline-block;
  border: 1px solid var(--gold-light); color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.24em; text-indent: 0.24em; text-transform: uppercase;
  font-size: 0.9rem; padding: 5px 18px; border-radius: 2px;
}
.verse .verse-marker { margin-bottom: 16px; }
.verse .arabic { color: #e9c964; }
.verse .translation { color: #ece4cd; }
.verse .citation { color: var(--gold-light); border-top: 1px solid rgba(217, 189, 118, 0.35); }

/* Small storybook vignette illustration */
.vignette { max-width: 340px; margin: 30px auto; text-align: center; }
.vignette img {
  display: block; width: 100%; height: auto;
  border-radius: 10px;
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule); outline-offset: 4px;
  box-shadow: 0 12px 30px var(--shadow);
}
.vignette-cap {
  margin-top: 12px; font-size: 1.02rem; line-height: 1.65;
  color: var(--ink-soft); font-style: italic;
}

/* Source honesty note */
.note-card {
  max-width: 760px; margin: 60px auto 0;
  background: rgba(168, 132, 47, 0.07);
  border: 1px solid var(--rule); border-top: 3px solid var(--gold);
  padding: 26px 30px; font-size: 1.08rem; color: var(--ink-soft);
}
.note-card .note-kicker {
  font-family: 'Cormorant Garamond', serif; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--gold-deep); font-size: 0.95rem;
  margin: 0 0 10px;
}
.note-card p { margin: 0; }
.note-card .tradition {
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
  letter-spacing: 0.06em; color: var(--gold-deep);
}

/* Lessons */
.lessons { max-width: 760px; margin: 60px auto 0; }
.lessons h2 { font-size: 2rem; margin: 0 0 18px; text-align: center; }
.lessons ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lessons li {
  background: var(--card); border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  padding: 17px 22px; font-size: 1.1rem; color: var(--ink-soft);
}
.lessons li strong { color: var(--ink); font-family: 'Cormorant Garamond', serif; font-size: 1.18rem; letter-spacing: 0.03em; }

/* Quiz */
.quiz {
  max-width: 760px; margin: 60px auto 0;
  background: var(--card);
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule); outline-offset: 5px;
  padding: 36px 38px; box-shadow: 0 10px 30px var(--shadow);
}
.quiz h2 { font-size: 2rem; margin: 0 0 6px; text-align: center; }
.quiz-sub { text-align: center; color: var(--ink-soft); font-style: italic; margin: 0 0 26px; }
.quiz-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 30px; }
.quiz-q .qq { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; margin: 0 0 12px; }
.quiz-q .qnum { color: var(--gold-deep); margin-right: 6px; }
.quiz-q .opts { display: grid; gap: 10px; }
.quiz-q .opt {
  text-align: left; background: #fffdf6;
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 13px 18px; min-height: 52px; cursor: pointer;
  font-family: 'EB Garamond', Georgia, serif; font-size: 1.08rem; color: var(--ink);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.quiz-q .opt:hover:not(:disabled) { border-color: var(--gold); background: #fdf8ea; }
.quiz-q .opt:disabled { cursor: default; }
.quiz-q .opt.correct { border-color: #3f7a4e; background: rgba(63, 122, 78, 0.1); }
.quiz-q .opt.wrong { border-color: #a33b3b; background: rgba(163, 59, 59, 0.07); }
.quiz-q .qfb { margin: 12px 0 0; font-size: 1.05rem; color: var(--ink-soft); }
.quiz-q .qfb strong.correct { color: #3f7a4e; }
.quiz-q .qfb strong.wrong { color: #a33b3b; }
.quiz-score {
  font-family: 'Cormorant Garamond', serif; font-size: 1.4rem;
  text-align: center; color: var(--gold-deep); margin: 30px 0 0;
  border-top: 1px solid var(--rule); padding-top: 22px;
}

/* Prev / next chapter cards */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  max-width: 1140px; margin: 72px auto 0; padding: 0 22px;
}
.pn-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--rule);
  padding: 26px 28px; min-height: 110px;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 8px 24px var(--shadow);
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}
.pn-card:hover, .pn-card:focus-visible {
  transform: translateY(-4px); border-color: var(--gold);
  box-shadow: 0 14px 36px rgba(74, 58, 32, 0.2); color: var(--ink);
}
.pn-card:last-child { justify-content: flex-end; text-align: right; }
.pn-card .pn-label {
  display: block; font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.24em; text-transform: uppercase;
  font-size: 0.92rem; color: var(--gold-deep); margin-bottom: 4px;
}
.pn-card .pn-title { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; line-height: 1.25; }
.pn-card .pn-arrow { font-size: 1.9rem; color: var(--gold-deep); flex: none; }

/* Story hero spacing for rail layout */
.story-hero { padding-bottom: 8px; }

/* Refined homepage touches */
.hero-frame {
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--gold-deep); outline-offset: 7px;
}
.intro-card, .story-card { border-top: 3px solid var(--gold-light); }

@media (max-width: 940px) {
  .prev-next { grid-template-columns: 1fr; }
  .pn-card:last-child { justify-content: flex-start; text-align: left; }
  .pn-card:last-child .pn-arrow { order: 2; }
}
@media (max-width: 760px) {
  .quiz { padding: 28px 22px; }
  .scene h2 { font-size: 1.85rem; }
  .vignette { max-width: 300px; }
}

/* Reduced motion: everything calm and instant */
@media (prefers-reduced-motion: reduce) {
  html.js body, html.js body.loaded { opacity: 1; transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .verse, .pn-card, .story-card, .btn, .opt { transition: none !important; }
  .story-card:hover .thumb img { transform: none; }
}

/* ---------- Hadith panel — deep espresso/olive, distinct from verse panels ---------- */
.hadith {
  max-width: 760px; margin: 38px auto;
  background: linear-gradient(168deg, #2c2314 0%, #3a2e1a 60%, #332818 100%);
  border: 1px solid var(--gold);
  outline: 1px solid rgba(168, 132, 47, 0.35); outline-offset: 5px;
  padding: 30px 36px 24px;
  box-shadow: 0 10px 30px var(--shadow);
  transition: box-shadow 0.8s ease;
}
.hadith:hover { box-shadow: 0 14px 38px rgba(44, 35, 20, 0.35); }
.hadith .h-label { text-align: center; margin: 0 0 16px; }
.hadith .h-label span {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
  font-size: 0.92rem; color: #0f0c07;
  background: linear-gradient(160deg, var(--gold-light), var(--gold));
  padding: 6px 22px; border-radius: 2px;
}
.hadith .h-text {
  color: #f2ead4; font-size: 1.14rem; line-height: 1.8; margin: 0 0 14px;
}
.hadith .h-narrator {
  color: var(--gold-light); font-style: italic; font-size: 1.02rem; margin: 0 0 14px;
}
.hadith .h-cite { margin: 0; border-top: 1px solid rgba(217, 189, 118, 0.3); padding-top: 14px; text-align: center; }
.hadith .h-cite a {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif; letter-spacing: 0.1em;
  font-size: 1.02rem; color: var(--gold-light); text-decoration: none;
  border: 1px solid rgba(217, 189, 118, 0.55); border-radius: 20px;
  padding: 8px 20px; min-height: 44px; line-height: 1.4;
  transition: background 0.3s ease, color 0.3s ease;
}
.hadith .h-cite a:hover, .hadith .h-cite a:focus-visible {
  background: rgba(217, 189, 118, 0.14); color: #f6e9c4;
}
@media (max-width: 760px) {
  .hadith { padding: 26px 22px 20px; margin: 32px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hadith { transition: none !important; }
}

/* ============ Phase 2.1 — hand-crafted manuscript language ============ */

/* Soft vignette over the page, like an aged folio */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 65; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(74, 58, 32, 0.11) 100%);
}

/* Aged paper is never uniform — slight tint variation per card */
.intro-card:nth-child(2) { background: #faf4e4; }
.intro-card:nth-child(3) { background: #f7efdb; }
.story-card:nth-child(2) .card-body { background: #faf4e4; }
.lessons li:nth-child(2n) { background: #faf5e7; }
.lessons li:nth-child(3n) { background: #f8f1de; }

/* Chapter headpiece — small hand-set fleuron row */
.headpiece { display: flex; justify-content: center; margin: 6px 0 18px; }
.headpiece svg { width: 210px; height: 24px; }
.headpiece line { stroke: #a8842f; stroke-width: 1.1; }
.headpiece .dia { fill: none; stroke: #8a6a24; stroke-width: 1.2; }
.headpiece .dia-fill { fill: #a8842f; }
.headpiece circle { fill: #a8842f; }

/* Hand-drawn scene dividers — thin rules, central diamond, fractional rotation */
.scene-divider { display: flex; justify-content: center; margin: 44px 0 6px; }
.scene-divider svg { width: 250px; height: 20px; }
.scene-divider line { stroke: #b39a55; stroke-width: 1; }
.scene-divider .dia { fill: none; stroke: #8a6a24; stroke-width: 1.2; }
.scene-divider circle { fill: #b39a55; }
.story-body .scene-divider:nth-of-type(odd) svg { transform: rotate(-0.4deg); }
.story-body .scene-divider:nth-of-type(even) svg { transform: rotate(0.35deg); }

/* Illustrations sit slightly off-square, the way a hand places them */
.scene:nth-of-type(odd) .vignette { transform: rotate(0.5deg); }
.scene:nth-of-type(even) .vignette { transform: rotate(-0.45deg); }

/* Honest framing under every symbolic illustration */
.illustration-note {
  margin: 8px 0 0; font-size: 0.92rem; font-style: italic;
  color: var(--ink-soft); opacity: 0.8;
}
.story-figure .illustration-note {
  margin-top: 0; padding: 0 18px 14px;
  background: var(--card); border-top: none; text-align: center;
}

/* Serif-italic captions under the thin gold keylines */
.story-figure figcaption, .vignette-cap {
  font-family: 'EB Garamond', Georgia, serif; font-style: italic;
}

/* Story index — the single story page when no prophet is chosen */
.story-index { max-width: 720px; margin: 0 auto; padding: 110px 22px 90px; text-align: center; }
.story-index h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 18px 0 6px; }
.story-index-list { list-style: none; margin: 42px auto 0; padding: 0; max-width: 540px; text-align: left; }
.story-index-list li { margin: 0 0 14px; }
.story-index-list a {
  display: block; padding: 18px 22px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--card); text-decoration: none; transition: border-color 0.3s ease, transform 0.3s ease;
}
.story-index-list a:hover { border-color: var(--gold); transform: translateY(-2px); }
.story-index-list .pn-label { display: block; margin-bottom: 4px; }
.story-index-list .pn-title { font-size: 1.35rem; }

/* Colophon — the hand-set note at the end of the book */
.colophon {
  max-width: 680px; margin: 0 auto; text-align: center;
  border-top: 3px double var(--gold); border-bottom: 1px solid var(--rule);
  padding: 34px 26px 30px;
}
.colophon .kicker { margin-bottom: 12px; }
.colophon p { color: var(--ink-soft); font-size: 1.06rem; margin: 0 0 12px; }
.colophon p:last-child { margin-bottom: 0; }
.colophon .colo-rule { display: flex; justify-content: center; margin: 18px 0 4px; }
.colophon .colo-rule svg { width: 120px; height: 16px; }
.colophon .colo-rule line { stroke: #b39a55; stroke-width: 1; }
.colophon .colo-rule .dia { fill: #a8842f; }

@media (prefers-reduced-motion: reduce) {
  .scene-divider svg, .scene .vignette { transform: none !important; }
}

/* ================= Qasas ul-Huda v3 — framed manuscript homepage ================= */

/* Centered nav, letterspaced links with diamond-dot separators */
.nav-centered .nav-inner { justify-content: flex-start; max-width: 1280px; }
.nav-centered .brand { display: inline-flex; align-items: center; margin-right: 48px; }
.nav-centered .brand img { display: block; }
.nav-centered .nav-links { display: flex; align-items: center; flex: 1; justify-content: space-evenly; margin: 0; padding: 0; list-style: none; }
.nav-centered .nav-links li { display: flex; align-items: center; }
.nav-centered .nav-links li + li::before {
  content: "\00B7"; color: var(--gold-deep); font-size: 1.3rem; margin: 0 14px; line-height: 1;
}
.nav-centered .nav-links a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.08rem; letter-spacing: 0.24em; text-indent: 0;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}

/* Hero v3 — gold title, flourish, wide framed banner */
.hero-v3 { text-align: center; padding: 70px 20px 30px; }
.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600;
  font-size: clamp(4rem, 15vw, 8.5rem);
  letter-spacing: 0.12em; text-indent: 0.12em; margin: 0; line-height: 1;
  background: linear-gradient(178deg, #d9b968 0%, #a8842f 45%, #7c5f22 70%, #c19a44 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero-v3 .hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  letter-spacing: 0.38em; text-indent: 0.38em; text-transform: uppercase;
  color: var(--ink); margin: 14px 0 0;
}
.flourish { margin: 22px auto 0; text-align: center; }
.flourish img { width: min(530px, 86%); height: auto; }
.banner-frame {
  max-width: 1240px; margin: 30px auto 0;
  border: 1px solid var(--gold-deep);
  box-shadow: 0 18px 50px var(--shadow);
  background: var(--card);
  padding: 0; line-height: 0;
}
.banner-frame img { display: block; width: 100%; height: auto; }

/* Three pillar cards */
.pillars { padding: 26px 0 10px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 8px; }
.pillar-card {
  background: var(--card);
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule); outline-offset: 4px;
  box-shadow: 0 12px 32px var(--shadow);
  padding: 26px 26px 28px; text-align: center;
}
.pillar-card .pillar-icon { height: 40px; width: auto; }
.pillar-card h3 { font-size: 1.65rem; margin: 16px 0 10px; }
.pillar-card p { margin: 0; color: var(--ink-soft); font-size: 1.06rem; }

/* Era strip — exact asset from the reference design */
.eras { padding: 30px 0 4px; }
.era-strip-img { max-width: 1240px; margin: 0 auto; }
.era-strip-img img { display: block; width: 100%; height: auto; }

/* Resources */
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 38px; }
.resource-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--gold-light);
  outline: 1px solid var(--rule); outline-offset: 4px;
  box-shadow: 0 12px 32px var(--shadow);
  padding: 32px 32px 34px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.resource-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px var(--shadow); color: inherit; }
.resource-card h3 { font-size: 1.8rem; margin: 0 0 8px; }
.resource-card p { margin: 0 0 14px; color: var(--ink-soft); }

/* v3 responsive */
@media (max-width: 900px) {
  .nav-centered .nav-inner { flex-direction: column; gap: 4px; padding-top: 12px; padding-bottom: 10px; }
  .nav-centered .brand { margin-right: 0; }
  .nav-centered .nav-links { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
  .nav-centered .nav-links li + li::before { margin: 0 8px; }
  .nav-centered .nav-links a { font-size: 0.95rem; letter-spacing: 0.18em; }
  .pillar-grid { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .resource-grid { grid-template-columns: 1fr; }
  .era-strip-img { overflow-x: auto; }
  .era-strip-img img { min-width: 640px; }
  .hero-v3 { padding-top: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .resource-card, .resource-card:hover { transform: none; }
}

/* ============================================================
   Homepage v4 — original illuminated cover (all artwork original)
   ============================================================ */

/* Nav emblem */
.nav-centered .brand img { width: 40px; height: 40px; border-radius: 50%; }

/* Night hero */
.hero-night { position: relative; overflow: hidden; background: #14100b; color: #f7f1e3; text-align: center; display: flex; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }
.hero-night-bg { position: absolute; inset: 0; }
.hero-night-bg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-night::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 8, 5, 0.55) 0%, rgba(10, 8, 5, 0.18) 34%, rgba(10, 8, 5, 0.22) 66%, rgba(10, 8, 5, 0.72) 100%);
}
.hero-night-inner { position: relative; z-index: 1; margin: auto; width: 100%; padding: 56px 20px 64px; }
.hero-emblem { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--gold-deep); box-sizing: border-box; box-shadow: 0 12px 44px rgba(0, 0, 0, 0.55); }
.hero-night-kicker {
  margin: 18px 0 0; font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  letter-spacing: 0.34em; text-indent: 0.34em; text-transform: uppercase;
  color: var(--gold-light);
}
.hero-night .hero-title { margin-top: 8px; font-size: clamp(3rem, 10.5vw, 6rem); }
.hero-night-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  letter-spacing: 0.38em; text-indent: 0.38em; text-transform: uppercase;
  color: #f2e9d2; margin: 12px 0 0;
}
.hero-night-lede {
  max-width: 640px; margin: 16px auto 0;
  font-size: 1.12rem; line-height: 1.7; color: #e7dcc0;
}
.hero-night-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-night-ctas .btn { margin-top: 24px; min-height: 48px; padding: 10px 32px; font-size: 1.12rem; }
.btn-ghost {
  background: transparent; border: 1px solid var(--gold-light);
  color: var(--gold-light); box-shadow: none;
}
.btn-ghost:hover { background: rgba(217, 189, 118, 0.14); color: #fffdf6; box-shadow: none; }
.hero-night-scroll { position: absolute; z-index: 1; left: 50%; bottom: 18px; transform: translateX(-50%); }
.hero-night-scroll i {
  display: block; width: 9px; height: 9px;
  border-right: 1px solid var(--gold-light); border-bottom: 1px solid var(--gold-light);
  transform: rotate(45deg); opacity: 0.85;
}

/* Home flourish divider */
.flourish-home { margin: 34px auto 6px; }
.flourish-home img { width: min(640px, 90%); }

/* Verse callout */
.verse-callout-sec { padding: 14px 0 0; }
.verse-callout {
  max-width: 880px; margin: 0 auto; padding: 48px 44px 42px; text-align: center;
  background: #1d1610; color: #f1e8d2;
  border: 1px solid var(--gold-deep);
  outline: 1px solid var(--rule); outline-offset: 5px;
  box-shadow: 0 18px 50px var(--shadow);
}
.verse-callout blockquote { margin: 0; padding: 0; }
.vc-emblem { width: 54px; height: 54px; border-radius: 50%; margin-bottom: 4px; }
.vc-ar { font-family: 'Amiri', serif; font-size: 1.65rem; line-height: 2.15; margin: 12px 0 20px; }
.vc-en {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.32rem; line-height: 1.7; color: #e3d4b1; margin: 0;
}
.verse-callout figcaption {
  margin-top: 22px; font-size: 0.95rem;
  letter-spacing: 0.28em; text-indent: 0.28em; text-transform: uppercase;
  color: var(--gold-light);
}

/* Era journey — seven stations */
.era-journey {
  position: relative; display: flex; justify-content: space-between;
  max-width: 1080px; margin: 46px auto 0; padding: 0 12px;
}
.era-journey::before {
  content: ""; position: absolute; top: 26px; left: 56px; right: 56px;
  height: 1px; background: var(--gold-light); opacity: 0.65;
}
.era-station { position: relative; z-index: 1; flex: 1; text-align: center; }
.era-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--gold-deep);
  color: var(--gold-deep); font-family: 'Cormorant Garamond', serif; font-size: 1.05rem;
}
.era-name {
  display: block; margin-top: 12px; font-size: 1rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}

/* v4 responsive */
@media (max-width: 900px) {
  .hero-night-inner { padding: 48px 20px 60px; }
  .hero-emblem { width: 76px; height: 76px; }
  .verse-callout { padding: 38px 26px 34px; }
  .vc-ar { font-size: 1.4rem; }
  .era-journey { overflow-x: auto; justify-content: flex-start; }
  .era-journey::before { left: 30px; right: 30px; }
  .era-station { min-width: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-night-scroll i { animation: none; }
}
