/* Ranora — one stylesheet for every page.
 *
 * The palette is the app's own dark theme, not a website palette invented
 * beside it: midnight ground, coral doing all the pointing, amber second.
 * Green appears nowhere. In the app green means exactly one thing — "on
 * track" — and spending it on a marketing gradient would take that meaning
 * away from the only place it earns its keep.
 *
 * Arabic is the default direction. Everything is written with logical
 * properties (inline-start / inline-end), so the English toggle flipping
 * `dir` needs no second stylesheet.
 */

:root {
  --ground: #0f1420;
  --raised: #1a2032;
  --border: #2a3247;
  --ink: #f2f4f8;
  --ink-dim: #9aa3b8;
  --coral: #ff6b4a;
  --coral-deep: #e8542f;
  --amber: #ffc15e;
  --amber-deep: #efa00b;

  --radius: 22px;
  --radius-sm: 14px;
  --page: 1120px;

  /* Arabic script has no tracking. Latin at display sizes gets a hair of
     negative tracking instead — set per-element, never globally, or the
     Arabic inherits it and the glyphs collide. */
  --track-latin: -0.02em;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Tajawal, "SF Arabic", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* One ambient light source, behind everything, anchored to the start edge so
   it follows the reading direction when the page flips to English. */
body::before {
  content: "";
  position: fixed;
  inset-block-start: -30vh;
  inset-inline-start: -20vw;
  width: 90vw;
  height: 90vh;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.16), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

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

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

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}

:dir(ltr) h1,
:dir(ltr) h2 {
  letter-spacing: var(--track-latin);
}

p {
  margin: 0;
}

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

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(15, 20, 32, 0.78);
  border-block-end: 1px solid transparent;
  transition: border-color 0.2s;
}

.site-header.is-stuck {
  border-block-end-color: var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 21px;
}

.brand svg {
  display: block;
  width: 34px;
  height: 34px;
}

.spacer {
  flex: 1;
}

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26, 32, 50, 0.7);
}

.lang-toggle button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 5px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--coral);
  color: #1a0d08;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  color: #200b05;
  box-shadow: 0 12px 34px -12px rgba(255, 107, 74, 0.7);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--ink);
  background: rgba(26, 32, 50, 0.6);
}

.btn:hover {
  transform: translateY(-2px);
}

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

.hero {
  padding-block: clamp(52px, 9vw, 104px) clamp(48px, 8vw, 92px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 193, 94, 0.28);
  background: rgba(255, 193, 94, 0.08);
  color: var(--amber);
  font-size: 14px;
  font-weight: 700;
  margin-block-end: 22px;
}

.hero h1 {
  font-size: clamp(38px, 6.2vw, 66px);
  font-weight: 800;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--coral), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin-block-start: 22px;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-dim);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block-start: 34px;
}

.hero-note {
  margin-block-start: 18px;
  font-size: 14.5px;
  color: var(--ink-dim);
}

/* ---------- phone ---------- */

.phone {
  --w: 300px;
  width: var(--w);
  margin-inline: auto;
  border-radius: 40px;
  padding: 11px;
  background: linear-gradient(160deg, #2c3450, #131826);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-screen {
  border-radius: 30px;
  background: var(--ground);
  padding: 20px 17px 17px;
  overflow: hidden;
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 18px;
}

.phone-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #200b05;
}

.phone-hello {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.phone-hello span {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-dim);
}

.ring-card {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
}

.ring-wrap {
  display: grid;
  place-items: center;
  position: relative;
}

.ring-wrap svg {
  width: 158px;
  height: 158px;
  transform: rotate(-90deg);
}

.ring-centre {
  position: absolute;
  text-align: center;
}

.ring-centre b {
  display: block;
  font-size: 33px;
  font-weight: 800;
  line-height: 1.1;
}

.ring-centre span {
  font-size: 11.5px;
  color: var(--ink-dim);
}

.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-block-start: 16px;
}

.macro span {
  font-size: 11px;
  color: var(--ink-dim);
}

.macro b {
  font-size: 12.5px;
  font-weight: 700;
}

.macro-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.09);
  margin-block-start: 5px;
  overflow: hidden;
}

.macro-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.meal-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-block-start: 10px;
}

.meal-row .ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 107, 74, 0.14);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.meal-row .txt {
  flex: 1;
  min-width: 0;
}

.meal-row .txt b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.meal-row .txt span {
  font-size: 11px;
  color: var(--ink-dim);
}

.meal-row .kcal {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--amber);
}

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

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

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

.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.section-head p {
  margin-block-start: 14px;
  color: var(--ink-dim);
  font-size: clamp(16px, 1.7vw, 18px);
}

.rule {
  border: 0;
  border-block-start: 1px solid var(--border);
  margin: 0;
}

/* ---------- the contrast block ---------- */

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

.contrast .panel {
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid var(--border);
  background: var(--raised);
}

.contrast .panel.bad {
  background: rgba(26, 32, 50, 0.45);
}

.contrast .panel h3 {
  font-size: 18px;
  margin-block-end: 14px;
}

.contrast .panel.bad h3 {
  color: var(--ink-dim);
}

.contrast .panel.good h3 {
  color: var(--coral);
}

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

.contrast li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15.5px;
  color: var(--ink-dim);
}

.contrast .good li {
  color: var(--ink);
}

.contrast li::before {
  content: "—";
  color: var(--ink-dim);
  flex: none;
}

.contrast .good li::before {
  content: "✓";
  color: var(--coral);
  font-weight: 800;
}

/* ---------- feature grid ---------- */

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

.feature {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature:hover {
  border-color: rgba(255, 107, 74, 0.42);
  transform: translateY(-3px);
}

.feature .ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 107, 74, 0.13);
  font-size: 21px;
  margin-block-end: 16px;
}

.feature h3 {
  font-size: 18px;
  margin-block-end: 9px;
}

.feature p {
  color: var(--ink-dim);
  font-size: 15.5px;
}

/* ---------- honest roadmap ---------- */

.building {
  border: 1px dashed rgba(255, 193, 94, 0.4);
  background: rgba(255, 193, 94, 0.05);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 38px);
}

.building h2 {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--amber);
}

.building > p {
  color: var(--ink-dim);
  margin-block-start: 12px;
  max-width: 62ch;
}

.building ul {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.building li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.building li b {
  display: block;
  font-size: 16px;
}

.building li p {
  color: var(--ink-dim);
  font-size: 15px;
}

.pill {
  flex: none;
  margin-block-start: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 193, 94, 0.16);
  color: var(--amber);
  white-space: nowrap;
}

/* ---------- closing call ---------- */

.cta {
  text-align: center;
  border-radius: 30px;
  padding: clamp(38px, 6vw, 66px) 26px;
  background: linear-gradient(150deg, rgba(255, 107, 74, 0.16), rgba(26, 32, 50, 0.5));
  border: 1px solid var(--border);
}

.cta h2 {
  font-size: clamp(26px, 4vw, 40px);
}

.cta p {
  color: var(--ink-dim);
  margin: 14px auto 30px;
  max-width: 48ch;
}

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

.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 40px 52px;
  margin-block-start: clamp(40px, 6vw, 80px);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 15px;
}

.site-footer a:hover {
  color: var(--ink);
}

.copyright {
  font-size: 14px;
  color: var(--ink-dim);
}

/* ---------- long-form pages (privacy, deletion) ---------- */

.doc {
  padding-block: clamp(40px, 6vw, 72px);
}

.doc .wrap {
  max-width: 780px;
}

.doc h1 {
  font-size: clamp(30px, 5vw, 44px);
}

.doc .updated {
  color: var(--ink-dim);
  font-size: 15px;
  margin-block-start: 12px;
}

.doc h2 {
  font-size: clamp(20px, 2.6vw, 26px);
  margin-block-start: 46px;
}

.doc h3 {
  font-size: 17.5px;
  margin-block-start: 28px;
}

.doc p,
.doc li {
  color: #cdd4e2;
  font-size: 16.5px;
}

.doc p {
  margin-block-start: 14px;
}

.doc ul,
.doc ol {
  margin-block-start: 14px;
  padding-inline-start: 22px;
  display: grid;
  gap: 9px;
}

.doc .callout {
  margin-block-start: 22px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 193, 94, 0.34);
  background: rgba(255, 193, 94, 0.07);
  padding: 18px 20px;
}

.doc .callout p {
  margin: 0;
  color: var(--ink);
}

.doc table {
  width: 100%;
  margin-block-start: 18px;
  border-collapse: collapse;
  font-size: 15.5px;
}

.doc th,
.doc td {
  text-align: start;
  padding: 11px 13px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.doc th {
  background: var(--raised);
  font-weight: 700;
}

.doc td {
  color: #cdd4e2;
}

.table-scroll {
  overflow-x: auto;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin-block-start: 20px;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.steps li::before {
  content: counter(step);
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: #200b05;
  font-weight: 800;
  font-size: 14px;
}

/* ---------- language switching ---------- */

/* Both languages ship in the markup so Arabic renders with JavaScript off —
   the app's own rule is that Arabic is the native language, not a locale the
   page falls back to. The English copy is simply hidden until asked for. */
[data-en] {
  display: none;
}

html[lang="en"] [data-ar] {
  display: none;
}

html[lang="en"] [data-en] {
  display: revert;
}

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .lede {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .eyebrow {
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding-inline: 18px;
  }

  .phone {
    --w: min(300px, 86vw);
  }

  .btn {
    width: 100%;
  }
}

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

  .btn:hover,
  .feature:hover {
    transform: none;
  }
}
