/* ==========================================================================
   LangLab — launch site
   One stylesheet serves English (LTR) and Arabic (RTL). Everything directional
   uses CSS logical properties, so the RTL page needs no mirrored overrides.
   Palette is sampled from the app logo and the Flutter theme seed (#2E5BFF).
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */
:root {
  /* brand — sampled from assets/icon/app_icon.png */
  --blue: #2e5bff;
  --blue-deep: #1c3fd1;
  --indigo: #4a5bf0;
  --violet: #7f3cf0;
  --violet-deep: #6425cf;
  --green: #2f9d80;
  --orange: #d9782a;
  --flame: #ff8a00;
  --navy: #0f1a3d;

  --grad-brand: linear-gradient(120deg, var(--blue) 0%, var(--violet) 100%);
  --grad-soft: linear-gradient(120deg, #eef2ff 0%, #f6f0ff 100%);

  /* spacing — the app's 4pt grid */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* radii — mirrors lib/app/tokens.dart Corners */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  --container: 1140px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 400ms;

  --font: "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Tahoma, "Noto Sans Arabic", "Helvetica Neue", sans-serif;
}

/* light (default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfcff;
  --bg-alt: #f3f5fd;
  --surface: #ffffff;
  --surface-2: #f7f8fe;
  --line: #e3e7f5;
  --line-strong: #ccd3ea;
  --text: #14192e;
  --text-muted: #5a6285;
  /* 4.6:1 on --surface-2, the lightest surface it lands on. The obvious
     lighter grey here fails AA at the 0.85rem this is used at. */
  --text-faint: #67708f;
  --brand-text: var(--blue-deep);
  --on-brand: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 26, 61, 0.06), 0 2px 8px rgba(15, 26, 61, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 26, 61, 0.07), 0 12px 32px rgba(15, 26, 61, 0.07);
  --shadow-lg: 0 12px 28px rgba(15, 26, 61, 0.1), 0 32px 64px rgba(15, 26, 61, 0.11);
  --glow-a: rgba(46, 91, 255, 0.16);
  --glow-b: rgba(127, 60, 240, 0.14);
  --header-bg: rgba(251, 252, 255, 0.82);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e1c;
  --bg-alt: #0e1428;
  --surface: #141b33;
  --surface-2: #1a2240;
  --line: #262f4f;
  --line-strong: #36416a;
  --text: #eef1fb;
  --text-muted: #a4adcd;
  --text-faint: #7b85a8;
  --brand-text: #9db2ff;
  --on-brand: #ffffff;
  --grad-soft: linear-gradient(120deg, #161d38 0%, #1d1839 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45), 0 32px 64px rgba(0, 0, 0, 0.45);
  --glow-a: rgba(46, 91, 255, 0.3);
  --glow-b: rgba(127, 60, 240, 0.26);
  --header-bg: rgba(10, 14, 28, 0.8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0a0e1c;
    --bg-alt: #0e1428;
    --surface: #141b33;
    --surface-2: #1a2240;
    --line: #262f4f;
    --line-strong: #36416a;
    --text: #eef1fb;
    --text-muted: #a4adcd;
    --text-faint: #7b85a8;
    --brand-text: #9db2ff;
    --grad-soft: linear-gradient(120deg, #161d38 0%, #1d1839 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45), 0 32px 64px rgba(0, 0, 0, 0.45);
    --glow-a: rgba(46, 91, 255, 0.3);
    --glow-b: rgba(127, 60, 240, 0.26);
    --header-bg: rgba(10, 14, 28, 0.8);
  }
}

/* ---------------------------------------------------------- 2. Base / reset */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
:root[lang="ar"] h1,
:root[lang="ar"] h2,
:root[lang="ar"] h3,
:root[lang="ar"] h4 { letter-spacing: 0; line-height: 1.35; }

h1 { font-size: clamp(2.15rem, 1.5rem + 3.1vw, 3.85rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.9vw, 2.6rem); }
h3 { font-size: clamp(1.12rem, 1.03rem + 0.4vw, 1.3rem); }

p { text-wrap: pretty; }

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

button, input, select, textarea { font: inherit; color: inherit; }

:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--violet); color: #fff; }

.sr-only {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--sp-4);
  z-index: 100;
  padding: var(--sp-3) var(--sp-5);
  background: var(--blue);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus-visible { inset-block-start: 0; }

/* ------------------------------------------------------------- 3. Utilities */
.container {
  inline-size: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.section--alt { background: var(--bg-alt); }

.section-head {
  max-inline-size: 44rem;
  margin-inline: auto;
  margin-block-end: clamp(2rem, 1rem + 3vw, 3.5rem);
  text-align: center;
}
.section-head p {
  margin-block-start: var(--sp-4);
  color: var(--text-muted);
  font-size: 1.075rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-block-end: var(--sp-4);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
:root[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.85rem; }

.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  color: var(--text-muted);
}

/* --------------------------------------------------------------- 4. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-block-size: 48px;
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--grad-brand);
  color: var(--on-brand);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 35%, transparent);
}
.btn--primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--blue) 45%, transparent); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--blue); color: var(--brand-text); }

.btn--sm { min-block-size: 40px; padding: var(--sp-2) var(--sp-4); font-size: 0.925rem; }

.btn svg { inline-size: 1.15em; block-size: 1.15em; flex: none; }
/* Arrow glyphs point at the reading direction, so flip them in RTL. */
[dir="rtl"] .btn .icon-arrow { transform: scaleX(-1); }

/* ---------------------------------------------------------------- 5. Header */
.header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  block-size: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-block-end: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.header.is-stuck {
  border-block-end-color: var(--line);
  box-shadow: 0 1px 12px rgba(15, 26, 61, 0.05);
}

.header .container {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand img { inline-size: 30px; block-size: 38px; object-fit: contain; }
.brand .lab { color: var(--blue); }

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-inline-start: auto;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--dur-fast) var(--ease);
}
.nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}
.nav + .header-actions { margin-inline-start: 0; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { inline-size: 20px; block-size: 20px; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  block-size: 44px;
  padding-inline: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.lang-switch:hover { border-color: var(--blue); color: var(--brand-text); }
.lang-switch svg { inline-size: 17px; block-size: 17px; flex: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .brand span { display: none; }
  .brand img { inline-size: 34px; block-size: 42px; }
}

/* ------------------------------------------------------------------ 6. Hero */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 1rem + 6vw, 5rem) clamp(3rem, 1.5rem + 6vw, 6rem);
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.hero::before {
  inline-size: 46rem; block-size: 46rem;
  inset-block-start: -22rem;
  inset-inline-end: -14rem;
  background: var(--glow-a);
}
.hero::after {
  inline-size: 34rem; block-size: 34rem;
  inset-block-end: -18rem;
  inset-inline-start: -12rem;
  background: var(--glow-b);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}

.hero-logo {
  inline-size: clamp(190px, 16vw, 250px);
  margin-block-end: var(--sp-5);
}
.hero h1 { margin-block-end: var(--sp-5); }
.hero .lead { max-inline-size: 34rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-block-end: var(--sp-5);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--brand-text);
  font-size: 0.9rem;
  font-weight: 700;
}
.pill .dot {
  inline-size: 8px; block-size: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block: var(--sp-6) var(--sp-5);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  color: var(--text-muted);
  font-size: 0.925rem;
}
.hero-meta li { display: flex; align-items: center; gap: var(--sp-2); list-style: none; }
.hero-meta svg { inline-size: 17px; block-size: 17px; color: var(--green); flex: none; }
.hero-meta ul { display: contents; }

/* store buttons — anchors once a listing is live (#122: iOS is), spans while
   a store is still pending, so nothing is ever clickable-but-dead */
.stores { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block-start: var(--sp-5); }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.store-btn svg { inline-size: 26px; block-size: 26px; flex: none; }
.store-btn b { display: block; font-size: 1rem; line-height: 1.2; font-weight: 800; }
.store-btn small { display: block; font-size: 0.72rem; color: var(--text-faint); line-height: 1.5; }
/* The anchor variant: same badge, but it behaves like the button it looks
   like. The .legal selector out-specifies `.legal a`, which would otherwise
   paint it blue and underlined on article pages like /android. */
a.store-btn, .legal a.store-btn {
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: transform var(--dur, 200ms) ease, border-color var(--dur, 200ms) ease;
}
a.store-btn:hover { transform: translateY(-2px); border-color: var(--blue); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy .lead, .hero-logo { margin-inline: auto; }
  .hero-cta, .hero-meta, .stores, .waitlist { justify-content: center; }
  .hero-visual { order: 2; }
}

/* ---------------------------------------------------------- 7. Phone mockup */
.hero-visual { display: grid; place-items: center; position: relative; }

.phone {
  position: relative;
  inline-size: min(320px, 84vw);
  aspect-ratio: 320 / 660;
  padding: 11px;
  border-radius: 46px;
  background: linear-gradient(160deg, #2b3350, #10131f 55%, #262d47);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}
.phone::after { /* dynamic island */
  content: "";
  position: absolute;
  inset-block-start: 22px;
  /* auto margins against both edges, so it centres in LTR and RTL alike.
     inset-inline-start:50% + translateX(-50%) mixes a logical offset with a
     physical transform and drifts off-centre on the Arabic page. */
  inset-inline: 0;
  margin-inline: auto;
  inline-size: 84px; block-size: 24px;
  border-radius: var(--r-pill);
  background: #05070d;
  z-index: 3;
}
.phone-screen {
  block-size: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 36px;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.55;
}

.app-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 42px var(--sp-4) var(--sp-3);
  background: var(--surface-2);
  border-block-end: 1px solid var(--line);
}
.app-bar .avatar {
  inline-size: 34px; block-size: 34px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem;
  flex: none;
}
.app-bar .who { min-inline-size: 0; }
.app-bar .who b { display: block; font-size: 0.85rem; font-weight: 800; line-height: 1.3; }
.app-bar .who small { color: var(--text-faint); font-size: 0.68rem; }
.app-bar .streak {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--flame) 16%, transparent);
  color: #8a4a00;
  font-weight: 800; font-size: 0.72rem;
  flex: none;
}
:root[data-theme="dark"] .app-bar .streak { color: #ffc078; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .app-bar .streak { color: #ffc078; }
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 80% 0%, color-mix(in srgb, var(--violet) 7%, transparent), transparent),
    var(--surface);
}

.bubble {
  max-inline-size: 84%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.bubble--tutor {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-start-start-radius: 4px;
}
.bubble--me {
  align-self: flex-end;
  background: var(--grad-brand);
  color: #fff;
  border-end-end-radius: 4px;
}
/* The learner is studying English, so target-language text stays LTR even on
   the Arabic page — as its own block, or it would inherit the bubble's RTL
   alignment and sit ragged-left. */
.bubble > [dir="ltr"] { display: block; text-align: start; }

.bubble .translated {
  display: block;
  margin-block-start: var(--sp-2);
  padding-block-start: var(--sp-2);
  border-block-start: 1px dashed var(--line-strong);
  color: var(--text-faint);
  font-size: 0.74rem;
}

.word-chip {
  border-radius: 5px;
  padding: 1px 3px;
  background: color-mix(in srgb, var(--violet) 18%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--violet) 55%, transparent);
  font-weight: 700;
}

.bubble-tools { display: flex; gap: var(--sp-2); margin-block-start: var(--sp-2); }
.tool {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.68rem; font-weight: 700;
}
.tool svg { inline-size: 11px; block-size: 11px; }
.tool--on { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--brand-text); border-color: transparent; }

.collect-toast {
  align-self: center;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: #1c6b58;
  font-size: 0.7rem;
  font-weight: 800;
}
:root[data-theme="dark"] .collect-toast { color: #7fd9c0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .collect-toast { color: #7fd9c0; }
}

.typing { display: inline-flex; gap: 4px; align-items: center; padding-block: 3px; }
.typing i {
  inline-size: 6px; block-size: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: bounce 1.3s var(--ease) infinite;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.composer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-5);
  border-block-start: 1px solid var(--line);
  background: var(--surface-2);
}
.composer .field {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.76rem;
}
.composer .mic {
  inline-size: 36px; block-size: 36px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
}
.composer .mic svg { inline-size: 17px; block-size: 17px; }

/* floating language chips echoing the logo */
.chip-float {
  position: absolute;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
  animation: float 6s var(--ease) infinite;
}
.chip-float:nth-of-type(2) { animation-delay: -2s; }
.chip-float:nth-of-type(3) { animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.chip-ar { background: var(--green); inset-block-start: 8%; inset-inline-start: -4%; }
.chip-en { background: var(--blue); inset-block-end: 22%; inset-inline-end: -5%; }
.chip-fr { background: var(--indigo); inset-block-end: 6%; inset-inline-start: 2%; }

@media (max-width: 1000px) { .chip-float { display: none; } }

/* --------------------------------------------------------- 8. Language band */
.lang-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-block-start: var(--sp-6);
}
.lang-chip {
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.lang-chip--live {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 30%, transparent);
}
.lang-chip--soon { border-style: dashed; color: var(--text-faint); box-shadow: none; background: transparent; }

/* -------------------------------------------------------------- 9. Features */
.grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
}
.card h3 { margin-block-end: var(--sp-2); }
.card p { color: var(--text-muted); font-size: 0.975rem; }

.card-icon {
  display: grid;
  place-items: center;
  inline-size: 50px; block-size: 50px;
  margin-block-end: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 28%, transparent);
}
.card-icon svg { inline-size: 25px; block-size: 25px; }
.card-icon--violet { background: linear-gradient(135deg, var(--violet), #b06bff); box-shadow: 0 6px 16px color-mix(in srgb, var(--violet) 28%, transparent); }
.card-icon--green  { background: linear-gradient(135deg, var(--green), #58c9a8); box-shadow: 0 6px 16px color-mix(in srgb, var(--green) 28%, transparent); }
.card-icon--flame  { background: linear-gradient(135deg, var(--orange), var(--flame)); box-shadow: 0 6px 16px color-mix(in srgb, var(--flame) 28%, transparent); }

/* ------------------------------------------------------------- 10. Lina row */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

.lina-card {
  position: relative;
  padding: clamp(1.75rem, 1rem + 3vw, 2.75rem);
  border-radius: var(--r-2xl);
  background: var(--grad-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.lina-card::after {
  content: "";
  position: absolute;
  inset-block-start: -6rem; inset-inline-end: -6rem;
  inline-size: 16rem; block-size: 16rem;
  border-radius: 50%;
  background: var(--glow-b);
  filter: blur(50px);
  pointer-events: none;
}
/* flex, not grid: the bubbles rely on align-self to pick their side */
.lina-quotes { display: flex; flex-direction: column; gap: var(--sp-3); position: relative; }
.lina-quotes .bubble { max-inline-size: 92%; font-size: 0.95rem; }

.checklist { display: grid; gap: var(--sp-3); margin-block-start: var(--sp-5); padding: 0; }
.checklist li { display: flex; gap: var(--sp-3); align-items: flex-start; list-style: none; }
.checklist svg {
  inline-size: 22px; block-size: 22px; flex: none;
  margin-block-start: 3px;
  color: var(--green);
}
.checklist b { display: block; }
.checklist span { color: var(--text-muted); font-size: 0.95rem; }

/* --------------------------------------------------------------- 11. Steps */
.steps {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  counter-reset: step;
}
.step {
  position: relative;
  padding: var(--sp-6);
  border-radius: var(--r-2xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  inline-size: 42px; block-size: 42px;
  margin-block-end: var(--sp-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--brand-text);
  font-weight: 900;
  font-size: 1.05rem;
}
.step h3 { margin-block-end: var(--sp-2); }
.step p { color: var(--text-muted); font-size: 0.975rem; }

/* ---------------------------------------------------------------- 12. Road */
.road {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.road-node {
  display: grid;
  place-items: center;
  inline-size: 40px; block-size: 40px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  flex: none;
}
.road-node--done { background: var(--grad-brand); color: #fff; }
.road-node--now {
  background: var(--surface);
  color: var(--brand-text);
  border: 2px dashed var(--blue);
}
.road-node--locked { background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--line); }
.road-line { flex: 1; min-inline-size: 12px; block-size: 3px; border-radius: 2px; background: var(--line-strong); }
.road-line--done { background: var(--grad-brand); }

/* -------------------------------------------------------------- 13. Pricing */
.plans {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  max-inline-size: 56rem;
  margin-inline: auto;
  align-items: start;
}
.plan {
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.plan--featured {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad-brand) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
}
.plan-name { display: flex; align-items: center; gap: var(--sp-3); margin-block-end: var(--sp-2); }
.plan-name h3 { font-size: 1.35rem; }
.tag {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.plan-price { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; margin-block: var(--sp-2); }
.plan-price small { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.plan ul { margin-block-start: var(--sp-5); padding: 0; display: grid; gap: var(--sp-3); }
.plan li { display: flex; gap: var(--sp-3); align-items: flex-start; list-style: none; font-size: 0.975rem; }
.plan li svg { inline-size: 20px; block-size: 20px; flex: none; margin-block-start: 3px; color: var(--green); }
.plan-note { margin-block-start: var(--sp-5); font-size: 0.85rem; color: var(--text-faint); }

/* ------------------------------------------------------------------ 14. FAQ */
.faq { max-inline-size: 48rem; margin-inline: auto; display: grid; gap: var(--sp-3); }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.faq details[open] { border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.faq summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  min-block-size: 56px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  margin-inline-start: auto;
  inline-size: 11px; block-size: 11px;
  /* Physical borders on purpose: this caret means open/closed, not a reading
     direction, so it must point down in RTL too. Logical borders would flip it
     into a sideways chevron on the Arabic page. */
  border-right: 2.5px solid var(--text-faint);
  border-bottom: 2.5px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease);
  flex: none;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p { padding: 0 var(--sp-5) var(--sp-5); color: var(--text-muted); font-size: 0.975rem; }

/* ------------------------------------------------------------- 15. Waitlist */
.cta-band {
  position: relative;
  padding: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 3vw, 4rem);
  border-radius: var(--r-2xl);
  background: var(--grad-brand);
  color: #fff;
  overflow: hidden;
  text-align: center;
}
.cta-band::after {
  content: "";
  position: absolute;
  inset-block-start: -50%; inset-inline-start: -10%;
  inline-size: 60%; block-size: 200%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.cta-band h2, .cta-band p { position: relative; }
.cta-band p { margin-block-start: var(--sp-4); color: rgba(255, 255, 255, 0.9); }

.waitlist {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  max-inline-size: 32rem;
  margin: var(--sp-6) auto 0;
}
.waitlist input {
  flex: 1 1 15rem;
  min-block-size: 52px;
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
}
.waitlist input::placeholder { color: #7d86a6; }
.waitlist input:focus-visible { outline-color: #fff; }
.waitlist input[aria-invalid="true"] { border-color: #ffd0d0; box-shadow: 0 0 0 3px rgba(255, 120, 120, 0.35); }
.waitlist .btn {
  min-block-size: 52px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.waitlist .btn:hover { background: #1b2a58; }
.waitlist-status {
  position: relative;
  min-block-size: 1.5rem;
  margin-block-start: var(--sp-3);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* --------------------------------------------------------------- 16. Footer */
.footer {
  padding-block: var(--sp-7) var(--sp-6);
  border-block-start: 1px solid var(--line);
  background: var(--bg-alt);
}
.footer-top {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  margin-block-end: var(--sp-6);
}
.footer .brand { font-size: 1.15rem; }
.footer-about p { margin-block-start: var(--sp-3); color: var(--text-muted); font-size: 0.925rem; max-inline-size: 24rem; }
.footer h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-block-end: var(--sp-3); }
:root[lang="ar"] .footer h3 { text-transform: none; letter-spacing: 0; font-size: 0.9rem; }
.footer ul { padding: 0; display: grid; gap: var(--sp-2); }
.footer li { list-style: none; }
.footer li a { color: var(--text-muted); text-decoration: none; font-size: 0.925rem; }
.footer li a:hover { color: var(--brand-text); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  align-items: center;
  justify-content: space-between;
  padding-block-start: var(--sp-5);
  border-block-start: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------- 17. Motion */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================ Legal pages */
.legal { max-inline-size: 46rem; margin-inline: auto; }
.legal h1 {
  font-size: clamp(1.9rem, 1.5rem + 2vw, 2.6rem);
  line-height: 1.2;
  margin-block-end: var(--sp-2);
}
.legal .meta { color: var(--text-muted); font-size: 0.95rem; margin-block-end: var(--sp-6); }
.legal h2 { font-size: 1.3rem; margin-block: var(--sp-6) var(--sp-3); }
.legal p, .legal li { color: var(--text-muted); line-height: 1.75; }
.legal ul { padding-inline-start: 1.2rem; margin-block: var(--sp-3); display: grid; gap: var(--sp-2); }
.legal strong { color: inherit; font-weight: 700; }
.legal a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.legal .legal-summary {
  border-inline-start: 3px solid var(--blue);
  background: var(--grad-soft);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-5) var(--sp-6);
}
:root[data-theme="dark"] .legal .legal-summary { background: rgba(46, 91, 255, 0.08); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .legal .legal-summary { background: rgba(46, 91, 255, 0.08); }
}
