/* =========================================================================
   RTL Landing — base styles
   Mobile-first. Light theme by default; dark via [data-theme="dark"]
   (set by inline script in <head>). prefers-color-scheme is the no-JS
   fallback. Layout uses logical properties so RTL flips automatically.
   ========================================================================= */

/* ---------- Theme tokens (LIGHT — defaults) ---------- */
:root {
  /* Brand */
  --color-brand: #0891b2;          /* cyan-600 — calm, trustworthy */
  --color-brand-hover: #0e7490;    /* cyan-700 */
  --color-brand-on: #ffffff;

  /* Surfaces */
  --color-bg: #ffffff;
  --color-surface: #f8fafc;        /* slate-50 */
  --color-surface-2: #f1f5f9;      /* slate-100 */
  --color-border: #e2e8f0;         /* slate-200 */

  /* Text — contrast-checked against --color-bg (#ffffff) */
  --color-text: #0f172a;           /* slate-900 — 17.85:1 */
  --color-text-muted: #475569;     /* slate-600 — 7.06:1, well above 4.5:1 */

  /* Type */
  --font-latin: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hebrew: 'Heebo', 'Inter', system-ui, sans-serif;
  --font-arabic: 'Cairo', 'Inter', system-ui, sans-serif;
  --fs-base: 1rem;                 /* 16px floor */
  --lh-body: 1.65;

  /* Spacing scale (rem) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius / shadow */
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 760px;
}

/* ---------- DARK theme — explicit (set by JS) ---------- */
:root[data-theme="dark"] {
  --color-brand: #22d3ee;
  --color-brand-hover: #67e8f9;
  --color-brand-on: #082f49;

  --color-bg: #0b1220;
  --color-surface: #111a2e;
  --color-surface-2: #182238;
  --color-border: #1e2b48;

  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
}

/* ---------- DARK theme — no-JS fallback (system preference only) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-brand: #22d3ee;
    --color-brand-hover: #67e8f9;
    --color-brand-on: #082f49;

    --color-bg: #0b1220;
    --color-surface: #111a2e;
    --color-surface-2: #182238;
    --color-border: #1e2b48;

    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;        /* keep anchored sections clear of sticky header */
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-latin);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Locale-specific body fonts (Heebo for Hebrew, Cairo for Arabic) */
html[lang="he"] body { font-family: var(--font-hebrew); }
html[lang="ar"] body { font-family: var(--font-arabic); }

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

/* ---------- Skip link (a11y) — uses logical inset for RTL/LTR ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--color-brand);
  color: var(--color-brand-on);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 1000;
}
.skip-link:focus {
  inset-inline-start: var(--space-4);
  top: var(--space-4);
}

/* ---------- Visually hidden (for screen-reader-only headings) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container-narrow { max-width: var(--max-width-narrow); }

@media (max-width: 640px) {
  .container { padding-inline: var(--space-4); }
}

.section { padding-block: var(--space-20); }
.section-alt { background: var(--color-surface); }
@media (max-width: 640px) {
  .section { padding-block: var(--space-12); }
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  margin: 0 0 var(--space-4);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
/* Hebrew/Arabic typography is denser — reduce negative letter-spacing */
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 {
  letter-spacing: 0;
}

h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.75rem, 2.25rem); margin-bottom: var(--space-10); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-brand-hover); }

/* Visible focus ring (do not remove without replacement) */
:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  min-height: 44px;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-brand);
  color: var(--color-brand-on);
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 700;
}

.primary-nav {
  display: flex;
  gap: var(--space-6);
}
.primary-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-1);
}
.primary-nav a:hover { color: var(--color-text); }

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

/* ---------- Header tools (lang switcher + theme toggle) ---------- */
.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}
.lang-switcher button {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  padding: 0 var(--space-3);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 36px;
  min-width: 40px;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s;
}
.lang-switcher button + button {
  border-inline-start: 1px solid var(--color-border);
}
.lang-switcher button[aria-pressed="true"] {
  background: var(--color-brand);
  color: var(--color-brand-on);
}
.lang-switcher button:hover:not([aria-pressed="true"]) {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  font-family: inherit;
}
.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: center;
  white-space: nowrap;
  font-family: inherit;
}
.btn-large { padding: var(--space-4) var(--space-8); font-size: 1.0625rem; }

.btn-primary {
  background: var(--color-brand);
  color: var(--color-brand-on);
}
.btn-primary:hover { background: var(--color-brand-hover); color: var(--color-brand-on); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-2); color: var(--color-text); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding-block: var(--space-24) var(--space-16);
}
.hero h1 { max-width: 820px; margin-inline: auto; margin-bottom: var(--space-6); }
.hero-subtitle {
  max-width: 640px;
  margin: 0 auto var(--space-10);
  color: var(--color-text-muted);
  font-size: 1.125rem;
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .hero { padding-block: var(--space-16) var(--space-12); }
  .hero-ctas .btn { width: 100%; }
}

/* ---------- Demo grid ---------- */
.demo-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.demo-grid figure { margin: 0; }
.demo-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}
.demo-grid figcaption {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.steps li {
  background: var(--color-bg);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--color-brand-on);
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: var(--space-4);
}
.steps p { color: var(--color-text-muted); }

/* ---------- Supported sites ---------- */
.site-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}
.site-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  /* Brand names are LTR even on RTL pages */
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Pricing ---------- */
.price-card {
  max-width: 520px;
  margin-inline: auto;
  background: var(--color-bg);
  border: 2px solid var(--color-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  box-shadow: var(--shadow);
}
.price-amount {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-2);
  letter-spacing: -0.04em;
  color: var(--color-text);
  /* Currency + digits as a single LTR atom regardless of page direction */
  direction: ltr;
  unicode-bidi: isolate;
}
.price-currency {
  font-size: 0.5em;
  vertical-align: top;
  margin-inline-end: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.price-label {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  font-size: 1.0625rem;
}
.price-note {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-brand);
  border-radius: var(--radius);
  padding: var(--space-5);
  font-size: 0.9375rem;
  text-align: start;
  margin-bottom: var(--space-6);
  color: var(--color-text);
  line-height: 1.55;
}
.price-note strong { display: block; margin-bottom: var(--space-2); }
.price-fineprint {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: var(--space-4);
  margin-bottom: 0;
}

/* ---------- FAQ ---------- */
.faq-list { margin: 0; }
.faq-item {
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.faq-item:last-child { border-bottom: 0; }
.faq-item dt {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.faq-item dd {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ---------- Legal pages (privacy / terms / accessibility) ---------- */
.legal-page {
  padding-block: var(--space-12) var(--space-20);
}
.legal-back {
  margin: 0 0 var(--space-6);
  font-size: 0.9375rem;
}
.legal-back a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.legal-back a:hover { color: var(--color-brand); text-decoration: underline; }

.legal-header h1 { margin-bottom: var(--space-6); }

.legal-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0 0 var(--space-10);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  border-inline-start: 4px solid var(--color-brand);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.legal-meta dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-muted);
}
.legal-meta dd {
  margin: 0;
  color: var(--color-text);
}
.legal-meta time {
  font-variant-numeric: tabular-nums;
  /* Dates always render LTR, even on RTL pages */
  direction: ltr;
  unicode-bidi: isolate;
}
@media (max-width: 600px) {
  .legal-meta {
    grid-template-columns: 1fr;
    gap: 0;
    padding: var(--space-4);
  }
  .legal-meta dt { margin-top: var(--space-3); }
  .legal-meta dt:first-child { margin-top: 0; }
  .legal-meta dd { margin-bottom: var(--space-1); }
}

.legal-body { line-height: 1.7; color: var(--color-text); }
.legal-body h2 {
  font-size: 1.5rem;
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 {
  font-size: 1.125rem;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.legal-body p { margin: 0 0 var(--space-4); }
.legal-body ul,
.legal-body ol {
  margin: 0 0 var(--space-4);
  padding-inline-start: var(--space-6);
}
.legal-body li { margin-bottom: var(--space-2); }
.legal-body code {
  background: var(--color-surface-2);
  padding: 0.1em 0.35em;
  border-radius: 0.25em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  /* Code snippets always render LTR */
  direction: ltr;
  unicode-bidi: isolate;
}
.legal-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

.placeholder-note {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.placeholder-note strong {
  color: var(--color-brand);
  font-weight: 700;
  margin-inline-end: var(--space-2);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-8);
  background: var(--color-surface);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.site-footer nav {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.site-footer nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-footer nav a:hover { color: var(--color-text); text-decoration: underline; }
.copyright {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin: 0;
}
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
