/* Quran Scroller — marketing and legal site.
   One stylesheet, no JavaScript, no third-party requests.
   Colours are the app's DesignSystem tokens (dark appearance):
   Packages/ScrollKit/Sources/DesignSystem/Tokens.swift */

/* Source Serif 4 (SIL OFL 1.1), subset to Latin and renamed per OFL clause 3.
   Licence: assets/fonts/LICENSE-SourceSerif4.md */
@font-face {
  font-family: "Scroll Serif";
  src: url("fonts/scroll-serif-var.woff") format("woff-variations"),
       url("fonts/scroll-serif-var.woff") format("woff");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --bg-raised: #0f0f11;
  --card: #1e1e23;
  --chip: #303035;
  --divider: #38383b;
  --text: #ffffff;
  --text-secondary: #999999;
  --text-tertiary: #9a9a9e;
  --flame-top: #fd8d32;
  --flame-bottom: #e7533d;
  --green: #30d158;

  --serif: "Scroll Serif", "Source Serif 4", "Iowan Old Style", Georgia,
    "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --measure: 42rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration-color: var(--flame-top);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--text);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 2.5rem 0;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose {
  max-width: var(--measure);
}

/* ---------- header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 6vw, 4rem);
  background:
    radial-gradient(120% 90% at 50% 0%, #241d16 0%, rgba(36, 29, 22, 0) 60%),
    var(--bg);
  text-align: center;
}

.hero img.icon {
  width: 92px;
  height: 92px;
  border-radius: 21px;
  margin: 0 auto 1.75rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
}

.hero p.pitch {
  font-size: clamp(1.0625rem, 2.4vw, 1.3125rem);
  color: var(--text-secondary);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.hero p.pitch.verse {
  margin-bottom: 2.25rem;
}

.hero p.pitch.verse small {
  display: block;
  margin-top: 0.375rem;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  margin: 0 0 0.75rem;
}

.muted {
  color: var(--text-secondary);
}

.arabic {
  font-size: 1.5rem;
  color: var(--text-tertiary);
  direction: rtl;
  margin: 0 0 0.5rem;
  line-height: 1.9;
}

/* App Store badge placeholder — swapped for Apple's official badge on release. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.375rem;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.badge small {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge[aria-disabled="true"] {
  opacity: 0.75;
  cursor: default;
}

/*
 * Reserved for the real Apple badge (see the commented swap point in index.html).
 * Apple's guidelines require clear space around the artwork and forbid recoloring,
 * resizing disproportionately, or adding chrome (border/background/shadow/filter) to
 * it — so this rule only reserves that clear space via margin and lets the <img>
 * render at its own intrinsic proportions. Unused until the swap point is uncommented.
 */
.app-store-badge {
  display: inline-block;
  margin: 0.5rem;
  line-height: 0;
}

/* ---------- shots ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1.25rem, 4vw, 2.5rem);
  padding: clamp(2rem, 6vw, 4rem) 0;
}

.shot figcaption {
  margin-top: 0.875rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-align: center;
}

.shot img {
  border-radius: 18px;
  border: 1px solid var(--divider);
}

/* ---------- feature list ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  padding-bottom: clamp(2rem, 6vw, 4rem);
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.features li {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 1.5rem;
}

.features h3 {
  font-family: var(--serif);
  font-size: 1.1875rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.features p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ---------- document pages ---------- */

.doc {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 1rem;
}

.doc h1 {
  font-size: clamp(1.875rem, 5vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.doc .updated {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  margin: 0 0 2.5rem;
}

.doc h2 {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2.75rem 0 0.75rem;
  letter-spacing: -0.005em;
}

.doc h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 1.75rem 0 0.375rem;
}

.doc p,
.doc li {
  color: #d6d6d9;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li {
  margin-bottom: 0.4rem;
}

.callout {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout .lede {
  font-family: var(--serif);
  font-size: 1.1875rem;
  color: var(--text);
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9375rem;
}

.price-table th,
.price-table td {
  text-align: left;
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

.price-table th {
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.faq h2 {
  font-size: 1.1875rem;
  margin-top: 2rem;
}

.contact-card {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 0;
}

.contact-card .label {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--divider);
  margin-top: clamp(3rem, 8vw, 5rem);
  padding: 2rem 0 3rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.site-footer a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.attribution {
  margin: 1rem 0 0;
  max-width: var(--measure);
  line-height: 1.6;
}

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  background: var(--card);
  padding: 0.5rem 1rem;
  border-radius: 10px;
}

:focus-visible {
  outline: 2px solid var(--flame-top);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-header,
  .site-footer nav {
    display: none;
  }
  .doc p,
  .doc li {
    color: #000;
  }
}

/* --- At-a-glance stat strip ------------------------------------------- */
.stats {
  list-style: none;
  margin: 0 0 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  text-align: center;
}
.stats li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stats b {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stats span {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
@media (max-width: 34rem) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1.25rem; }
}

/* --- Closing pull quote ------------------------------------------------ */
.pullquote {
  margin: 3.5rem auto;
  padding: 0;
  max-width: var(--measure);
  text-align: center;
  border: 0;
}
.pullquote .arabic {
  font-size: clamp(1.3rem, 4.5vw, 1.8rem);
  color: var(--text-tertiary);
  margin: 0 0 0.9rem;
  line-height: 1.9;
}
.pullquote p:not(.arabic) {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 0.9rem;
  text-wrap: balance;
}
.pullquote cite {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* --- Closing call to action ------------------------------------------- */
.closing {
  text-align: center;
  padding: 0 0 4rem;
  border-top: 1px solid var(--divider);
  padding-top: 3rem;
}
.closing h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 500;
  margin: 0 0 0.6rem;
}
.closing .muted {
  margin: 0 auto;
  max-width: 32rem;
}

/* --- Nav call to action ------------------------------------------------ */
.nav-cta {
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 0.4em 0.95em;
  color: var(--text) !important;
  background: var(--card);
}
.nav-cta:hover { background: var(--chip); }

/* --- Two-column hero --------------------------------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  text-align: left;
}
.hero-grid .hero-copy > * { margin-left: 0; margin-right: 0; }
.hero-grid h1,
.hero-grid .pitch { text-align: left; }
.hero-grid .icon { margin: 0 0 1.25rem; }
.hero-art { display: flex; justify-content: center; }
.hero-art img {
  width: 100%;
  max-width: 19rem;
  height: auto;
  border-radius: 2rem;
  border: 1px solid var(--divider);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.75rem;
}
.btn-ghost {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--divider);
  padding-bottom: 2px;
}
.btn-ghost:hover { color: var(--text); }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-grid h1, .hero-grid .pitch { text-align: center; }
  .hero-grid .icon { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 14rem; }
}

/* --- Alternating feature blocks ---------------------------------------- */
.feature-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 0;
  border-top: 1px solid var(--divider);
}
.feature-block.reversed .feature-text { order: 2; }
.feature-block.reversed .feature-art { order: 1; }
.feature-text h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
.feature-text p {
  color: var(--text-secondary);
  margin: 0;
  max-width: 34rem;
}
.feature-art { margin: 0; display: flex; justify-content: center; }
.feature-art img {
  width: 100%;
  max-width: 15.5rem;
  height: auto;
  border-radius: 1.75rem;
  border: 1px solid var(--divider);
}
@media (max-width: 52rem) {
  .feature-block { grid-template-columns: 1fr; text-align: center; }
  .feature-block.reversed .feature-text,
  .feature-block.reversed .feature-art { order: initial; }
  .feature-text p { margin-inline: auto; }
  .feature-art img { max-width: 13rem; }
}
