/* Layout: white canvas and a centred 1200px column. The hero and closing CTA sit on a live field of
   mosaic tiles; product UI appears as dark panels. Headlines run two-tone: ink, then a muted second line. */
:root {
  /* Surfaces and text (cool neutrals, biased toward the lapis accent) */
  --bg: #ffffff;
  --bg-soft: #f4f5f8;
  --surface: #ffffff;
  --line: #e6e7ee;
  --line-strong: #d3d5df;
  --ink: #0d0e13;
  --ink-2: #555968;
  --ink-3: #6b6e7c; /* small labels: 5.1:1 on white (WCAG AA) */
  --ink-muted: #868997; /* grey second line of big headlines: 3.5:1 (AA for large text) */
  --accent: #365b72; /* Mosaik interface accent */
  --ok: #17915a;
  --live: #4ade80;
  --err: #b42318;
  --warn: #b54708;
  --btn-bg: #0d0e13;
  --btn-fg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(13, 14, 19, 0.05), 0 4px 14px -6px rgba(13, 14, 19, 0.12);
  --shadow-lg: 0 40px 90px -30px rgba(13, 14, 19, 0.45), 0 0 0 1px rgba(13, 14, 19, 0.06);

  /* Deep sections (guardrails, dark pricing card, top bar) */
  --deep: #0d0e13;
  --deep-2: #171920;
  --deep-line: #262934;
  --deep-ink: #f3f4f8;
  --deep-ink-2: #a0a4b3;
  --deep-ink-3: #828696;

  /* Product panels (always dark) */
  --panel: #111318;
  --panel-2: #1a1c23;
  --panel-line: #272a34;
  --panel-ink: #eef0f5;
  --panel-ink-2: #9a9eac;
  --panel-ink-3: #838796;
  --panel-accent: #abd2e7;
  --panel-ok: #4ade80;
  --panel-warn: #fbbf24;

  /* Mosaic tiles for the background field (theme-dependent) */
  --tile-1: #a9c2ff; /* lapis */
  --tile-2: #9fe0d2; /* verdigris */
  --tile-3: #ffd89c; /* ochre */
  --tile-4: #ffb9ca; /* rose */
  --tile-5: #cfbdff; /* amethyst */
  --tile-alpha: 0.6;
  --glow-opacity: 0.85;
  --grid-line: rgba(13, 14, 19, 0.055);

  /* Chip colours for avatars and icons (same in both themes, dark text on top) */
  --chip-1: #a9c2ff;
  --chip-2: #9fe0d2;
  --chip-3: #ffd89c;
  --chip-4: #ffb9ca;
  --chip-5: #cfbdff;
  --chip-ink: #0d0e13;

  /* Type */
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 64px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --section-space: clamp(80px, 11vw, 150px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0f;
    --bg-soft: #121419;
    --surface: #16181f;
    --line: #23262f;
    --line-strong: #323541;
    --ink: #f2f3f7;
    --ink-2: #a5a9b7;
    --ink-3: #7e8290;
    --ink-muted: #6c707e;
    --accent: #abd2e7;
    --ok: #4ade80;
    --err: #f97066;
    --warn: #fdb022;
    --btn-bg: #f2f3f7;
    --btn-fg: #0a0b0f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.07);
    --deep: #111319;
    --deep-2: #1a1d25;
    --deep-line: #2a2d38;
    --panel: #13151b;
    --panel-2: #1c1f27;
    --panel-line: #2c303b;
    --tile-1: #3c56c4;
    --tile-2: #1d8a78;
    --tile-3: #a8741f;
    --tile-4: #a8405f;
    --tile-5: #6549c4;
    --tile-alpha: 0.42;
    --glow-opacity: 0.5;
    --grid-line: rgba(255, 255, 255, 0.05);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0b0f;
  --bg-soft: #121419;
  --surface: #16181f;
  --line: #23262f;
  --line-strong: #323541;
  --ink: #f2f3f7;
  --ink-2: #a5a9b7;
  --ink-3: #7e8290;
  --ink-muted: #6c707e;
  --accent: #abd2e7;
  --ok: #4ade80;
  --err: #f97066;
  --warn: #fdb022;
  --btn-bg: #f2f3f7;
  --btn-fg: #0a0b0f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --deep: #111319;
  --deep-2: #1a1d25;
  --deep-line: #2a2d38;
  --panel: #13151b;
  --panel-2: #1c1f27;
  --panel-line: #2c303b;
  --tile-1: #3c56c4;
  --tile-2: #1d8a78;
  --tile-3: #a8741f;
  --tile-4: #a8405f;
  --tile-5: #6549c4;
  --tile-alpha: 0.42;
  --glow-opacity: 0.5;
  --grid-line: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-space); }

/* ---------- Type ---------- */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 1.3rem + 3.9vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.muted { color: var(--ink-muted); }

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.center { text-align: center; }

.lead {
  margin: 0;
  max-width: 34em;
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.19rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.btn .i { width: 14px; height: 14px; transition: transform 0.2s ease; }
.btn:hover .i { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--ink) 55%, transparent); }

.btn-ghost {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-color: var(--line);
  color: var(--ink);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface); }

.btn-invert { background: var(--deep-ink); color: var(--deep); }
.btn-invert:hover { box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6); }

.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  overflow: hidden;
  background: var(--deep);
  color: var(--deep-ink);
  font-size: 13px;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--chip-1) 22%, transparent),
    transparent 32%, transparent 68%,
    color-mix(in srgb, var(--chip-4) 22%, transparent));
}
.topbar-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  min-height: 40px;
  padding-block: 6px;
  text-align: center;
}
.topbar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent);
}
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--deep-ink) 12%, transparent);
  transition: background-color 0.2s ease;
}
.topbar-link:hover { background: color-mix(in srgb, var(--deep-ink) 20%, transparent); }
.topbar-link .i { width: 12px; height: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-sub { color: var(--ink-3); font-weight: 600; }

.nav-links { display: flex; gap: 2px; margin-inline-start: 28px; }
.nav-links a,
.nav-contact {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover,
.nav-contact:hover { color: var(--ink); background: var(--bg-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding-inline: var(--gutter);
}
.mobile-menu a {
  display: block;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 500;
}
.mobile-menu a:last-child { border-bottom: 0; }

@media (max-width: 860px) {
  .nav-links, .nav-contact { display: none; }
  .nav-toggle { display: grid; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 64px 32px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.footer-brand p { margin: 16px 0 0; max-width: 28em; color: var(--ink-2); }
.footer-brand p + p { margin-top: 10px; }
.footer-contact { display: grid; gap: 8px; margin-top: 18px !important; }
.footer-contact li { display: flex; align-items: center; gap: 8px; }
.footer-contact .i { width: 14px; height: 14px; color: var(--ink-3); }
.footer-contact a { color: var(--ink-2); }
.footer-contact a:hover { color: var(--ink); }
.footer-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer ul a { color: var(--ink-2); transition: color 0.2s ease; }
.footer ul a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: flex; align-items: center; gap: 2px; }
.lang-switch a {
  padding: 6px 8px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.lang-switch a:hover { color: var(--ink); background: var(--bg-soft); }
.lang-switch a[aria-current="true"] { color: var(--ink); }

.mobile-lang {
  display: flex;
  gap: 8px;
  padding-block: 14px;
}
.mobile-lang a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
}
.mobile-lang a[aria-current="true"] { border-color: var(--ink); }

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

/* ---------- Arabic and right-to-left ---------- */
:root:lang(ar) {
  --font-display: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Sans Arabic", ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Letter-spacing breaks the joins between Arabic letters, and Arabic needs taller lines. */
:lang(ar) * { letter-spacing: 0 !important; }
:lang(ar) .display,
:lang(ar) .hero-title { line-height: 1.3; }
:lang(ar) .lead,
:lang(ar) body { line-height: 1.75; }

/* Direction arrows and chevrons point the other way in right-to-left layouts. */
[dir="rtl"] svg:has(> use[href="#i-arrow"]),
[dir="rtl"] svg:has(> use[href="#i-chev-left"]),
[dir="rtl"] svg:has(> use[href="#i-chev-right"]),
[dir="rtl"] svg:has(> use[href="#i-forward"]) { scale: -1 1; }
/* Prices stay in the Latin display face: Arabic-font digits run wider and would overflow the cards. */
:lang(ar) .plan-price {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.045em !important; /* Latin digits only, so the Arabic tracking reset does not apply */
}
