/* Fasih site — one stylesheet shared by every page.
   Palette mirrors the app's teal theme (icon teal #0F766E, accent #0F766E light / #2DD4BF dark,
   warm off-white paper, near-black ink). Display type is Fraunces; Arabic is Amiri. No JavaScript. */
:root {
  color-scheme: light dark;

  /* teal family */
  --teal: #0F766E; --teal-bright: #11857C; --teal-deep: #0B5C57;
  --accent: #0F766E; --accent-ink: #FAF9F6;

  /* surfaces & ink */
  --bg: #FAF9F6; --surface: #FFFFFF; --tint: #F2EFE7; --wash: rgba(15,118,110,.08);
  --ink: #14120F; --ink-mid: #46423C; --ink-soft: #756F66;
  --line: #E6E2D9; --line-strong: #D8D3C7;

  /* shape & scale */
  --radius: 18px; --radius-lg: 26px; --radius-sm: 12px; --max: 1080px;

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(20,18,15,.04), 0 4px 14px rgba(20,18,15,.05);
  --shadow-md: 0 10px 30px rgba(20,18,15,.09);
  --shadow-lg: 0 30px 70px rgba(20,18,15,.18);

  --header-bg: rgba(250,249,246,.72);
}
@media (prefers-color-scheme: dark) {
  :root {
    --teal: #2DD4BF; --teal-bright: #2DD4BF; --teal-deep: #0B3A37;
    --accent: #2DD4BF; --accent-ink: #052F2C;
    --bg: #14120F; --surface: #1E1B17; --tint: #1A1713; --wash: rgba(45,212,191,.12);
    --ink: #F2EFE8; --ink-mid: #C6C0B6; --ink-soft: #A29B90;
    --line: #2C2823; --line-strong: #3A352E;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.3);
    --shadow-md: 0 10px 30px rgba(0,0,0,.4);
    --shadow-lg: 0 30px 70px rgba(0,0,0,.55);
    --header-bg: rgba(20,18,15,.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6;
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--wash); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section[id] { scroll-margin-top: 88px; }

/* prose pages (support, privacy) */
.prose { max-width: 720px; margin: 0 auto; padding: 56px 24px 64px; }
.prose h1 { font-family: var(--font-display); color: var(--accent); font-size: clamp(2rem, 4vw, 2.6rem); margin: 0 0 .3em; letter-spacing: -0.01em; }
.prose h2 { font-family: var(--font-display); margin-top: 1.8em; font-size: 1.4rem; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--ink-mid); }
.prose strong { color: var(--ink); }
.muted { color: var(--ink-soft); font-size: 0.9em; }

/* Arabic runs inside English prose: Amiri if present, else the system Arabic face. */
.ar { font-family: Amiri, "Geeza Pro", "Noto Naskh Arabic", "Times New Roman", serif;
  font-size: 1.15em; line-height: 2; direction: rtl; unicode-bidi: isolate; }

/* ---------- sticky header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink-mid); text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .15s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.btn, .nav-links a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 20px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .95rem;
  text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.badge { display: inline-block; }
.badge img { height: 54px; width: auto; }

/* ---------- generic band ---------- */
.band { padding: 72px 0; }
.band-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 680px; margin: 0 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .14em;
  font-size: .74rem; color: var(--accent); font-weight: 700; margin: 0; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.title { font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 600;
  margin: 12px 0 14px; letter-spacing: -0.015em; line-height: 1.12; }
.lede { color: var(--ink-mid); font-size: 1.08rem; max-width: 640px; margin: 0; }
.more-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-weight: 700;
  font-size: .98rem; color: var(--accent); text-decoration: none; }
.more-link::after { content: "→"; transition: transform .15s ease; }
.more-link:hover::after { transform: translateX(4px); }

/* subpage intro band */
.page-intro { position: relative; overflow: hidden; padding: 72px 0 12px; }
.page-intro::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(140% 130% at 50% 0%, var(--wash), transparent 62%); }
.page-intro > .wrap { position: relative; z-index: 1; }
.page-intro .section-head { margin-bottom: 0; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 36px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 0%, var(--wash), transparent 62%),
    radial-gradient(90% 80% at 100% 100%, var(--wash), transparent 72%);
}
.hero-inner { position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-icon { width: 88px; height: 88px; border-radius: 21px; box-shadow: var(--shadow-md); margin-bottom: 22px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 5.4vw, 4rem);
  line-height: 1.02; margin: 0 0 10px; letter-spacing: -0.03em; }
.hero .tag { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  color: var(--ink); margin: 0 0 20px; line-height: 1.25; }
.hero .sub { color: var(--ink-mid); font-size: 1.05rem; max-width: 540px; margin: 0 0 28px; }
.hero .cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.hero-device { position: relative; }
.hero-device::after { content: ""; position: absolute; inset: 6% 12%; z-index: -1; border-radius: 50%;
  background: var(--accent); opacity: .18; filter: blur(60px); }
.phone { border-radius: 42px; border: 9px solid #17150f; background: #000; overflow: hidden;
  box-shadow: var(--shadow-lg); max-width: 300px; margin: 0 auto;
  animation: float 7s ease-in-out infinite; }
.phone img { display: block; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- stats band ---------- */
.band-stats { padding: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin: -44px 0 0; position: relative; z-index: 2; }
.stat { padding: 30px 22px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 3vw, 2.4rem);
  color: var(--accent); letter-spacing: -0.02em; line-height: 1.1; }
.stat span { color: var(--ink-mid); font-size: .9rem; }

/* ---------- feature / method cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card .ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 13px; background: var(--wash); color: var(--accent); margin-bottom: 16px; }
.card .ico svg { width: 23px; height: 23px; display: block; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--ink-mid); font-size: .97rem; }

/* ---------- anatomy of an entry ---------- */
.entry { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 36px 40px; box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.entry-tag { display: inline-block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); background: var(--wash); border-radius: 999px; padding: 5px 12px; margin: 0 0 18px; }
.entry .headword { font-family: Amiri, serif; font-size: clamp(2.8rem, 6vw, 3.6rem); line-height: 1.3;
  margin: 0 0 6px; text-align: right; color: var(--ink); }
.entry .gloss { color: var(--ink-mid); margin: 0 0 22px; font-size: 1rem; }
.entry dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; }
.entry dt { color: var(--ink-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.entry dd { margin: 0; color: var(--ink-mid); font-size: .98rem; }
.entry-examples { border-left: 1px solid var(--line); padding-left: 40px; }
.examples-label { margin: 0 0 16px; color: var(--ink-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.example { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.example:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.example .ar { display: block; font-size: 1.3em; margin: 0 0 6px; }
.example-tr { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- screenshots ---------- */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 22px;
  overflow-x: auto; padding: 10px 4px 20px; scroll-snap-type: x mandatory; scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent; }
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.shot { scroll-snap-align: start; text-align: center; }
.shot img { border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.shot figcaption { margin-top: 14px; color: var(--ink-mid); font-size: .93rem; }

/* ---------- privacy ---------- */
.privacy { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.privacy ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.privacy li { position: relative; padding-left: 32px; color: var(--ink-mid); }
.privacy li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--wash);
  background-image: none; }
.privacy li::after { content: ""; position: absolute; left: 6.5px; top: 8px; width: 6px; height: 10px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- closing CTA ---------- */
.cta-band { position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--teal-bright), var(--teal-deep)); color: #FAF9F6; box-shadow: var(--shadow-md); }
.cta-band h2 { position: relative; font-family: var(--font-display); font-weight: 600; margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem); letter-spacing: -0.01em; }
.cta-band p { position: relative; margin: 0 0 26px; opacity: .9; }
.cta-band .badge { position: relative; }

/* ---------- footer ---------- */
footer { padding: 40px 0 56px; margin-top: 8px; border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: .9rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--ink-mid); text-decoration: none; margin-right: 18px; }
footer a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 36px; }
  .hero-icon { margin-left: auto; margin-right: auto; }
  .hero .sub { margin-left: auto; margin-right: auto; }
  .hero .cta { justify-content: center; }
  .hero-device { order: -1; }
  .grid { grid-template-columns: 1fr 1fr; }
  .entry, .privacy { grid-template-columns: 1fr; gap: 28px; }
  .entry-examples { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
  .entry .headword { text-align: center; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 620px) {
  .band { padding: 56px 0; }
  .stats { grid-template-columns: 1fr 1fr; margin-top: -36px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phone { animation: none; }
  * { transition: none !important; }
}
