:root {
  --bg: #ecebf8;
  --card: #ffffff;
  --card-2: #f4f3fc;
  --ink: #1b1a33;
  --ink-2: #55537a;
  --ink-3: #8a88a8;
  --line: rgba(27, 26, 51, 0.1);
  --accent: #5a4bff;
  --code: #17162b;
  --code-ink: #e8e6ff;
  --code-line: rgba(255, 255, 255, 0.07);
  --mono: "JetBrains Mono", "Vazirmatn", ui-monospace, "SF Mono", Consolas, monospace;
  --spring: cubic-bezier(.3, 1.55, .5, 1);
  --shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(27, 26, 51, .04), 0 22px 44px -26px rgba(27, 26, 51, .35);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12112a;
  --card: #1d1c33;
  --card-2: #26253f;
  --ink: #f3f2ff;
  --ink-2: #b4b2d3;
  --ink-3: #8280a6;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #8b7dff;
  --code: #0d0c1f;
  --shadow: 0 0 0 1px var(--line), 0 22px 44px -26px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Vazirmatn", system-ui, sans-serif; line-height: 1.85;
  -webkit-font-smoothing: antialiased; transition: background-color .3s, color .3s;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, kbd { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
p code, li code, td code, .d-ex-head code {
  padding: .08em .45em; border-radius: 8px; background: var(--card-2); font-size: .86em;
  box-shadow: inset 0 0 0 1px var(--line);
}
.d-skip { position: absolute; inset-inline-start: 12px; top: -60px; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); z-index: 100; }
.d-skip:focus { top: 12px; }

/* header ---------------------------------------------------------------- */
.d-top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.d-top-in { max-width: 1280px; margin: auto; display: flex; align-items: center; gap: 18px; padding: 10px clamp(16px, 4vw, 48px); }
.d-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.d-brand small { font: 500 .72rem var(--mono); color: var(--ink-3); padding: 2px 8px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); }
.d-brand-mark { width: 22px; height: 22px; border-radius: 8px; background: var(--ink); position: relative; }
.d-brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 3px; background: var(--bg); }
.d-top-links { display: flex; gap: 4px; margin-inline-start: 18px; }
.d-top-links a { padding: 4px 12px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .92rem; transition: background-color .2s, color .2s; }
.d-top-links a:hover { background: var(--card); color: var(--ink); }
.d-tools { margin-inline-start: auto; display: flex; gap: 8px; }
.d-chip { padding: 5px 14px; border: 0; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: .86rem; font-weight: 500; transition: transform .35s var(--spring), background-color .2s; }
.d-chip:hover { background: var(--card-2); }
.d-chip:active { transform: scale(.92); }
.d-icon-btn { display: none; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.d-icon-btn svg { width: 20px; height: 20px; }

.d-langs { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.d-lang { padding: 2px 12px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); font-size: .82rem; font-weight: 600; transition: background-color .25s, color .25s, transform .35s var(--spring); }
.d-lang:hover { color: var(--ink); }
.d-lang:active { transform: scale(.92); }
.d-lang[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
:root[lang="en"] body, :root[lang="de"] body { font-family: "Inter", "Vazirmatn", system-ui, sans-serif; line-height: 1.75; }
:root[lang="en"] .d-brand, :root[lang="de"] .d-brand { letter-spacing: -.01em; }

/* hero ------------------------------------------------------------------ */
.d-hero { padding: clamp(28px, 5vw, 72px) clamp(16px, 4vw, 48px) clamp(32px, 5vw, 56px); }
.d-hero-in { max-width: 1184px; margin: auto; }
.d-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(28px, 5vw, 76px); align-items: center; }
.d-h1 { max-width: 15ch; margin: 0; font-size: clamp(2.3rem, 5.2vw, 4.2rem); font-weight: 900; line-height: 1.4; letter-spacing: -.02em; }
:root[lang="en"] .d-h1, :root[lang="de"] .d-h1 { line-height: 1.08; letter-spacing: -.04em; max-width: 14ch; }
.d-stage-wrap { position: relative; }
.d-stage {
  position: relative; height: 500px; overflow: hidden; isolation: isolate; border-radius: 34px;
  --sk: color-mix(in srgb, var(--ink) 10%, transparent);
  background: var(--card);
  box-shadow: var(--shadow);
}
.d-sk { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 24px; padding: 30px 28px 28px; }
.d-sk-top { display: flex; align-items: center; gap: 14px; }
.d-sk-dot { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--sk); }
.d-sk-bar { display: block; height: 12px; border-radius: 99px; background: var(--sk); }
.d-sk-bar.s { height: 9px; opacity: .65; }
.d-sk-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, 1fr); gap: 16px; }
.d-sk-card {
  display: grid; align-content: center; gap: 12px; padding: 20px; border-radius: 24px; background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .7s var(--spring), opacity .45s ease;
}
.d-sk-card[data-gone] { transform: scale(.82); opacity: 0; }
.d-sk-ico { display: block; width: 40px; height: 40px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 28%, transparent); }
#sk-target .d-sk-ico { background: var(--accent); }
.d-stage-pause {
  position: absolute; z-index: 10; inset-block-start: 14px; inset-inline-end: 14px; padding: 4px 14px; border: 0; border-radius: 99px;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--ink-2); font-size: .8rem; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .35s var(--spring), color .2s;
}
.d-stage-pause:hover { color: var(--ink); }
.d-stage-pause:active { transform: scale(.92); }
.d-sub { max-width: 54ch; margin: 10px 0 0; color: var(--ink-2); font-size: 1.05rem; }
.d-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 26px; }
.d-install { display: inline-flex; align-items: center; gap: 14px; padding-block: 6px; padding-inline: 18px 6px; border-radius: 99px; background: var(--code); color: var(--code-ink); font-size: .95rem; }
.d-install button { padding: 6px 14px; border: 0; border-radius: 99px; background: rgba(255,255,255,.1); color: inherit; font: 500 .8rem "Vazirmatn", sans-serif; transition: transform .3s var(--spring), background-color .2s; }
.d-install button:hover { background: rgba(255,255,255,.18); }
.d-install button:active { transform: scale(.9); }
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 99px; background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: .95rem; transition: transform .35s var(--spring), background-color .2s, color .2s;
}
.d-btn:hover { background: var(--ink); color: var(--bg); }
.d-btn:active { transform: scale(.94); }
.d-btn-solid { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 75%, transparent); }
.d-btn-solid:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.d-btn[data-tone="danger"]:hover { background: #f03e5f; color: #fff; }
.d-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: clamp(36px, 5vw, 60px) 0 0; padding: 0; border-top: 1px solid var(--line); }
.d-facts > div { padding: 18px 0 0; padding-inline-end: 20px; }
.d-facts dt { color: var(--ink-3); font-size: .85rem; }
.d-facts dd { margin: 0; font-weight: 600; }

/* shell ----------------------------------------------------------------- */
.d-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 52px; max-width: 1280px; margin: auto; padding: 0 clamp(16px, 4vw, 48px) 40px; }
.d-side-in { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding-bottom: 20px; scrollbar-width: thin; }
.d-search { position: relative; display: block; }
.d-search svg { position: absolute; inset-inline-start: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink-3); pointer-events: none; }
.d-search input { width: 100%; height: 44px; padding: 0 42px; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: .92rem; box-shadow: inset 0 0 0 1px var(--line); outline: none; transition: box-shadow .2s; }
.d-search input:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.d-search kbd { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); padding: 0 7px; border-radius: 6px; background: var(--card-2); color: var(--ink-3); font-size: .75rem; box-shadow: inset 0 0 0 1px var(--line); }
.d-found { margin: 10px 4px 0; color: var(--ink-2); font-size: .85rem; }
.d-nav { margin-top: 18px; display: grid; gap: 2px; }
.d-nav-title { margin: 16px 12px 4px; color: var(--ink-3); font-size: .82rem; font-weight: 600; }
.d-nav a { display: block; position: relative; padding: 5px 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: .93rem; transition: background-color .2s, color .2s; }
.d-nav a:hover { background: var(--card); color: var(--ink); }
.d-nav a[data-active] { color: var(--ink); font-weight: 700; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.d-nav a[data-active]::before { content: ""; position: absolute; inset-inline-start: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.d-nav-sub { display: none; margin: 2px 0 6px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); margin-inline-start: 18px; }
.d-nav-sub a { padding: 3px 10px; font-size: .86rem; color: var(--ink-3); }
.d-nav-group[data-open] > .d-nav-sub { display: block; }

/* content --------------------------------------------------------------- */
.d-sec { padding-top: 56px; }
.d-sec:first-child { padding-top: 8px; }
.d-sec h2 { margin: 0; font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; line-height: 1.4; letter-spacing: -.01em; }
.d-intro { max-width: 76ch; color: var(--ink-2); }
.d-intro p { margin: 12px 0 0; }
.d-intro b { color: var(--ink); }

.d-ex { margin: 22px 0 0; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 84px; }
.d-ex-head { padding: 22px 26px 18px; }
.d-ex h3 { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.6; }
.d-ex h3 a { color: inherit; text-decoration: none; }
.d-ex h3 a::after { content: "#"; margin-inline-start: 8px; color: var(--ink-3); font-weight: 400; opacity: 0; transition: opacity .2s; }
.d-ex h3 a:hover::after { opacity: 1; }
.d-ex-head p { margin: 4px 0 0; max-width: 78ch; color: var(--ink-2); font-size: .95rem; }
.d-code { background: var(--code); color: var(--code-ink); direction: ltr; text-align: left; }
.d-code-bar { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px 7px 20px; border-bottom: 1px solid var(--code-line); color: #8886ad; font: 500 .75rem var(--mono); }
.d-copy { padding: 4px 12px; border: 0; border-radius: 99px; background: rgba(255,255,255,.07); color: #c9c7ee; font: 500 .75rem "Vazirmatn", sans-serif; transition: background-color .2s, transform .3s var(--spring); }
.d-copy:hover { background: rgba(255,255,255,.14); }
.d-copy:active { transform: scale(.9); }
.d-code pre { margin: 0; padding: 18px 22px 20px; overflow: auto; font: 400 13.5px/1.8 var(--mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: #3a3862 transparent; }
.d-code code { font: inherit; padding: 0; background: none; box-shadow: none; }
.t-c { color: #7c7aa6; font-style: italic; }
.t-s { color: #9ee6c4; }
.t-n { color: #ffc98b; }
.t-k { color: #bcaaff; }
.t-o { color: #ffd9a8; }
.t-f { color: #8fd0ff; }
.t-p { color: #f7a8c4; }

.d-tray { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 20px 16px; background: var(--card-2); border-top: 1px solid var(--line); }
.d-run {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px 0 18px; border: 0; border-radius: 99px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: .95rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px -8px color-mix(in srgb, var(--ink) 80%, transparent);
  transition: transform .4s var(--spring), box-shadow .2s;
}
.d-run:hover { transform: translateY(-2px); }
.d-run:active { transform: scale(.94); }
.d-run i { width: 0; height: 0; border-block: 6px solid transparent; border-inline-start: 10px solid currentColor; transform: scaleX(-1); margin-inline-end: 2px; }
:root[dir="ltr"] .d-run i { transform: none; }
.d-note { color: var(--ink-3); font-size: .86rem; }
.d-live { display: flex; flex-wrap: wrap; gap: 10px; }

/* tables / faq ---------------------------------------------------------- */
.d-ref h3 { margin: 40px 0 12px; font-size: 1.25rem; font-weight: 700; scroll-margin-top: 84px; }
.d-table-wrap { margin: 16px 0 0; overflow: auto; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.d-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.d-table th { padding: 12px 18px; background: var(--card-2); text-align: start; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
.d-table td { padding: 11px 18px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink-2); line-height: 1.8; }
.d-table tr:last-child td { border-bottom: 0; }
.d-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.d-table td:first-child code { background: none; box-shadow: none; padding: 0; color: var(--accent); font-weight: 500; }
.d-table td code { white-space: normal; }
.d-faq { margin-top: 18px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.d-faq details { border-bottom: 1px solid var(--line); }
.d-faq details:last-child { border-bottom: 0; }
.d-faq summary { padding: 16px 22px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.d-faq summary::-webkit-details-marker { display: none; }
.d-faq summary::after { content: "+"; font: 500 1.3rem var(--mono); color: var(--ink-3); transition: transform .35s var(--spring); }
.d-faq details[open] summary::after { transform: rotate(45deg); }
.d-faq p { margin: 0; padding: 0 22px 18px; color: var(--ink-2); max-width: 80ch; }
.d-empty { margin: 40px 0; padding: 40px; text-align: center; color: var(--ink-2); border-radius: 22px; box-shadow: inset 0 0 0 1px var(--line); }
.d-foot { max-width: 1280px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 56px; color: var(--ink-3); font-size: .9rem; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }

@media (max-width: 960px) {
  .d-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .d-stage { height: 440px; }
  .d-shell { grid-template-columns: minmax(0, 1fr); }
  .d-side { display: none; }
  .d-icon-btn { display: grid; }
  .d-top-links { display: none; }
}
@media (max-width: 560px) {
  .d-ex-head { padding: 18px 18px 14px; }
  .d-chip { padding: 5px 10px; font-size: .8rem; }
  .d-lang { padding: 2px 8px; font-size: .78rem; }
  .d-tools { gap: 6px; }
  .d-top-in { gap: 10px; }
  .d-brand small { display: none; }
  .d-code pre { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
