:root {
  color-scheme: light;
  --ink: #172238;
  --ink-soft: #5e6c82;
  --navy: #13233f;
  --blue: #2563eb;
  --blue-soft: #edf4ff;
  --line: #dfe5ee;
  --surface: #ffffff;
  --surface-muted: #f6f8fb;
  --content-width: 760px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #1748b9;
}

a:focus-visible,
summary:focus-visible,
select:focus-visible,
main:focus-visible {
  outline: 3px solid rgb(37 99 235 / 28%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--navy);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 8px;
}

.brand-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.brand-section {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-picker {
  display: inline-flex;
}

.language-picker select {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.language-picker select:hover {
  border-color: #b7c4d8;
  box-shadow: 0 5px 16px rgb(19 35 63 / 8%);
}

.open-app {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.open-app:hover {
  border-color: #b7c4d8;
  color: var(--ink);
  box-shadow: 0 5px 16px rgb(19 35 63 / 8%);
  transform: translateY(-1px);
}

.site-layout {
  display: grid;
  width: 100%;
  max-width: 1480px;
  min-height: calc(100vh - 136px);
  margin: 0 auto;
  grid-template-columns: 250px minmax(0, 1fr) 210px;
}

.sidebar {
  padding: 38px 26px 60px 30px;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
}

.sidebar nav {
  position: sticky;
  top: 102px;
}

.nav-home {
  display: block;
  margin-bottom: 25px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-home[aria-current='page'],
.nav-home:hover {
  color: var(--blue);
}

.nav-section + .nav-section {
  margin-top: 25px;
}

.nav-section h2 {
  margin: 0 0 8px;
  color: #7c8799;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-section ul,
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-section a {
  display: block;
  margin-left: -10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 540;
  hyphens: auto;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.nav-section a:hover {
  color: var(--ink);
  background: #eaf0f8;
}

.nav-section a.is-active {
  color: #1748b9;
  background: #e2ecff;
  font-weight: 700;
}

.mobile-navigation {
  display: none;
}

main {
  min-width: 0;
  padding: 50px clamp(28px, 5vw, 76px) 80px;
}

.breadcrumbs {
  display: flex;
  max-width: var(--content-width);
  align-items: center;
  gap: 8px;
  margin: 0 auto 26px;
  color: #7c8799;
  font-size: 13px;
}

.breadcrumbs a {
  color: #5e6c82;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--blue);
}

.article {
  max-width: var(--content-width);
  margin: 0 auto;
}

.article-category {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article h1 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 5vw, 50px);
  font-weight: 700;
  hyphens: auto;
  letter-spacing: -0.035em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.article-description {
  max-width: 670px;
  margin: 20px 0 38px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.55;
}

.article-body {
  color: #2c3950;
}

.article-body h2,
.article-body h3 {
  color: var(--navy);
  hyphens: auto;
  overflow-wrap: anywhere;
  scroll-margin-top: 94px;
}

.article-body h2 {
  margin: 48px 0 15px;
  padding-top: 7px;
  font-size: 27px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.article-body h3 {
  margin: 31px 0 11px;
  font-size: 20px;
  line-height: 1.35;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 19px;
}

.article-body ul,
.article-body ol {
  padding-left: 25px;
}

.article-body li {
  margin: 7px 0;
  padding-left: 4px;
}

.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 30px 0;
  border: 1px solid #d6deea;
  border-radius: 11px;
  background: var(--surface-muted);
  box-shadow: 0 16px 40px rgb(19 35 63 / 10%);
}

.article-body blockquote {
  margin: 26px 0;
  padding: 14px 18px;
  border-left: 4px solid #7aa5f8;
  border-radius: 0 8px 8px 0;
  color: #3b4a62;
  background: var(--blue-soft);
}

.article-body blockquote > :last-child {
  margin-bottom: 0;
}

.article-body code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #8a2e59;
  background: #f4edf2;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
}

.article-body pre {
  overflow-x: auto;
  margin: 24px 0;
  padding: 18px;
  border-radius: 10px;
  background: var(--navy);
}

.article-body pre code {
  padding: 0;
  color: #edf3ff;
  background: transparent;
}

.article-body table {
  width: 100%;
  margin: 26px 0;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  border-collapse: separate;
  overflow: hidden;
  font-size: 14px;
}

.article-body th,
.article-body td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  color: var(--navy);
  background: var(--surface-muted);
  font-weight: 700;
}

.article-body tr:last-child td {
  border-bottom: 0;
}

.article-body hr {
  margin: 42px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.toc {
  padding: 51px 24px 50px 0;
}

.toc > p,
.toc > ol {
  position: relative;
}

.toc > p {
  margin: 0 0 11px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.toc ol {
  position: sticky;
  top: 128px;
}

.toc li {
  margin: 8px 0;
  line-height: 1.35;
}

.toc .toc-depth-3 {
  padding-left: 12px;
}

.toc a {
  color: #778397;
  font-size: 12px;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
}

.article-pagination {
  display: grid;
  max-width: var(--content-width);
  margin: 58px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.article-pagination a {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  hyphens: auto;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.article-pagination a span {
  margin-bottom: 3px;
  color: #8993a3;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.article-pagination .pagination-next {
  text-align: right;
}

.article-pagination a:hover {
  color: var(--blue);
}

footer {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-top: 1px solid var(--line);
  color: #778397;
  background: var(--surface-muted);
  font-size: 12px;
}

footer a {
  color: #5e6c82;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .site-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 62px;
    gap: 12px;
    padding: 0 18px;
  }

  .brand-divider,
  .brand-section {
    display: none;
  }

  .open-app {
    padding: 6px 9px;
  }

  .header-actions {
    gap: 8px;
  }

  .language-picker select {
    max-width: 106px;
    padding: 6px 7px;
  }

  .mobile-navigation {
    display: block;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
  }

  .mobile-navigation summary {
    cursor: pointer;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-navigation nav {
    padding: 20px 2px 7px;
  }

  .sidebar {
    display: none;
  }

  .site-layout {
    display: block;
    min-height: calc(100vh - 131px);
  }

  main {
    padding: 34px 20px 64px;
  }

  .breadcrumbs {
    margin-bottom: 20px;
  }

  .article h1 {
    font-size: 37px;
  }

  .article-description {
    margin: 16px 0 30px;
    font-size: 17px;
  }

  .article-body h2 {
    margin-top: 39px;
    font-size: 24px;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
  }

  footer {
    padding: 0 20px;
  }
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
