/* Iqra Scroll website — shared styles. "Mushaf" palette from design/DESIGN.md and app/src/theme.ts:
   paper, ink, one cobalt accent; night follows the device.
   No third-party requests: system fonts for UI and serif, Scheherazade New (SIL OFL) self-hosted for Arabic. */
@font-face { font-family: "Scheherazade New"; src: url("assets/fonts/ScheherazadeNew-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --paper: #F6F2E9;
  --paper-raised: #FFFDF8;
  --paper-sunk: #EFE9DC;
  --ink: #1B1A17;
  --ink-dim: #5E594F;
  --ink-faint: #9A9385;
  --rule: rgba(27, 26, 23, 0.12);
  --accent: #2A4A9A;
  --accent-soft: rgba(42, 74, 154, 0.10);
  --on-accent: #FFFFFF;
  --danger: #B3261E;
  --header: rgba(246, 242, 233, 0.86);
  --frame: #1B1A17;
  --shadow: 0 30px 80px -30px rgba(27, 26, 23, 0.35), 0 8px 24px -12px rgba(27, 26, 23, 0.18);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1120px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-raised: #1C1B19;
    --paper-sunk: #181715;
    --ink: #ECE6DA;
    --ink-dim: #ABA496;
    --ink-faint: #6F695E;
    --rule: rgba(236, 230, 218, 0.12);
    --accent: #9DB2EA;
    --accent-soft: rgba(157, 178, 234, 0.14);
    --on-accent: #0E1422;
    --danger: #F2B8B5;
    --header: rgba(18, 17, 16, 0.86);
    --frame: #2C2A27;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.arabic { font-family: "Scheherazade New", "Amiri Quran", serif; direction: rtl; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--header); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--ink-dim); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .hide-sm { display: none; }

/* Type */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
h1 { font-size: clamp(40px, 10vw, 72px); line-height: 1.04; margin: 0 0 20px; }
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(30px, 6.4vw, 46px); line-height: 1.1; margin: 0 0 14px; }
.kicker { color: var(--accent); font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.lede { color: var(--ink-dim); font-size: 19px; line-height: 1.55; margin: 0 0 28px; max-width: 30em; }
.fine { font-size: 14px; color: var(--ink-faint); margin: 14px 0 0; max-width: 34em; }

/* Store badge (placeholder until the App Store link exists) */
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 22px 10px 18px; min-height: 56px;
  border-radius: 14px; color: var(--paper); background: var(--ink); text-decoration: none;
}
.store-badge:hover { color: var(--paper); opacity: 0.9; }
.store-badge svg { width: 26px; height: 26px; fill: currentColor; }
.store-badge small { display: block; font-size: 12px; opacity: 0.75; line-height: 1.2; }
.store-badge strong { display: block; font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

/* iPhone frame around a real screenshot (1206 × 2622 → ratio 0.46) */
.phone {
  position: relative; width: min(300px, 74vw); aspect-ratio: 1206 / 2622; flex: none;
  border-radius: 15% / 7%; padding: 3.2%; background: var(--frame); box-shadow: var(--shadow);
}
.phone::before { /* side button */
  content: ""; position: absolute; right: -3px; top: 24%; width: 3px; height: 11%; border-radius: 0 3px 3px 0; background: var(--frame);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 12.4% / 5.7%; background: var(--paper); }
.phone .island { position: absolute; top: 3.9%; left: 50%; width: 30%; height: 3.6%; transform: translateX(-50%); border-radius: 999px; background: #000; }
.phone.sm { width: min(240px, 60vw); }

/* Hero */
.hero { padding-top: 44px; padding-bottom: 64px; display: grid; gap: 48px; align-items: center; }
.hero-art { position: relative; display: flex; justify-content: center; padding: 8px 0 0; }
.hero-art .phone.back { display: none; }
.hero-ayah { margin: 34px 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); max-width: 30em; }
.hero-ayah .ar { font-size: 28px; line-height: 1.9; margin: 0; color: var(--ink); text-align: right; }
.hero-ayah .en { font-family: var(--serif); font-size: 17px; color: var(--ink-dim); margin: 6px 0 0; }
.hero-ayah .ref { font-size: 13px; color: var(--ink-faint); margin: 4px 0 0; }

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--rule); }
.section-lede { color: var(--ink-dim); font-size: 18px; margin: 0 0 8px; max-width: 34em; }

/* Feature rows: text + real screenshot, alternating on wide screens */
.feature { display: grid; gap: 36px; align-items: center; padding: 56px 0; }
.feature + .feature { border-top: 1px solid var(--rule); }
.feature .copy { max-width: 30em; }
.feature h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 5vw, 34px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.feature p { color: var(--ink-dim); margin: 0 0 14px; }
.feature ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.feature li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; color: var(--ink-dim); font-size: 16px; }
.feature li::before { content: ""; width: 7px; height: 7px; margin-top: 10px; border-radius: 50%; background: var(--accent); }
.feature .art { position: relative; display: flex; justify-content: center; }
.feature .dial {
  position: absolute; width: min(150px, 34vw); aspect-ratio: 1; right: -4px; bottom: -4%;
  border-radius: 50%; box-shadow: var(--shadow); background: var(--paper-raised);
}
.feature .dial img { width: 100%; height: 100%; border-radius: 50%; }

/* Numbers strip */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 20px; margin: 40px 0 0; padding: 0; list-style: none; }
.facts li { border-top: 1px solid var(--rule); padding-top: 14px; }
.facts b { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; color: var(--ink); }
.facts span { color: var(--ink-dim); font-size: 15px; }

/* Trial */
.panel { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 28px 24px; }
.timeline { list-style: none; margin: 24px 0 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--rule); }
.timeline b { color: var(--accent); font-size: 15px; font-weight: 600; }
.timeline span { color: var(--ink-dim); font-size: 16px; }

/* Sources */
.sources { display: grid; gap: 0; margin: 28px 0 0; padding: 0; list-style: none; }
.sources li { padding: 16px 0; border-top: 1px solid var(--rule); color: var(--ink-dim); font-size: 16px; }
.sources b { color: var(--ink); font-weight: 600; }

/* FAQ / support */
details { border-bottom: 1px solid var(--rule); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { color: var(--ink-dim); margin: 10px 0 0; }
.faq { margin-top: 24px; border-top: 1px solid var(--rule); }

/* Closing call to action */
.closing { text-align: center; }
.closing .lede { margin-left: auto; margin-right: auto; }
.closing .arabic { font-size: 44px; line-height: 1.5; color: var(--accent); margin: 0 0 8px; }

/* Legal / docs pages */
.doc { padding-top: 40px; padding-bottom: 64px; max-width: 760px; }
.doc h1 { font-size: clamp(32px, 7vw, 44px); }
.doc h2 { font-size: 24px; margin-top: 40px; }
.doc h3 { font-size: 18px; font-weight: 600; margin-top: 24px; }
.doc p, .doc li { color: var(--ink-dim); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); color: var(--ink-dim); min-width: 140px; }
.doc th { color: var(--ink); font-weight: 600; }
.updated { color: var(--ink-faint); font-size: 14px; }
.draft { border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--ink); border-radius: var(--radius); padding: 14px 18px; font-size: 15px; margin: 0 0 24px; }
.placeholder { background: var(--accent-soft); color: var(--ink); padding: 0 4px; border-radius: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 36px 0 52px; color: var(--ink-faint); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 16px; }
.site-footer nav a { color: var(--ink-dim); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer p { margin: 6px 0; }

@media (min-width: 760px) {
  .nav .hide-sm { display: inline; }
  .hero { grid-template-columns: 1.1fr 0.9fr; padding-top: 88px; padding-bottom: 96px; }
  .hero-art { min-height: 640px; align-items: center; }
  .hero-art .phone.front { z-index: 1; transform: translateX(-12%); }
  .hero-art .phone.back { display: block; position: absolute; width: min(250px, 24vw); right: 0; top: 64px; transform: rotate(4deg); opacity: 0.98; }
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; padding: 80px 0; }
  .feature.flip .art { order: -1; }
  .feature .dial { right: calc(50% - 300px); bottom: -5%; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .panel { padding: 40px; }
  .sources { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}
