/* Hifz Quran — website styles.
   Brand teal from the app icon (#28ABC2), with warm gold as a secondary accent
   that ties back to the mushaf. Warm paper and deep-night grounds from the app's
   Theme.swift. Every color is a light/dark pair. Arabic is set in the app's own
   KFGQPC Uthmanic Hafs, so the mushaf on the page is the mushaf in the app. */

/* ---- fonts ---- */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-VF.ttf") format("truetype-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Italic-VF.ttf") format("truetype-variations");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
/* KFGQPC Uthmanic Hafs V22: the same Quran face the app renders.
   Free to use and distribute (King Fahd Complex terms). */
@font-face {
  font-family: "UthmanicHafs";
  src: url("fonts/UthmanicHafsV22.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---- the color vocabulary ---- */
:root {
  --paper:      #F7F8F6;
  --paperDeep:  #EFF1EC;
  --card:       #FFFEFA;
  --ink:        #22271F;
  --ink2:       #59614F;
  --muted:      #6B7464;   /* AA on paper / paperDeep / card */
  --line:       rgba(34, 39, 31, 0.10);
  --line2:      rgba(34, 39, 31, 0.16);

  --teal:       #28ABC2;   /* brand, for marks and decoration */
  --tealText:   #0E7C90;   /* AA for text, links, buttons on paper */
  --tealSoft:   rgba(40, 171, 194, 0.12);

  --gold:       #A87E2C;   /* warm secondary, decorative */
  --goldBright: #B98F33;
  --goldSoft:   rgba(176, 141, 62, 0.13);
  --crimson:    #A84B3F;

  --selection:  rgba(40, 171, 194, 0.16);
  --shadow:     rgba(30, 26, 15, 0.07);
  --shadow2:    rgba(30, 26, 15, 0.12);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ui:    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --quran: "UthmanicHafs", "Scheherazade New", "Noto Naskh Arabic", serif;

  --wrap: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14120D;
    --paperDeep:  #1B1812;
    --card:       #1B1812;
    --ink:        #E9E2D2;
    --ink2:       #B4AB98;
    --muted:      #8F887A;
    --line:       rgba(233, 226, 210, 0.11);
    --line2:      rgba(233, 226, 210, 0.17);

    --teal:       #3FC3DA;
    --tealText:   #57CCE1;
    --tealSoft:   rgba(63, 195, 218, 0.16);

    --gold:       #C9A85C;
    --goldBright: #D8B45E;
    --goldSoft:   rgba(201, 168, 92, 0.15);
    --crimson:    #D08B7B;

    --selection:  rgba(63, 195, 218, 0.20);
    --shadow:     rgba(0, 0, 0, 0.42);
    --shadow2:    rgba(0, 0, 0, 0.55);
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--selection); }

a { color: var(--tealText); text-decoration-color: var(--line2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(40px, 7.4vw, 68px); font-weight: 480; }
h2 { font-size: clamp(28px, 4.4vw, 41px); }
h3 { font-size: 21px; }

p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 2.3vw, 22px); color: var(--ink2); line-height: 1.6; }
.small { font-size: 15px; }
.muted { color: var(--muted); }

/* screen-reader-only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- the brand mark (open mushaf on a rehal, from the app icon) ---- */
.mark { width: 1em; height: 1em; display: inline-block; }

/* ---- wordmark ---- */
.wordmark {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--serif);
  font-weight: 520;
  font-size: 23px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .mark { width: 26px; height: 26px; }
.wordmark b { font-weight: 520; }
.wordmark .g { color: var(--tealText); font-style: italic; font-weight: 500; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  font-family: var(--ui); font-size: 15px; color: var(--ink2);
  text-decoration: none; letter-spacing: 0.01em;
}
.nav a:hover { color: var(--tealText); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ui); font-size: 16px; font-weight: 560;
  padding: 14px 24px; border-radius: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.btn-solid {
  color: #FFFFFF;
  background: #0E7C90;
  box-shadow: 0 10px 26px var(--shadow);
}
.btn-solid:hover { transform: translateY(-1px); }
.btn svg.appleglyph { width: 19px; height: 19px; }

/* ---- sections ---- */
section { padding: 88px 0; position: relative; }
.eyebrow {
  font-family: var(--ui); font-size: 13px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--tealText); margin: 0 0 15px; font-weight: 600;
}

/* slim rule with a small centred mark, used as a section divider */
.rule-mark {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 0 auto 44px; max-width: 240px;
}
.rule-mark::before, .rule-mark::after {
  content: ""; height: 1px; flex: 1; background: var(--line2);
}
.rule-mark .mark { width: 26px; height: 26px; opacity: .95; }

/* ---- hero ---- */
.hero { padding: 68px 0 44px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 52px; align-items: center; }
.hero h1 .soft { color: var(--gold); font-style: italic; }
.hero .lead { margin-top: 22px; max-width: 34ch; }
.hero .cta { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 32px; }
.hero .fine { margin-top: 16px; }

/* ---- the mushaf card in the hero (mirrors the app's page) ---- */
.mushaf {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 26px;
  box-shadow: 0 34px 70px var(--shadow2);
  padding: 26px 26px 30px;
  max-width: 440px; margin-left: auto;
}
.mushaf::before {
  content: ""; position: absolute; inset: 12px; border-radius: 16px;
  border: 1px solid var(--goldSoft); pointer-events: none;
}
.mushaf .surah-head {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 16px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.mushaf .surah-head .name { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink); }
.mushaf .surah-head .meta {
  font-family: var(--ui); font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.mushaf .lines { direction: rtl; text-align: center; padding: 16px 2px 6px; }
.mushaf .ayah {
  display: block; font-family: var(--quran); color: var(--ink);
  font-size: 29px; line-height: 2.15; font-weight: 400;
  padding: 8px 10px; border-radius: 13px; margin-bottom: 4px;
}
.mushaf .ayah.active { background: var(--selection); }
.mushaf .pending { color: var(--ink); opacity: 0.22; }
.ayah-end {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.34em; height: 1.34em; margin: 0 0.15em; vertical-align: -0.18em;
  font-family: var(--ui); font-size: 0.5em; color: var(--gold); font-weight: 700;
  border: 1.4px solid var(--gold); border-radius: 50%;
}
.mushaf .listen {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  font-family: var(--ui); font-size: 13.5px; color: var(--tealText); font-weight: 560;
}
.mushaf .listen .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--teal);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--tealSoft); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* a faint mark watermark behind the hero card */
.hero .halo {
  position: absolute; right: -4%; top: 50%; transform: translateY(-50%);
  width: 520px; opacity: 0.05; pointer-events: none; z-index: -1;
}

/* ---- steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 26px; box-shadow: 0 12px 32px var(--shadow); position: relative;
}
.step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-bottom: 16px;
  font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--gold);
  border: 1px solid var(--goldSoft); border-radius: 50%; background: var(--goldSoft);
}
.step h3 { margin-bottom: 7px; }
.step p { margin: 0; color: var(--ink2); font-size: 16px; }

/* ---- feature rows ---- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 36px; }
.feature { position: relative; padding-left: 2px; }
.feature .ico { width: 30px; height: 30px; color: var(--teal); margin-bottom: 13px; }
.feature .ico svg { width: 100%; height: 100%; display: block; stroke-width: 1.5; }
.feature h3 { margin-bottom: 7px; }
.feature p { color: var(--ink2); font-size: 16px; margin: 0; }
.feature .k {
  font-family: var(--ui); font-size: 12px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--tealText); margin-bottom: 9px; display: block; font-weight: 600;
}

/* ---- screenshot gallery ---- */
.shots-head { text-align: center; }
.shots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px 34px;
  max-width: 940px; margin: 0 auto; padding: 46px 0 0;
}
.shots figure { position: relative; margin: 0; }
.shots img {
  width: 100%; height: auto; display: block; aspect-ratio: 684 / 1486;
  border-radius: 30px; border: 1px solid var(--line2);
  box-shadow: 0 18px 44px var(--shadow2);
  transition: transform .35s cubic-bezier(.2,.85,.25,1);
}
.shots figure:hover img { transform: translateY(-6px); }
.shots figcaption {
  font-family: var(--ui); color: var(--muted); font-size: 14.5px; font-weight: 500;
  text-align: center; margin-top: 15px;
}
.shots figcaption b { display: block; font-family: var(--serif); font-style: italic;
  font-weight: 500; color: var(--ink); font-size: 18px; margin-bottom: 2px; }
.shots-hint { text-align: center; margin-top: 6px; }

/* ---- privacy pledge ---- */
.pledge {
  position: relative; overflow: hidden;
  background: var(--paperDeep); border: 1px solid var(--line);
  border-radius: 28px; padding: 56px 48px; text-align: center;
}
.pledge .halo {
  position: absolute; width: 240px; right: -50px; bottom: -60px;
  opacity: 0.06; pointer-events: none;
}
.pledge h2 { margin-bottom: 14px; }
.pledge p { color: var(--ink2); max-width: 640px; margin: 0 auto; position: relative; }
.pledge .chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px;
}
.pledge .chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ui); font-size: 14px; color: var(--ink2); font-weight: 500;
  border: 1px solid var(--line2); border-radius: 999px; padding: 7px 16px;
  background: var(--card);
}
.pledge .chip svg { width: 14px; height: 14px; color: var(--tealText); flex: 0 0 auto; }

/* ---- acknowledgements ---- */
.thanks { text-align: center; }
.thanks p { color: var(--ink2); max-width: 620px; margin: 0 auto 4px; }
.thanks .sources {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 22px;
}
.thanks .src {
  font-family: var(--ui); font-size: 13.5px; color: var(--muted); font-weight: 500;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
}

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 72px; background: var(--paperDeep); }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.foot-links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-links a { font-family: var(--ui); font-size: 15px; color: var(--ink2); text-decoration: none; }
.foot-links a:hover { color: var(--tealText); }
.foot-note { font-family: var(--ui); font-size: 13px; color: var(--muted); margin-top: 22px; }
.foot-ayah {
  font-family: var(--quran); direction: rtl; color: var(--gold); font-size: 22px;
  margin-top: 6px; opacity: 0.9;
}

/* ---- legal / content pages ---- */
.doc { max-width: 760px; margin: 0 auto; padding: 62px 24px 96px; position: relative; }
.doc h1 { margin-bottom: 8px; }
.doc .updated { font-family: var(--ui); font-size: 14px; color: var(--muted); margin-bottom: 40px; }
.doc h2 { font-size: 25px; margin: 42px 0 12px; }
.doc h3 { font-size: 19px; margin: 26px 0 8px; font-family: var(--serif); }
.doc p, .doc li { color: var(--ink2); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc a { word-break: break-word; }
.back {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--ui);
  font-size: 15px; color: var(--ink2); text-decoration: none; margin-bottom: 10px;
}
.back:hover { color: var(--tealText); }
.callout {
  position: relative;
  background: var(--paperDeep); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px; margin: 26px 0;
}
.callout::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 3px; background: var(--teal);
}
.callout p:last-child { margin-bottom: 0; }
.signoff {
  margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
}
.signoff .mark { width: 40px; height: 40px; flex: 0 0 auto; }
.signoff p { margin: 0; font-family: var(--serif); font-style: italic; color: var(--ink2); font-size: 20px; line-height: 1.35; }

/* ---- focus (a11y) ---- */
:focus-visible { outline: 2px solid var(--tealText); outline-offset: 3px; border-radius: 5px; }

/* ---- responsive ---- */
/* tablet: single-column hero, two-up features, tighter rhythm */
@media (max-width: 940px) {
  .hero { padding: 44px 0 28px; }
  .hero-grid { grid-template-columns: 1fr; gap: 38px; }
  .hero .lead { max-width: 48ch; }
  .mushaf { margin: 0 auto; }
  .hero .halo { display: none; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .features { grid-template-columns: 1fr 1fr; gap: 30px 34px; }
  section { padding: 64px 0; }
  .pledge { padding: 44px 34px; }
  .foot-grid { gap: 34px 40px; }
}
/* phone: one column throughout, full-width CTA, edge-to-edge carousel */
@media (max-width: 620px) {
  body { font-size: 17px; }
  .wrap { padding: 0 20px; }
  .hide-sm { display: none; }
  .site-header .bar { height: 58px; }
  .nav { gap: 20px; }
  .wordmark { font-size: 20px; gap: 9px; }
  .wordmark .mark { width: 22px; height: 22px; }

  .hero { padding: 22px 0 18px; }
  .hero .lead { max-width: none; margin-top: 18px; }
  .hero .cta { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 26px; }
  .hero .cta .btn { width: 100%; justify-content: center; padding: 15px 24px; }
  .hero .fine { text-align: center; }

  .mushaf { padding: 22px 20px 24px; border-radius: 22px; }
  .mushaf .ayah { font-size: 26px; line-height: 2.0; }

  .step { padding: 24px 22px; }
  .features { grid-template-columns: 1fr; gap: 26px; }
  section { padding: 52px 0; }

  .shots { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; padding: 30px 0 0; }

  .pledge { padding: 34px 22px; border-radius: 22px; }
  .pledge .chips { gap: 8px; }

  .foot-grid { flex-direction: column; gap: 28px; }

  .doc { padding: 44px 20px 72px; }
  .doc h2 { font-size: 22px; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 33px; }
  .wordmark { font-size: 19px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-solid:hover { transform: none; }
  .shots img { transition: none; }
  .shots figure:hover img { transform: none; }
  .mushaf .listen .dot { animation: none; }
}
