/* Rafiq's website. Bold editorial layout in Rafiq's own colours, white, black and orange: a black hero with a huge
   condensed title, white sections numbered 002, 003…, orange for buttons, highlights and the footer.
   Latin: Archivo (condensed, heavy) for titles, Host Grotesk for text, Geist Mono for labels.
   Arabic: Noto Kufi Arabic for titles, IBM Plex Sans Arabic for text. Light by default; dark when chosen. */

:root {
  --night: #161615; /* the black of the hero and dark cards */
  --cream: #f7f6f3; /* the white of the page */
  --on-dark: #f7f6f3;
  --ink: #141414;
  --muted: #5f5c57;
  --soft: #8d8984;
  --line: rgba(20, 20, 20, 0.1);
  --amber: #d9733a; /* Rafiq orange, for buttons and highlights */
  --terracotta: #d9733a;
  --card: #ffffff;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Host Grotesk", -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ar-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif;
  --ar-body: "IBM Plex Sans Arabic", "Host Grotesk", sans-serif;
  --max: 1280px;
  /* Older names, still used by the admin page */
  --bg: var(--cream); --surface: var(--card); --raised: var(--card); --track: var(--line); --accent: var(--terracotta);
  --accent-soft: rgba(217, 115, 58, 0.14); --solid: #141414; --on-solid: #f7f6f3; --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 30px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}
.btn-solid { background: var(--solid); color: var(--on-solid); }
.muted { color: var(--muted); }

:root[data-theme="dark"] {
  --solid: #f7f6f3; --on-solid: #141414;
  --cream: #121212;
  --night: #000000;
  --ink: #f2f1ee;
  --muted: #a5a29d;
  --soft: #8c8985;
  --line: rgba(242, 241, 238, 0.12);
  --card: #1d1d1c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--cream);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--ar-body); font-size: 18px; line-height: 1.85; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(18px, 3vw, 40px); }

/* ---- Type ---- */
.display {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 72%;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.86;
  margin: 0;
}
html[lang="ar"] .display { font-family: var(--ar-display); font-stretch: normal; text-transform: none; letter-spacing: 0; line-height: 1.3; font-weight: 800; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
html[lang="ar"] .label { font-family: var(--ar-body); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.num { font-family: var(--mono); font-size: 12px; color: var(--soft); margin-bottom: 14px; display: block; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 30em; margin: 0; }
.accent-line { color: var(--terracotta); }

/* ---- Floating pill navigation ---- */
.topbar { position: fixed; inset: 16px 0 auto; z-index: 20; pointer-events: none; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.1); color: #141414; }
.pill a, .pill button { text-decoration: none; font: 500 14px/1 var(--body); padding: 9px 14px; border-radius: 999px; border: 0; background: none; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
html[lang="ar"] .pill a, html[lang="ar"] .pill button { font-family: var(--ar-body); font-size: 15px; }
.pill a.on, .pill a:hover, .pill button:hover { background: rgba(20, 20, 20, 0.08); }
.pill .brand img { width: 24px; height: 24px; border-radius: 6px; }
.pill .brand { font-weight: 700; padding-inline: 8px 14px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
@media (max-width: 760px) { .pill.center { display: none; } }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 999px; font: 600 16px/1 var(--body); text-decoration: none; border: 0; cursor: pointer; }
html[lang="ar"] .btn { font-family: var(--ar-body); }
.btn svg { width: 18px; height: 18px; }
.btn-amber { background: var(--amber); color: #141414; box-shadow: 0 10px 30px rgba(217, 115, 58, 0.3); }
.btn-ink { background: #141414; color: var(--on-dark); }
:root[data-theme="dark"] .btn-ink { background: var(--amber); color: #141414; }
.btn[aria-disabled="true"] { cursor: default; }

/* ---- Hero ---- */
.hero { position: relative; min-height: 100svh; background: var(--night); color: var(--on-dark); overflow: hidden; display: flex; padding: 84px 0 40px; }
.hero::after { content: ""; position: absolute; inset: auto -10% -35% -10%; height: 65%; background: radial-gradient(55% 60% at 50% 100%, rgba(217, 115, 58, 0.3), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; }
.hero .labels { display: flex; justify-content: space-between; gap: 18px; color: rgba(247, 246, 243, 0.85); }
.hero .labels span:nth-child(2) { text-align: center; }
.hero .labels span:last-child { text-align: end; }
.hero h1 { font-size: clamp(54px, 11.6vw, 176px); margin-top: 22px; color: var(--on-dark); }
html[lang="ar"] .hero h1 { font-size: clamp(56px, 9.6vw, 150px); }
.hero .below { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-top: 40px; }
.hero .pitch { max-width: 440px; }
.hero .pitch p { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; margin: 0 0 26px; color: rgba(247, 246, 243, 0.78); }
.hero .pitch p b { color: #fff; font-weight: 600; }
.hero .pitch p.fine { margin: 14px 0 0; font-size: 14px; color: rgba(247, 246, 243, 0.6); }
.hero .device { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: -14vw; }
html[lang="ar"] .hero .device { margin-top: -6vw; }
.hero .device .label { color: rgba(247, 246, 243, 0.7); }
@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero .labels span:nth-child(2) { display: none; }
  .hero .below { flex-direction: column; align-items: stretch; }
  .hero .device, html[lang="ar"] .hero .device { margin: 30px auto 0; }
}

/* ---- Phones: the real app screenshots in a black frame ---- */
.phone { width: 250px; aspect-ratio: 1206 / 2622; border-radius: 40px; padding: 8px; background: #0b0b0b; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06); flex: none; }
.phone img { width: 100%; height: 100%; border-radius: 32px; object-fit: cover; object-position: top; }
@media (max-width: 900px) { .phone { width: 220px; border-radius: 36px; } .phone img { border-radius: 29px; } }

/* ---- Sections ---- */
section.block { padding: clamp(80px, 10vw, 140px) 0; }
section.block + section.block { border-top: 1px solid var(--line); }
.head-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px 60px; flex-wrap: wrap; margin-bottom: 48px; }
.head-split h2 { font-size: clamp(54px, 8.4vw, 124px); }
.head-split .lede { max-width: 24em; }
.head-center { text-align: center; max-width: 920px; margin: 0 auto 54px; }
.head-center h2 { font-size: clamp(54px, 8vw, 116px); }
.head-center .lede { margin: 22px auto 0; }
html[lang="ar"] .head-split h2, html[lang="ar"] .head-center h2 { font-size: clamp(40px, 6vw, 84px); }

/* Tall screenshot cards with a quoted caption, like a gallery */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery .shot { aspect-ratio: 0.6; border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(0, 0, 0, 0.08); }
.gallery .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.gallery figcaption { margin-top: 12px; font-size: 15px; }
.gallery figcaption .label { display: block; margin-top: 4px; color: var(--soft); }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Two big colour cards */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.feature { border-radius: 26px; padding: clamp(24px, 3vw, 40px); overflow: hidden; display: flex; flex-direction: column; min-height: 660px; }
.feature.night { background: var(--night); color: var(--on-dark); }
.feature.amber { background: var(--amber); color: #141414; }
.feature .label { opacity: 0.85; }
.feature h3 { font-size: clamp(40px, 4.4vw, 64px); margin: 16px 0 12px; }
html[lang="ar"] .feature h3 { font-size: clamp(30px, 3.2vw, 46px); }
.feature p { margin: 0; max-width: 30em; font-size: 17px; opacity: 0.9; }
.feature .phone { margin: 34px auto -170px; }
.duo-note { text-align: center; color: var(--muted); max-width: 34em; margin: 30px auto 0; font-size: 16px; }
@media (max-width: 900px) { .duo { grid-template-columns: minmax(0, 1fr); } .feature { min-height: 580px; } }

/* Headline on one side, a numbered list on the other */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 80px; align-items: start; }
.split h2 { font-size: clamp(54px, 7.6vw, 112px); margin-bottom: 26px; }
html[lang="ar"] .split h2 { font-size: clamp(40px, 5.4vw, 78px); }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps .n { font-family: var(--mono); font-size: 13px; padding-top: 3px; }
.steps b { display: block; font-weight: 600; }
.steps .t { color: var(--muted); font-size: 16px; }
.split .after { margin-top: 30px; }
.split .after .fine { margin-top: 14px; font-size: 14px; color: var(--soft); }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* A verse, quoted exactly as the app shows it */
.verse { margin-top: 34px; border-radius: 22px; padding: 28px; background: var(--card); border: 1px solid var(--line); max-width: 520px; }
.verse .ar { font-family: "Amiri Quran", var(--ar-body); font-size: 30px; line-height: 2.2; direction: rtl; text-align: right; }
.verse .ar .aya { white-space: nowrap; }
.verse .tr { margin-top: 10px; color: var(--muted); font-size: 16px; }
.verse .ref { margin-top: 10px; color: var(--terracotta); }

/* Sources strip */
.sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 30px; border-top: 1px solid var(--line); margin-top: 10px; }
.sources div { padding: 24px 0; border-bottom: 1px solid var(--line); }
.sources .label { color: var(--soft); display: block; margin-bottom: 8px; }
.sources p { margin: 0; font-size: 16px; }
@media (max-width: 900px) { .sources { grid-template-columns: minmax(0, 1fr); } }

/* ---- Text pages: privacy, terms, support ---- */
.doc-hero { background: var(--night); color: var(--on-dark); padding: 130px 0 56px; }
.doc-hero h1 { font-size: clamp(56px, 10vw, 140px); }
html[lang="ar"] .doc-hero h1 { font-size: clamp(42px, 7vw, 96px); }
.doc-hero .label { color: rgba(247, 246, 243, 0.7); display: block; margin-top: 20px; }
.doc { max-width: 760px; margin: 0 auto; padding: 56px clamp(18px, 3vw, 40px) 90px; }
.doc h2 { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 44px 0 12px; text-transform: uppercase; }
html[lang="ar"] .doc h2 { font-family: var(--ar-display); text-transform: none; letter-spacing: 0; font-size: 24px; }
.doc p, .doc li { color: var(--muted); }
.doc b { color: var(--ink); }
.doc ul { padding-inline-start: 22px; }
.doc li { margin: 6px 0; }
.doc .callout { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 22px 0; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 14px 0; }
.doc th, .doc td { text-align: start; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.doc th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--soft); font-weight: 500; }
html[lang="ar"] .doc th { font-family: var(--ar-body); text-transform: none; letter-spacing: 0; font-size: 14px; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq:first-of-type { border-top: 1px solid var(--line); }
details.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; color: var(--ink); display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--mono); color: var(--soft); }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin-top: 0; }

/* ---- Footer: terracotta, with a huge closing line ---- */
.site-footer { background: var(--terracotta); color: #141414; padding: clamp(40px, 6vw, 80px) 0 28px; }
.site-footer .big { font-family: var(--body); font-weight: 400; font-size: clamp(60px, 12.6vw, 186px); letter-spacing: -0.05em; line-height: 0.95; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 40px; margin: 0; color: #141414; }
html[lang="ar"] .site-footer .big { font-family: var(--ar-display); font-weight: 500; letter-spacing: 0; font-size: clamp(50px, 9.4vw, 136px); line-height: 1.3; }
.site-footer .rule { border-top: 1px solid rgba(20, 20, 20, 0.22); margin: clamp(26px, 4vw, 50px) 0 30px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .about { max-width: 30em; margin: 0; font-size: 16px; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.site-footer nav a { text-decoration: none; border-bottom: 1px solid rgba(20, 20, 20, 0.45); padding-bottom: 1px; }
.site-footer nav a:hover { border-color: #141414; }
.site-footer .bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; flex-wrap: wrap; }
.site-footer .bottom a { text-decoration: none; border-bottom: 1px solid rgba(20, 20, 20, 0.45); }
.site-footer .credits { margin-top: 26px; font-size: 13px; opacity: 0.82; max-width: 62em; }
@media (max-width: 900px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .about { grid-column: 1 / -1; } }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
