/* Spark Software - shared platform styles (light CI, dark hero/sections) */

:root {
  --white: #ffffff;
  --beige: #e8e4e0;
  --beige-2: #d4cfc8;
  --grey-1: #f5f5f5;
  --grey-2: #ebeae7;
  --grey-3: #d9d6d1;
  --black: #0a0a0a;
  --text: #1a1a1a;
  --text-2: #333333;
  --muted: #666666;
  --gold: #e8b339;
  --gold-dark: #c7961f;
  --blue: #3B5EF5;
  --green: #1aa36a;
  --red: #e5484d;
  --amber: #f5a623;

  --radius: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.12);

  --f-sans: "Lato", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,10,0.96);
  color: #fff;
  backdrop-filter: blur(10px);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 18px 48px;
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 900; letter-spacing: -0.01em; }
a.brand { color: inherit; text-decoration: none; }
a.brand:hover .brand-logo { opacity: .85; }
.brand .b1 { font-weight: 900; font-size: 20px; }
.brand .b2 { font-weight: 400; font-size: 20px; }
.brand .brand-logo { height: 34px; width: auto; display: block; }
.brand .brand-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); border-left: 1px solid rgba(255,255,255,.25); padding-left: 10px; margin-left: 8px; font-weight: 600; }
html[dir="rtl"] .brand .brand-sub { border-left: 0; border-right: 1px solid rgba(255,255,255,.25); padding-left: 0; padding-right: 10px; margin-left: 0; margin-right: 8px; }
.nav-links { display: flex; gap: 22px; margin-left: 32px; font-size: 13.5px; }
.nav-links a { color: rgba(255,255,255,0.78); }
.nav-links a:hover { color: #fff; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-switch { display: inline-flex; gap: 0; padding: 3px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.lang-switch button { background: transparent; border: 0; color: rgba(255,255,255,0.6); font-weight: 700; font-size: 11px; padding: 5px 10px; border-radius: 999px; }
.lang-switch button.active { background: #fff; color: #0a0a0a; }

/* Back-to-suite breadcrumb */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7); font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.back-link:hover { color: #fff; }
.back-link::before { content: "←"; display: inline-block; }

/* ---------- PILL CTA (black on light / white on dark) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 20px;
  background: #0a0a0a; color: #fff;
  border-radius: 999px; border: 0;
  font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn .arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: #fff; color: #0a0a0a;
}
.btn.light { background: #fff; color: #0a0a0a; }
.btn.light .arrow { background: #0a0a0a; color: #fff; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn.ghost .arrow { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn.gold { background: var(--gold); color: #0a0a0a; }
.btn.gold .arrow { background: #0a0a0a; color: var(--gold); }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
.section { padding: 100px 0; }
.section.dark { background: #0a0a0a; color: #fff; }
.section.beige { background: var(--beige); }
.section.grey { background: var(--grey-1); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--gold); display: inline-block; }
.section.dark .eyebrow { color: var(--gold); }
.section.dark .eyebrow::before { background: var(--gold); }

h1, h2, h3, h4 { margin: 0; font-weight: 900; letter-spacing: -0.02em; line-height: 1.08; }
h1 { font-size: 72px; }
h2 { font-size: 52px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
p { line-height: 1.6; margin: 0 0 12px; color: var(--text-2); }
.lead { font-size: 19px; color: var(--text-2); max-width: 720px; }
.muted { color: var(--muted); }

/* ---------- STAT ROW ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stat { padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.stat .v { font-size: 40px; font-weight: 900; color: var(--gold); letter-spacing: -0.02em; }
.stat .s { font-size: 12.5px; color: rgba(255,255,255,0.6); margin-top: 6px; }

/* ---------- CARDS ---------- */
.card {
  background: #fff;
  border: 1px solid var(--grey-3);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #999; }
.card .num { font-weight: 900; font-size: 13px; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 16px; }

/* ---------- FOOTER ---------- */
footer { background: #0a0a0a; color: #fff; padding: 72px 0 48px; }
footer .foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
footer h5 { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin: 0 0 16px; }
footer a { display: block; color: rgba(255,255,255,0.75); font-size: 14px; padding: 5px 0; }
footer a:hover { color: var(--gold); }
footer .legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12.5px; color: rgba(255,255,255,0.4); display: flex; justify-content: space-between; }

/* ---------- DEMO-TOOL CHROME ---------- */
.toolbar {
  background: #fff; border: 1px solid var(--grey-3);
  border-radius: var(--radius-lg); padding: 10px;
  display: flex; align-items: center; gap: 10px;
}
.pill-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--grey-1); font-size: 11.5px; font-weight: 700;
  color: var(--text-2); letter-spacing: 0.02em;
}
.pill-tag.gold { background: var(--gold); color: #0a0a0a; }
.pill-tag.blue { background: var(--blue); color: #fff; }
.pill-tag.green { background: #d8f1e4; color: var(--green); }
.pill-tag.red { background: #fde7e8; color: var(--red); }
.pill-tag.amber { background: #fdeccd; color: #b26e00; }
.pill-tag.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Severity colours - reused across tools */
.sev-crit  { color: #d7263d; }
.sev-high  { color: #e5484d; }
.sev-med   { color: #f5a623; }
.sev-low   { color: #3B5EF5; }
.sev-info  { color: #6b7280; }
.sev-ok    { color: var(--green); }
.sev-bg-crit  { background: #fdebee; color: #d7263d; }
.sev-bg-high  { background: #fde7e8; color: #e5484d; }
.sev-bg-med   { background: #fdeccd; color: #b26e00; }
.sev-bg-low   { background: #e4ebff; color: #2a44c4; }
.sev-bg-ok    { background: #d8f1e4; color: var(--green); }

/* Dot grid decoration */
.dot-grid {
  display: grid; grid-template-columns: repeat(9, 10px); gap: 12px;
}
.dot-grid span { display: block; width: 4px; height: 4px; border-radius: 50%; background: #cccccc; }

@media (max-width: 980px) {
  .wrap { padding: 0 24px; }
  .section { padding: 64px 0; }
  h1 { font-size: 44px; }
  h2 { font-size: 36px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  footer .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}

/* ============================ MOBILE (phones) ============================ */
.nav-hamburger { display: none; background: transparent; border: 0; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }

@media (max-width: 760px) {
  .nav-inner { position: relative; flex-wrap: wrap; gap: 12px; padding: 12px 18px; }
  .nav-hamburger { display: inline-flex; order: 3; margin-left: 8px; }
  .nav-right { gap: 8px; }
  .lang-switch { display: none; }
  /* nav links become a dropdown toggled by the hamburger */
  .nav-inner .nav-links { display: none; }
  .nav-inner.open .nav-links {
    display: flex; flex-direction: column; gap: 0; margin: 0;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
    background: #0a0a0a; padding: 6px 18px 14px; border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 18px 40px rgba(0,0,0,.4);
  }
  .nav-inner.open .nav-links a { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); color: #fff; }

  .wrap { padding: 0 18px; }
  .section { padding: 48px 0; }
  h1 { font-size: 34px !important; }
  h2 { font-size: 27px !important; }
  h3 { font-size: 20px; }
  .lead { font-size: 16px; }

  .stat-row { grid-template-columns: 1fr 1fr !important; gap: 14px; }
  .stat .v { font-size: 28px; }

  /* any wide table scrolls horizontally instead of breaking the layout */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-wrap table { min-width: 560px; }

  footer { padding: 48px 0 36px; }
  footer .foot-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  footer .legal { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* injected live-action bars stack */
  .live-bar { margin: -22px auto 0 !important; }
  .live-bar > div { flex-direction: column; align-items: stretch !important; }
  .live-bar > div > span[style*="margin-left:auto"], .live-bar #lc-score,
  .live-bar #ld-grade, .live-bar #ls-grade, .live-bar #lf-stat { margin-left: 0 !important; }
  .live-bar .btn { justify-content: center; }

  /* assistant widget */
  #spk-panel { right: 10px; left: 10px; width: auto; height: 72vh; bottom: 82px; }
  #spk-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
}

@media (max-width: 440px) {
  .stat-row { grid-template-columns: 1fr !important; }
  footer .foot-grid { grid-template-columns: 1fr; }
  h1 { font-size: 29px !important; }
  h2 { font-size: 23px !important; }
  .btn { padding: 8px 8px 8px 14px; font-size: 12.5px; }
  .btn .arrow { width: 24px; height: 24px; }
}

/* ============================ RTL / Arabic ============================ */
html[lang="ar"] body { font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", "Geeza Pro", "Dubai", Tahoma, Arial, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.3; }
html[lang="ar"] .eyebrow, html[lang="ar"] th, html[lang="ar"] .meta, html[lang="ar"] .pill-tag, html[lang="ar"] .label, html[lang="ar"] .lvl { letter-spacing: 0; text-transform: none; }
html[lang="ar"] p, html[lang="ar"] li { line-height: 1.75; }
html[dir="rtl"] .nav-right { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-links { margin-left: 0; margin-right: 32px; }
html[dir="rtl"] .back-link::before { content: "→"; }
html[dir="rtl"] .btn { padding: 10px 20px 10px 10px; }
html[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] .eyebrow::before { order: 2; }
html[dir="rtl"] footer .legal, html[dir="rtl"] .cta-row { flex-direction: row-reverse; }
html[dir="rtl"] #spk-fab { right: auto; left: 22px; }
html[dir="rtl"] #spk-panel { right: auto; left: 22px; }
html[dir="rtl"] .spk-m.u { text-align: left; }
html[dir="rtl"] .spk-m .b { text-align: right; }
html[dir="rtl"] .why li, html[dir="rtl"] .tl li { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .why li::before, html[dir="rtl"] .tl li::before { left: auto; right: 0; }
html[dir="rtl"] .heat .cell, html[dir="rtl"] .exec { border-left: 1px solid var(--grey-3); border-right: 5px solid var(--grey-3); }
html[dir="rtl"] .exec { border-right: 4px solid var(--gold); border-left: 1px solid rgba(255,255,255,.12); }
html[dir="rtl"] .nav-inner.open .nav-links a { text-align: right; }
html[dir="rtl"] .mono, html[dir="rtl"] code, html[dir="rtl"] .val, html[dir="rtl"] input[type="email"], html[dir="rtl"] .check-bar input { direction: ltr; unicode-bidi: embed; }
@media (max-width: 760px) { html[dir="rtl"] #spk-panel { left: 10px; right: 10px; } html[dir="rtl"] #spk-fab { left: 16px; right: auto; } }
html[dir="rtl"] .brand { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .stat-row, html[dir="rtl"] .kpis, html[dir="rtl"] .tools-grid, html[dir="rtl"] .bench { direction: rtl; }

/* Technical SVG diagrams stay left-to-right even under RTL, so fixed-position
   labels and text-anchors don't mirror/overlap (keeps the architecture and
   evidence-chain diagrams readable in Arabic). */
html[dir="rtl"] svg, html[dir="rtl"] svg text, html[dir="rtl"] svg tspan { direction: ltr; unicode-bidi: bidi-override; }
html[dir="rtl"] .diag svg, html[dir="rtl"] .ev-diag svg, html[dir="rtl"] .map-card svg, html[dir="rtl"] #ncc-map svg { direction: ltr; }
