:root {
  --bg: #050608;
  --panel: #0c0d10;
  --panel-soft: #111217;
  --panel-card: #141722;
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --line: #23252f;
  --line-soft: #1a1d25;
  --accent: #4ea3ff;
  --accent-soft: #0b2a4f;
  --radius: 12px;
  --header-h: 44px;
  --subheader-h: 48px;
  --sidebar-w: 320px;
  --content-max: 980px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

.global-nav {
  height: var(--header-h);
  background: #000;
  border-bottom: 1px solid #111;
}

.global-nav-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.apple-wordmark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.global-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #c9c9ce;
  font-size: 13px;
}

.global-links a {
  color: #c9c9ce;
}

.global-links a:hover {
  color: #fff;
}

.doc-nav {
  height: var(--subheader-h);
  background: #090a0d;
  border-bottom: 1px solid var(--line-soft);
}

.doc-nav-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-title {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.doc-title-sub {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.language-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.language-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0f1117;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.language-icon svg {
  width: 12px;
  height: 12px;
  stroke: #b7bdc8;
  fill: none;
  stroke-width: 1.8;
}

.language-picker {
  border: 1px solid var(--line);
  background: #0f1117;
  color: var(--text);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  padding: 7px 28px 7px 11px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9ba0aa 50%),
    linear-gradient(135deg, #9ba0aa 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h) - var(--subheader-h));
}

.sidebar {
  border-right: 1px solid var(--line-soft);
  background: #06070a;
  padding: 14px 12px 16px;
  position: sticky;
  top: calc(var(--header-h) + var(--subheader-h));
  align-self: start;
  height: calc(100vh - var(--header-h) - var(--subheader-h));
  overflow: auto;
}

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

.back-link:hover {
  color: #fff;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 650;
  margin: 2px 0 10px;
}

.sidebar-filter {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b0d14;
  color: #d5d7de;
  font-size: 12px;
  padding: 9px 10px;
  margin-bottom: 12px;
}

.sidebar-group {
  margin-bottom: 14px;
}

.sidebar-group-title {
  color: #757a87;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 7px;
}

.sidebar-nav-item {
  display: block;
  border-radius: 8px;
  padding: 8px 10px;
  color: #c8c9cf;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background: #111521;
  color: #fff;
  border-color: #202536;
}

.sidebar-nav-item.active {
  background: #161f33;
  color: #fff;
  border-color: #273a62;
}

.main {
  padding: 0 24px 42px;
}

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

.hero {
  margin-top: 18px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #13396f;
  background: radial-gradient(circle at 80% 20%, rgba(65, 141, 255, 0.45) 0, rgba(20, 72, 143, 0.22) 40%, rgba(7, 25, 56, 0.9) 70%),
    linear-gradient(160deg, #0d4c99 0%, #082a56 50%, #07172f 100%);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: 40px;
  top: 22px;
  width: 180px;
  height: 120px;
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(116, 183, 255, 0.35), rgba(27, 93, 173, 0.08));
  transform: rotate(-14deg);
  box-shadow: 0 0 0 1px rgba(108, 171, 255, 0.14) inset;
}

.hero-content {
  padding: 26px 28px;
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.hero-kicker {
  color: #9ec8ff;
  font-size: 13px;
  margin-bottom: 6px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hero p {
  margin: 10px 0 0;
  color: #d9e7ff;
  line-height: 1.56;
  font-size: 17px;
}

.hero-meta {
  margin-top: 14px;
  color: #bad8ff;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.content-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: var(--radius);
  padding: 20px;
}

.content-section h2 {
  margin: 0 0 10px;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.content-section h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.content-section p {
  margin: 10px 0 0;
  color: #d4d6dc;
  line-height: 1.7;
}

.content-section ul,
.content-section ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #c9ccd5;
  line-height: 1.72;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.doc-card {
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #141722 0%, #11141b 100%);
  padding: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.doc-card:hover {
  transform: translateY(-2px);
  border-color: #2d3e63;
}

.doc-card h3 {
  margin: 0;
  font-size: 20px;
}

.doc-card p {
  margin: 8px 0 0;
  color: #c5c8d1;
  line-height: 1.65;
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.info-item {
  border: 1px solid #242937;
  border-radius: 12px;
  background: #0d1018;
  padding: 14px;
}

.info-item .label {
  color: #8ba2c6;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-item .value {
  font-size: 14px;
  color: #e4e8f1;
  line-height: 1.5;
}

.footer {
  max-width: var(--content-max);
  margin: 18px auto 0;
  color: #8d94a4;
  font-size: 12px;
  line-height: 1.6;
}

.footer a {
  color: #87bbff;
}

.code-block {
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #2a2f3f;
  background: #11131a;
  padding: 14px;
  overflow: auto;
  color: #dce2ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }

  .main {
    padding: 0 12px 34px;
  }

  .hero::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .global-links {
    display: none;
  }

  .doc-title-sub {
    display: none;
  }

  .hero-content {
    padding: 20px;
  }

  .card-grid,
  .info-list {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 16px;
  }
}
