/* ============================================================
   KAYAN ROBOTICS — SHARED DESIGN SYSTEM v1.0
   Bilingual EN⇄AR / LTR⇄RTL responsive site
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg:            #FAFBFC;
  --bg-dark:       #0F172A;
  --bg-dark-2:     #0B1220;
  --surface:       #FFFFFF;
  --surface-dark:  #172033;
  --surface-elev:  #FFFFFF;
  --fg:            #0F172A;
  --fg-invert:     #F1F5F9;
  --muted:         #64748B;
  --muted-invert:  #94A3B8;
  --border:        #E2E8F0;
  --border-dark:   #1E2A44;
  --border-strong: #CBD5E1;

  --primary:       #2563EB;   /* Tech Electric Blue */
  --primary-600:   #1D4ED8;
  --primary-tint:  #EFF4FF;
  --accent:        #10B981;   /* Cyber Teal / Emerald */
  --accent-600:    #059669;
  --accent-tint:   #E8FBF3;
  --accent-glow:   rgba(16, 185, 129, 0.35);
  --warn:          #F59E0B;
  --danger:        #EF4444;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:    0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.28);

  --font-en-display: "Montserrat", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-en-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-ar-display: "Cairo", "Tajawal", ui-sans-serif, system-ui, sans-serif;
  --font-ar-body:    "Tajawal", "Cairo", ui-sans-serif, system-ui, sans-serif;
  --font-mono:       "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --container: 1240px;
  --gutter-sm: 20px;
  --gutter:    28px;
  --gutter-lg: 48px;

  --nav-h: 72px;
}

html[lang="en"] { --font-display: var(--font-en-display); --font-body: var(--font-en-body); }
html[lang="ar"] { --font-display: var(--font-ar-display); --font-body: var(--font-ar-body); }
html { --font-display: var(--font-en-display); --font-body: var(--font-en-body); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
@media (max-width: 720px) { .container { padding-inline: var(--gutter-sm); } }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 3.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); letter-spacing: -0.015em; }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; max-width: 65ch; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--fg); opacity: 0.85; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-en-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-600);
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  background: var(--accent-tint);
}
.dark .eyebrow { background: rgba(16, 185, 129, 0.08); color: var(--accent); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* Arabic text tuning */
html[lang="ar"] body { font-size: 16.5px; line-height: 1.75; }
html[lang="ar"] h1, html[lang="ar"] h2 { letter-spacing: 0; }
html[lang="ar"] .eyebrow { letter-spacing: 0.02em; font-size: 13px; }

/* Show/hide by language */
[data-lang="en"] { display: initial; }
[data-lang="ar"] { display: none; }
html[lang="ar"] [data-lang="en"] { display: none; }
html[lang="ar"] [data-lang="ar"] { display: initial; }

/* The language switch buttons use data-lang to declare which language they
   SELECT, not to mark translatable content — so the rules above were hiding
   whichever language was not active. That left one button visible and made
   it impossible to switch language at all. Keep both permanently visible. */
html .lang-switch button[data-lang] { display: inline-block; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
@media (max-width: 720px) { .nav-inner { padding-inline: var(--gutter-sm); } }

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-en-display);
  font-size: 20px;
  letter-spacing: -0.028em;
  line-height: 1;
}
/* Wordmark — weighted split "Kayan" bold + "Robotics" lighter · one word visually */
.brand .wm-k { font-weight: 800; color: var(--fg); letter-spacing: -0.028em; }
.brand .wm-r { font-weight: 500; color: var(--muted); letter-spacing: -0.02em; }
html[lang="ar"] .brand { font-size: 22px; }
html[lang="ar"] .brand .wm-k,
html[lang="ar"] .brand .wm-r { letter-spacing: 0; }
html[lang="ar"] .brand .wm-r { padding-inline-start: 0; }

/* Dark surfaces (footer): light bold + accent teal lighter */
.footer .brand .wm-k { color: var(--fg-invert); }
.footer .brand .wm-r { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--fg);
  font-weight: 500;
  font-size: 14.5px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background .15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--primary-tint); color: var(--primary-600); }
html[lang="ar"] .nav-links a { font-size: 15.5px; }

.nav-right {
  display: flex; align-items: center; gap: 10px;
}
.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 100px;
  font-family: var(--font-en-body);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 100px;
  color: var(--muted);
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  min-width: 44px;
}
.lang-switch button:hover:not(.active) { color: var(--fg); background: var(--bg); }
.lang-switch button.active { background: var(--fg); color: var(--surface); }
.lang-switch button[data-lang="ar"] { font-family: var(--font-ar-body); font-weight: 700; }

.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  width: 40px; height: 40px; padding: 0;
  color: var(--fg);
}
@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: var(--nav-h); inset-inline: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  letter-spacing: 0.005em;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #04231A;
  box-shadow: 0 6px 20px -6px var(--accent-glow), inset 0 -2px 0 rgba(0,0,0,0.14);
}
.btn-primary:hover { background: var(--accent-600); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--fg); background: var(--surface); }
/* .hero and .roi are dark sections but do not carry the .dark class, so the
   secondary button rendered --fg (#0F172A) on the #0F172A hero — invisible.  */
.dark .btn-secondary,
.hero .btn-secondary,
.roi .btn-secondary { color: var(--fg-invert); border-color: rgba(255,255,255,0.16); }
.dark .btn-secondary:hover,
.hero .btn-secondary:hover,
.roi .btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.32); }
.btn-ghost {
  background: transparent; color: var(--primary); padding: 10px 14px;
}
.btn-ghost:hover { color: var(--primary-600); }
.btn-lg { padding: 15px 26px; font-size: 16px; }

/* Directional arrow flip for RTL */
html[dir="rtl"] .btn svg.arrow { transform: scaleX(-1); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 120px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }
.section-header { max-width: 720px; margin: 0 auto clamp(40px, 5vw, 64px); text-align: center; }
.section-header .eyebrow { margin-bottom: 18px; }
.section-header p { margin-inline: auto; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.dark { background: var(--bg-dark); color: var(--fg-invert); }
.dark h1, .dark h2, .dark h3, .dark h4 { color: var(--fg-invert); }
.dark p { color: var(--muted-invert); }
.dark a { color: var(--accent); }
.dark .lead { color: var(--fg-invert); opacity: 0.88; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--bg-dark);
  color: var(--fg-invert);
  overflow: hidden;
  padding: clamp(80px, 10vw, 140px) 0 clamp(60px, 8vw, 100px);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 700px at 85% -20%, rgba(37, 99, 235, 0.32), transparent 60%),
    radial-gradient(700px 500px at -5% 90%, rgba(16, 185, 129, 0.20), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; }
}
.hero-copy .eyebrow { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.06); color: var(--accent); }
.hero-copy h1 { color: var(--fg-invert); margin: 20px 0 20px; }
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy .lead { color: var(--fg-invert); opacity: 0.82; max-width: 52ch; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.hero-stat .num {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  color: var(--fg-invert);
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero-stat .num sup { font-size: 0.65em; color: var(--accent); letter-spacing: 0; margin-inline-start: 2px; }
.hero-stat .label {
  font-size: 12.5px;
  color: var(--muted-invert);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 6px;
}
html[lang="ar"] .hero-stat .label { text-transform: none; letter-spacing: 0; font-size: 13.5px; }

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(160deg, #1B2C4D, #0B1220);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-lg);
}
.hero-visual img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 1;
}
.hero-visual .badge { z-index: 3; }
.hero-visual .badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--fg-invert);
  font-size: 12.5px;
  display: flex; align-items: center; gap: 10px;
  min-width: 150px;
}
.hero-visual .badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.20);
  animation: pulse 2s infinite;
}
.hero-visual .badge .label { color: var(--muted-invert); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-visual .badge .value { font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; }
.hero-visual .badge.tl { top: 20px; inset-inline-start: 20px; }
.hero-visual .badge.tr { top: 20px; inset-inline-end: 20px; }
.hero-visual .badge.bl { bottom: 20px; inset-inline-start: 20px; }
.hero-visual .badge.br { bottom: 20px; inset-inline-end: 20px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16,185,129,0.20); }
  50%      { box-shadow: 0 0 0 8px rgba(16,185,129,0.02); }
}
/* placeholder when hero image not yet generated */
.hero-visual .ph-scan {
  position: absolute; inset: 0;
  background:
    conic-gradient(from 200deg at 50% 65%, transparent 0deg, rgba(16,185,129,0.14) 60deg, transparent 120deg),
    radial-gradient(circle at 50% 65%, rgba(37,99,235,0.35), transparent 55%);
}
.hero-visual .ph-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent 20%, black 60%, black 90%, transparent);
}
.hero-visual .ph-robot {
  position: absolute;
  left: 50%; bottom: 22%;
  transform: translateX(-50%);
  width: 62%;
  aspect-ratio: 5 / 3;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(16,185,129,0.55), transparent 65%),
    linear-gradient(180deg, #2A3956, #0F172A);
  border-radius: 40% 40% 20% 20% / 50% 50% 20% 20%;
  box-shadow: 0 40px 80px -30px rgba(16,185,129,0.35);
}

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 940px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card .card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: 18px;
}
.card .card-icon svg { width: 22px; height: 22px; }
.card.accent .card-icon { background: var(--accent-tint); color: var(--accent-600); }

.industry-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  color: var(--fg-invert);
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-dark);
  transition: transform .18s ease, box-shadow .18s ease;
}
.industry-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.15) 40%, rgba(15,23,42,0.85));
  z-index: 1;
}
.industry-card > * { position: relative; z-index: 2; }
.industry-card .num {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: auto;
}
.industry-card h3 { color: var(--fg-invert); margin: 0 0 6px; }
.industry-card p { color: var(--muted-invert); margin: 0; font-size: 14px; }
.industry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.industry-card .bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(135deg, rgba(37,99,235,0.24), rgba(16,185,129,0.08)),
    var(--bg-dark);
}

/* ---------- Feature list ---------- */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feature-list li {
  display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start;
  color: var(--fg);
}
.feature-list li::before {
  content: "";
  margin-top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.dark .feature-list li { color: var(--fg-invert); }

/* ---------- Trust strip / logo row ---------- */
.trust-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 18px 40px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.trust-strip .trust-label {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.trust-strip .logo {
  font-family: var(--font-en-display); font-weight: 700; letter-spacing: -0.02em;
  color: var(--muted); font-size: 17px; opacity: 0.75;
}
html[lang="ar"] .trust-strip .trust-label { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ---------- Product cards ---------- */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.product-card .product-image {
  aspect-ratio: 4 / 3;
  position: relative;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  display: grid; place-items: center;
  overflow: hidden;
}
.product-card .product-image .badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: var(--fg); color: var(--surface);
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 8px; border-radius: 4px; letter-spacing: 0.05em;
}
.product-card .product-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { font-size: 1.15rem; margin: 0 0 4px; }
.product-card .model-code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 12px; }
.product-card .spec-mini {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 12px 0 16px;
  font-size: 13px;
}
.product-card .spec-mini dt { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.product-card .spec-mini dd { margin: 0 0 0; font-family: var(--font-mono); font-weight: 600; color: var(--fg); }
html[lang="ar"] .product-card .spec-mini dt { text-transform: none; letter-spacing: 0; font-size: 12px; }
.product-card .product-cta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.product-card .product-cta a { font-weight: 600; font-size: 14px; }

/* ---------- ROI Calculator ---------- */
.roi {
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(37,99,235,0.25), transparent 60%),
    radial-gradient(700px 400px at 90% 100%, rgba(16,185,129,0.18), transparent 60%),
    var(--bg-dark);
  color: var(--fg-invert);
  padding: clamp(64px, 8vw, 100px) 0;
  position: relative;
  overflow: hidden;
}
.roi::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.roi-wrap {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 940px) { .roi-wrap { grid-template-columns: 1fr; } }

.roi-copy h2 { color: var(--fg-invert); }
.roi-copy p { color: var(--muted-invert); }
.roi-copy .eyebrow { background: rgba(16,185,129,0.08); color: var(--accent); border-color: rgba(16,185,129,0.35); }

.roi-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.roi-panel .roi-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 620px) { .roi-panel .roi-inputs { grid-template-columns: 1fr; } }

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field.field-full { grid-column: 1 / -1; }
.field label {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-invert); font-weight: 600;
}
html[lang="ar"] .field label { text-transform: none; letter-spacing: 0; font-size: 13px; }

.field input, .field select, .field textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--fg-invert);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  border-radius: 8px;
  transition: border-color .15s ease, background .15s ease;
  width: 100%;
}
.field select { font-family: var(--font-body); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(16,185,129,0.06);
}
.field input::placeholder { color: rgba(255,255,255,0.35); }

/* Light-theme form (contact page) */
.form-light .field label { color: var(--muted); }
.form-light .field input, .form-light .field select, .form-light .field textarea {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg);
}
.form-light .field input:focus, .form-light .field select:focus, .form-light .field textarea:focus {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.roi-output {
  margin-top: 24px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16,185,129,0.28);
  border-radius: var(--radius);
}
.roi-output .roi-hdr {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 12px;
}
html[lang="ar"] .roi-output .roi-hdr { text-transform: none; letter-spacing: 0; }
.roi-output .roi-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 620px) { .roi-output .roi-metrics { grid-template-columns: 1fr 1fr; } }
.roi-metric .num {
  font-family: var(--font-en-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--fg-invert);
  letter-spacing: -0.02em;
  line-height: 1;
}
.roi-metric .num .cur { font-size: 0.55em; color: var(--accent); margin-inline-end: 4px; letter-spacing: 0; }
.roi-metric .lbl { font-size: 12px; color: var(--muted-invert); margin-top: 6px; }
.roi-note { font-size: 12px; color: var(--muted-invert); margin-top: 14px; }

/* ---------- Tables ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.spec-table th, .spec-table td {
  text-align: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.spec-table th {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}
html[lang="ar"] .spec-table th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.spec-table td:last-child { font-family: var(--font-mono); font-weight: 600; color: var(--fg); }
.spec-table tr:hover td { background: var(--primary-tint); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 32px;
}
.filter-group {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.filter-group .chip {
  border: 0; background: transparent;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-body); font-weight: 500; font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.filter-group .chip:hover { color: var(--fg); }
.filter-group .chip.active { background: var(--fg); color: var(--surface); }
.filter-group .filter-label {
  padding: 8px 10px 8px 12px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; align-self: center;
}
html[lang="ar"] .filter-group .filter-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; }

/* ---------- Tabs (industries) ---------- */
.tabs {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (max-width: 840px) { .tabs { grid-template-columns: 1fr; } }
.tab-list {
  display: flex; flex-direction: column; gap: 4px;
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 12px;
}
@media (max-width: 840px) {
  .tab-list { flex-direction: row; overflow-x: auto; border-inline-start: 0; padding-inline-start: 0; padding-bottom: 8px; gap: 6px; }
}
.tab-list button {
  text-align: start;
  background: transparent; border: 0;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 10px 14px; border-radius: 8px;
  color: var(--muted);
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}
.tab-list button:hover { color: var(--fg); background: var(--bg); }
.tab-list button[aria-selected="true"] { color: var(--primary-600); background: var(--primary-tint); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel .grid-2 { align-items: start; }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-dark-2);
  color: var(--fg-invert);
  padding: 64px 0 32px;
  border-top: 1px solid var(--border-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-invert); margin: 0 0 16px;
}
html[lang="ar"] .footer h4 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--fg-invert); opacity: 0.72; font-size: 14.5px; }
.footer a:hover { opacity: 1; color: var(--accent); }
.footer-brand p { color: var(--muted-invert); max-width: 320px; margin-top: 12px; font-size: 14px; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--muted-invert); font-size: 13px;
  flex-wrap: wrap;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 40px; }
.chip-static {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 100px;
  background: var(--accent-tint); color: var(--accent-600);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.chip-static.blue { background: var(--primary-tint); color: var(--primary-600); }
.dark .chip-static { background: rgba(16,185,129,0.08); color: var(--accent); }
.dark .chip-static.blue { background: rgba(37,99,235,0.10); color: #7DA6FF; }

.divider { height: 1px; background: var(--border); margin: 32px 0; }
.dark .divider { background: rgba(255,255,255,0.08); }

/* Selection */
::selection { background: var(--accent); color: #04231A; }

/* ---------- Mobile overflow fixes ----------
   The export overflowed horizontally on every page at 360/390/430px. Causes
   and fixes:

   1. The nav CTA sat outside the collapsible menu with `white-space: nowrap`,
      so brand + toggle + language switch + CTA could not fit. Below the
      toggle breakpoint the bar CTA is hidden and a full-width copy is shown
      inside the open menu, so the action stays reachable.
   2. Five two-column grids set `grid-template-columns` inline, which outranks
      the stylesheet's mobile rules, so they never collapsed. Those now use
      .grid-split with the ratio passed in as --split.
   3. A filter group was a single nowrap flex row wider than the viewport.
   4. The spec table gets a scroll container so long values can never push
      the page wider.                                                     */
.grid-split { grid-template-columns: minmax(0, 1fr) minmax(0, var(--split, 1fr)); }
@media (max-width: 940px) {
  .grid-split { grid-template-columns: minmax(0, 1fr); }
}

.nav-cta-mobile { display: none; }
@media (max-width: 940px) {
  .nav-right > .btn-primary { display: none; }
  .nav-cta-mobile { display: block; margin-top: 8px; }
  .nav-cta-mobile .btn { width: 100%; justify-content: center; }
}

@media (max-width: 720px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-group { flex-wrap: wrap; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- RTL bidi corrections ----------
   Under dir="rtl" the bidi algorithm lays out separate Latin/numeric runs
   right-to-left, which silently reorders content that is not prose:

   - The wordmark rendered "RoboticsKayan" (brand spec requires the single
     word "KayanRobotics"). .brand is a flex container, so its item order
     follows `direction` — it needs an explicit ltr.
   - Telemetry and spec values inverted, e.g. "92% · 4h 42m" rendered as
     "4h 42m · 92%", which reverses their meaning.

   `unicode-bidi: plaintext` derives each element's base direction from its
   own first strong character, so Latin values stay LTR while Arabic values
   still read RTL. `text-align: start` keeps following the inherited
   direction, so alignment within the RTL layout is unchanged.        */
.brand { direction: ltr; }

.hero-visual .badge .value,
.product-card .model-code,
.product-card .spec-mini dd,
.spec-table td,
.hero-stat .num,
.industry-card .num,
/* Contact details are the worst case: "+962 6 500 4200" rendered as
   "4200 500 6 962+" in Arabic, which is a misdialling risk, and
   "< 4 h SLA" became "h SLA 4 >". These carry no strong-direction
   character, so plaintext resolves them to LTR and keeps them intact,
   while genuinely Arabic siblings still resolve to RTL. */
.footer li,
.contact-card .row > div,
.zone .l,
.zone .p,
.trust-strip .logo {
  unicode-bidi: plaintext;
}
