/* ============================================================
   BiDi — Landing Page
   Aesthetic: "Typographic Duality" — dark editorial,
   celebrating the intersection of LTR and RTL worlds.
   ============================================================ */

/* --- Tokens --- */
:root {
  --color-bg: #08090d;
  --color-surface: #0f1117;
  --color-surface-raised: #161822;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-vivid: rgba(74, 144, 217, 0.25);
  --color-text: #e2e4ed;
  --color-text-muted: #8b8fa7;
  --color-text-faint: #5a5e75;
  --color-primary: #4a90d9;
  --color-primary-glow: rgba(74, 144, 217, 0.15);
  --color-accent: #d4a053;
  --color-danger: #e85d5d;
  --color-success: #4ad99a;
  --font-display: "Outfit", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-hebrew: "Heebo", sans-serif;
  --font-arabic: "Cairo", sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Light Theme --- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --color-bg: #f5f6fa;
    --color-surface: #ffffff;
    --color-surface-raised: #edeef3;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-vivid: rgba(74, 144, 217, 0.3);
    --color-text: #1a1c24;
    --color-text-muted: #5a5e75;
    --color-text-faint: #8b8fa7;
    --color-primary: #3a7bc8;
    --color-primary-glow: rgba(74, 144, 217, 0.1);
    --color-danger: #d14343;
    --color-success: #2a9d6a;
  }
}

:root[data-theme="light"] {
  --color-bg: #f5f6fa;
  --color-surface: #ffffff;
  --color-surface-raised: #edeef3;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-vivid: rgba(74, 144, 217, 0.3);
  --color-text: #1a1c24;
  --color-text-muted: #5a5e75;
  --color-text-faint: #8b8fa7;
  --color-primary: #3a7bc8;
  --color-primary-glow: rgba(74, 144, 217, 0.1);
  --color-danger: #d14343;
  --color-success: #2a9d6a;
}

/* Light-mode specific overrides */
:root[data-theme="light"] .bg-grid {
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bg-grid {
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  }
}

:root[data-theme="light"] .bg-glow--1 {
  background: radial-gradient(circle, rgba(74, 144, 217, 0.08), transparent 70%);
}

:root[data-theme="light"] .bg-glow--2 {
  background: radial-gradient(circle, rgba(212, 160, 83, 0.05), transparent 70%);
}

:root[data-theme="light"] .nav-header {
  background: rgba(245, 246, 250, 0.8);
}

:root[data-theme="light"] .hero__gradient {
  background: linear-gradient(135deg, var(--color-primary), #2a6ab5, #b8860b);
  background-clip: text;
  -webkit-background-clip: text;
}

:root[data-theme="light"] .browser-frame {
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .btn--primary {
  box-shadow: 0 0 0 0 rgba(58, 123, 200, 0.3),
    0 4px 20px -4px rgba(58, 123, 200, 0.25);
}

:root[data-theme="light"] .btn--primary:hover {
  box-shadow: 0 0 0 4px rgba(58, 123, 200, 0.1),
    0 8px 32px -4px rgba(58, 123, 200, 0.3);
}

:root[data-theme="light"] .feature-card:hover {
  box-shadow: 0 20px 60px -15px rgba(74, 144, 217, 0.08);
}

:root[data-theme="light"] .mode-card--highlight {
  background: linear-gradient(135deg, #ffffff, rgba(74, 144, 217, 0.05));
  box-shadow: 0 0 40px -10px rgba(74, 144, 217, 0.08);
}

:root[data-theme="light"] .cta-section__inner {
  background: linear-gradient(135deg, #ffffff, rgba(74, 144, 217, 0.04));
}

:root[data-theme="light"] .demo__panel:hover {
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1);
}

/* prefers-color-scheme light equivalents */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bg-glow--1 {
    background: radial-gradient(circle, rgba(74, 144, 217, 0.08), transparent 70%);
  }
  :root:not([data-theme="dark"]) .bg-glow--2 {
    background: radial-gradient(circle, rgba(212, 160, 83, 0.05), transparent 70%);
  }
  :root:not([data-theme="dark"]) .nav-header {
    background: rgba(245, 246, 250, 0.8);
  }
  :root:not([data-theme="dark"]) .hero__gradient {
    background: linear-gradient(135deg, var(--color-primary), #2a6ab5, #b8860b);
    background-clip: text;
    -webkit-background-clip: text;
  }
  :root:not([data-theme="dark"]) .browser-frame {
    box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(0, 0, 0, 0.06);
  }
  :root:not([data-theme="dark"]) .btn--primary {
    box-shadow: 0 0 0 0 rgba(58, 123, 200, 0.3),
      0 4px 20px -4px rgba(58, 123, 200, 0.25);
  }
  :root:not([data-theme="dark"]) .btn--primary:hover {
    box-shadow: 0 0 0 4px rgba(58, 123, 200, 0.1),
      0 8px 32px -4px rgba(58, 123, 200, 0.3);
  }
  :root:not([data-theme="dark"]) .feature-card:hover {
    box-shadow: 0 20px 60px -15px rgba(74, 144, 217, 0.08);
  }
  :root:not([data-theme="dark"]) .mode-card--highlight {
    background: linear-gradient(135deg, #ffffff, rgba(74, 144, 217, 0.05));
    box-shadow: 0 0 40px -10px rgba(74, 144, 217, 0.08);
  }
  :root:not([data-theme="dark"]) .cta-section__inner {
    background: linear-gradient(135deg, #ffffff, rgba(74, 144, 217, 0.04));
  }
  :root:not([data-theme="dark"]) .demo__panel:hover {
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1);
  }
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-muted);
  transition: border-color 0.3s, color 0.3s;
}

.theme-toggle:hover {
  border-color: var(--color-border-vivid);
  color: var(--color-text);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
  transition: transform 0.35s var(--ease-spring);
}

.theme-toggle:hover .theme-toggle__icon {
  transform: rotate(30deg);
}

.theme-toggle__sun,
.theme-toggle__moon {
  transition: opacity 0.25s;
}

/* In dark mode show sun icon, in light mode show moon icon */
.theme-toggle__sun { opacity: 1; }
.theme-toggle__moon { opacity: 0; position: absolute; }

:root[data-theme="light"] .theme-toggle__sun { opacity: 0; position: absolute; }
:root[data-theme="light"] .theme-toggle__moon { opacity: 1; position: static; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle__sun { opacity: 0; position: absolute; }
  :root:not([data-theme="dark"]) .theme-toggle__moon { opacity: 1; position: static; }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@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;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Hebrew mode */
html[lang="he"] body {
  font-family: var(--font-hebrew);
}

html[lang="he"] h1,
html[lang="he"] h2,
html[lang="he"] h3,
html[lang="he"] h4 {
  font-family: var(--font-hebrew);
}

/* Arabic mode */
html[lang="ar"] body {
  font-family: var(--font-arabic);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 {
  font-family: var(--font-arabic);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.88em;
  padding: 3px 8px;
  background: rgba(74, 144, 217, 0.1);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-primary);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* --- Ambient Background --- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.bg-glow--1 {
  width: 600px;
  height: 600px;
  top: -180px;
  right: -100px;
  background: radial-gradient(circle, var(--color-primary-glow), transparent 70%);
}

.bg-glow--2 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, rgba(212, 160, 83, 0.08), transparent 70%);
}

/* --- Navigation --- */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.7);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav__logo img {
  border-radius: 6px;
}

.nav__links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s var(--ease-out);
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.nav__links a:hover {
  color: var(--color-text);
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Language Toggle --- */
.lang-toggle {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0;
  cursor: default;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.lang-toggle:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.lang-toggle:hover {
  border-color: var(--color-border-vivid);
}

.lang-toggle__track {
  display: flex;
  align-items: center;
  position: relative;
  width: 126px;
  height: 36px;
  padding: 3px;
}

.lang-toggle__option {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  z-index: 2;
  transition: color 0.3s;
  user-select: none;
  line-height: 30px;
  cursor: pointer;
}

.lang-toggle__option--active {
  color: var(--color-text);
  cursor: default;
}

.lang-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(33.333% - 2px);
  height: 30px;
  background: var(--color-surface-raised);
  border-radius: 100px;
  transition: transform 0.35s var(--ease-spring);
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Thumb positions for 3-way toggle */
.lang-toggle[data-active="en"] .lang-toggle__thumb {
  transform: translateX(0);
}

.lang-toggle[data-active="ar"] .lang-toggle__thumb {
  transform: translateX(100%);
}

.lang-toggle[data-active="he"] .lang-toggle__thumb {
  transform: translateX(200%);
}

/* Active option text color */
.lang-toggle[data-active="en"] .lang-toggle__option[data-lang="en"],
.lang-toggle[data-active="ar"] .lang-toggle__option[data-lang="ar"],
.lang-toggle[data-active="he"] .lang-toggle__option[data-lang="he"] {
  color: var(--color-text);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn__icon {
  flex-shrink: 0;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.4),
    0 4px 20px -4px rgba(74, 144, 217, 0.35);
}

.btn--primary:hover {
  background: #5a9de3;
  box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.15),
    0 8px 32px -4px rgba(74, 144, 217, 0.45);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  color: var(--color-text);
  border-color: var(--color-border-vivid);
  background: var(--color-primary-glow);
}

.btn--lg {
  padding: 18px 40px;
  font-size: 1.05rem;
}

.btn--sm {
  padding: 8px 16px;
  gap: 8px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  padding: 100px 0 40px;
}

.hero__inner {
  text-align: center;
}

.hero__badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  padding: 6px 16px;
  border: 1px solid var(--color-border-vivid);
  border-radius: 100px;
  margin-bottom: 32px;
  background: var(--color-primary-glow);
  animation: fade-slide-up 0.6s var(--ease-out) both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}

html[lang="he"] .hero__title,
html[lang="ar"] .hero__title {
  letter-spacing: 0;
}

.hero__line {
  display: block;
}

.hero__line--1 {
  color: var(--color-text);
  animation: fade-slide-up 0.6s 0.1s var(--ease-out) both;
}

.hero__line--2 {
  animation: fade-slide-up 0.6s 0.2s var(--ease-out) both;
}

.hero__line--3 {
  color: var(--color-text-muted);
  animation: fade-slide-up 0.6s 0.3s var(--ease-out) both;
}

.hero__gradient {
  background: linear-gradient(135deg, var(--color-primary), #7bb8f0, var(--color-accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__sub {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: fade-slide-up 0.6s 0.4s var(--ease-out) both;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-slide-up 0.6s 0.5s var(--ease-out) both;
}

/* --- Hero Visual (Browser mockup) --- */
.hero__visual {
  margin-top: 64px;
  perspective: 1200px;
  animation: fade-slide-up 0.8s 0.6s var(--ease-out) both;
}

.browser-frame {
  max-width: 720px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transform: rotateX(2deg);
  transition: transform 0.5s var(--ease-out);
}

.browser-frame:hover {
  transform: rotateX(0);
}

.browser-frame__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
}

.browser-frame__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.browser-frame__dot:first-child {
  background: #e85d5d;
}

.browser-frame__dot:nth-child(2) {
  background: #e8b85d;
}

.browser-frame__dot:nth-child(3) {
  background: #4ad99a;
}

.browser-frame__url {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-faint);
  background: var(--color-surface);
  padding: 5px 16px;
  border-radius: 6px;
  margin: 0 40px;
}

.browser-frame__ext {
  display: flex;
  align-items: center;
  gap: 4px;
}

.browser-frame__badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-vivid);
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.browser-frame__content {
  padding: 24px;
  min-height: 200px;
}

/* --- Chat Demo inside browser --- */
.chat-demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-demo__msg {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.7;
}

.chat-demo__msg--user {
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-vivid);
  align-self: flex-end;
  max-width: 85%;
}

.chat-demo__msg--ai {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  max-width: 90%;
}

.chat-demo__msg p {
  margin: 0 0 6px;
}

.chat-demo__msg p:last-child {
  margin-bottom: 0;
}

.chat-demo__indicator {
  display: flex;
  justify-content: center;
}

.chat-demo__bidi-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-success);
  background: rgba(74, 217, 154, 0.08);
  border: 1px solid rgba(74, 217, 154, 0.2);
  padding: 4px 14px;
  border-radius: 100px;
  letter-spacing: 0.03em;
}

/* --- Section Titles --- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 16px;
}

html[lang="he"] .section-title,
html[lang="ar"] .section-title {
  letter-spacing: 0;
}

.section-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto 56px;
}

/* --- Before / After Demo --- */
.demo {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.demo__panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}

.demo__panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.demo__panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
}

.demo__panel--before {
  border-color: rgba(232, 93, 93, 0.15);
}

.demo__panel--after {
  border-color: rgba(74, 217, 154, 0.15);
}

.demo__label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 20px;
}

.demo__label--bad {
  color: var(--color-danger);
  background: rgba(232, 93, 93, 0.1);
  border: 1px solid rgba(232, 93, 93, 0.2);
}

.demo__label--good {
  color: var(--color-success);
  background: rgba(74, 217, 154, 0.1);
  border: 1px solid rgba(74, 217, 154, 0.2);
}

.demo__line {
  margin-bottom: 12px;
}

.demo__text-broken {
  font-family: var(--font-hebrew);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  opacity: 0.7;
}

.demo__text-fixed {
  font-family: var(--font-hebrew);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.demo__text-en {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  direction: ltr;
  text-align: left;
  display: block;
}

.demo__annotation {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--color-danger);
  font-style: italic;
}

.demo__annotation--good {
  color: var(--color-success);
}

.demo__divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  gap: 12px;
}

.demo__divider-line {
  width: 1px;
  flex: 1;
  background: linear-gradient(to bottom, transparent, var(--color-border-vivid), transparent);
}

.demo__divider-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-vivid);
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

/* --- Features --- */
.features {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all 0.35s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.feature-card:hover {
  border-color: var(--color-border-vivid);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(74, 144, 217, 0.12);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-vivid);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  color: var(--color-primary);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* --- Modes --- */
.modes {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.modes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mode-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all 0.35s var(--ease-out);
}

.mode-card--highlight {
  border-color: var(--color-border-vivid);
  background: linear-gradient(
    135deg,
    var(--color-surface),
    rgba(74, 144, 217, 0.06)
  );
  box-shadow: 0 0 40px -10px rgba(74, 144, 217, 0.12);
}

.mode-card:hover {
  transform: translateY(-4px);
}

.mode-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-card__badge {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.08em;
  background: var(--color-surface-raised);
  color: var(--color-text-faint);
  border: 1px solid var(--color-border);
}

.mode-card__badge--auto {
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border-color: var(--color-border-vivid);
}

.mode-card__badge--rtl {
  color: var(--color-accent);
  background: rgba(212, 160, 83, 0.1);
  border-color: rgba(212, 160, 83, 0.25);
}

.mode-card__recommended {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
}

.mode-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.mode-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Install --- */
.install {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.install__steps {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertical line connecting steps */
.install__steps::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 48px;
  bottom: 48px;
  width: 1px;
  background: linear-gradient(to bottom, var(--color-border-vivid), var(--color-border));
}

html[dir="rtl"] .install__steps::before {
  left: auto;
  right: 22px;
}

.install__step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 20px 0;
}

.install__number {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-vivid);
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.install__detail {
  flex: 1;
  padding-top: 8px;
}

.install__detail h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.install__detail p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.install__detail code {
  display: inline-block;
  margin-top: 4px;
}

.install__detail a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.install__detail a:hover {
  opacity: 0.8;
}

/* --- CTA Section --- */
.cta-section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.cta-section__inner {
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--color-surface),
    rgba(74, 144, 217, 0.06)
  );
  border: 1px solid var(--color-border-vivid);
  border-radius: var(--radius-xl);
  padding: 80px 48px;
  position: relative;
  overflow: hidden;
}

.cta-section__inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary),
    transparent
  );
}

.cta-section__inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

html[lang="he"] .cta-section__inner h2,
html[lang="ar"] .cta-section__inner h2 {
  letter-spacing: 0;
}

.cta-section__inner p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 36px;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer__brand img {
  border-radius: 4px;
}

.footer__links {
  display: flex;
  gap: 28px;
}

.footer__links a {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

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

.footer__copy {
  font-size: 0.82rem;
  color: var(--color-text-faint);
}

/* --- Animations --- */
@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal-stagger--visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger--visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger--visible > *:nth-child(3) { transition-delay: 0.2s; }

.reveal-stagger--visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- RTL Overrides --- */
html[dir="rtl"] .nav__links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero__actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .demo__panel--before .demo__content {
  text-align: left;
}

html[dir="rtl"] .demo__panel--after .demo__content {
  text-align: right;
}

/* --- Privacy Policy Page --- */
.policy {
  max-width: 720px;
  padding: 100px 28px 80px;
}

.policy__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.policy__updated {
  color: var(--color-text-faint);
  font-size: 0.9rem;
  margin-bottom: 48px;
}

.policy h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
}

.policy p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.75;
}

.policy strong {
  color: var(--color-text);
}

.policy ul {
  padding-inline-start: 20px;
  margin-bottom: 16px;
}

.policy li {
  color: var(--color-text-muted);
  margin-bottom: 10px;
  line-height: 1.75;
}

.policy a {
  color: var(--color-primary);
  transition: opacity 0.2s;
}

.policy a:hover {
  opacity: 0.8;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .features__grid,
  .modes__grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .demo__panels {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .demo__divider {
    flex-direction: row;
    padding: 0;
  }

  .demo__divider-line {
    width: auto;
    height: 1px;
    flex: 1;
  }
}

@media (max-width: 640px) {
  .nav__links {
    display: none;
  }

  .hero {
    padding: 72px 0 32px;
  }

  .hero__sub {
    font-size: 1rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .demo,
  .features,
  .modes,
  .install,
  .cta-section {
    padding: 80px 0;
  }

  .cta-section__inner {
    padding: 56px 28px;
  }

  .browser-frame {
    border-radius: var(--radius-md);
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
}
