/* ============================================================================
   arabcode — shared design system (single dark GOLD theme, RTL)
   Terminal gold = xterm 214 = #ffaf00. No light mode.
   Type: code-style everywhere — JetBrains Mono (Latin) + Noto Kufi Arabic.
   The whole page is set in the terminal's own voice.
   ============================================================================ */

:root {
  color-scheme: dark;

  /* neutrals — darkest gold, near black; uniform, no glow */
  --bg: #080602;
  --panel: #100d07;
  --elevated: #171208;
  --border: #251f14;
  --hairline: #1b160e;

  /* text */
  --text: #ece7db;
  --text-dim: #b8b09c;
  --muted: #7d766a;

  /* gold accent */
  --accent: #ffaf00;
  --accent-bright: #ffc23d; /* small text / links, AA */
  --accent-deep: #c98a00;   /* borders / pressed */
  --accent-soft: rgba(255, 175, 0, 0.11);
  --accent-line: rgba(255, 175, 0, 0.28);

  /* code / terminal */
  --code-bg: #0a0806;
  --code-fg: #e6ddcb;

  /* diff — semantic, NOT accent */
  --diff-add: #57d38c;
  --diff-remove: #f2708a;

  /* no background texture/glow — uniform dark */
  --grid: transparent;

  /* ONE terminal voice for the whole site, both scripts: IBM Plex Mono for
     Latin, and a true monospace Arabic (DejaVu Sans Mono / system mono) for
     Arabic — the same terminal look the footer uses everywhere. */
  --font-mono: "IBM Plex Mono", "DejaVu Sans Mono", ui-monospace, "Noto Sans Mono", Menlo, Consolas, monospace;
  --font-ui: var(--font-mono);

  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, var(--grid) 1px, transparent 0);
  background-size: 26px 26px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.72;
  direction: rtl;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}
/* Latin runs (code names, commands) tuned tighter inside mono flow */
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; }

/* ---- links ---- */
a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- headings ---- */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.85rem, 4.8vw, 2.85rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.9rem); margin-top: 2.2rem; letter-spacing: -0.02em; }
h3 { font-size: 1.18rem; margin-top: 1.8rem; color: var(--text); letter-spacing: -0.01em; }
h4 { font-size: 1rem; margin-top: 1.4rem; color: var(--text-dim); }
p { margin: 0 0 1rem; }
strong, b { color: var(--text); font-weight: 700; }

/* code/commands forced LTR */
code, pre, kbd, samp, .ltr { direction: ltr; unicode-bidi: isolate; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(2.4rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--hairline); }
.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 62ch; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.center { text-align: center; }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }

/* ============================================================================
   Header / nav
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  height: 62px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.brand .glyph {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--accent-deep);
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.95rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.97rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-links a.active { color: var(--accent-bright); }
.nav-links a.gh {
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.nav-links a.gh:hover { border-color: var(--accent-deep); background: var(--accent-soft); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav { gap: 0.8rem; }
  .nav-links { gap: 0.1rem; flex-wrap: wrap; justify-content: flex-end; }
  .nav-links a { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
  .nav-links a.gh .lbl { display: none; }
}

/* ============================================================================
   Hero
   ============================================================================ */
.hero {
  position: relative;
  padding-block: clamp(2.6rem, 7vw, 5rem);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 55% at 82% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 20ch; }
.hero h1 .code-name { font-family: var(--font-mono); color: var(--accent); }
.hero .tagline { font-size: 1.18rem; color: var(--text-dim); max-width: 60ch; margin-top: 0.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; align-items: center; }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent-deep);
}
.btn-primary:hover { background: var(--accent-bright); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent-deep); background: var(--accent-soft); }

/* ============================================================================
   Copy command box + tabs
   ============================================================================ */
.cmd {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.55rem 0.55rem 0.9rem;
  font-family: var(--font-mono);
  direction: ltr;
  max-width: 100%;
  overflow-x: auto;
}
.cmd code { color: var(--code-fg); font-size: 0.98rem; white-space: nowrap; }
.cmd code .tok-cmd { color: var(--text-dim); }
.cmd code .tok-pkg { color: var(--accent-bright); font-weight: 600; }
.copy-btn {
  all: unset;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--hairline);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-deep); background: var(--accent-soft); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn .ic-check { display: none; color: var(--diff-add); }
.copy-btn.copied .ic-copy { display: none; }
.copy-btn.copied .ic-check { display: block; }

.tabs { margin: 1.2rem 0; }
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: -1px;
}
.tab-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-dim);
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected="true"] {
  color: var(--accent-bright);
  background: var(--panel);
  border-color: var(--border);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================================
   Code blocks
   ============================================================================ */
pre.code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
  direction: ltr;
}
pre.code code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--code-fg);
  white-space: pre;
}
.code-block { position: relative; margin-bottom: 1.1rem; }
.code-block .code-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.35rem 0.8rem;
  direction: ltr;
  text-align: left;
}
.code-block .code-title + pre.code { border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-bottom: 0; }
.code-block > .copy-btn { position: absolute; top: 8px; left: 8px; background: var(--elevated); }

code.inline {
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 0.08em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent-bright);
}

/* syntax-ish tokens for JSON blocks */
.tk-key { color: var(--accent-bright); }
.tk-str { color: #b7d99a; }
.tk-num { color: #e0a94a; }
.tk-punc { color: var(--muted); }
.tk-comment { color: var(--muted); font-style: italic; }
.tk-prompt { color: var(--accent); }

/* ============================================================================
   Cards / grids
   ============================================================================ */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}
.card h3 { margin-top: 0; font-size: 1.08rem; display: flex; align-items: center; gap: 0.55rem; }
.card p { margin-bottom: 0; color: var(--text-dim); font-size: 0.98rem; }
.card.feature { position: relative; }
.card .ic {
  flex: none;
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.card .ic svg { width: 18px; height: 18px; }
.card.highlight { border-color: var(--accent-deep); background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--panel); }
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  vertical-align: middle;
}

/* feature list (Lander-style) */
.feat-list { list-style: none; padding: 0; margin: 0; }
.feat-list li { padding: 0.55rem 0; border-top: 1px solid var(--hairline); color: var(--text-dim); }
.feat-list li:first-child { border-top: none; }
.feat-list li b { color: var(--text); }

/* ============================================================================
   Terminal demo
   ============================================================================ */
.term {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: 0 20px 50px -30px rgba(0,0,0,0.9);
}
.term-bar {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: var(--elevated);
  border-bottom: 1px solid var(--border);
}
.term-bar .tb-dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3226; }
.term-bar .tb-title { margin-inline-start: auto; margin-inline-end: auto; font-size: 0.78rem; color: var(--muted); direction: ltr; }
.term-body { padding: 1rem 1.1rem; font-size: 0.92rem; line-height: 1.9; }
.term-body .ln { margin: 0; white-space: pre-wrap; }
.term-body .ln.ltr { direction: ltr; }
.term-body .prompt { color: var(--accent); }
.term-body .who { color: var(--accent-bright); font-weight: 600; }
.term-body .ar-reply { color: var(--text); }
.term-body .comment { color: var(--muted); }

/* ============================================================================
   Tables
   ============================================================================ */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1.2rem; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-size: 0.92rem;
}
th, td {
  text-align: right;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
thead th {
  background: var(--elevated);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--accent-soft); }
td code, th code { direction: ltr; unicode-bidi: isolate; }
.free-tag { color: var(--diff-add); font-weight: 700; }

/* ============================================================================
   Callouts
   ============================================================================ */
.note {
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent-deep);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin: 1.2rem 0;
  color: var(--text-dim);
}
.note.tip { border-inline-start-color: var(--diff-add); }
.note strong { color: var(--text); }
.note .note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 0.25rem;
}
.note.tip .note-label { color: var(--diff-add); }

/* steps */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 1rem 0; }
ol.steps > li {
  position: relative;
  padding: 0 3rem 1.2rem 0;
  border-inline-start: 1px solid var(--border);
  margin-inline-start: 14px;
}
ol.steps > li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: -14px;
  top: -2px;
  width: 27px; height: 27px;
  background: var(--elevated);
  border: 1px solid var(--accent-deep);
  color: var(--accent-bright);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ============================================================================
   Footer
   ============================================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding-block: 2.2rem;
  color: var(--text-dim);
  font-size: 0.94rem;
}
.site-footer .wrap { display: grid; gap: 1.2rem; }
.foot-top { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: start; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.foot-links a { color: var(--text-dim); }
.foot-links a:hover { color: var(--accent-bright); }
.lineage {
  border-top: 1px solid var(--hairline);
  padding-top: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.lineage strong { color: var(--text-dim); }

/* ============================================================================
   Utilities
   ============================================================================ */
.hr { border: none; border-top: 1px solid var(--hairline); margin: 2rem 0; }
.stack > * + * { margin-top: 0.6rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: var(--panel);
}
.anchor-h { scroll-margin-top: 80px; }

/* ============================================================================
   Top banner
   ============================================================================ */
.banner {
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--accent-line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem;
  color: var(--accent-bright);
}
.banner .flag { color: var(--muted); }
.banner a { text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================================
   Terminal cursor + prompt eyebrow
   ============================================================================ */
.cursor {
  display: inline-block;
  width: 0.55ch; height: 1.05em;
  background: var(--accent);
  vertical-align: -0.16em;
  margin-inline-start: 3px;
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* an eyebrow that reads like a shell prompt: "$ الميزات" */
.eyebrow.sh::before { content: "$ "; color: var(--accent); }

/* ============================================================================
   Hero terminal (large)
   ============================================================================ */
.hero-term {
  margin-top: 2rem;
  max-width: 760px;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.95);
}
.hero-term .term-body { font-size: 0.95rem; line-height: 2; }

/* ============================================================================
   Stats strip (honest ecosystem numbers)
   ============================================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--panel); padding: 1.4rem 1rem; text-align: center; }
.stat .num {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  direction: ltr;
  line-height: 1.1;
}
.stat .lbl { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.35rem; }
@media (max-width: 620px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ============================================================================
   FAQ accordion (native details/summary — no JS)
   ============================================================================ */
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:first-child { border-top: none; }
.faq summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--accent-soft); color: var(--accent-bright); }
.faq .faq-body { padding: 0 1.2rem 1.15rem; color: var(--text-dim); }
.faq .faq-body p { margin-bottom: 0.6rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ============================================================================
   Docs layout (sidebar + content)
   ============================================================================ */
.docs-layout { display: grid; grid-template-columns: 236px 1fr; gap: 2.6rem; align-items: start; }
.docs-nav {
  position: sticky;
  top: 78px;
  align-self: start;
  font-size: 0.9rem;
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding-inline-end: 0.4rem;
}
.docs-nav .grp { margin-bottom: 1.25rem; }
.docs-nav .grp-title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding-inline-start: 0.6rem;
}
.docs-nav a {
  display: block;
  padding: 0.3rem 0.6rem;
  color: var(--text-dim);
  border-radius: 6px;
  border-inline-start: 2px solid transparent;
}
.docs-nav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.docs-nav a.active { color: var(--accent-bright); border-inline-start-color: var(--accent); background: var(--accent-soft); }
.docs-main { min-width: 0; }
.docs-main > section { scroll-margin-top: 80px; }
.docs-main > section + section { margin-top: 2.8rem; padding-top: 2.1rem; border-top: 1px solid var(--hairline); }
.docs-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.4rem; }
  .docs-nav { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 0.6rem; }
}

/* ============================================================================
   GRID SYSTEM v2 — opencode-inspired framed "spec-sheet" layout
   Dark-gold identity kept; layout becomes a bordered, hairline-ruled grid.
   Classic single mono font already applies to everything (headings + body).
   ============================================================================ */

/* The frame: a centered column with visible side rules, like a printed spec. */
.frame {
  max-width: 1120px;
  margin-inline: auto;
  border-inline: 1px solid var(--border);
  background: var(--bg);
}
body.framed { background: var(--bg); }               /* uniform dark, no gutter contrast */

/* Header inside the frame */
.frame > .site-header { border-top: none; }

/* Rows: each section is a full-width band separated by hairline rules. */
.row {
  padding: clamp(2.2rem, 5vw, 3.6rem) clamp(1.2rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--border);
}
.frame > .row:last-of-type { border-bottom: none; }
.row > .inner { max-width: 860px; margin-inline: auto; }
.row.narrow > .inner { max-width: 680px; }
.row h2 { margin-top: 0; }
.row > .inner > p.lead { margin-bottom: 0; }

/* Hero row: no glow, centered content */
.row.hero-row { padding-block: clamp(2.6rem, 6vw, 4.4rem); }
.row.hero-row > .inner { max-width: 860px; text-align: start; }
.row.hero-row .cast-controls { justify-content: flex-start; }

/* ---- Logo: terminal wordmark, the only mark in the header ---- */
.logo { display: inline-flex; align-items: center; line-height: 0; }
.logo:hover { text-decoration: none; }
.logo img {
  height: 21px; width: auto; display: block;
  mix-blend-mode: lighten;   /* drop the logo's black backdrop onto our dark surface */
}

/* ---- [*] spec list — replaces icon cards for capability lists ---- */
.speclist { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.speclist > li {
  display: grid; grid-template-columns: auto 1fr; gap: 0.9rem;
  padding: 0.72rem 0; border-top: 1px solid var(--hairline);
  color: var(--text-dim);
}
.speclist > li:first-child { border-top: none; }
.speclist > li::before {
  content: "[*]"; direction: ltr; unicode-bidi: isolate;
  font-family: var(--font-mono); color: var(--accent);
  font-size: 0.92rem; line-height: 1.75;
}
.speclist > li.star::before { content: "[+]"; }         /* highlight the Arabic item */
.speclist b { color: var(--text); font-weight: 700; }
.speclist .desc { display: block; }

/* ---- Figure row (ASCII/data figures with fig captions) ---- */
.figrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 1.4rem; }
.fig-cap { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 0.6rem; }
@media (max-width: 640px) { .figrow { grid-template-columns: 1fr; } }

/* ---- Install block inside the hero ---- */
.hero-install { margin-top: 1.6rem; max-width: 580px; }
.hero-install .tabs { margin: 0; }

/* ---- Animated terminal cast (the demo "video") ---- */
.cast { margin-top: 2rem; max-width: 900px; box-shadow: 0 30px 70px -40px rgba(0,0,0,0.95); }
.cast .term-body { min-height: 300px; }

/* hero demo clip (video) */
.hero-clip {
  margin-top: 2rem; max-width: 900px;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #000;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.95);
}
.hero-clip video { display: block; width: 100%; height: auto; }
.cast-controls { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.7rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.cast-controls button { all: unset; cursor: pointer; color: var(--text-dim); border: 1px solid var(--hairline); border-radius: 6px; padding: 0.15rem 0.6rem; }
.cast-controls button:hover { color: var(--accent); border-color: var(--accent-deep); }

/* diff lines inside terminal/cast */
.term-body .add, .cast .add { color: var(--diff-add); }
.term-body .del, .cast .del { color: var(--diff-remove); }
.term-body .tool, .cast .tool { color: var(--accent-bright); }
.term-body .path { color: var(--text); }
.term-body .think { color: var(--muted); font-style: italic; }

/* footer aligns to frame edges */
.frame > .site-footer { border-inline: none; }

/* ---- Footer: clean, organized section (no terminal frame) ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); padding: clamp(1.9rem, 4vw, 3rem) clamp(1.2rem, 4vw, 2.6rem); }
.foot-wrap { max-width: 900px; margin-inline: auto; }
.foot-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem;
  padding-bottom: 1.3rem; border-bottom: 1px solid var(--hairline);
}
.foot-head .logo img { height: 30px; }
.foot-head .f-tag { color: var(--text-dim); margin: 0; max-width: 48ch; font-size: 0.86rem; line-height: 1.7; }
.foot-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; margin-top: 1.4rem; }
.foot-col .foot-h { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.03em; margin: 0 0 0.6rem; }
.foot-col a { color: var(--accent-bright); }
.foot-col a:hover { color: var(--accent); }
.foot-col > a { display: block; padding: 0.16rem 0; }
.foot-col .foot-sub { color: var(--text-dim); font-size: 0.82rem; margin: 0.24rem 0 0; line-height: 1.7; }
.foot-col .foot-sub a { display: inline; }
@media (max-width: 420px) { .foot-cols { grid-template-columns: 1fr; } }

/* developer credit — single line at the very bottom */
.foot-bottom {
  margin-top: 1.5rem; padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
  text-align: center; color: var(--muted); font-size: 0.85rem;
}
.foot-bottom a { color: var(--accent-bright); font-weight: 700; }
.foot-bottom a:hover { color: var(--accent); }

/* ---- Copy toast + clickable command ---- */
.cmd { cursor: pointer; }
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--elevated); color: var(--accent-bright);
  border: 1px solid var(--accent-deep); border-radius: 8px;
  padding: 0.55rem 1.1rem; font-family: var(--font-mono); font-size: 0.9rem;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,0.8);
  opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================================
   Provider logos strip
   ============================================================================ */
.providers-strip .cap { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.9rem; }
.providers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.prov {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--panel);
  padding: 1.15rem 0.6rem;
  color: var(--text-dim);
  transition: color .18s ease, background .18s ease;
}
.prov svg { width: 21px; height: 21px; fill: currentColor; opacity: .7; transition: opacity .18s ease; flex-shrink: 0; }
.prov .pn { font-size: 0.82rem; font-family: var(--font-mono); direction: ltr; white-space: nowrap; }
.prov:hover { color: var(--accent); background: var(--elevated); }
.prov:hover svg { opacity: 1; }
@media (max-width: 860px) { .providers { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================================
   Hero platform chips — quick jump to each platform section
   ============================================================================ */
.plat-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.86rem;
  color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.38rem 0.95rem;
  background: var(--panel);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.chip:hover { color: var(--accent-bright); border-color: var(--accent-deep); background: var(--accent-soft); text-decoration: none; }
.chip-ic {
  font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate;
  color: var(--accent); font-size: 0.82rem; line-height: 1;
}
.chip-ic.big { font-size: 2rem; color: var(--accent); }

/* nav CTA button sizing inside the header */
.nav-links .nav-cta { font-size: 0.88rem; padding: 0.42rem 0.9rem; }
@media (max-width: 720px) { .nav-links .nav-cta { display: none; } }

/* ============================================================================
   Pipeline — the 4-step agent loop (يفهم → يخطط → ينفّذ → يتحقق)
   ============================================================================ */
.pipeline {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.8rem;
  counter-reset: pipe;
}
.pipe-step { position: relative; background: var(--panel); padding: 1.5rem 1.25rem 1.35rem; }
.pipe-step .pipe-num {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--accent-deep); border-radius: 50%;
  color: var(--accent-bright); background: var(--accent-soft);
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
  margin-bottom: 0.8rem;
}
.pipe-step b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.4rem; }
.pipe-step p { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.75; }
/* arrow between steps (points left in RTL flow) */
.pipe-step:not(:last-child)::after {
  content: "←";
  position: absolute;
  inset-inline-end: -11px; top: 1.55rem;
  z-index: 1;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-size: 0.75rem; line-height: 1;
}
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe-step::after { display: none; }
}
@media (max-width: 520px) { .pipeline { grid-template-columns: 1fr; } }

/* ============================================================================
   Platform sections — one row per platform, alternating copy/visual
   ============================================================================ */
.plat-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.4rem, 4vw, 2.8rem);
  align-items: center;
}
.plat-grid.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.plat-grid.flip .plat-copy { order: 2; }
.plat-grid.flip .plat-visual { order: 1; }
@media (max-width: 860px) {
  .plat-grid, .plat-grid.flip { grid-template-columns: 1fr; }
  .plat-grid.flip .plat-copy { order: 1; }
  .plat-grid.flip .plat-visual { order: 2; }
}
.plat-idx {
  font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate;
  text-align: start;
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 0.7rem;
}
html[dir="rtl"] .plat-idx { text-align: right; }
.plat-copy h3 { margin-top: 0; font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
.plat-copy p { color: var(--text-dim); }
.plat-points { list-style: none; margin: 1rem 0 1.3rem; padding: 0; }
.plat-points li {
  position: relative;
  padding: 0.34rem 1.4rem 0.34rem 0;
  color: var(--text-dim); font-size: 0.94rem;
  border-top: 1px solid var(--hairline);
}
.plat-points li:first-child { border-top: none; }
.plat-points li::before {
  content: "[+]"; position: absolute; inset-inline-start: 0; top: 0.36rem;
  font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate;
  color: var(--accent); font-size: 0.8rem;
}
.plat-cmd { max-width: 340px; }
.plat-cmd .tok-prompt { color: var(--accent); }
.plat-cta { margin: 0; }
.plat-visual .term, .plat-visual .web-clip { margin: 0; }
.plat-visual .term-body { font-size: 0.86rem; line-height: 1.95; }
.plat-visual .clip-ph { gap: 0.7rem; }
.kbd-combo { display: inline-flex; align-items: center; gap: 0.4rem; direction: ltr; }
.kbd-combo kbd {
  font-family: var(--font-mono); font-size: 1.05rem;
  color: var(--accent-bright);
  background: var(--panel);
  border: 1px solid var(--accent-line);
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
}
.kbd-combo span { color: var(--muted); }

/* ============================================================================
   Comparison table — arabcode column highlighted
   ============================================================================ */
.compare-scroll { border-color: var(--border); }
table.compare { min-width: 640px; }
table.compare thead th { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; text-align: center; }
table.compare thead th:first-child { direction: rtl; }
table.compare td { text-align: center; color: var(--text-dim); }
table.compare td:first-child { text-align: right; color: var(--text); white-space: nowrap; }
table.compare .col-ac {
  background: var(--accent-soft);
  color: var(--text);
  border-inline: 1px solid var(--accent-line);
  font-weight: 600;
}
table.compare thead .col-ac { color: var(--accent-bright); }
table.compare .yes { color: var(--diff-add); font-weight: 700; }
table.compare .no { color: var(--muted); }
.compare-closer {
  margin: 1.4rem 0 0;
  font-size: 1.02rem; color: var(--text);
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 1rem;
}

/* ============================================================================
   Scroll reveal — subtle, respects prefers-reduced-motion (JS adds .in)
   ============================================================================ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================================
   Web UI clip
   ============================================================================ */
.web-clip { margin-top: 1.4rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.web-clip video { display: block; width: 100%; height: auto; background: #000; }
.clip-ph {
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.85rem;
  text-align: center; padding: 1rem;
  color: var(--text-dim);
  background:
    radial-gradient(circle at 50% 42%, var(--accent-soft), transparent 62%),
    repeating-linear-gradient(45deg, transparent 0 15px, rgba(255,175,0,0.025) 15px 16px),
    var(--elevated);
}
.clip-ph .play {
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid var(--accent-line); background: var(--panel);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.clip-ph .play svg { width: 24px; height: 24px; margin-inline-start: 3px; }
.clip-ph .pht { font-size: 0.98rem; color: var(--text); }
.clip-ph .phh { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); direction: ltr; }
