/* sbc — the download site and the privacy and terms pages.
   The app's violet night, with sharp edges: no rounded corners anywhere.
   El Messiri for headings, Rubik for text (the app's own pair). */

:root {
  --deep: #040210;
  --night: #0a0514;
  --panel: #120a24;
  --violet: #9d6bff;
  --violet-strong: #7c3aed;
  --orchid: #d6a4ff;
  --bein: #5b2a86;
  --text: #f5f0ff;
  --muted: #a99bcb;
  --line: rgba(157, 107, 255, 0.24);
  --line-strong: rgba(157, 107, 255, 0.55);
  --live: #ff3d71;
  --ok: #34d399;
  --gutter: 16px;
  --maxw: 1080px;
  --head: "El Messiri", "Tajawal", "Rubik", system-ui, sans-serif;
  --body: "Rubik", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--deep);
  color: var(--text);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: var(--orchid); text-decoration: none; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(32px, 6.4vw, 58px); }
h2 { font-size: clamp(22px, 3.6vw, 32px); }
h3 { font-size: 18px; }
p { margin: 0 0 0.9em; }
ul { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.3em; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- bar */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(4, 2, 16, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex; align-items: center; gap: 12px;
  height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
  font-family: var(--head); font-weight: 700; font-size: 24px;
  margin-inline-end: auto;
}
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 2px; }
.nav a {
  padding: 8px 12px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--violet);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  font-weight: 700; font-size: 15px;
  color: #fff;
  background: var(--violet-strong);
  border: 1px solid var(--violet);
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--violet); color: #fff; }
.btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: square; stroke-linejoin: miter;
}
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* The big download button: a slab of violet with a hard white edge. */
.dl-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(100deg, var(--violet-strong), var(--violet));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 8px 8px 0 rgba(157, 107, 255, 0.28);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dl-btn:hover {
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 rgba(157, 107, 255, 0.4);
}
.dl-btn:active { transform: translate(2px, 2px); box-shadow: 4px 4px 0 rgba(157, 107, 255, 0.4); }
.dl-btn .android { width: 34px; height: 34px; fill: #fff; flex: none; }
.dl-btn .arrow {
  width: 26px; height: 26px; flex: none; margin-inline-start: auto;
  fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: square;
}
.dl-text { display: flex; flex-direction: column; line-height: 1.25; }
.dl-text strong { font-family: var(--head); font-size: 24px; }
.dl-text small { font-size: 13.5px; opacity: 0.86; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}

/* A wall of posters leaning back into the dark, as in the app's opening. */
.wall {
  position: absolute;
  inset: -18% -12%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  transform: perspective(1200px) rotateX(18deg) rotateZ(-8deg) scale(1.08);
  transform-origin: center;
  opacity: 0.9;
}
.wall .col { display: flex; flex-direction: column; gap: 10px; }
.wall .col:nth-child(even) { margin-top: -90px; }
.wall img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.wall.live .col { animation: drift 60s linear infinite; }
.wall.live .col:nth-child(2) { animation-duration: 74s; animation-direction: reverse; }
.wall.live .col:nth-child(3) { animation-duration: 66s; }
.wall.live .col:nth-child(4) { animation-duration: 80s; animation-direction: reverse; }
.wall.live .col:nth-child(5) { animation-duration: 70s; }
@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 2, 16, 0.96) 0%, rgba(4, 2, 16, 0.86) 42%, rgba(4, 2, 16, 0.45) 100%),
    linear-gradient(180deg, rgba(4, 2, 16, 0.4) 0%, rgba(4, 2, 16, 0) 30%, rgba(4, 2, 16, 0.9) 100%);
}
[dir="rtl"] .veil {
  background:
    linear-gradient(270deg, rgba(4, 2, 16, 0.96) 0%, rgba(4, 2, 16, 0.86) 42%, rgba(4, 2, 16, 0.45) 100%),
    linear-gradient(180deg, rgba(4, 2, 16, 0.4) 0%, rgba(4, 2, 16, 0) 30%, rgba(4, 2, 16, 0.9) 100%);
}

.hero-inner {
  position: relative;
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(40px, 7vw, 80px);
}
.hero-inner > * { max-width: 560px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  font-size: 13.5px; font-weight: 500;
  color: var(--orchid);
  background: rgba(157, 107, 255, 0.12);
  border-inline-start: 3px solid var(--violet);
}
.kicker .dot { width: 7px; height: 7px; background: var(--ok); }
.hero h1 em { font-style: normal; color: var(--orchid); }
.lead { color: var(--muted); font-size: 17px; margin-bottom: 26px; }

.dl {
  padding: 18px;
  background: rgba(18, 10, 36, 0.82);
  border: 1px solid var(--line-strong);
  border-inline-start: 4px solid var(--violet);
}
.dl-meta {
  display: flex; flex-wrap: wrap; gap: 6px 0;
  list-style: none; padding: 0; margin: 14px 0 6px;
  font-size: 14px; color: var(--muted);
}
.dl-meta li { margin: 0; padding-inline-end: 12px; margin-inline-end: 12px; border-inline-end: 1px solid var(--line); }
.dl-meta li:last-child { border: 0; margin: 0; padding: 0; }
.dl-meta b { color: var(--text); font-weight: 500; }
.dl-note { font-size: 13.5px; color: var(--muted); margin: 0; }
.no-release .dl-note { color: var(--orchid); }
.sha { margin-top: 10px; font-size: 13px; color: var(--muted); }
.sha summary { cursor: pointer; }
.sha code {
  display: block; margin-top: 6px; padding: 8px 10px;
  font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 11.5px;
  word-break: break-all;
  background: rgba(4, 2, 16, 0.7); border: 1px solid var(--line);
  color: var(--text);
}

/* ---------------------------------------------------------------- steps */
.steps { padding-top: clamp(40px, 6vw, 72px); padding-bottom: 8px; }
.steps ol {
  list-style: none; padding: 0; margin: 18px 0 0;
  display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border: 1px solid var(--line);
}
.steps li {
  position: relative;
  margin: 0;
  padding: 22px 20px 18px;
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
}
.steps li:last-child { border-inline-end: 0; }
.steps .n {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 12px;
  font-family: var(--head); font-size: 20px; font-weight: 700;
  color: #fff; background: var(--violet-strong);
}
.steps p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------------------------------------------------------------- rail */
.rail-sec { padding: clamp(40px, 6vw, 72px) 0 8px; }
.rail-head p { color: var(--muted); }
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(118px, 15vw, 168px);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))) 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--bein) transparent;
}
.rail img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  transition: transform 0.2s, border-color 0.2s;
}
.rail img:hover { transform: translateY(-4px); border-color: var(--violet); }

/* ---------------------------------------------------------------- features */
.features { padding-top: clamp(32px, 5vw, 56px); }
.grid {
  display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  border: 1px solid var(--line);
}
.card {
  padding: 20px 18px;
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.card svg {
  width: 28px; height: 28px; margin-bottom: 10px;
  fill: none; stroke: var(--orchid); stroke-width: 1.8;
  stroke-linecap: square; stroke-linejoin: miter;
}
.card p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------------------------------------------------------------- plans */
.plans { padding-top: clamp(40px, 6vw, 72px); }
.plans .sub { color: var(--muted); }
.plan-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 16px;
}
.plan {
  position: relative;
  padding: 22px 20px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
}
.plan.hot { border-top-color: var(--violet); background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), var(--panel) 60%); }
.plan .badge {
  position: absolute; top: -3px; inset-inline-end: -1px;
  padding: 4px 10px;
  font-size: 12.5px; font-weight: 700;
  background: var(--violet); color: #fff;
}
.price { margin: 6px 0 12px; }
.price b { font-family: var(--head); font-size: 30px; color: var(--text); }
.price span { color: var(--muted); font-size: 14px; }
.plan ul { color: var(--muted); font-size: 14.5px; }
.fine { color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* ---------------------------------------------------------------- final */
.final {
  margin-top: clamp(48px, 7vw, 88px);
  background: linear-gradient(100deg, var(--bein), var(--violet-strong));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.final-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px;
  padding-top: 34px; padding-bottom: 34px;
}
.final h2 { margin: 0; }
.final .dl-btn {
  width: auto; min-width: 280px;
  background: var(--deep);
  box-shadow: 8px 8px 0 rgba(4, 2, 16, 0.45);
}

/* ---------------------------------------------------------------- phone bar */
.mbar { display: none; }
@media (max-width: 720px) {
  .mbar {
    position: fixed; z-index: 30;
    inset-inline: 0; bottom: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: rgba(4, 2, 16, 0.94);
    border-top: 1px solid var(--line-strong);
    transform: translateY(110%);
    transition: transform 0.25s;
  }
  .mbar.show { transform: translateY(0); }
  .mbar img { width: 30px; height: 30px; }
  .mbar span { font-size: 14px; color: var(--muted); margin-inline-end: auto; }
  .mbar b { color: var(--text); font-family: var(--head); }
  body.home { padding-bottom: 70px; }
}

/* ---------------------------------------------------------------- text pages */
.doc { padding: clamp(28px, 5vw, 56px) 0 48px; }
.doc header { margin-bottom: 20px; }
.doc .meta { color: var(--muted); font-size: 14px; }
.doc .meta code {
  font-family: ui-monospace, monospace; font-size: 12.5px;
  padding: 1px 6px; direction: ltr; unicode-bidi: isolate;
  background: rgba(157, 107, 255, 0.12); border: 1px solid var(--line);
}
.doc article {
  padding: clamp(18px, 3vw, 30px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--violet);
}
.doc article h2 { color: var(--orchid); font-size: 21px; padding-top: 4px; margin-top: 1.4em; }
.doc article h2:first-of-type { margin-top: 0.4em; }
.doc article li strong, .doc article p strong { color: var(--text); font-weight: 500; }
.note {
  padding: 12px 14px;
  background: rgba(157, 107, 255, 0.12);
  border-inline-start: 3px solid var(--violet);
  color: var(--text); font-size: 14px;
}
.toc {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none;
}
.toc li { margin: 0; }
.toc a {
  display: inline-block; padding: 5px 11px;
  background: rgba(157, 107, 255, 0.1); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.toc a:hover { color: var(--text); border-color: var(--violet); }

/* ---------------------------------------------------------------- footer */
footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  color: var(--muted); font-size: 13.5px;
}
footer .wrap {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  align-items: center; justify-content: space-between;
}
footer nav { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 720px) {
  .nav { display: none; }
  .home .top .nav { display: none; }
  .wall { grid-template-columns: repeat(3, 1fr); inset: -10% -30%; }
  .wall .col:nth-child(n + 4) { display: none; }
  [dir="rtl"] .veil,
  .veil {
    background: linear-gradient(180deg, rgba(4, 2, 16, 0.55) 0%, rgba(4, 2, 16, 0.82) 38%, rgba(4, 2, 16, 0.96) 100%);
  }
  .hero { min-height: auto; }
  .dl-text strong { font-size: 21px; }
  .steps li { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .steps li:last-child { border-bottom: 0; }
  .final .dl-btn { width: 100%; min-width: 0; }
}
@media (max-width: 720px) {
  /* The text pages keep their links: they have no download bar. */
  body:not(.home) .nav { display: flex; }
  body:not(.home) .nav a { padding: 6px 8px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wall.live .col { animation: none; }
  .dl-btn, .rail img, .mbar { transition: none; }
}
