:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #0c0d0f;
  --surface-raised: #111214;
  --surface-soft: #15171a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f3f3f3;
  --muted: #96999e;
  --muted-low: #666a70;
  --sidebar: 270px;
  --topbar: 60px;
  --site-header: 64px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

body.sidebar-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

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

img,
video,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  color: #08090a;
  background: #fff;
}

.docs-topbar {
  position: fixed;
  inset: var(--site-header) 0 auto;
  z-index: 100;
  height: var(--topbar);
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: rgba(8, 9, 10, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-brand-area,
.topbar-main,
.topbar-actions,
.breadcrumbs,
.docs-brand {
  display: flex;
  align-items: center;
}

.topbar-brand-area {
  padding: 0 20px;
  border-right: 1px solid var(--line);
}

.docs-brand {
  gap: 9px;
  font-size: 14px;
  letter-spacing: 0.1em;
}

.docs-brand i {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.brand-mark {
  position: relative;
  width: 25px;
  height: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 4px;
  height: 15px;
  border-radius: 4px;
  background: #fff;
  transform: skew(-15deg);
}

.brand-mark::before {
  left: 7px;
}

.brand-mark::after {
  left: 14px;
  opacity: 0.45;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  padding: 8px;
  display: none;
  color: #d8d9da;
  background: transparent;
  border: 0;
}

.sidebar-toggle svg,
.docs-search svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.topbar-main {
  min-width: 0;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px 0 28px;
}

.breadcrumbs {
  min-width: 0;
  gap: 9px;
  color: var(--muted-low);
  font-size: 12px;
  white-space: nowrap;
}

.breadcrumbs span:last-child {
  max-width: 260px;
  overflow: hidden;
  color: #c9cbce;
  text-overflow: ellipsis;
}

.breadcrumbs i {
  font-style: normal;
  color: #45484d;
}

.topbar-actions {
  gap: 9px;
}

.docs-search {
  position: relative;
  width: min(270px, 26vw);
  height: 36px;
  display: flex;
  align-items: center;
  color: #71757b;
  background: #0e0f11;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.docs-search:focus-within {
  color: #dfe0e2;
  border-color: rgba(255, 255, 255, 0.22);
}

.docs-search > svg {
  width: 16px;
  height: 16px;
  margin-left: 11px;
  flex: 0 0 auto;
}

.docs-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  color: #e9eaeb;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.docs-search input::placeholder {
  color: #666a70;
}

.docs-search kbd {
  margin-right: 7px;
  padding: 3px 6px;
  color: #777b81;
  background: #141518;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 9px;
  white-space: nowrap;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 90px));
  overflow-y: auto;
  padding: 7px;
  color: var(--text);
  background: #111214;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.search-result-label {
  padding: 9px 10px 7px;
  color: var(--muted-low);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-result-item {
  width: 100%;
  padding: 11px 10px;
  display: grid;
  gap: 4px;
  color: #dfe0e2;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-result-item span {
  font-size: 12px;
}

.search-result-item small {
  color: var(--muted-low);
  font-size: 10px;
}

.search-empty {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.copy-link-button,
.home-button {
  height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.copy-link-button {
  color: #b6b8bc;
  background: #0f1012;
  border: 1px solid var(--line);
  cursor: pointer;
}

.copy-link-button:hover {
  color: #fff;
  border-color: var(--line-strong);
}

.home-button {
  color: #090a0b;
  background: #f3f3f3;
}

.docs-sidebar {
  position: fixed;
  inset: calc(var(--site-header) + var(--topbar)) auto 0 0;
  z-index: 80;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: #090a0b;
  border-right: 1px solid var(--line);
}

.sidebar-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 24px 13px;
  scrollbar-width: thin;
  scrollbar-color: #2a2c30 transparent;
}

.sidebar-intro {
  padding: 0 9px 19px;
}

.sidebar-intro span {
  color: #64686e;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.sidebar-intro p {
  margin: 7px 0 0;
  color: #c9cbce;
  font-size: 12px;
}

.category-group + .category-group {
  margin-top: 4px;
}

.category-button {
  width: 100%;
  min-height: 40px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #a7aaae;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.category-button:hover,
.category-button[aria-expanded="true"] {
  color: #f2f2f2;
  background: rgba(255, 255, 255, 0.035);
}

.category-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 160ms ease;
}

.category-button[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.category-articles {
  margin: 2px 0 8px;
  padding: 0 0 0 9px;
}

.category-articles[hidden] {
  display: none;
}

.article-link {
  width: 100%;
  min-height: 35px;
  padding: 7px 10px 7px 15px;
  display: block;
  position: relative;
  color: #70747a;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.45;
}

.article-link::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 4px;
  width: 1px;
  background: #25272b;
}

.article-link:hover {
  color: #c7c9cc;
}

.article-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.article-link.active::before {
  background: #fff;
}

.sidebar-footer {
  padding: 13px 20px;
  display: flex;
  gap: 18px;
  color: #777b80;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.sidebar-footer a:hover {
  color: #fff;
}

.sidebar-overlay {
  position: fixed;
  inset: calc(var(--site-header) + var(--topbar)) 0 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.62);
  border: 0;
}

.docs-main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding-top: calc(var(--site-header) + var(--topbar));
  background:
    radial-gradient(circle at 46% 0, rgba(255, 255, 255, 0.025), transparent 26%),
    var(--bg);
}

.docs-layout {
  width: min(1050px, calc(100% - 72px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 760px) 190px;
  justify-content: space-between;
  gap: 70px;
}

.docs-article {
  min-width: 0;
  padding: 58px 0 120px;
}

.docs-article:focus {
  outline: 0;
}

.article-loading {
  display: grid;
  gap: 14px;
}

.article-loading span {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #111214, #1b1d20, #111214);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.article-loading span:first-child {
  width: 44%;
  height: 38px;
}

.article-loading span:nth-child(2) {
  width: 88%;
}

.article-loading span:nth-child(3) {
  width: 76%;
}

.article-loading span:nth-child(4) {
  width: 58%;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.article-header {
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.article-kicker {
  display: block;
  margin-bottom: 14px;
  color: #72767c;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0;
  color: #f7f7f7;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.article-summary {
  max-width: 680px;
  margin: 20px 0 0;
  color: #a8abb0;
  font-size: 15px;
  line-height: 1.8;
}

.article-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: #65696f;
  font-size: 10px;
}

.article-section {
  padding-top: 54px;
}

.article-section h2 {
  margin: 0 0 17px;
  color: #f0f0f0;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.article-section h3 {
  margin: 32px 0 13px;
  color: #dfe0e1;
  font-size: 16px;
  font-weight: 400;
}

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

.article-section p {
  margin: 0 0 18px;
}

.article-section ul,
.article-section ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-section li + li {
  margin-top: 7px;
}

.steps-list {
  padding: 0 !important;
  list-style: none;
  counter-reset: steps;
}

.steps-list li {
  position: relative;
  min-height: 40px;
  padding: 8px 0 18px 48px;
  counter-increment: steps;
}

.steps-list li::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  top: 5px;
  left: 0;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #c6c8cb;
  background: #111214;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.docs-callout {
  margin: 25px 0;
  padding: 18px 20px;
  color: #aeb1b5;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-left-color: rgba(255, 255, 255, 0.48);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.75;
}

.docs-callout strong {
  display: block;
  margin-bottom: 5px;
  color: #e2e3e4;
  font-weight: 400;
}

.media-figure {
  margin: 28px 0 32px;
}

.media-frame,
.video-placeholder,
.comparison-grid {
  overflow: hidden;
  background: #101113;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.media-frame {
  padding: 18px;
}

.media-frame img,
.media-frame video {
  width: 100%;
  border-radius: 9px;
}

.media-frame img {
  max-height: 520px;
  object-fit: contain;
}

.video-placeholder {
  min-height: 340px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--media-color, #83868c) 20%, transparent), transparent 34%),
    linear-gradient(145deg, #141517, #0c0d0f);
}

.video-placeholder::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 11px;
}

.video-placeholder-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 13px;
  color: #b5b7ba;
  font-size: 12px;
}

.video-play {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #f1f1f1;
  border-radius: 50%;
}

.video-play::before {
  content: "";
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #0a0b0c;
}

.media-figure figcaption,
.comparison-item span {
  display: block;
  margin-top: 10px;
  color: #676b71;
  font-size: 10px;
  line-height: 1.55;
}

.comparison-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.comparison-item {
  min-width: 0;
}

.comparison-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 9px;
}

.comparison-item span {
  margin: 8px 4px 3px;
}

.color-palette {
  margin: 25px 0 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.color-card {
  min-width: 0;
  overflow: hidden;
  background: #111214;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.color-swatch {
  height: 78px;
  background: var(--swatch);
  border-bottom: 1px solid var(--line);
}

.color-card div:last-child {
  padding: 10px;
  display: grid;
  gap: 4px;
}

.color-card span {
  overflow: hidden;
  color: #babcc0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-card code {
  color: #64686e;
  font-family: inherit;
  font-size: 9px;
}

.qa-list {
  margin: 25px 0;
  border-top: 1px solid var(--line);
}

.qa-item {
  border-bottom: 1px solid var(--line);
}

.qa-item summary {
  padding: 18px 32px 18px 0;
  position: relative;
  color: #d8d9da;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  line-height: 1.55;
}

.qa-item summary::-webkit-details-marker {
  display: none;
}

.qa-item summary::after {
  content: "+";
  position: absolute;
  top: 17px;
  right: 5px;
  color: #74787e;
  font-size: 18px;
  font-weight: 300;
}

.qa-item[open] summary::after {
  content: "−";
}

.qa-item p {
  margin: -3px 34px 18px 0;
  color: #85898f;
  font-size: 12px;
  line-height: 1.75;
}

.article-next {
  margin-top: 70px;
  padding: 19px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #d7d8da;
  background: #0e0f11;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

.article-next:hover {
  background: #111214;
  border-color: var(--line-strong);
}

.article-next small {
  display: block;
  margin-bottom: 5px;
  color: #62666c;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-next span:last-child {
  color: #777b80;
}

.article-outline {
  position: sticky;
  top: calc(var(--topbar) + 48px);
  align-self: start;
  max-height: calc(100vh - var(--topbar) - 80px);
  overflow-y: auto;
  margin-top: 58px;
  padding-left: 17px;
  border-left: 1px solid var(--line);
}

.outline-label {
  display: block;
  margin-bottom: 12px;
  color: #62666c;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-outline a {
  display: block;
  padding: 6px 0;
  color: #696d73;
  font-size: 10px;
  line-height: 1.5;
  transition: color 150ms ease;
}

.article-outline a:hover,
.article-outline a.active {
  color: #e8e8e8;
}

.docs-toast {
  position: fixed;
  z-index: 150;
  bottom: 24px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 9px 13px;
  color: #d9dadd;
  background: #151619;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.docs-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.load-error {
  padding: 28px;
  color: #b9bbc0;
  background: #111214;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.8;
}

.load-error strong {
  display: block;
  margin-bottom: 8px;
  color: #ededed;
  font-weight: 400;
}

@media (max-width: 1120px) {
  .docs-layout {
    width: min(780px, calc(100% - 64px));
    grid-template-columns: minmax(0, 1fr);
  }

  .article-outline {
    display: none;
  }

  .docs-search {
    width: min(240px, 30vw);
  }
}

@media (max-width: 850px) {
  :root {
    --sidebar: min(310px, 84vw);
  }

  .docs-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-brand-area {
    padding: 0 14px;
  }

  .sidebar-toggle {
    display: block;
  }

  .docs-brand i,
  .docs-brand span:last-child {
    display: none;
  }

  .topbar-main {
    padding: 0 14px;
  }

  .breadcrumbs,
  .copy-link-button {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .docs-search {
    width: min(360px, 100%);
  }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  body.sidebar-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-main {
    margin-left: 0;
  }

  .docs-layout {
    width: min(720px, calc(100% - 40px));
  }
}

@media (max-width: 760px) {
  :root {
    --site-header: 58px;
  }
}

@media (max-width: 600px) {
  .home-button,
  .docs-search kbd {
    display: none;
  }

  .docs-article {
    padding-top: 42px;
  }

  .article-header {
    padding-bottom: 35px;
  }

  .article-header h1 {
    font-size: 35px;
  }

  .article-summary,
  .article-section p,
  .article-section li {
    font-size: 13px;
  }

  .article-section {
    padding-top: 43px;
  }

  .article-section h2 {
    font-size: 22px;
  }

  .color-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .video-placeholder {
    min-height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* WordPress admin bar spacing. */
body.admin-bar .docs-topbar {
  top: calc(var(--site-header) + 32px);
}

body.admin-bar .docs-sidebar {
  top: calc(var(--site-header) + var(--topbar) + 32px);
}

body.admin-bar .sidebar-overlay {
  top: calc(var(--site-header) + var(--topbar) + 32px);
}

@media (max-width: 782px) {
  body.admin-bar .docs-topbar {
    top: calc(var(--site-header) + 46px);
  }

  body.admin-bar .docs-sidebar,
  body.admin-bar .sidebar-overlay {
    top: calc(var(--site-header) + var(--topbar) + 46px);
  }
}
