/* WirdFirst website. Tokens are the app's own (see .superpowers/sdd/design-plan-final.json):
   logo green, a 2% green canvas, flat tone instead of shadows, one green fill per view,
   gold only on the ribbon's fold. Readex Pro is the only face, as in the app. */

@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/readex-400-arabic.woff") format("woff");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/readex-500-arabic.woff") format("woff");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/readex-600-arabic.woff") format("woff");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/readex-400-latin.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/readex-500-latin.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/readex-600-latin.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  color-scheme: light dark;
  --canvas: #F3F5F4;
  --surface: #FFFFFF;
  --ink: #15201C;
  --muted: #5E6A65;
  --green: #114A40;
  --green-text: #114A40;
  --on-green: #FFFFFF;
  --line: #DDE3E0;
  --fill: #E7ECEA;
  --warn: #8A5A00;
  /* The Mushaf page: white in light, pure black in dark, as on the app's werd screen. */
  --page: #FFFFFF;
  /* Boxes set into the white install section. */
  --well: #F3F5F4;
  /* The ribbon is the app's bookmark: logo colours in light, the app's dark-mode pair in dark. */
  --ribbon: #114A40;
  --ribbon-fold: #A47A2C;
  --track: #DDE3E0;

  --gutter: 20px;
  --measure: 34rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000000;
    --surface: #151D1A;
    --ink: #E8EEEB;
    --muted: #95A39D;
    --green: #2A735E;
    --green-text: #7CC2A9;
    --line: #26302C;
    --fill: #1F2925;
    --warn: #F5C76B;
    --page: #000000;
    --well: #1F2925;
    --ribbon: #2A735E;
    --ribbon-fold: #C9A45C;
    --track: #33403B;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Readex Pro", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
body:lang(en) { line-height: 1.6; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 0.75em; }

a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green-text); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; inset-inline-start: var(--gutter); top: -100px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 12px;
}
.skip:focus { top: 12px; }

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

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.125rem;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); }
.lang {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 18px;
  border-radius: 999px; background: var(--fill); color: var(--ink);
  font-weight: 500; font-size: 0.9375rem; text-decoration: none;
}
.lang:hover { background: var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 32px; border-radius: 999px;
  background: var(--green); color: var(--on-green);
  font-weight: 600; font-size: 1.0625rem; line-height: 1.4; text-decoration: none; text-align: center;
  transition: transform 90ms var(--ease), filter 160ms var(--ease);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.98); }
.btn svg { flex: none; width: 20px; height: 20px; }
@media (max-width: 479px) { .btn { width: 100%; } }
/* Narrow phones, or large system font sizes: keep the label on one line beside its icon. */
@media (max-width: 379px) { .btn { padding-inline: 20px; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

/* Instructions live in .meta lines too (the WhatsApp tip, the phone-call warning), so they keep the
   16px minimum for body text. */
.meta { color: var(--muted); font-size: 1rem; line-height: 1.7; }

/* ---------- hero ---------- */
.hero {
  display: grid; gap: 40px;
  padding-block: clamp(24px, 6vw, 56px) clamp(8px, 3vw, 24px);
}
.hero h1 { font-size: clamp(3rem, 14vw, 5.25rem); line-height: 1.2; }
.hero .lead { margin-top: 16px; max-width: var(--measure); font-size: clamp(1.125rem, 4.6vw, 1.3125rem); line-height: 1.8; }
body:lang(en) .hero .lead { line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 28px; }
.cta .meta { flex-basis: 100%; }
.cta-alt { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

.werd-shot { margin: 0; justify-self: center; width: min(78vw, 340px); }
.werd-shot figcaption { margin-top: 14px; color: var(--muted); font-size: 0.9375rem; line-height: 1.7; text-align: center; text-wrap: balance; }

/* The Mushaf page, with the app's ribbon laid in as a bookmark above the first line. */
.page {
  position: relative; overflow: hidden;
  background: var(--page); border: 1px solid var(--line); border-radius: 28px;
  padding-top: 44px;
}
.ribbon {
  position: absolute; top: 0; right: 15%;
  width: 20px; height: 50px;
  background: linear-gradient(var(--ribbon-fold) 0 6px, var(--ribbon) 6px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 9px), 0 100%);
  transform-origin: top;
}
/* The page's one motion: the ribbon glides down into place once, like the app's Done screen. */
@media (prefers-reduced-motion: no-preference) {
  .ribbon { animation: ribbon-glide 700ms var(--ease) 300ms both; }
}
@keyframes ribbon-glide { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (min-width: 880px) {
  :root { --gutter: 40px; }
  /* The text starts near the header and the page fits a laptop screen with its action bar in view. */
  .hero { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 64px; padding-top: 32px; }
  .hero > div:first-child { padding-top: 56px; }
  .werd-shot { width: 340px; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 10vw, 104px); }
.section h2 { font-size: clamp(1.75rem, 6.4vw, 2.5rem); }
.section-intro { margin-top: 12px; max-width: var(--measure); color: var(--muted); }

/* Numbered markers: these are real sequences, numbered in the page's own digits. */
.steps, .install-steps, .note ol { list-style: none; margin: 0; padding: 0; }
.steps { counter-reset: step; }
.install-steps { counter-reset: install; }
.note ol { counter-reset: fix; }
:lang(ar) { --digits: arabic-indic; }
:lang(en) { --digits: decimal; }

/* Every step number sits in a small round well, so a lone Arabic-Indic ١ reads as a number, not a bar. */
.steps h3::before, .install-steps > li::before, .note ol > li::before {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill); color: var(--green-text);
  font-size: 1.0625rem; font-weight: 600; line-height: 1;
}

/* how it works */
.steps { display: grid; gap: 48px; margin-top: 36px; }
.steps > li { counter-increment: step; display: flex; flex-direction: column; }
/* The number is centred on the title's first line, also when the title wraps. */
.steps h3 { display: flex; align-items: flex-start; gap: 12px; font-size: 1.25rem; }
.steps h3::before { content: counter(step, var(--digits)); margin-top: calc((1.25rem * 1.35 - 32px) / 2); }
.steps p { margin-top: 8px; max-width: var(--measure); }
.shot {
  margin: 20px 0 0; overflow: hidden; max-width: 420px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.shot figcaption {
  padding: 10px 16px 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9375rem; line-height: 1.5;
}
/* A picture whose light and dark versions are different screens: two images, each with its own alt
   text, and only the one for the current theme is shown. Both load (they are small), so a theme
   change never leaves an empty frame. */
.for-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .for-light { display: none; }
  .for-dark { display: block; }
}
@media (min-width: 880px) {
  /* Three columns whose titles, text and pictures line up row by row. */
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 0 32px; }
  .steps > li { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; }
  .steps .shot { margin-top: 24px; max-width: none; align-self: start; }
}

/* Step 2: a day drawn as a line. The ribbon marks the werd time; the first unlock after it opens the werd. */
.dayline {
  position: relative; aspect-ratio: 3 / 2;
  display: grid; align-items: center;
}
.dayline::before, .dayline::after {
  content: ""; position: absolute; top: 50%; height: 2px; margin-top: -1px;
}
.dayline::before { inset-inline: 7%; background: var(--track); }
.dayline::after { inset-inline: 26% 28%; background: var(--green); }
.dl-stop {
  position: absolute; inset-block: 0; width: 132px; margin-inline-start: -66px;
  display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; text-align: center;
}
.dl-stop:first-child { inset-inline-start: 26%; }
.dl-stop:last-child { inset-inline-start: 72%; }
.dl-top { align-self: end; margin-bottom: 14px; font-weight: 600; line-height: 1.4; }
.dl-bottom { align-self: start; margin-top: 22px; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
/* The ribbon hangs from the line like the bookmark on the app's Home card: its gold fold sits on the line. */
.dl-ribbon {
  position: relative; z-index: 1; width: 18px; height: 36px; translate: 0 14px;
  background: linear-gradient(var(--ribbon-fold) 0 7px, var(--ribbon) 7px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 8px), 0 100%);
}
.dl-lock {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--green); color: var(--green-text);
}
.dl-lock svg { width: 20px; height: 20px; }

/* ---------- install ---------- */
.install { background: var(--surface); }
.install-grid { display: grid; gap: 40px; }
.install-head p { margin-top: 12px; max-width: var(--measure); }
.install-head .btn { margin-top: 24px; }
.install-head .meta { margin-top: 12px; }

.install-steps > li {
  --pt: 0px;
  counter-increment: install;
  position: relative; padding-inline-start: 44px; padding-bottom: 28px;
}
@media (min-width: 880px) { .install-steps > li { padding-inline-start: 52px; } }
.install-steps > li + li { --pt: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
/* The number is centred on the first line of the step's title. */
.install-steps > li::before {
  content: counter(install, var(--digits));
  position: absolute; inset-inline-start: 0;
  top: calc(var(--pt) + (1.1875rem * 1.35 - 32px) / 2);
}
.install-steps h3 { font-size: 1.1875rem; }
.install-steps p { margin-top: 6px; }
.install-steps h3 + p { margin-top: 6px; }

.key { font-weight: 600; }

.note {
  margin-top: 18px; padding: 18px 20px; border-radius: 12px; background: var(--fill);
}
.note h4 { color: var(--warn); font-size: 1.0625rem; }
.note > p { margin-top: 4px; }
.note ol { margin-top: 10px; display: grid; gap: 8px; }
.note ol > li { counter-increment: fix; position: relative; padding-inline-start: 34px; }
.note ol > li::before {
  content: counter(fix, var(--digits));
  position: absolute; inset-inline-start: 0; top: calc((1.0625rem * 1.8 - 24px) / 2);
  width: 24px; height: 24px; background: var(--surface); font-size: 0.875rem;
}
.note .meta { margin-top: 10px; }

/* Android's "more options" menu, drawn: Readex Pro has no ⋮, and the fallback glyph looks like a colon. */
.dots {
  display: inline-grid; place-items: center; vertical-align: -0.2em;
  width: 1.25em; height: 1.25em; margin-inline: 0.15em;
  border-radius: 6px; background: var(--surface); color: var(--ink);
}
.dots svg { width: 4px; height: 16px; }

.perms { margin: 12px 0 0; display: grid; gap: 10px; }
.perms div { padding: 12px 16px; border-radius: 12px; background: var(--well); }
.perms dt { font-weight: 600; }
.perms dd { margin: 0; color: var(--muted); }
/* On phones the boxes use the number gutter too, so their text gets the full width. */
@media (max-width: 879px) {
  .install-steps .note, .install-steps .perms { margin-inline-start: -44px; }
}

.update { margin-top: 12px; padding-top: 28px; padding-inline-start: 44px; border-top: 1px solid var(--line); }
@media (min-width: 880px) { .update { padding-inline-start: 52px; } }
.update h3 { font-size: 1.1875rem; }
.update p { margin-top: 6px; }

@media (min-width: 880px) {
  .install-grid { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 72px; align-items: start; }
  .install-head { position: sticky; top: 32px; }
  .install-body { max-width: 40rem; }
}

/* ---------- about the text, privacy ---------- */
.facts { display: grid; gap: 56px; }
.facts p { margin-top: 12px; max-width: var(--measure); }
.facts h2 { font-size: clamp(1.5rem, 5.6vw, 2rem); }
.facts .more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 500; }
@media (min-width: 880px) { .facts { grid-template-columns: 1fr 1fr; gap: 72px; } }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 40px 48px; }
.site-foot h2 { font-size: 1.25rem; }
.site-foot .contact p { margin-top: 8px; max-width: var(--measure); }
.email { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; unicode-bidi: isolate; }
.foot-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px;
  margin: 28px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.9375rem;
}
.foot-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--muted); }
.foot-links a:hover { color: var(--ink); }

/* ---------- privacy and other text pages ---------- */
.doc { padding-block: clamp(24px, 6vw, 56px) clamp(56px, 10vw, 96px); max-width: 44rem; }
.doc h1 { font-size: clamp(2.25rem, 9vw, 3.25rem); line-height: 1.25; }
.doc .updated { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.doc .summary { margin-top: 24px; font-size: 1.1875rem; }
.doc h2 { margin-top: 44px; font-size: 1.375rem; }
.doc h2 + p, .doc h2 + ul { margin-top: 10px; }
.doc ul { margin: 12px 0 0; padding-inline-start: 1.25em; }
.doc ul + p { margin-top: 16px; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--muted); }
.doc .back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 40px; font-weight: 500; }
