@font-face {
  font-family:Adwaita;
  src:url('./assets/AdwaitaSans.ttf') format('truetype');
  font-weight:100 900;
  font-display:swap;
}

:root {
  color-scheme:dark;
  --background:#0b0e0b;
  --surface:#111610;
  --text:#e6ebe2;
  --muted:#99a392;
  --line:#283023;
  --accent:#b4ec7b;
  --soft:#1b2814;
  --code:#151d11;
  --sage:#21331a;
  --sage-ink:#b4ec7b;
  --lavender:#21291d;
  --lavender-ink:#bbc6b2;
  --sand:#2a301c;
  --sand-ink:#d1dfa2;
  --radius:14px;
}

* {
  box-sizing:border-box;
}

html {
  scroll-behavior:smooth;
  scroll-padding-top:100px;
}

body {
  margin:0;
  background:var(--background);
  color:var(--text);
  font-family:Adwaita,Arial,sans-serif;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

button,input {
  font:inherit;
}

a {
  color:inherit;
  text-decoration:none;
}

button {
  cursor:pointer;
}

button, input {
  accent-color:var(--accent);
}

button:disabled {
  cursor:default;
}

svg {
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.65;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex-shrink:0;
}

button,a,input {
  -webkit-tap-highlight-color:transparent;
}

::selection {
  color:var(--text);
  background:var(--sage);
}

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

input:focus-visible {
  outline:none;
}

* {
  scrollbar-width:thin;
  scrollbar-color:var(--line) transparent;
}

kbd,code {
  font-family:ui-monospace,monospace;
  font-size:.85em;
}

kbd {
  border:1px solid var(--line);
  border-radius:4px;
  padding:1px 5px;
  color:var(--muted);
}

main:focus {
  outline:none;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}

.skip-link {
  position:fixed;
  left:20px;
  top:-80px;
  z-index:20;
  background:var(--text);
  color:var(--surface);
  padding:10px 16px;
}

.skip-link:focus {
  top:15px;
}

.header {
  height:82px;
  border-bottom:1px solid var(--line);
  background:var(--background);
  position:sticky;
  top:0;
  z-index:10;
}

.header-inner {
  height:100%;
  max-width:1248px;
  padding:0 40px;
  margin:auto;
  display:flex;
  align-items:center;
  gap:46px;
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  letter-spacing:-.04em;
  font-size:25px;
  font-weight:700;
  white-space:nowrap;
}

.brand .avatar {
  display:block;
  width:40px;
  height:40px;
  flex-shrink:0;
  overflow:hidden;
  border-radius:11px;
  background:#000;
}

.brand .avatar img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.6);
}

.brand-docs {
  font-size:16px;
  font-weight:450;
  letter-spacing:-.02em;
  margin-left:8px;
  color:var(--muted);
}

.header-link {
  font-size:13px;
  align-self:stretch;
  display:flex;
  align-items:center;
  position:relative;
}

.header-link[aria-current="page"]:after {
  content:'';
  position:absolute;
  bottom:-1px;
  left:0;
  right:0;
  height:2px;
  background:var(--accent);
}

.header-tools {
  display:flex;
  align-items:center;
  gap:20px;
  margin-left:auto;
}

#language-toggle {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-around;
  flex-shrink:0;
  width:80px;
  height:36px;
  padding:0 3px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
}

#language-toggle:hover {
  border-color:var(--muted);
}

.language-thumb {
  position:absolute;
  top:3px;
  left:3px;
  width:34px;
  height:28px;
  border-radius:14px;
  background:var(--soft);
  transition:transform .2s cubic-bezier(.16,1,.3,1);
}

#language-toggle[data-locale="en"] .language-thumb {
  transform:translateX(38px);
}

.language-flag {
  position:relative;
  width:23px;
  height:16px;
  border-radius:2px;
  opacity:.45;
  transition:opacity .2s ease;
}

#language-toggle[data-locale="ru"] .flag-ru,
#language-toggle[data-locale="en"] .flag-us {
  opacity:1;
}

@media(max-width:400px) {
  .header-inner {
    gap:14px;
  }
  .search-box {
    gap:6px;
    padding-inline:8px;
  }
}

.search-wrap {
  position:relative;
}

.search-box {
  display:flex;
  align-items:center;
  gap:9px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:7px 10px;
  background:var(--surface);
  color:var(--muted);
}

.search-box:focus-within {
  border-color:var(--accent);
  outline:2px solid var(--soft);
}

.search-box svg {
  width:16px;
  height:16px;
}

.search-box input {
  border:0;
  outline:0;
  min-width:0;
  width:200px;
  color:var(--text);
  background:none;
  font-size:12px;
  caret-color:var(--accent);
}

.search-box input::placeholder {
  color:var(--muted);
}

.search-box kbd {
  font-size:11px;
  line-height:17px;
  padding:0 5px;
}

.icon-button {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:0;
  background:transparent;
  border-radius:8px;
  color:var(--muted);
}

.icon-button:hover {
  color:var(--text);
  background:var(--soft);
}

.search-results {
  position:absolute;
  right:0;
  top:calc(100% + 12px);
  width:420px;
  max-height:460px;
  overflow-y:auto;
  padding:7px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 12px 30px #00000012;
}

.search-result {
  display:block;
  padding:12px 14px;
  border-radius:7px;
}

.search-result:hover,.search-result:focus {
  background:var(--soft);
}

.search-result small {
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-bottom:3px;
}

.search-result strong {
  font-size:14px;
  font-weight:550;
}

.search-empty {
  padding:20px;
  font-size:13px;
  color:var(--muted);
}

.search-empty strong {
  display:block;
  color:var(--text);
  margin-bottom:4px;
}

.home {
  max-width:1248px;
  padding:87px 40px 140px;
  margin:auto;
  min-height:calc(100svh - 158px);
}

.home-heading {
  margin-bottom:43px;
}

.home h1 {
  font-size:46px;
  font-weight:550;
  line-height:1.15;
  letter-spacing:-.035em;
  margin:0;
}

.home-heading p {
  margin:15px 0 0;
  font-size:15px;
  color:var(--muted);
}

.project-grid {
  display:grid;
  grid-template-columns:minmax(0,520px);
  gap:20px;
}

.project-card {
  position:relative;
  display:flex;
  flex-direction:column;
  padding:28px 28px 21px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  min-height:284px;
  transition:transform .2s ease,border-color .2s ease;
}

.project-docs::after {
  content:'';
  position:absolute;
  inset:0;
  z-index:1;
  border-radius:var(--radius);
}

.project-docs:focus-visible {
  outline:none;
}

.project-docs:focus-visible::after {
  outline:2px solid var(--accent);
  outline-offset:5px;
}

.project-card:hover {
  border-color:var(--muted);
  transform:translateY(-4px);
}

.project-card:hover .card-arrow {
  transform:translateX(4px);
  color:var(--text);
}

.project-icon {
  width:49px;
  height:49px;
  border-radius:12px;
  display:grid;
  place-items:center;
}

.project-icon svg {
  width:25px;
  height:25px;
  stroke-width:1.5;
}

.sage {
  background:var(--sage);
  color:var(--sage-ink);
}

.lavender {
  background:var(--lavender);
  color:var(--lavender-ink);
}

.sand {
  background:var(--sand);
  color:var(--sand-ink);
}

.card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.card-arrow {
  color:var(--muted);
  transition:transform .2s,color .2s;
  width:19px;
}

.project-card h2 {
  font-size:21px;
  letter-spacing:-.02em;
  font-weight:600;
  line-height:1.3;
  margin:25px 0 10px;
}

.project-card p {
  font-size:14px;
  color:var(--muted);
  margin:0 0 25px;
  max-width:48ch;
  line-height:1.65;
}

.mod-icon {
  display:block;
  width:72px;
  height:72px;
  flex-shrink:0;
  object-fit:contain;
}

.article-links {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:20px;
  margin-top:26px;
  font-size:12px;
}

.project-links {
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}

.project-links a {
  position:relative;
  z-index:2;
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:8px;
  color:var(--muted);
}

.project-links a:hover {
  color:var(--accent);
  background:var(--soft);
}

.project-links .brand-icon {
  width:19px;
  height:19px;
  fill:currentColor;
  stroke:none;
}

.article-links span {
  margin-left:8px;
  font-size:10px;
  color:var(--muted);
}

.source-link {
  display:inline-block;
  margin-top:26px;
  font-size:11px;
}

.article code {
  overflow-wrap:anywhere;
}

.article pre code {
  overflow-wrap:normal;
}

.sidebar-project .mod-icon {
  width:38px;
  height:38px;
}

.sidebar-project strong {
  line-height:1.35;
}

.card-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-top:18px;
  border-top:1px solid var(--line);
  margin-top:auto;
  font-size:11px;
  color:var(--muted);
  gap:16px;
}

.card-meta {
  display:flex;
  flex-direction:column;
  gap:2px;
}

.card-meta span:last-child {
  font-variant-numeric:tabular-nums;
}

.home-help {
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  margin-top:30px;
}

.home-help svg {
  width:16px;
  height:16px;
}

.home-help a {
  color:var(--text);
  text-decoration:underline;
  text-underline-offset:4px;
  text-decoration-color:var(--line);
}

.home-help a:hover {
  text-decoration-color:var(--text);
}

.footer {
  max-width:1168px;
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:0 auto;
  border-top:1px solid var(--line);
  font-size:11px;
  color:var(--muted);
}

.footer a:hover {
  color:var(--text);
}

.footer span {
  font-variant-numeric:tabular-nums;
}

.docs-layout {
  max-width:1328px;
  margin:auto;
  display:grid;
  grid-template-columns:232px minmax(0,1fr) 174px;
  gap:48px;
  padding:42px 40px 90px;
  min-height:calc(100svh - 158px);
}

.sidebar {
  position:sticky;
  top:114px;
  align-self:start;
  max-height:calc(100svh - 140px);
  overflow:auto;
  padding-right:12px;
}

.back-link {
  display:flex;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  margin-bottom:32px;
}

.back-link svg {
  width:14px;
  height:14px;
}

.back-link:hover {
  color:var(--text);
}

.sidebar-project {
  display:flex;
  gap:11px;
  align-items:center;
  margin-bottom:30px;
}

.sidebar-project .project-icon {
  width:34px;
  height:34px;
  border-radius:8px;
}

.sidebar-project svg {
  width:18px;
  height:18px;
}

.sidebar-project strong {
  font-size:15px;
  font-weight:600;
}

.sidebar-project small {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:1px;
}

.nav-group {
  margin:24px 0;
}

.nav-group-label {
  font-size:11px;
  font-weight:600;
  margin:0 0 9px 10px;
  color:var(--muted);
}

.nav-link {
  display:block;
  font-size:13px;
  color:var(--muted);
  padding:7px 10px;
  border-radius:6px;
  margin:2px 0;
}

.nav-link:hover {
  background:var(--code);
  color:var(--text);
}

.nav-link[aria-current="page"] {
  background:var(--soft);
  color:var(--accent);
  font-weight:550;
}

.article {
  min-width:0;
  max-width:700px;
  padding:0 0 20px;
}

.breadcrumb {
  display:flex;
  align-items:center;
  gap:9px;
  color:var(--muted);
  font-size:11px;
  margin:4px 0 22px;
}

.breadcrumb svg {
  width:12px;
  height:12px;
}

.article h1 {
  font-size:38px;
  font-weight:600;
  letter-spacing:-.035em;
  line-height:1.2;
  margin:0 0 23px;
  text-wrap:balance;
}

.article .lead {
  font-size:19px;
  color:var(--muted);
  line-height:1.55;
  margin:0 0 27px;
}

.article p,.article li {
  font-size:14px;
  line-height:1.85;
}

.article p {
  margin:14px 0;
}

.article h2 {
  font-size:22px;
  line-height:1.3;
  font-weight:600;
  letter-spacing:-.02em;
  margin:42px 0 17px;
  scroll-margin-top:110px;
}

.article ul,.article ol {
  padding-left:21px;
  margin:16px 0;
}

.article li {
  padding-left:5px;
  margin:8px 0;
}

.article a:not(.page-link) {
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:3px;
  text-decoration-color:var(--line);
}

.article a:hover {
  text-decoration-color:var(--accent);
}

.article :not(pre)>code {
  padding:2px 5px;
  background:var(--code);
  border-radius:4px;
  overflow-wrap:anywhere;
}

.article pre {
  position:relative;
  background:var(--code);
  border:1px solid var(--line);
  border-radius:9px;
  padding:22px;
  overflow:auto;
  font-size:12px;
  line-height:1.8;
  margin:18px 0;
}

.article pre code {
  font-size:inherit;
}

.copy-button {
  position:absolute;
  top:9px;
  right:9px;
  display:grid;
  place-items:center;
  background:var(--surface);
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:5px;
  width:29px;
  height:29px;
}

.copy-button svg {
  width:14px;
  height:14px;
}

.copy-button:hover {
  color:var(--text);
}

.note {
  background:var(--soft);
  border-radius:8px;
  padding:18px 20px;
  margin:26px 0;
  font-size:13px;
  line-height:1.8;
}

.note strong {
  font-weight:600;
}

.toc {
  position:sticky;
  top:128px;
  align-self:start;
  border-left:1px solid var(--line);
  padding-left:18px;
  margin-top:4px;
}

.toc p {
  font-size:11px;
  font-weight:550;
  margin:0 0 14px;
}

.toc a {
  display:block;
  font-size:11px;
  line-height:1.5;
  padding:7px 0;
  color:var(--muted);
}

.toc a:hover,.toc a[aria-current="location"] {
  color:var(--accent);
}

.page-navigation {
  margin-top:54px;
  padding-top:24px;
  border-top:1px solid var(--line);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.page-link {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:13px;
}

.page-link svg {
  width:17px;
  height:17px;
}

.page-link small {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-bottom:3px;
}

.page-link:last-child {
  grid-column:2;
  justify-content:flex-end;
  text-align:right;
}

.mobile-docs-toggle {
  display:none;
}

.not-found {
  text-align:center;
  padding:100px 20px;
  min-height:70vh;
}

.not-found h1 {
  font-size:30px;
}

.not-found p {
  color:var(--muted);
}

.not-found a {
  display:inline-block;
  margin-top:15px;
  color:var(--accent);
  text-decoration:underline;
}

@media(min-width:1500px) {
  .home {
    padding-top:108px;
  }
  .home h1 {
    font-size:50px;
  }
  .project-card {
    min-height:306px;
  }
}

@media(max-width:1100px) {
  .docs-layout {
    grid-template-columns:200px minmax(0,1fr);
    gap:40px;
  }
  .toc {
    display:none;
  }
  .footer {
    margin:0 40px;
  }
  .project-card {
    padding:23px;
    min-height:285px;
  }
  .header-inner {
    gap:32px;
  }
}

@media(max-width:760px) {
  .header {
    height:72px;
  }
  .header-inner {
    padding:0 24px;
    gap:24px;
  }
  .header-link {
    display:none;
  }
  .header-tools {
    gap:10px;
  }
  .search-box input {
    width:170px;
  }
  .search-box kbd {
    display:none;
  }
  .brand-docs {
    display:none;
  }
  .home {
    padding:56px 24px 80px;
  }
  .home h1 {
    font-size:37px;
  }
  .home-heading {
    margin-bottom:30px;
  }
  .home-heading p {
    font-size:14px;
  }
  .project-grid {
    grid-template-columns:1fr;
    gap:14px;
  }
  .project-card {
    min-height:230px;
    padding:23px;
  }
  .project-card h2 {
    margin-top:19px;
  }
  .project-card p {
    max-width:42ch;
    margin-bottom:22px;
  }
  .card-bottom {
    padding-top:14px;
  }
  .home-help {
    align-items:flex-start;
    font-size:11px;
    line-height:1.9;
  }
  .home-help svg {
    margin-top:3px;
  }
  .footer {
    margin:0 24px;
    min-height:70px;
  }
  .docs-layout {
    display:block;
    padding:22px 24px 60px;
  }
  .sidebar {
    display:none;
    position:static;
    max-height:none;
    margin:20px 0 30px;
    padding:20px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:10px;
  }
  .sidebar.is-open {
    display:block;
  }
  .sidebar .back-link {
    margin-bottom:20px;
  }
  .sidebar-project {
    margin-bottom:20px;
  }
  .mobile-docs-toggle {
    display:flex;
    align-items:center;
    gap:10px;
    background:none;
    border:0;
    color:var(--muted);
    font-size:12px;
    padding:4px 0 12px;
  }
  .mobile-docs-toggle svg {
    width:16px;
    height:16px;
  }
  .article {
    max-width:none;
  }
  .breadcrumb {
    margin-top:24px;
  }
  .article h1 {
    font-size:32px;
  }
  .article .lead {
    font-size:18px;
  }
  .article h2 {
    font-size:21px;
  }
  .search-results {
    width:min(420px,calc(100vw - 36px));
    position:fixed;
    top:67px;
    right:18px;
  }
  .article pre {
    padding:20px 16px;
    font-size:11px;
  }
  .toc {
    display:none;
  }
}

@media(max-width:380px) {
  .header-inner {
    padding:0 18px;
  }
  .search-box input {
    width:142px;
  }
  .header-tools {
    gap:5px;
  }
  .brand {
    gap:7px;
    font-size:22px;
  }
  .brand img {
    width:28px;
    height:28px;
  }
  .home {
    padding-right:18px;
    padding-left:18px;
  }
  .docs-layout {
    padding-left:18px;
    padding-right:18px;
  }
}

.header-tools,.search-wrap {
  min-width:0;
}

.search-box {
  width:275px;
  max-width:100%;
}

.search-box input {
  width:100%;
  flex:1;
}

.search-wrap {
  flex:1;
}

@media(max-width:760px) {
  .header-tools {
    flex:1;
  }
  .search-box {
    width:100%;
  }
  .search-box input {
    width:100%;
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }
  *,*:before,*:after {
    transition:none!important;
    animation:none!important;
  }
  .project-card:hover {
    transform:none;
  }
}

@media(max-width:380px) {
  .header-inner {
    gap:12px;
  }
  .brand {
    font-size:20px;
  }
  .brand .avatar {
    width:32px;
    height:32px;
    border-radius:9px;
  }
}

@media(max-width:340px) {
  .header-inner {
    gap:10px;
  }
  .brand {
    gap:6px;
    font-size:18px;
  }
  .brand .avatar {
    width:28px;
    height:28px;
  }
}


/* Documentation media retain their native aspect ratio. */
.article img, .article video { display:block; max-width:100%; height:auto; margin:24px 0; border:1px solid var(--line); border-radius:10px; }
.article img { cursor:zoom-in; }
.article .table-scroll { max-width:100%; overflow-x:auto; margin:24px 0; }
.article table { width:100%; border-collapse:collapse; font-size:14px; }
.article th, .article td { padding:10px 12px; border:1px solid var(--line); text-align:left; vertical-align:top; min-width:100px; }
.article th { background:var(--surface); }
.article { min-width:0; overflow-wrap:anywhere; }
.image-preview { max-width:95vw; max-height:95vh; padding:36px 12px 12px; border:1px solid var(--line); border-radius:12px; background:#0b0e0b; }
.image-preview::backdrop { background:#000c; }
.image-preview img { display:block; max-width:100%; max-height:85vh; object-fit:contain; }
.image-preview button { position:absolute; right:8px; top:0; font-size:28px; color:#eee; background:none; border:0; cursor:pointer; }
@media(min-width:1101px) { .project-grid { grid-template-columns:repeat(2,minmax(0,520px)); } }
