/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Design tokens --- */
:root {
  --navy: #0E2748;
  --navy-light: #1A3A63;
  --brass: #C9A24A;
  --brass-light: #DDB865;
  --cream: #FBF7EE;
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #5A5A5A;
  --border: rgba(14, 39, 72, 0.12);
  --border-on-navy: rgba(201, 162, 74, 0.28);
  --shadow-sm: 0 2px 8px rgba(14, 39, 72, 0.08);
  --shadow-md: 0 8px 24px rgba(14, 39, 72, 0.12);
  --shadow-lg: 0 20px 48px rgba(14, 39, 72, 0.18);

  --font-display: 'EB Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --font-arabic: 'Scheherazade New', 'Amiri', 'Lateef', serif;

  --container: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-pad: clamp(64px, 9vw, 120px);
}

/* --- Body + typography --- */
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { font-size: 1.0625rem; }
p.lead { font-size: 1.1875rem; color: var(--muted); }
em, i { font-style: italic; }

/* --- Layout primitives --- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-pad); }
.section--navy { background: var(--navy); color: var(--cream); }
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--cream); }
.section--navy p { color: rgba(251, 247, 238, 0.85); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 4px;
  font-family: var(--font-body); font-weight: 500; font-size: 1rem;
  letter-spacing: 0.01em; text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}
.btn--primary { background: var(--brass); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brass-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--brass); border: 1.5px solid var(--brass); }
.btn--ghost:hover { background: var(--brass); color: var(--navy); transform: translateY(-2px); }

/* --- Links --- */
a.inline-link { position: relative; color: var(--brass); }
a.inline-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 200ms ease;
}
a.inline-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* --- Accessibility --- */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 39, 72, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-on-navy);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 14px;
}
.nav__brand {
  font-family: var(--font-display); font-size: 1.25rem; color: var(--cream);
  letter-spacing: 0.01em;
}
.nav__brand em { color: var(--brass); font-style: italic; }
.nav__cta { padding: 10px 20px; font-size: 0.9375rem; }
@media (max-width: 540px) {
  .nav__brand { font-size: 1.0625rem; }
  .nav__cta { padding: 8px 14px; font-size: 0.875rem; }
}

/* --- Hero --- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 55% 60% at 72% 48%, rgba(201, 162, 74, 0.22), rgba(201, 162, 74, 0) 65%),
    linear-gradient(180deg, #0A1F3C 0%, #1A3A63 100%);
  color: var(--cream);
  min-height: calc(100vh - 60px);
  display: flex; align-items: center;
  overflow: hidden;
  padding-block: clamp(80px, 12vw, 160px);
  border-bottom: 1px solid var(--border-on-navy);
}
.hero .lead { color: rgba(251, 247, 238, 0.82); }
@media (max-width: 880px) {
  .hero {
    background:
      radial-gradient(ellipse 72% 42% at 50% 28%, rgba(201, 162, 74, 0.22), rgba(201, 162, 74, 0) 68%),
      linear-gradient(180deg, #0A1F3C 0%, #1A3A63 100%);
  }
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__visual { order: -1; }
}
.hero__bismillah {
  font-family: var(--font-display); font-style: italic;
  color: var(--brass); font-size: 1rem; margin-bottom: 24px;
}
.hero h1 { margin-bottom: 24px; }
.hero h1 .accent { color: var(--brass); }
.hero .lead { max-width: 48ch; margin-inline: auto; margin-bottom: 36px; }
@media (min-width: 881px) { .hero .lead { margin-inline: 0; } }
.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 880px) { .hero__cta { justify-content: center; } }
.hero__visual { display: flex; justify-content: center; perspective: 1200px; }
.hero__cover {
  max-width: 320px; width: 100%;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
  transform-style: preserve-3d;
  transition: transform 200ms ease-out;
  will-change: transform;
}

/* --- Section heads --- */
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__head--centered { margin-inline: auto; text-align: center; }
.section__head h2 { margin-bottom: 16px; }
.section__head .lead { color: var(--muted); }
.section--navy .section__head .lead { color: rgba(251, 247, 238, 0.78); }
.accent { color: var(--brass); }

/* --- Card grid (used by Challenge §3 and Why Support §7) --- */
.cards { display: grid; gap: 24px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .cards--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .cards--3, .cards--2 { grid-template-columns: 1fr; }
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brass); }
.card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brass); background: rgba(201, 162, 74, 0.1);
  border-radius: 8px; margin-bottom: 20px;
}
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

/* --- Sample spread (§4) --- */
.sample-spread {
  max-width: 960px; margin: 0 auto 64px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.sample-spread__trigger {
  display: block; padding: 0; border-radius: 6px;
  transition: transform 240ms ease, filter 240ms ease;
  cursor: zoom-in;
}
.sample-spread__trigger:hover { transform: translateY(-4px); }
.sample-spread__trigger:hover .sample-spread__pages { filter: brightness(1.04); }
.sample-spread__pages {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.45));
  transition: filter 240ms ease;
}
.sample-spread__pages img {
  width: 100%; height: auto; border-radius: 4px;
  background: var(--cream);
}
.sample-spread figcaption {
  font-family: var(--font-display); font-style: italic;
  color: rgba(251, 247, 238, 0.65); font-size: 0.9375rem;
}
.sample-spread figcaption em {
  color: var(--brass); font-style: italic;
}
@media (max-width: 640px) {
  .sample-spread__pages { grid-template-columns: 1fr; gap: 16px; }
}

/* --- Lightbox --- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 39, 72, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  transition: opacity 220ms ease;
}
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox__close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(251, 247, 238, 0.08);
  color: var(--cream); font-size: 1.75rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 160ms ease, transform 160ms ease;
}
.lightbox__close:hover { background: var(--brass); color: var(--navy); transform: scale(1.05); }
.lightbox__content {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px);
  max-width: 100%; max-height: 100%;
}
.lightbox__content img {
  max-height: calc(100vh - 96px);
  width: auto; max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  background: var(--cream);
}
@media (max-width: 820px) {
  .lightbox__content { grid-template-columns: 1fr; overflow-y: auto; }
  .lightbox__content img { max-height: none; max-width: calc(100vw - 48px); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
  .sample-spread__trigger, .sample-spread__pages { transition: none; }
  .sample-spread__trigger:hover { transform: none; }
}

/* --- Feature list (plain, no card border) --- */
.book__features { margin-top: 16px; }
.feature {
  padding: 24px 0;
  border-top: 1px solid var(--border-on-navy);
}
.feature h3 { color: var(--brass); font-size: 1.125rem; margin-bottom: 8px; font-weight: 500; }
.feature p { color: rgba(251, 247, 238, 0.8); font-size: 0.9375rem; }

/* --- Progress --- */
.progress__grid {
  display: grid; grid-template-columns: auto 1fr; gap: 64px;
  align-items: center; margin-bottom: 72px;
}
@media (max-width: 760px) {
  .progress__grid { grid-template-columns: 1fr; gap: 48px; }
}
.progress__ring-wrap { text-align: center; }
.progress__ring-figure {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.progress-ring { display: block; }
.progress__ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.1;
  pointer-events: none;
}
.progress__ring-text strong {
  font-family: var(--font-display); font-size: 2.25rem; color: var(--navy);
}
.progress__ring-text span {
  font-size: 0.875rem; color: var(--muted); letter-spacing: 0.02em;
}
.progress__verse { margin-top: 24px; font-size: 1.0625rem; color: var(--ink); }
.progress__verse strong { font-family: var(--font-display); color: var(--brass); font-size: 1.125rem; }
.progress__updated { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }

/* --- Timeline --- */
.timeline__title { font-size: 1.25rem; margin-bottom: 24px; }
.timeline__list { border-left: 2px solid var(--border); padding-left: 24px; }
.timeline__list li {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: baseline; padding: 16px 0; position: relative;
  border-bottom: 1px solid var(--border);
}
.timeline__list li:last-child { border-bottom: none; }
.timeline__dot {
  position: absolute; left: -32px; top: 22px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brass); box-shadow: 0 0 0 4px var(--cream);
}
.timeline__stage { font-family: var(--font-display); font-size: 1.125rem; color: var(--navy); }
.timeline__dates { font-size: 0.9375rem; color: var(--muted); white-space: nowrap; }
.timeline__launch .timeline__stage { color: var(--brass); font-weight: 500; }
.timeline__launch .timeline__dot { width: 16px; height: 16px; left: -34px; }

/* --- Latest verse card --- */
.latest-verse {
  max-width: 760px; margin: 0 auto 48px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 48px);
  text-align: center;
  position: relative;
}
.latest-verse::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 72px; height: 2px; background: var(--brass);
  border-radius: 0 0 2px 2px;
}
.latest-verse__label {
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brass); font-weight: 500;
  margin-bottom: 28px;
}
.latest-verse__arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 2;
  color: var(--navy);
  margin-bottom: 24px;
  font-weight: 400;
  direction: rtl;
}
.latest-verse__ref {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 20px;
}
.latest-verse__ref strong {
  color: var(--brass); font-weight: 500; font-style: normal;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}
.latest-verse__english {
  font-family: var(--font-display); font-style: italic;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 52ch; margin: 0 auto;
}

/* --- Funds --- */
.funds {
  max-width: 760px; margin: 0 auto; padding: 32px;
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
}
.funds__bar {
  height: 12px; background: var(--border); border-radius: 6px; overflow: hidden;
  margin-bottom: 20px;
}
.funds__fill {
  height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-light));
  border-radius: 6px;
}
.funds__labels p { font-size: 1.0625rem; }
.funds__labels p strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--navy); }
.funds__gap { color: var(--muted); margin-top: 4px; font-size: 0.9375rem; }

/* --- Team --- */
.team__grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px;
  margin-bottom: 64px;
}
@media (max-width: 880px) { .team__grid { grid-template-columns: 1fr; gap: 48px; } }
.team__intro h3, .team__tafsirs h3 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--brass); margin-bottom: 20px; font-weight: 500; font-family: var(--font-body);
}
.team__intro p { margin-bottom: 16px; max-width: 40ch; }
.team__intro p strong { color: var(--brass); font-weight: 500; }
.tafsirs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px;
}
@media (max-width: 560px) { .tafsirs { grid-template-columns: 1fr; } }
.tafsirs li { display: flex; flex-direction: column; }
.tafsirs em {
  font-family: var(--font-display); font-size: 1.125rem; color: var(--cream);
}
.tafsirs span {
  font-size: 0.875rem; color: rgba(251, 247, 238, 0.6); margin-top: 2px;
}
.team__roles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  padding-top: 48px; border-top: 1px solid var(--border-on-navy);
}
@media (max-width: 760px) { .team__roles { grid-template-columns: 1fr; } }
.role h4 {
  font-family: var(--font-display); font-size: 1.25rem; color: var(--brass);
  margin-bottom: 8px; font-weight: 500;
}
.role p { font-size: 0.9375rem; color: rgba(251, 247, 238, 0.8); }

/* --- Why support --- */
.why__cards .card h3 { color: var(--navy); }

/* --- How to support --- */
.support__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 760px) { .support__grid { grid-template-columns: 1fr; } }
.donate-card {
  background: var(--navy-light); border: 1px solid var(--border-on-navy);
  border-radius: 8px; padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform 220ms ease, border-color 220ms ease;
}
.donate-card:hover { transform: translateY(-2px); border-color: var(--brass); }
.donate-card h3 { color: var(--brass); font-size: 1.375rem; }
.donate-card p { color: rgba(251, 247, 238, 0.85); font-size: 0.9375rem; flex: 1; }
.donate-card .btn { align-self: flex-start; }
.bank { display: flex; flex-direction: column; gap: 6px; }
.bank > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: baseline; }
.bank dt {
  font-size: 0.8125rem; color: rgba(251, 247, 238, 0.6);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.bank dd { font-family: var(--font-mono); font-size: 0.9375rem; }
.bank button.copy {
  color: var(--cream); text-align: left;
  padding: 4px 6px; margin: -4px -6px; border-radius: 4px;
  transition: background 150ms ease;
  font-family: inherit;
}
.bank button.copy:hover { background: rgba(201, 162, 74, 0.15); }
.bank button.copy.copied { background: var(--brass); color: var(--navy); }
.donate-card__note {
  font-size: 0.8125rem; color: rgba(251, 247, 238, 0.65);
  margin-top: 4px;
}
.support__footnote {
  text-align: center; font-size: 0.875rem;
  color: rgba(251, 247, 238, 0.6); max-width: 720px;
  margin: 24px auto 0;
}

/* --- Footer --- */
.footer { background: var(--cream); padding-block: 56px; border-top: 1px solid var(--border); }
.footer__inner { text-align: center; }
.footer__bismillah {
  font-family: var(--font-display); font-size: 1.25rem;
  color: var(--navy); margin-bottom: 12px;
}
.footer__small { font-size: 0.8125rem; color: var(--muted); }

/* --- Reveal on scroll --- */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
