/* Iqra — site styles. Mirrors the app's design tokens.
   Illuminated-manuscript palette: cream paper, deep emerald, gold leaf. */

:root {
  --paper:    #F7F2E8;
  --paper-2:  #EFE8D9;
  --ink:      #141814;
  --ink-2:    #2E362F;
  --muted:    #707C73;
  --faint:    #A8B0A4;
  --divider:  #DED9C9;
  --accent:   #0A6B43;
  --accent-soft: #D8ECE1;
  --cream:    #FBF7EF;
  --gold:     #C99E46;
  --bronze:   #946B3C;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1410;
    --paper-2: #141F18;
    --ink: #FBF7EF;
    --ink-2: #D8E4D9;
    --muted: #8AA08F;
    --faint: #5F7065;
    --divider: rgba(255,255,255,0.08);
    --cream: #141814;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; height: auto; display: block; }

/* ============================================================
   SINGLE-PAGE LAYOUT (index)
   Fits in 100vh, no scroll on common viewports
   ============================================================ */

body.single-page {
  overflow: hidden;
}

.stage {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px 28px 14px;
  gap: 8px;
}

/* Compact bar */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 14px;
  border-bottom: 1px solid var(--divider);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg, .brand img { width: 28px; height: 28px; }
.brand-wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.nav { display: flex; gap: 22px; font-size: 13px; }
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--accent); text-decoration: none; }

/* Hero grid: copy on left, phone on right */
.hero-wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-height: 0;       /* allow inner content to shrink */
}

.copy {
  min-width: 0;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.kicker::before {
  content: ''; width: 22px; height: 1px; background: var(--accent);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.02;
  letter-spacing: -1.5px;
  font-weight: 500;
  margin: 0 0 14px;
}
h1 em { color: var(--accent); font-style: italic; }

.lede {
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 17px);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 44ch;
}

.stats {
  display: flex;
  gap: 28px;
  margin: 0 0 24px;
}
.stats > div {
  display: flex; flex-direction: column;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.stats strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.6px;
  margin-bottom: 4px;
}
.stats span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-appstore {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px;
  background: var(--ink); color: var(--cream);
  font-weight: 600; font-size: 15px;
  transition: transform .18s ease;
}
.btn-appstore:hover { transform: translateY(-1px); text-decoration: none; }
.btn-appstore svg { width: 22px; height: 22px; fill: currentColor; }

.micro {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   iPhone mockup with card replica
   ============================================================ */

.phone {
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  height: 100%;
}

/* Size the phone by AVAILABLE HEIGHT so it never overflows the
   viewport. Width auto-derives from the 9:19.5 aspect ratio. */
.phone-frame {
  position: relative;
  height: clamp(420px, 70vh, 620px);
  aspect-ratio: 9 / 19.5;
  background: var(--ink);
  border-radius: 36px;
  padding: 8px;
  box-shadow:
    0 24px 48px -16px rgba(27, 22, 18, 0.40),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  border: 1.5px solid #0a0a0a;
}

.phone-screen {
  position: relative;
  background: var(--paper);
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* The app's own screen, edge to edge inside the frame */
.phone-shot { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Tiny footer */
.footline {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 2px;
}
.footline .dot { color: var(--faint); }
.footline a { color: var(--muted); }
.footline a:hover { color: var(--ink); text-decoration: none; }

/* Smaller screens: stack copy above phone with no scroll if possible */
@media (max-width: 760px) {
  body.single-page { overflow: auto; }   /* allow scroll on phones */
  .stage { padding: 14px 18px; height: auto; min-height: 100dvh; }
  .hero-wrap { grid-template-columns: 1fr; gap: 28px; }
  .phone-frame { width: min(260px, 70vw); margin: 0 auto; }
  .stats { flex-wrap: wrap; }
}

/* ============================================================
   DOC PAGES — privacy / terms
   ============================================================ */

.site-header {
  padding: 22px 0;
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--divider);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.cta-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--cream);
  padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px;
  transition: transform .18s ease;
}
.cta-pill:hover { transform: translateY(-1px); text-decoration: none; }

.doc {
  padding: 60px 0 96px;
  max-width: 760px;
  margin: 0 auto;
}
.doc h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -1.4px;
  line-height: 1.05;
  margin: 0 0 8px;
}
.doc .updated {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 36px;
}
.doc h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 40px 0 12px;
}
.doc h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 22px 0 8px;
}
.doc p, .doc li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}
.doc strong { color: var(--ink); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--cream);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--divider);
}
.doc .callout {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  padding: 16px 18px;
  border-radius: 8px;
  margin: 20px 0;
}
.doc .callout strong { display: block; font-family: var(--serif); font-size: 17px; margin-bottom: 4px; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}
.doc th, .doc td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.doc th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer {
  padding: 40px 0 56px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--divider);
}
.site-footer .container {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.site-footer .links a { color: var(--muted); margin-left: 18px; }
.site-footer .links a:hover { color: var(--ink); text-decoration: none; }

/* The invitation page for a khatm circle. */
.join .code { font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 28px; letter-spacing: 0.18em; }
.join .btn-appstore { display: inline-flex; }
