/* Til docs site — Inter, sharp corners, centered */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #5c5c5c;
  --border: #d8d8d8;
  --code-bg: #f0f0f0;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --fs-body: 16px;
  --fs-small: 14px;
  --radius: 0;
  --shell-max: 920px;
  --site-header-h: 3.75rem;
  --doc-nav-w: 220px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --syn-kw: #0a0a0a;
  --syn-str: #444;
  --syn-fn: #222;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--fg);
  background-color: #fff;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s var(--ease);
}

a:hover {
  opacity: 0.65;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  opacity: 0.85;
}

.brand__title {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tag {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ----- Home landing ----- */
.home-view {
  flex: 1;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
}

.home-view--hidden {
  display: none !important;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-up 0.65s var(--ease) both;
}

.animate-in--delay-1 {
  animation-delay: 0.08s;
}
.animate-in--delay-2 {
  animation-delay: 0.16s;
}
.animate-in--delay-3 {
  animation-delay: 0.24s;
}

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.hero__uzbek {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  color: var(--fg);
}

.hero__logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.keyword-chips {
  list-style: none;
  margin: 0 auto 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 36rem;
}

.keyword-chips li {
  margin: 0;
}

.keyword-chips code {
  font-size: 13px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--code-bg);
  font-weight: 500;
}

.hero__title {
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 1rem;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.hero__lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 auto 1.75rem;
}

.hero__lead code {
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid var(--fg);
  transition:
    transform 0.15s var(--ease),
    background 0.15s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
}

.btn--ghost:hover {
  background: var(--code-bg);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.setup {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setup-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s var(--ease);
}

.setup-step:hover {
  border-color: #999;
}

.setup-step__num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--fg);
}

.setup-step h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.setup-step p:not(.setup-step__desc) {
  margin: 0 0 0.5rem;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Compact command line (home setup) */
.cmd-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  background: #fafafa;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.35;
  min-height: 2.25rem;
  max-width: 100%;
}

.cmd-row__prompt {
  flex-shrink: 0;
  padding: 0.45rem 0.5rem 0.45rem 0.65rem;
  color: var(--muted);
  user-select: none;
  border-right: 1px solid var(--border);
  background: #f0f0f0;
}

.cmd-row__code {
  flex: 1;
  padding: 0.45rem 0.65rem;
  overflow-x: auto;
  white-space: nowrap;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  border: none;
}

.cmd-row__btn {
  flex-shrink: 0;
  align-self: stretch;
  min-width: 2.5rem;
  border: none;
  border-left: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cmd-row__btn:hover {
  background: var(--code-bg);
}

.setup-step__body {
  flex: 1;
  min-width: 0;
}

.setup-step__desc {
  margin: 0 0 0.35rem;
  font-size: var(--fs-small);
  color: var(--muted);
}

.platforms {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.platforms__hint {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.platform-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.platform-card:hover {
  border-color: #999;
}

.platform-card__name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.platform-card__tool {
  font-size: 13px;
  color: var(--muted);
}

.explore {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  background: #fff;
}

.explore__text {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: var(--fs-small);
}

/* ----- Hujjatlar: chapda viewportga qadalgan navigatsiya ----- */
.doc-view {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - var(--site-header-h));
  padding: 0 0 3rem;
  background: #fff;
  position: relative;
}

.doc-view--hidden {
  display: none !important;
}

.doc-sidebar {
  position: fixed;
  left: 0;
  top: var(--site-header-h);
  width: var(--doc-nav-w);
  height: calc(100vh - var(--site-header-h));
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
  background: #f7f7f7;
  box-sizing: border-box;
}

.nav {
  padding: 1.1rem 1rem 2rem;
  font-size: var(--fs-small);
  min-height: 0;
}

.doc-main-wrap {
  margin: 0 0 0 var(--doc-nav-w);
  padding: 1.25rem 1.5rem 2rem;
  min-height: calc(100vh - var(--site-header-h));
  box-sizing: border-box;
  animation: fade-up 0.45s var(--ease) both;
}

/* Sidebar chapda qoladi; matn ustuni o‘ngdagi maydon ichida markazga tekislanadi */
.doc-main-wrap .err {
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
}

.doc-main-wrap #content {
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
}

.nav__title {
  margin: 0 0 0.65rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  margin-bottom: 0.2rem;
}

.nav a {
  display: block;
  padding: 0.35rem 0.4rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav a:hover {
  background: rgba(0, 0, 0, 0.05);
  opacity: 1;
}

.nav a.active {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.08);
}

.loading {
  color: var(--muted);
  margin: 0;
}

/* Markdown */
.doc-body h1 {
  font-size: 1.35rem;
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc-body h2 {
  font-size: 1.12rem;
  margin-top: 1.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.doc-body h3 {
  font-size: 1.02rem;
  margin-top: 1.2rem;
  font-weight: 600;
}

.doc-body p {
  margin: 0.75rem 0;
}

.doc-body ul,
.doc-body ol {
  margin: 0.5rem 0;
  padding-left: 1.35rem;
}

.doc-body code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border: 1px solid transparent;
}

.doc-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 13px;
}

.doc-body pre code {
  background: none;
  padding: 0;
}

.doc-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-small);
  margin: 1rem 0;
}

.doc-body th,
.doc-body td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.doc-body th {
  background: var(--code-bg);
}

.doc-body blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.err {
  color: #b00020;
  font-size: var(--fs-small);
  margin-bottom: 0.75rem;
}

/* Copyable code blocks (Markdown docs): multiline = corner btn; one line = compact bar */
.code-wrap {
  position: relative;
  margin: 1rem 0;
}

.code-wrap:not(.code-wrap--compact) pre {
  margin: 0;
  padding: 2.1rem 0.85rem 0.65rem 0.85rem;
}

.code-wrap:not(.code-wrap--compact) .code-wrap__copy {
  position: absolute;
  top: 0;
  right: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-right: none;
  border-top: none;
  background: #fff;
  color: var(--fg);
  cursor: pointer;
}

.code-wrap:not(.code-wrap--compact) .code-wrap__copy:hover {
  background: var(--code-bg);
}

.code-wrap--compact {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.code-wrap--compact pre {
  flex: 1;
  margin: 0;
  padding: 0.45rem 0.65rem;
  min-height: 0;
  line-height: 1.4;
  border: none;
  background: transparent;
}

.code-wrap--compact .code-wrap__copy {
  position: static;
  flex-shrink: 0;
  align-self: stretch;
  border: none;
  border-left: 1px solid var(--border);
  padding: 0.35rem 0.65rem;
  min-width: 3.25rem;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fff;
  cursor: pointer;
  color: var(--fg);
}

.code-wrap--compact .code-wrap__copy:hover {
  background: #eee;
}

/* Editor + terminal demo */
.demo-windows {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.demo-windows__hint {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
  margin: 0 0 1.25rem;
}

.demo-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.demo-stack__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}

.fake-window {
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}

.fake-window__titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: #eaeaea;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.fake-window__dots::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  background: #bbb;
  vertical-align: middle;
}

.fake-window__title {
  flex: 1;
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

.fake-window__body {
  background: #fafafa;
}

.fake-window__code {
  margin: 0;
  padding: 1rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-x: auto;
  border: none;
  background: transparent;
}

.fake-window__code code {
  font-family: inherit;
  background: none;
  padding: 0;
  border: none;
}

.syn-kw {
  font-weight: 700;
  color: var(--syn-kw);
}

.syn-str {
  color: var(--syn-str);
}

.syn-fn {
  color: var(--syn-fn);
}

.fake-terminal {
  border: 1px solid var(--border);
  border-top: none;
  background: #0a0a0a;
  color: #e8e8e8;
}

.fake-terminal__titlebar {
  padding: 0.35rem 0.65rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  border-bottom: 1px solid #333;
}

.fake-terminal__body {
  padding: 0.75rem 1rem 1rem;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 5rem;
}

.fake-terminal__prompt {
  margin-bottom: 0.35rem;
  color: #aaa;
}

.fake-terminal__path {
  color: #7a9;
}

.fake-terminal__cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.fake-terminal__out {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e8e8e8;
  font-family: inherit;
  background: transparent;
  border: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: #fafafa;
}

.site-footer__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.35rem 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-footer__title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.site-footer__tag {
  font-size: 12px;
  color: var(--muted);
  max-width: 18rem;
  line-height: 1.4;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  font-size: 13px;
}

.site-footer__nav a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 500;
}

.site-footer__nav a:hover {
  text-decoration: underline;
  opacity: 1;
}

.site-footer__bottom {
  border-top: 1px solid var(--border);
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0.65rem 1.5rem 1.1rem;
  font-size: 11px;
  color: var(--muted);
}

.doc-page-meta {
  margin-top: 2.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.doc-page-meta__line {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

.doc-page-meta time {
  font-weight: 500;
  color: var(--fg);
}

@media (max-width: 720px) {
  .doc-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .doc-main-wrap {
    margin-left: 0;
    max-width: 100%;
  }

  .hero__title {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-in {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .setup-step:hover,
  .platform-card:hover {
    transform: none;
  }
}
