/* Iqra Scroll website — shared styles. "Mushaf" palette from design/DESIGN.md: paper, ink, one cobalt accent; night follows the device.
   No third-party requests: system fonts for UI and translation, 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: #FBF8F2;
  --ink: #1B1A17;
  --ink-dim: rgba(27, 26, 23, 0.68);
  --ink-faint: rgba(27, 26, 23, 0.48);
  --rule: rgba(27, 26, 23, 0.12);
  --accent: #2A4A9A;
  --accent-soft: rgba(42, 74, 154, 0.08);
  --on-accent: #FFFFFF;
  --danger: #B3402E;
  --header: rgba(246, 242, 233, 0.88);
  --phone-frame: #1B1A17;
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1080px;
  --serif: ui-serif, "New York", 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: #1C1A18;
    --ink: #ECE6DA;
    --ink-dim: rgba(236, 230, 218, 0.70);
    --ink-faint: rgba(236, 230, 218, 0.48);
    --rule: rgba(236, 230, 218, 0.14);
    --accent: #9DB2EA;
    --accent-soft: rgba(157, 178, 234, 0.12);
    --on-accent: #121110;
    --danger: #E39A8A;
    --header: rgba(18, 17, 16, 0.88);
    --phone-frame: #2A2826;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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 16px; }
.arabic { font-family: "Scheherazade New", "Amiri Quran", serif; direction: rtl; }
.ayah-mark { color: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--header); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); 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: 19px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { color: var(--ink-dim); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .hide-sm { display: none; }

/* Hero */
.hero { padding-top: 48px; padding-bottom: 24px; display: grid; gap: 40px; }
.eyebrow { color: var(--ink-dim); font-size: 15px; margin: 0 0 12px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 9vw, 60px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.01em; }
h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--ink-dim); font-size: 19px; margin: 0 0 28px; max-width: 34em; }

.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; min-height: 56px;
  border-radius: 14px; color: var(--on-accent); text-decoration: none; background: var(--accent);
}
.store-badge:hover { color: var(--on-accent); opacity: 0.92; }
.store-badge svg { width: 24px; height: 24px; fill: currentColor; }
.store-badge small { display: block; font-size: 12px; opacity: 0.8; line-height: 1.2; }
.store-badge strong { display: block; font-size: 18px; font-weight: 600; line-height: 1.2; }
.fine { font-size: 14px; color: var(--ink-faint); margin: 14px 0 0; max-width: 32em; }

/* Phone mock — mirrors the paper feed screen */
.phone {
  width: min(300px, 80vw); aspect-ratio: 9 / 19.5; margin: 0 auto; border-radius: 44px; padding: 10px;
  background: var(--phone-frame); box-shadow: 0 24px 60px rgba(27, 26, 23, 0.18);
}
.screen {
  position: relative; height: 100%; border-radius: 35px; overflow: hidden; padding: 64px 22px 96px;
  background: var(--paper); display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.screen .chip { position: absolute; top: 18px; left: 16px; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; }
.screen .chip span { color: var(--ink-faint); font-weight: 400; }
.screen .ar { font-size: 26px; line-height: 2.0; text-align: center; color: var(--ink); margin: 0; }
.screen .en { font-family: var(--serif); font-size: 14px; line-height: 1.55; text-align: center; color: var(--ink-dim); margin: 0; }
.screen .ref { font-size: 11px; text-align: center; color: var(--ink-faint); margin: 0; }
.screen .controls { position: absolute; left: 0; right: 0; bottom: 64px; display: flex; justify-content: center; gap: 12px; }
.screen .controls span { width: 30px; height: 30px; border-radius: 50%; background: var(--paper-raised); border: 1px solid var(--rule); }
.screen .tabs { position: absolute; left: 34px; right: 34px; bottom: 16px; height: 36px; border-radius: 999px; background: var(--paper-raised); border: 1px solid var(--rule); }
.screen .tabs i { position: absolute; left: 4px; top: 4px; bottom: 4px; width: 25%; border-radius: 999px; background: var(--accent-soft); }

/* Sections */
section { padding: 56px 0; border-top: 1px solid var(--rule); }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6vw, 38px); line-height: 1.2; margin: 0 0 12px; }
.section-lede { color: var(--ink-dim); margin: 0 0 32px; max-width: 38em; }
.grid { display: grid; gap: 28px 40px; }
.card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.card p { margin: 0; color: var(--ink-dim); font-size: 16px; }
.card .ico { margin-bottom: 10px; }
.card .ico svg { width: 26px; height: 26px; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 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 { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sources li { padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--ink-dim); font-size: 16px; }
.sources b { color: var(--ink); font-weight: 600; }

details { border-bottom: 1px solid var(--rule); padding: 16px 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; }

/* 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: 32px 0 48px; color: var(--ink-faint); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.site-footer nav a { color: var(--ink-dim); text-decoration: none; }
.site-footer p { margin: 6px 0; }

@media (min-width: 720px) {
  .nav .hide-sm { display: inline; }
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-top: 80px; padding-bottom: 56px; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .sources { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}
