/* Shattably landing page — one stylesheet for both the Arabic (RTL) and the
   English (LTR) page. Everything directional uses CSS logical properties
   (inline-start/end), so the same rules lay out correctly in both. Brand
   tokens mirror mobile/lib/brand.dart — keep them in sync on any recolor. */

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --palm: #0e6b43;
  --palm-ink: #053b24;
  --palm-glow: #00a884;
  --brass: #b9812a;
  --brass-bright: #e2ae5b;
  --sand: #f6f1e7;

  /* Light surfaces */
  --bg: #ffffff;
  --bg-alt: var(--sand);
  --surface: #ffffff;
  --text: #101a15;
  --muted: #56635c;
  --border: #e2ddd2;
  --shadow: 0 1px 2px rgba(5, 59, 36, 0.06), 0 8px 24px rgba(5, 59, 36, 0.06);

  --primary: var(--palm);
  --accent: var(--brass);
  --on-dark: #f3f6f4;
  --on-dark-muted: #b9cfc4;

  /* Tinted derivatives, written out rather than color-mix()'d — this has to
     render on the same low-end Android WebViews the app targets. */
  --primary-soft: rgba(14, 107, 67, 0.1);
  --primary-line: rgba(14, 107, 67, 0.28);
  --header-bg: rgba(255, 255, 255, 0.88);

  --maxw: 1080px;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #0b0b0b;
    --surface: #141414;
    --text: #e9edea;
    --muted: #9aa5a0;
    --border: #242424;
    --shadow: none;

    --primary: var(--palm-glow);
    --accent: var(--brass-bright);

    --primary-soft: rgba(0, 168, 132, 0.14);
    --primary-line: rgba(0, 168, 132, 0.3);
    --header-bg: rgba(0, 0, 0, 0.85);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  background: var(--palm);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

.skip-link:focus {
  inset-block-start: 16px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  border-block-end: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand svg {
  width: 30px;
  height: 30px;
  color: var(--primary);
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--primary);
}

/* Note: margin-inline-* resolves against *this* element's direction, so the
   switch must not carry its own dir attribute — that would flip which side the
   auto margin lands on and drag it back next to the wordmark. */
.lang-switch {
  margin-inline-start: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

/* The nav already claimed the free space; the switch just sits after it. */
.site-nav ~ .lang-switch {
  margin-inline-start: 0;
}

.lang-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  /* …so the switch has to claim the free space itself. */
  .site-nav ~ .lang-switch {
    margin-inline-start: auto;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--palm-ink) 0%, var(--palm) 100%);
  color: var(--on-dark);
  padding-block: clamp(56px, 9vw, 104px);
}

/* The mark itself, blown up as a watermark in the corner the text flows away
   from (inline-end: left in Arabic, right in English). */
.hero-mark {
  position: absolute;
  inset-block-end: -42px;
  inset-inline-end: -34px;
  width: 300px;
  height: 300px;
  color: #fff;
  opacity: 0.08;
  pointer-events: none;
}

@media (max-width: 720px) {
  .hero-mark {
    width: 190px;
    height: 190px;
    inset-block-end: -28px;
    inset-inline-end: -24px;
  }
}

.hero .wrap {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

/* The slogan sits above the headline and carries the brand line; the h1 below
   finishes the sentence, so the two are read as one thought. */
.hero .hero-tagline {
  margin-block: 0 0.35em;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 700;
  color: var(--brass-bright);
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  margin-block-end: 0.4em;
}

.hero p {
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: var(--on-dark-muted);
  max-width: 60ch;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 22px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(226, 174, 91, 0.5);
  background: rgba(185, 129, 42, 0.16);
  color: var(--brass-bright);
  font-size: 0.9rem;
  font-weight: 600;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass-bright);
  flex: 0 0 auto;
}

.hero-note {
  margin-block-start: 28px;
  margin-block-end: 0;
  font-size: 0.95rem;
  color: rgba(243, 246, 244, 0.62);
}

/* --------------------------------------------------------------- sections */

section {
  padding-block: clamp(48px, 7vw, 84px);
}

section.alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 62ch;
  margin-block-end: 40px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
}

.section-head p {
  color: var(--muted);
  margin-block-end: 0;
}

.eyebrow {
  display: block;
  margin-block-end: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ----------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Two wide panels rather than three cards — needs more room to breathe. */
.grid.pair {
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.12rem;
  margin-block-end: 0.35em;
}

.card p {
  color: var(--muted);
  margin-block-end: 0;
  font-size: 0.97rem;
}

.card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-block-end: 16px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.card .icon svg {
  width: 22px;
  height: 22px;
}

/* ----------------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  counter-reset: step;
}

.step {
  position: relative;
  padding-block-start: 52px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.step::after {
  content: "";
  position: absolute;
  inset-block-start: 18px;
  inset-inline-start: 46px;
  inset-inline-end: -24px;
  height: 2px;
  background: var(--primary-line);
}

.step:last-child::after {
  display: none;
}

@media (max-width: 720px) {
  .step::after {
    display: none;
  }
}

.step h3 {
  font-size: 1.05rem;
}

.step p {
  color: var(--muted);
  font-size: 0.97rem;
  margin-block-end: 0;
}

/* ------------------------------------------------------------ audiences */

.audience {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.audience > h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  margin-block-end: 6px;
}

.audience > h3 svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
  flex: 0 0 auto;
}

.audience > p {
  color: var(--muted);
  font-size: 0.97rem;
}

.ticks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.ticks li {
  position: relative;
  padding-inline-start: 30px;
  font-size: 0.98rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.62em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.85;
}

/* ------------------------------------------------------------ screenshots */

.shots {
  display: grid;
  gap: 32px 24px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.shot {
  margin: 0;
  text-align: center;
}

.shot-frame {
  padding: 9px;
  border-radius: 34px;
  background: #101211;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(5, 59, 36, 0.14);
  max-width: 260px;
  margin-inline: auto;
}

.shot-frame img {
  display: block;
  width: 100%;
  border-radius: 26px;
  background: var(--sand);
}

.shot figcaption {
  margin-block-start: 14px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--muted);
}

/* ---------------------------------------------------------------- footer */

.notes {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 70ch;
}

.notes p:last-child {
  margin-block-end: 0;
}

.site-footer {
  background: var(--palm-ink);
  color: var(--on-dark);
  padding-block: 52px 34px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  padding-block-end: 28px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  max-width: 34ch;
}

.footer-brand .brand {
  color: #fff;
  margin-block-end: 10px;
}

.footer-brand .brand svg {
  color: #fff;
}

.footer-brand p {
  color: var(--on-dark-muted);
  font-size: 0.94rem;
  margin-block-end: 0;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-bright);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 0.94rem;
}

.footer-col a {
  color: var(--on-dark-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  padding-block-start: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.88rem;
  color: rgba(243, 246, 244, 0.55);
}

.footer-bottom p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
