/* sultanc.dev: one stylesheet, system fonts only, no external resources. */

/* Dark is the house theme; light is one click away and remembered. */
:root { --fwd: right;
  /* The logo's emerald and copper, plus luminous versions for a dark page. */
  --falcon: #045d4c;
  --falcon-bright: #34d6a4;
  --copper: #e08a52;
  --copper-soft: #f5b486;
  --glow: rgba(52, 214, 164, .16);
  --glow-copper: rgba(224, 138, 82, .14);

  /* Page. */
  --bg: #03110e;
  --surface: #071d18;
  --ink: #e9f4f0;
  --muted: #8eb2a6;
  --line: #12332b;
  --link: #5ee6bb;

  /* Night: hero, header and code panels. */
  --night: #03110e;
  --night-2: #062520;
  --night-3: #0a332b;
  --night-line: #15443a;
  --night-ink: #eaf5f1;
  --night-muted: #8fb5a9;

  --font: system-ui, -apple-system, "Segoe UI", "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 70ch;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header: 68px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --falcon-bright: #0a8f6c;
  --copper: #c8703a;
  --glow: rgba(10, 143, 108, .10);
  --glow-copper: rgba(200, 112, 58, .10);
  --bg: #f5f8f6;
  --surface: #ffffff;
  --ink: #0d1f1a;
  --muted: #4a6158;
  --line: #dbe5e1;
  --link: #037a5f;
  color-scheme: light;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.7;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--copper); color: #1b120c; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
code, pre, kbd { font-family: var(--mono); }
html[lang="ar"] { --body-ls: 0; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--header);
  background: rgba(3, 38, 32, .92); color: var(--night-ink);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--night-line);
}
.home .top { position: absolute; inset: 0 0 auto 0; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 100%; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; font-weight: 700; font-size: 19px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; background: #f4f7f6; border-radius: 50%; padding: 3px; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--night-muted); font-size: 15px; }
.nav a:hover { color: var(--night-ink); background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { color: var(--night-ink); background: rgba(255,255,255,.08); }
.tools { display: flex; align-items: center; gap: 8px; }

.lang {
  display: inline-flex; border: 1px solid var(--night-line); border-radius: 999px; padding: 3px;
  background: rgba(0,0,0,.2);
}
.lang a, .lang span {
  min-width: 44px; padding: 4px 12px; border-radius: 999px; text-align: center;
  text-decoration: none; font-size: 14px; color: var(--night-muted); line-height: 1.5;
}
.lang a:hover { color: var(--night-ink); }
.lang [aria-current="true"] { background: var(--night-ink); color: var(--night); font-weight: 700; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--night-line); background: rgba(0,0,0,.2); color: var(--night-ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--night-muted); }
.icon-btn svg { width: 18px; height: 18px; }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .sun { display: none; }
:root[data-theme="light"] .theme .moon { display: block; }

/* Mobile menu: a <details>, works without script. */
.menu { display: none; position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-panel {
  position: absolute; inset-inline-end: 0; top: 46px; width: min(78vw, 300px);
  background: var(--night-2); border: 1px solid var(--night-line); border-radius: 14px;
  padding: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
  display: grid; gap: 2px;
}
.menu-panel a { color: var(--night-ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.menu-panel a:hover, .menu-panel a[aria-current="page"] { background: rgba(255,255,255,.07); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--night-ink);
  background:
    radial-gradient(900px 520px at 78% 18%, rgba(47,174,141,.20), transparent 62%),
    radial-gradient(700px 420px at 12% 92%, rgba(196,127,82,.13), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, #021b16 100%);
  padding: calc(var(--header) + 72px) 0 92px;
}
html[dir="rtl"] .hero {
  background:
    radial-gradient(900px 520px at 22% 18%, rgba(47,174,141,.20), transparent 62%),
    radial-gradient(700px 420px at 88% 92%, rgba(196,127,82,.13), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, #021b16 100%);
}
/* A faint grid: the "machine" behind the language. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(147,183,172,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147,183,172,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .wrap > * { min-width: 0; }
.hero h1 { margin: 0; font-size: clamp(42px, 6.2vw, 82px); line-height: 1.04; font-weight: 800; letter-spacing: -0.025em; }
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.2; }
.hero .lead { margin: 22px 0 0; max-width: 34em; font-size: clamp(18px, 1.55vw, 21px); color: var(--night-muted); }
.hero .lead strong { color: var(--night-ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--copper); color: #1b120c; }
.btn-primary:hover { background: var(--copper-soft); }
.btn-ghost { border-color: var(--night-line); color: var(--night-ink); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--night-muted); background: rgba(255,255,255,.05); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 30px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--night-muted); }
.facts li::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--falcon-bright); margin-inline-end: 8px; vertical-align: middle; }

/* ---------- Code panel ---------- */
.code {
  margin: 0; position: relative;
  background: linear-gradient(180deg, var(--night-3), var(--night-2) 30%);
  border: 1px solid var(--night-line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 90px rgba(0,0,0,.45), 0 0 0 1px rgba(47,174,141,.06);
}
.code::after { /* soft light along the top edge */
  content: ""; position: absolute; inset: 0 10% auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47,174,141,.55), transparent);
}
.code-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--night-line); font-family: var(--mono); font-size: 13px; color: var(--night-muted); }
.code-bar .file { direction: ltr; unicode-bidi: isolate; }
.switch { margin-inline-start: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid var(--night-line); }
.switch button { font: inherit; font-family: var(--font); font-size: 13px; cursor: pointer; border: 0; border-radius: 999px; padding: 4px 13px; background: transparent; color: var(--night-muted); }
.switch button:hover { color: var(--night-ink); }
.switch button[aria-pressed="true"] { background: var(--falcon-bright); color: var(--night); font-weight: 700; }
.code pre { margin: 0; padding: 22px 24px 24px; font-size: clamp(13px, 1.2vw, 15.5px); line-height: 1.75; color: var(--night-ink); overflow-x: auto; tab-size: 4; }
.code pre[dir="rtl"], .doc pre[dir="rtl"] { font-family: var(--font), var(--mono); }
.tok { display: inline-block; white-space: pre; transition: opacity .18s ease, filter .18s ease, transform .18s ease; }
.tok.out { opacity: 0; filter: blur(3px); transform: translateY(-3px); }
.code-out { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 12px 24px 16px; border-top: 1px dashed var(--night-line); font-family: var(--mono); font-size: 13px; color: var(--night-muted); }
.code-out .cmd { direction: ltr; unicode-bidi: isolate; flex-basis: 100%; text-align: start; }
.code-out b { color: var(--night-ink); font-weight: 500; }
.code pre[data-lang="en"] + .code-out { direction: ltr; }
.code pre[data-lang="ar"] + .code-out { direction: rtl; }

/* Syntax colors (code panels and docs). */
.k { color: var(--copper-soft); font-weight: 600; }
.ty { color: #7fd4bb; }
.s { color: #f1d3a8; }
.n { color: #b7c9f0; }
.c { color: var(--night-muted); font-style: italic; }

/* ---------- Keyword band ---------- */
.band { background: var(--night); color: var(--night-ink); border-top: 1px solid var(--night-line); }
.band ul { list-style: none; margin: 0 auto; padding: 24px var(--gutter); max-width: var(--wrap); display: flex; gap: 14px clamp(16px, 3vw, 40px); justify-content: space-between; flex-wrap: wrap; }
.band li { display: flex; align-items: baseline; gap: 10px; }
.band .ar { font-size: clamp(21px, 2.3vw, 29px); font-weight: 700; }
.band .en { font-family: var(--mono); font-size: 14px; color: var(--copper-soft); direction: ltr; }

/* ---------- Sections ---------- */
section.block { padding: clamp(64px, 9vw, 116px) 0; }
section.block + section.block { border-top: 1px solid var(--line); }
.block h2 { margin: 0 0 16px; font-size: clamp(30px, 3.5vw, 46px); line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; }
html[lang="ar"] .block h2 { letter-spacing: 0; line-height: 1.32; }
.block .intro { max-width: var(--measure); color: var(--muted); font-size: 19px; margin: 0; }
.block .more { margin: 22px 0 0; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.split > * { min-width: 0; }
:not(pre) > code { font-size: .88em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* Pipeline diagram. */
.pipeline { margin-top: 44px; position: relative; }
/* One track from source to executable: stages are points on a line, not boxes. */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 22px; position: relative; }
.pipe::before { content: ""; position: absolute; top: 7px; inset-inline: 0; height: 2px; background: linear-gradient(to var(--fwd), var(--falcon-bright), var(--line) 30%, var(--line) 70%, var(--copper)); }
.pipe::after { content: ""; position: absolute; top: 4px; inset-inline-start: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--copper-soft); box-shadow: 0 0 0 4px rgba(196,127,82,.18), 0 0 18px var(--copper); opacity: 0; pointer-events: none; }
.pipeline.run .pipe::after { animation: travel 2.8s cubic-bezier(.5,.1,.3,1) .2s 1 both; }
.pipe li { position: relative; padding-top: 30px; }
.pipe li::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); box-sizing: border-box; top: 2px; }
.pipe li.merge::before { border-color: var(--falcon-bright); background: var(--falcon-bright); }
.pipe li.out::before { border-color: var(--copper); background: var(--copper); }
.pipe li b { display: block; font-size: 17px; margin-bottom: 6px; }
.pipe li span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.sources { margin-bottom: 16px; display: flex; gap: 10px 22px; flex-wrap: wrap; }
.sources div { display: contents; }
.src { font-family: var(--mono); font-size: 14px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.src[lang="ar"] { direction: rtl; font-family: var(--font), var(--mono); }
.src::after { content: " \2193"; color: var(--muted); }
.pipe-note { margin: 26px 0 0; color: var(--muted); font-size: 15px; max-width: var(--measure); }
@keyframes travel { 0% { opacity: 0; inset-inline-start: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; inset-inline-start: calc(100% - 8px); } }

/* Features: a definition list. */
.features { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.features div { padding: 20px 0; border-top: 1px solid var(--line); }
.features dt { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.features dd { margin: 0; color: var(--muted); }

/* Examples list. */
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.ex-list li { border-top: 1px solid var(--line); }
.ex-list a { display: block; padding: 14px 0; text-decoration: none; color: var(--ink); }
.ex-list a:hover b { color: var(--link); }
.ex-list b { display: block; font-weight: 650; }
.ex-list span { display: block; color: var(--muted); font-size: 15px; }
.ex-list code { font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; direction: ltr; unicode-bidi: isolate; }

/* Terminal. */
.term { background: var(--night); color: var(--night-ink); border-radius: 14px; font-family: var(--mono); font-size: 14px; line-height: 1.85; padding: 20px 22px; overflow-x: auto; direction: ltr; text-align: left; border: 1px solid var(--night-line); }
.term .p { color: var(--falcon-bright); user-select: none; }
.term .st { color: var(--copper-soft); }
.term .o { color: var(--night-muted); }
.term div { white-space: pre; }
.term bdi { unicode-bidi: isolate; }
.stack { display: grid; gap: 16px; }
.code.small pre { font-size: 13.5px; padding: 16px 18px; max-height: 360px; }

/* Targets. */
.targets { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 32px 0 0; padding: 0; list-style: none; }
.targets li { font-size: clamp(26px, 3.3vw, 44px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.targets li span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); font-family: var(--mono); letter-spacing: 0; direction: ltr; text-align: start; }
html[dir="rtl"] .targets li span { text-align: right; }

/* Why. */
.why { background: var(--falcon); color: #eef7f4; }
.why .wrap { max-width: 920px; }
.why p.big { margin: 0; font-size: clamp(26px, 3.3vw, 42px); line-height: 1.35; font-weight: 700; }
.why p.small { margin: 22px 0 0; color: #c4e6dc; font-size: 18px; max-width: var(--measure); }
.why a { color: #fff; }

/* Install steps: a real sequence. */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; }
.steps li > div { min-width: 0; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; color: var(--link); background: var(--surface); }
.steps p { margin: 4px 0 8px; font-weight: 600; }
.cmdline { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px 9px 16px; font-size: 14px; direction: ltr; }
.cmdline code { flex: 1; overflow-x: auto; white-space: pre; font-size: 13.5px; background: none; border: 0; padding: 0; }
.copy { font: inherit; font-family: var(--font); font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 10px; min-width: 64px; }
.copy:hover { color: var(--ink); border-color: var(--muted); }
.copy[data-done] { color: var(--link); border-color: var(--link); }

/* ---------- Docs and example pages ---------- */
.page-head { background: var(--night); color: var(--night-ink); padding: 44px 0 36px; border-bottom: 1px solid var(--night-line); }
.page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.2; font-weight: 800; }
.page-head p { margin: 10px 0 0; color: var(--night-muted); max-width: var(--measure); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; color: var(--night-muted); }
.crumbs a { color: var(--night-muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .6; }

.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 80px; }
.docs-layout > * { min-width: 0; }
.sidebar { position: sticky; top: calc(var(--header) + 20px); align-self: start; max-height: calc(100vh - var(--header) - 40px); overflow-y: auto; font-size: 15px; }
.sidebar details { margin-bottom: 14px; }
.sidebar summary { font-weight: 700; cursor: pointer; padding: 4px 0; list-style: none; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar ul { list-style: none; margin: 4px 0 0; padding: 0; border-inline-start: 1px solid var(--line); }
.sidebar a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; margin-inline-start: -1px; border-inline-start: 2px solid transparent; }
.sidebar a:hover { color: var(--ink); }
.sidebar a[aria-current="page"] { color: var(--ink); font-weight: 600; border-inline-start-color: var(--falcon-bright); }
.docs-nav-mobile { display: none; margin-bottom: 20px; }

.doc { max-width: 78ch; font-size: 16.5px; }
.doc h1 { display: none; }
.doc h2 { font-size: 27px; line-height: 1.3; margin: 40px 0 12px; }
.doc h3 { font-size: 20px; margin: 30px 0 10px; }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.doc :is(h2, h3, h4) { scroll-margin-top: calc(var(--header) + 16px); }
.doc :is(h2, h3) a.anchor { opacity: 0; margin-inline-start: 8px; text-decoration: none; color: var(--muted); }
.doc :is(h2, h3):hover a.anchor, .doc a.anchor:focus { opacity: 1; }
.doc p, .doc li { max-width: var(--measure); }
.doc pre { background: var(--night); color: var(--night-ink); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; border: 1px solid var(--night-line); }
.doc pre[dir="ltr"] { text-align: left; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin: 18px 0; font-size: 15px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; text-align: start; }
.doc th { background: var(--surface); }
.doc blockquote { margin: 18px 0; padding: 4px 18px; border-inline-start: 3px solid var(--copper); color: var(--muted); }
.doc-foot { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.note { padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 15px; margin-bottom: 24px; }

.example-run { margin-top: 26px; display: grid; gap: 10px; }
.example-run h2 { font-size: 20px; margin: 0; }

/* ---------- Footer ---------- */
footer.site { padding: 44px 0 56px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: center; }
footer.site .brand { color: var(--ink); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer.site a { text-decoration: none; color: var(--muted); }
footer.site a:hover { color: var(--ink); }
footer.site .end { margin-inline-start: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-inline-start: 30px; }
  .pipe::before { top: 6px; bottom: 6px; inset-inline-start: 5px; inset-inline-end: auto; width: 2px; height: auto; background: linear-gradient(var(--falcon-bright), var(--line) 30%, var(--line) 70%, var(--copper)); }
  .pipe::after { display: none; }
  .pipe li { padding-top: 0; }
  .pipe li::before { inset-inline-start: -30px; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu { display: block; }
  .tools { margin-inline-start: auto; }
  .hero { padding-top: calc(var(--header) + 40px); }
  .hero .wrap, .split { grid-template-columns: 1fr; }
  .features, .ex-list { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .docs-nav-mobile { display: block; }
  .docs-nav-mobile > summary { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; cursor: pointer; }
  .docs-nav-mobile .sidebar { display: block; position: static; max-height: none; margin-top: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .code pre { padding: 16px 14px; font-size: 13px; }
  .code-out { padding: 10px 14px 14px; }
  .band ul { justify-content: center; }
  .targets li { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; transition: none !important; }
  .pipe::after { display: none; }
}
@media print {
  .top, .band, footer.site, .sidebar, .docs-nav-mobile { display: none; }
}

/* Narrow screens: nothing may widen the page; wide content scrolls inside its own box. */
.menu:not([open]) .menu-panel { display: none; }
.docs-layout > *, .example-run > *, .cmdline > code { min-width: 0; }
.example-run { grid-template-columns: minmax(0, 1fr); }
.doc p code, .doc li code, .doc td code { overflow-wrap: anywhere; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } }
.doc, .page-head h1, .page-head p { overflow-wrap: anywhere; }
[dir="rtl"] { --fwd: left; }
/* Inline code is its own direction run, so `--lang=en` stays whole inside Arabic text. */
main :not(pre) > code { unicode-bidi: isolate; }
.intro code, .features code, .lead code { white-space: nowrap; direction: ltr; }
.features code:lang(ar) { direction: inherit; }
.example-run p { margin: 0; } .example-run h2 { margin-top: 8px; }

/* ---------- Identity pass: emerald light on a dark page, copper for action. ---------- */
.hero {
  background:
    radial-gradient(760px 460px at 72% 30%, var(--glow), transparent 65%),
    radial-gradient(620px 380px at 18% 100%, var(--glow-copper), transparent 62%),
    var(--night);
}
html[dir="rtl"] .hero {
  background:
    radial-gradient(760px 460px at 28% 30%, var(--glow), transparent 65%),
    radial-gradient(620px 380px at 82% 100%, var(--glow-copper), transparent 62%),
    var(--night);
}
.hero h1 { background: linear-gradient(180deg, #ffffff 30%, #9fe9cf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.code { border-color: rgba(52,214,164,.28); box-shadow: 0 0 0 1px rgba(52,214,164,.06), 0 30px 80px rgba(0,0,0,.55), 0 0 80px rgba(52,214,164,.10); }
.btn-primary { background: var(--copper); color: #1a0e06; box-shadow: 0 8px 28px rgba(224,138,82,.28); }
.btn-primary:hover { background: var(--copper-soft); }
.k { color: #f5a46c; }
.ty { color: #5fe0b6; }
.s { color: #f3d79f; }
.n { color: #9ec3ff; }
.top { background: rgba(3,17,14,.82); }
section.block + section.block { border-top-color: var(--line); }
#pipeline { background: radial-gradient(900px 300px at 50% 0%, var(--glow), transparent 70%); }
.features div { border-top-color: var(--line); }
.features dt a:hover { color: var(--falcon-bright) !important; }
.term { box-shadow: 0 0 60px rgba(52,214,164,.07); border-color: var(--night-line); }

/* Closing: one statement and one command. */
.closing { text-align: center; background: radial-gradient(800px 360px at 50% 100%, var(--glow), transparent 70%), var(--bg); }
.closing .wrap { max-width: 860px; }
.closing .big { margin: 0; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.3; font-weight: 800; }
.closing .small { margin: 18px auto 0; color: var(--muted); font-size: 18px; max-width: 60ch; }
.install { margin: 56px auto 0; max-width: 760px; text-align: start; }
.install h2 { font-size: 22px !important; margin: 0 0 12px !important; }
.install p { color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.cmdline { background: var(--surface); border-color: var(--line); }

/* Light theme keeps the night hero and code, so the identity holds. */
:root[data-theme="light"] .hero h1 { background: none; color: var(--night-ink); }
:root[data-theme="light"] .closing .big { color: var(--ink); }
.page-head code { background: rgba(255,255,255,.08); border-color: var(--night-line); color: inherit; }

/* ---------- Install page ---------- */
.install-page { padding-top: 36px; padding-bottom: 80px; max-width: 900px; }
.os-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); width: fit-content; max-width: 100%; }
.os-tabs button { font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; border: 0; border-radius: 9px; padding: 8px 16px; background: transparent; color: var(--muted); }
.os-tabs button:hover { color: var(--ink); }
.os-tabs button[aria-selected="true"] { background: var(--falcon-bright); color: #03110e; }
.os-panel { margin-top: 28px; }
.os-panel + .os-panel { padding-top: 28px; border-top: 1px solid var(--line); }
.js-tabs .os-panel + .os-panel { padding-top: 0; border-top: 0; }
.os-name { font-size: 26px; margin: 0 0 6px; }
.js-tabs .os-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.intro-small { color: var(--muted); margin: 0 0 8px; }
.install-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.install-steps > li { counter-increment: s; position: relative; padding-inline-start: 46px; padding-block: 18px 4px; }
.install-steps > li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--falcon-bright); border: 1px solid var(--falcon-bright); }
.install-steps > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 52px; bottom: -14px; width: 1px; background: var(--line); }
.install-steps h3 { margin: 0 0 10px; font-size: 18px; line-height: 30px; }
.install-steps .cmdline + .cmdline, .install-steps .cmdline + .label { margin-top: 8px; }
.label { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.note-small { margin: 10px 0 0; color: var(--muted); font-size: 15px; max-width: var(--measure); }
.note-small:first-child { margin-top: 0; margin-bottom: 10px; }
.routes { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.routes h2 { font-size: 24px; margin: 0 0 10px; }
.routes p { color: var(--muted); max-width: var(--measure); }
.routes .doc table { margin: 14px 0; }
main :not(pre) > code { unicode-bidi: plaintext; }
.cmdline { align-items: flex-start; } .cmdline code { line-height: 1.7; }

/* ---------- Arabic typography ----------
   The same system font, set for Arabic: Arabic letters sit smaller on the body than Latin at the
   same size, need more leading for dots and marks, never take letter-spacing (it breaks the joins),
   and the heaviest weights fill the counters, so headings use 700. */
html[lang="ar"] body { font-size: 18.5px; line-height: 1.9; }
html[lang="ar"] .hero h1 { font-weight: 700; line-height: 1.35; font-size: clamp(44px, 6.4vw, 86px); }
html[lang="ar"] .block h2, html[lang="ar"] .page-head h1, html[lang="ar"] .closing .big { font-weight: 700; line-height: 1.45; letter-spacing: 0; }
html[lang="ar"] .hero .lead { font-size: clamp(19px, 1.7vw, 22.5px); line-height: 1.9; }
html[lang="ar"] .block .intro { font-size: 20px; line-height: 1.9; }
html[lang="ar"] .pipe li b, html[lang="ar"] .features dt { font-weight: 700; font-size: 18.5px; }
html[lang="ar"] .pipe li span, html[lang="ar"] .features dd { font-size: 16px; line-height: 1.8; }
html[lang="ar"] .nav a, html[lang="ar"] .menu-panel a { font-size: 16.5px; }
html[lang="ar"] .btn { font-size: 17px; padding-block: 11px; }
html[lang="ar"] .install-steps h3 { font-size: 19.5px; }
html[lang="ar"] .note-small, html[lang="ar"] .intro-small, html[lang="ar"] .routes p, html[lang="ar"] .pipe-note { font-size: 16.5px; line-height: 1.85; }
html[lang="ar"] .label, html[lang="ar"] .crumbs { font-size: 15px; }
html[lang="ar"] .sidebar a { font-size: 16px; }
html[lang="ar"] * { letter-spacing: 0 !important; }
/* Muted Arabic text loses its thin strokes first; give it a little more contrast. */
html[lang="ar"] { --muted: #a3c4b9; }
html[lang="ar"][data-theme="light"] { --muted: #3e554d; }
