/* Sawti — theme tokens (light + dark) */
:root {
  --card: #f7f8f8;
  --ring: #1da1f2;
  --input: #f7f9fa;
  --muted: #E5E5E6;
  --accent: #E3ECF6;
  --border: #e1eaef;
  --radius: 1.3rem;
  --chart-1: #1e9df1;
  --chart-2: #00b87a;
  --chart-3: #f7b928;
  --chart-4: #17bf63;
  --chart-5: #e0245e;
  --popover: #ffffff;
  --primary: #1e9df1;
  --sidebar: #f7f8f8;
  --font-mono: Menlo, ui-monospace, monospace;
  --font-sans: "Open Sans", system-ui, sans-serif;
  --font-display: "Open Sans", system-ui, sans-serif;
  --secondary: #0f1419;
  --background: #ffffff;
  --font-serif: Georgia, serif;
  --foreground: #0f1419;
  --destructive: #f4212e;
  --shadow-color: rgba(29,161,242,0.15);
  --card-foreground: #0f1419;
  --muted-foreground: #5b6770;
  --accent-foreground: #1e9df1;
  --popover-foreground: #0f1419;
  --primary-foreground: #ffffff;
  --secondary-foreground: #ffffff;

  /* Derived */
  --hairline: #e1eaef;
  --soft: #f1f6fb;
}

.dark {
  --card: #17181c;
  --ring: #1da1f2;
  --input: #22303c;
  --muted: #181818;
  --accent: #061622;
  --border: #242628;
  --popover: #000000;
  --primary: #1c9cf0;
  --sidebar: #17181c;
  --secondary: #f0f3f4;
  --background: #000000;
  --foreground: #e7e9ea;
  --destructive: #f4212e;
  --shadow-color: rgba(29,161,242,0.25);
  --card-foreground: #d9d9d9;
  --muted-foreground: #72767a;
  --accent-foreground: #1c9cf0;
  --popover-foreground: #e7e9ea;
  --primary-foreground: #ffffff;
  --secondary-foreground: #0f1419;

  --hairline: #1f2a33;
  --soft: #0a1419;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
:target, [id] { scroll-margin-top: 100px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "cv11";
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: color-mix(in oklab, var(--primary) 30%, transparent); color: var(--foreground); }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* Type */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
}
.h-display {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(40px, 6.4vw, 80px);
  line-height: 1.02;
  color: var(--foreground);
  text-wrap: balance;
}
.h-display em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--primary);
}
.h-section {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.022em;
  font-size: clamp(32px, 3.8vw, 50px);
  line-height: 1.06;
  text-wrap: balance;
  margin: 0;
}
.h-section em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--primary);
}
.lede {
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--muted-foreground);
  max-width: 60ch;
  text-wrap: pretty;
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 8px 24px -10px var(--shadow-color), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 88%, black); box-shadow: 0 12px 32px -10px var(--shadow-color); }
.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { background: var(--soft); border-color: color-mix(in oklab, var(--primary) 40%, var(--hairline)); }
.btn-dark {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-dark:hover { background: color-mix(in oklab, var(--secondary) 85%, white); }

/* Card */
.card {
  background: var(--background);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  position: relative;
}

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hairline);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--foreground);
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 22%, transparent);
}

/* Section spacing */
section { padding: clamp(72px, 8vw, 120px) 0; position: relative; }
.section-tight { padding: clamp(48px, 6vw, 84px) 0; }

/* Subtle grid background (used in select sections) */
.bg-grid {
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
}
.bg-fade-mask {
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* Hairlines */
.hr {
  height: 1px;
  background: var(--hairline);
  width: 100%;
}

/* Border beam — adapted from spec */
.beam-wrap {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  --border-width: 1.5px;
}
.beam-wrap::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  border: var(--border-width) solid color-mix(in oklab, var(--primary) 15%, transparent);
  z-index: -1;
}
.beam-wrap .beam-mover {
  position: absolute; top: 0; left: 0;
  width: var(--light-width, 240px);
  aspect-ratio: 1 / 1;
  background: radial-gradient(ellipse at center, var(--light-color, var(--primary)), transparent 65%);
  offset-path: var(--path);
  animation: beam-run var(--duration, 9s) linear infinite;
  filter: blur(2px);
}
@keyframes beam-run {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* Marquee progressive blur masks */
.edge-mask-left {
  background: linear-gradient(90deg, var(--background) 10%, transparent 100%);
}
.edge-mask-right {
  background: linear-gradient(270deg, var(--background) 10%, transparent 100%);
}

/* Toggle switch */
.toggle-track {
  width: 52px; height: 30px;
  background: var(--soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
  cursor: pointer;
  position: relative;
}
.toggle-thumb {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 4px 10px -2px var(--shadow-color);
  transition: transform .25s cubic-bezier(.7,.05,.2,1);
}
.toggle-track.on .toggle-thumb { transform: translateX(22px); }

/* Waveform bars (used in hero device + features) */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 30px;
}
.waveform .bar {
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
  animation: wave 1.4s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { transform: scaleY(.25); }
  50% { transform: scaleY(1); }
}

/* Avatar stack */
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--soft);
  border: 2px solid var(--background);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--foreground);
}

/* Reveal animation utility */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }

/* Aurora soft glows (light theme adapted) */
.aurora {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.aurora .blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
}
.aurora .b1 { width: 520px; height: 520px; background: color-mix(in oklab, var(--primary) 35%, transparent); top: -120px; left: -120px; animation: aurora-1 22s ease-in-out infinite alternate; }
.aurora .b2 { width: 460px; height: 460px; background: color-mix(in oklab, #7ec8ff 50%, transparent); bottom: -140px; right: -80px; animation: aurora-2 26s ease-in-out infinite alternate; }
.aurora .b3 { width: 360px; height: 360px; background: color-mix(in oklab, var(--accent) 80%, transparent); top: 40%; left: 50%; transform: translate(-50%, -50%); opacity: .8; }
@keyframes aurora-1 { to { transform: translate(120px, 80px); } }
@keyframes aurora-2 { to { transform: translate(-100px, -60px); } }
.dark .aurora .blob { opacity: .35; }

/* Slider — always flow LTR so the marquee math works in RTL pages too */
.slider-track {
  display: flex;
  width: max-content;
  direction: ltr;
  animation: slide var(--d, 30s) linear infinite;
}
.slider-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  direction: ltr;
}
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 24px)); }
}

/* Waves canvas */
.waves-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}

/* Inputs */
.input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--input);
  font: inherit;
  color: var(--foreground);
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 18%, transparent); }

/* RTL / Arabic */
html[lang="ar"] {
  --font-sans: "Cairo", "Open Sans", system-ui, sans-serif;
  --font-display: "Cairo", "Open Sans", system-ui, sans-serif;
}
html[lang="ar"] body { letter-spacing: 0; }
html[lang="ar"] .h-display em,
html[lang="ar"] .h-section em {
  font-family: "Cairo", var(--font-display);
  font-weight: 800;
  font-style: normal;
}
html[lang="ar"] .h-display { line-height: 1.25; }
html[lang="ar"] .h-section { line-height: 1.3; }
html[lang="ar"] .eyebrow { letter-spacing: 0.08em; }
html[lang="ar"] .mono { font-family: var(--font-mono); }

/* Marquee always travels left even in RTL (visual continuity) */
html[dir="rtl"] .slider-track,
html[dir="rtl"] .slider-group { direction: ltr; }
