:root {
  --bg: #fbfaf7; --surface: #ffffff; --surface-2: #f3f1ec; --text: #1b1a17; --muted: #67635b;
  --line: #e6e2d9; --accent: #0b6e4f; --accent-2: #0e8a63; --accent-soft: #e4f2ec; --err: #b42318;
  --code-bg: #1e1d1a; --code-text: #f1efe9; --code-muted: #a8a397;
  --bn: "Noto Sans Bengali", "Hind Siliguri", "SolaimanLipi", "Nirmala UI", "Vrinda", sans-serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121210; --surface: #1a1917; --surface-2: #22211e; --text: #ecebe6; --muted: #a29e95;
          --line: #2f2e2a; --accent: #4cc79a; --accent-2: #6fd8b0; --accent-soft: #19302a; --err: #f97066;
          --code-bg: #0c0c0b; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bn { font-family: var(--bn); }
code, pre, kbd { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .08em .35em; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
       backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid;
               place-items: center; font: 600 16px/1 var(--bn); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { color: var(--text); background: var(--surface-2); font-weight: 600; }
.gh { color: var(--muted); display: flex; }
.gh:hover { color: var(--text); }

/* layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 40px 16px 80px; max-width: 1120px; margin: 0 auto; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 14px; }
.toc h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
@media (max-width: 860px) { .doc { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; } .toc { display: none; } }
article { min-width: 0; }
.top-in { min-width: 0; } .nav { min-width: 0; }
article h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 8px; }
article .lede { color: var(--muted); font-size: 18px; margin: 0 0 32px; }
article h2 { font-size: 24px; letter-spacing: -.015em; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
article h3 { font-size: 18px; margin: 28px 0 8px; scroll-margin-top: 80px; }
article p, article li { max-width: 72ch; }

/* code blocks */
.code { position: relative; margin: 16px 0; }
.code pre { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 16px 18px;
            overflow-x: auto; line-height: 1.6; font-size: 14px; }
.code pre .c { color: var(--code-muted); }
.code pre .s { color: #9fe0bf; }
.code pre .bnout { font-family: var(--bn); color: #ffd58a; }
.code .copy { position: absolute; top: 8px; right: 8px; }
button.copy { font: 12px var(--ui); color: var(--code-muted); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
              border-radius: 6px; padding: 3px 8px; cursor: pointer; }
button.copy:hover { color: #fff; border-color: rgba(255,255,255,.35); }

/* tabs */
.tabs { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin: 16px 0; }
.tablist { display: flex; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tablist button { font: 500 14px var(--ui); color: var(--muted); background: none; border: 0; padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tablist button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tabs .panel { padding: 0 12px 12px; }
.tabs .panel[hidden] { display: none; }
.tabs .code { margin: 12px 0 0; }

/* tables */
.tbl { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.bn, td .bn { font-size: 16px; }

/* callouts */
.note { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 8px; margin: 16px 0; }
.note p { margin: 0; }

/* home */
.hero { padding: 72px 0 32px; text-align: center; }
.hero .eyebrow { display: inline-block; font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 20px; font-weight: 600; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -.035em; margin: 0 auto 16px; max-width: 16ch; }
.hero p { color: var(--muted); font-size: clamp(17px, 2vw, 20px); max-width: 56ch; margin: 0 auto 28px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 15px; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1a14; } }
.btn:hover { filter: brightness(1.05); }
.ticker { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 40px auto 0; max-width: 900px; }
.ticker span { font: 18px var(--bn); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
.ticker span b { font: 500 13px var(--mono); color: var(--muted); margin-right: 8px; }
section.band { padding: 56px 0; }
section.band h2 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 8px; text-align: center; }
section.band > .wrap > p.sub { color: var(--muted); text-align: center; margin: 0 auto 32px; max-width: 60ch; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.langs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.lang { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color .15s, transform .15s; }
.lang:hover { border-color: var(--accent); transform: translateY(-1px); }
.lang strong { display: block; font-size: 16px; }
.lang code { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); background: none; border: 0; padding: 0; word-break: break-all; }

/* playground */
.play { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.pg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.pg h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.pg h3 code { text-transform: none; letter-spacing: 0; color: var(--accent); background: none; border: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.row input[type=text], .row input[type=number], .row select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.row input[type=text] { flex: 1 1 140px; }
.row input[type=number] { width: 80px; }
.row input:focus, .row select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.out { display: flex; gap: 8px; align-items: flex-start; background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; min-height: 48px; }
.out span { flex: 1; font: 20px/1.45 var(--bn); word-break: break-word; }
.out.err { background: transparent; border: 1px dashed var(--err); }
.out.err span { color: var(--err); font: 14px/1.5 var(--ui); }
.out button.copy { color: var(--accent); border-color: var(--accent); background: transparent; }

footer.foot { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
footer.foot a { color: var(--muted); }
