/* rawaq.app. The app's palette (ios/Darbak/Design/DarbakStyle.swift) and the
   system's fonts: the site loads nothing from anyone else, so a visit tells no
   third party anything. Logical properties throughout, so Arabic mirrors. */

:root {
  --bg: #F2F0E7;
  --surface: #FBF9F2;
  --ink: #143F2D;
  --brand: #074633;
  --muted: #596759;
  --green: #126747;
  --line: #D9DECF;
  --sand: #C8BC98;
  --band: #143F2D;
  --band-2: #234F39;
  --band-ink: #F4F1E7;
  --band-muted: #C4CDBF;
  --mark: #F3DF9B;
  --mark-ink: #143F2D;
  --device: #0E241B;
  --shadow: rgba(20, 63, 45, .3);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --arabic: -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --arabic-display: ui-rounded, "SF Arabic Rounded", -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #102C22;
    --surface: #1C382C;
    --ink: #F4F1E7;
    --brand: #F4F1E7;
    --muted: #B1BCAC;
    --green: #BACCB0;
    --line: #405546;
    --band: #0A1F17;
    --band-2: #173528;
    --mark: #6B5A1E;
    --mark-ink: #FFF3C4;
    --device: #050F0B;
    --shadow: rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* Arabic needs the taller line; letter-spacing would break its joins, so none is ever set on it. */
[lang="ar"] { font-family: var(--arabic); }
html[lang="ar"] body { font-size: 18px; line-height: 1.8; }
[lang="en"] { font-family: var(--sans); }
html[lang="ar"] [lang="en"] { line-height: 1.65; }

img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 32px, 1080px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 760px); }

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.12; text-wrap: balance; }

/* Header and footer */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
/* The app's wordmark (BrandWordmark.swift): the icon, then the name in rounded bold, in the icon's green. */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--brand); font-family: var(--rounded); font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.brand img { border-radius: 22.4%; }
.switch { padding: 5px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .95rem; font-weight: 500; text-decoration: none; }
.switch:hover { background: var(--surface); }

.foot { margin-top: 24px; padding-block: 28px 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.foot .brand { font-size: 1rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { color: var(--ink); text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.foot p { flex-basis: 100%; margin: 0; }
.foot .legal { font-size: .85rem; }

/* Review builds only: what is still to fill */

.review { margin: 0; padding: 10px 16px; background: var(--mark); color: var(--mark-ink); font-size: .9rem; font-weight: 600; text-align: center; }
mark.ph { padding: 0 .25em; border-radius: 4px; background: var(--mark); color: var(--mark-ink); font-weight: 600; }

/* The phone. Sizes in cqw (hundredths of the device's width) keep the
   iPhone 17 Pro's proportions at any size: a 402-point screen with 55-point
   corners, and the 126 × 37-point island 11 points from the top. */

.device { container-type: inline-size; width: min(100%, 330px); margin-inline: auto; }
.phone { position: relative; padding: 2.8cqw; border-radius: 15.7cqw; background: var(--device); box-shadow: 0 40px 80px -30px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .07); }
.phone img { display: block; width: 100%; border-radius: 12.9cqw; }
.phone::after { content: ""; position: absolute; top: 5.4cqw; left: 50%; width: 29.6cqw; height: 8.7cqw; border-radius: 999px; background: #000; transform: translateX(-50%); }

/* Home */

.hero { display: grid; gap: 44px; align-items: center; padding-block: 28px 72px; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font: 600 .75rem/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.6rem, 1.5rem + 4.4vw, 4.5rem); letter-spacing: -.025em; line-height: 1.04; }
.lede { max-width: 32em; margin: 22px 0 30px; color: var(--muted); font-size: 1.2rem; }
.store { display: inline-block; margin: 0; padding: 13px 26px; border-radius: 999px; background: var(--green); color: var(--bg); font-weight: 600; text-decoration: none; }
.store.soon { border: 1.5px solid var(--ink); background: none; color: var(--ink); }
.note { margin: 14px 0 0; color: var(--muted); font-size: .95rem; }

.story { display: grid; gap: 28px; align-items: center; padding-block: 44px; }
.hero .device { width: min(86%, 330px); }
.story .device { width: min(72%, 290px); }
.story h2 { font-family: var(--serif); font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -.02em; }
.story-text p { margin: 18px 0 0; font-size: 1.12rem; }
.story-text .caption { color: var(--muted); font-size: .9rem; }

.features { padding-block: 56px 40px; }
.features h2, .band h2, .plus h2 { font-family: var(--serif); font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); letter-spacing: -.015em; }
.features ul { display: grid; gap: 16px; margin: 30px 0 0; padding: 0; list-style: none; }
.features li { padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.ico { width: 28px; height: 28px; color: var(--green); }
.features h3 { margin: 12px 0 6px; font-size: 1.12rem; font-weight: 600; }
.features li p { margin: 0; color: var(--muted); }

.band { margin-block: 40px; padding-block: 72px; background: linear-gradient(160deg, var(--band-2), var(--band)); color: var(--band-ink); }
.band ul { display: grid; gap: 18px 44px; max-width: 900px; margin: 28px 0 34px; padding: 0; list-style: none; }
.band li { position: relative; padding-inline-start: 30px; color: var(--band-muted); }
.band li::before { content: ""; position: absolute; inset-inline-start: 0; top: .42em; width: 14px; height: 14px; border-radius: 50%; background: var(--sand); }
.band strong { color: var(--band-ink); font-weight: 600; }
.band .more { color: var(--band-ink); font-weight: 600; }

.plus { width: min(100% - 32px, 760px); padding-block: 40px 16px; text-align: center; }
.plus p { margin: 16px 0 0; color: var(--muted); font-size: 1.12rem; }

.closing { padding-block: 48px 64px; text-align: center; }
.closing img { border-radius: 22.5%; box-shadow: 0 24px 44px -20px var(--shadow); }
.closing-name { margin: 12px 0 22px; font-size: 1.5rem; font-weight: 600; }

/* Six features: 3 × 2 or 2 × 3, never 4 + 2. */
@media (min-width: 560px) {
  .features ul { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 700px) {
  .band ul { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .features ul { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 760px) {
  .story { grid-template-columns: 1fr 1fr; gap: 64px; padding-block: 64px; }
  .story.flip .device { order: 2; }
}
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.15fr .85fr; padding-block: 48px 96px; }
}

/* Help and the policy */

.page { padding-block: 20px 72px; }
.page > h1 { font-family: var(--serif); font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.2rem); letter-spacing: -.02em; }
.page > .lede { margin-bottom: 8px; }
.page > h2 { margin: 36px 0 8px; font-family: inherit; font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.page > p { margin: 0; }

.notice { margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.editor { margin: 0 0 20px; padding: 14px 18px; border-radius: 16px; background: var(--mark); color: var(--mark-ink); font-size: .92rem; line-height: 1.55; }
.editor mark.ph { background: rgba(255, 255, 255, .5); }

.doc { line-height: 1.65; }
.doc h1 { margin: 12px 0 14px; font-family: var(--serif); font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.2rem); letter-spacing: -.02em; }
.doc h2 { margin: 48px 0 12px; padding-top: 26px; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.6rem; scroll-margin-top: 16px; }
.doc h3 { margin: 26px 0 8px; font-size: 1.05rem; font-weight: 600; }
.doc p, .doc ul { margin: 12px 0; }
.doc ul { padding-inline-start: 1.3em; }
.doc li { margin: 6px 0; }
.doc li > ul, .doc li > p { margin: 8px 0; }
.doc code { font-family: var(--mono); font-size: .9em; }
.summary { margin: 26px 0; padding: 4px 24px 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.summary h3 { margin-top: 18px; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.toc { margin: 28px 0 8px; }
.doc .toc h2 { margin: 0 0 8px; padding: 0; border: 0; font-family: inherit; font-size: 1.05rem; font-weight: 600; }
.toc ol { margin: 0; padding-inline-start: 1.5em; columns: 2 15em; column-gap: 36px; }
.toc li { margin: 4px 0; break-inside: avoid; }
.table { margin: 16px 0; overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.doc th { background: var(--surface); font-weight: 600; }

/* On a phone, each table row becomes a card with its column names inline. */
@media (max-width: 640px) {
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .doc tr { margin: 12px 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .doc td { padding: 6px 0; border: 0; }
  .doc td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
}

.missing { padding-block: 96px; text-align: center; }
.missing h1 { font-size: 2rem; }

/* Arabic, last so it wins: the app's rounded display face (its Arabic titles
   use .rounded), and no letter-spacing, which would break the letters' joins.
   :lang() rather than the page's lang, so the English policy text inside the
   Arabic page keeps its own type. */
.hero h1:lang(ar), .story h2:lang(ar), .features h2:lang(ar), .band h2:lang(ar),
.plus h2:lang(ar), .page > h1:lang(ar), .missing h1:lang(ar) {
  font-family: var(--arabic-display);
  letter-spacing: 0;
  line-height: 1.3;
}
.eyebrow:lang(ar) { font: 600 .95rem/1.4 var(--arabic); letter-spacing: 0; text-transform: none; }
.band li:lang(ar)::before { top: .62em; }
.brand:lang(ar) { font-family: var(--arabic-display); }
