:root,
html[data-theme='dark'] {
  color-scheme: dark;
  --bg-page: #121416;
  --bg-elevated: #1a1d21;
  --bg-panel: #20242a;
  --text-primary: #f2f4f7;
  --text-secondary: #c2c9d4;
  --text-muted: #8b95a5;
  --accent: #6ea8ff;
  --accent-soft: rgb(110 168 255 / 0.14);
  --border-subtle: rgb(255 255 255 / 0.08);
  --shadow-panel: 0 18px 48px rgb(0 0 0 / 0.28);
  --header-icon: #c2c9d4;
  --header-icon-hover: #ffffff;
  --header-icon-bg: rgb(255 255 255 / 0.04);
  --header-icon-bg-hover: rgb(255 255 255 / 0.08);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg-page: #f3f5f8;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;
  --text-primary: #15181d;
  --text-secondary: #3f4754;
  --text-muted: #667085;
  --accent: #2f6fed;
  --accent-soft: rgb(47 111 237 / 0.1);
  --border-subtle: rgb(15 23 42 / 0.1);
  --shadow-panel: 0 16px 40px rgb(15 23 42 / 0.08);
  --header-icon: #475467;
  --header-icon-hover: #15181d;
  --header-icon-bg: rgb(15 23 42 / 0.04);
  --header-icon-bg-hover: rgb(15 23 42 / 0.08);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.help-site {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgb(110 168 255 / 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgb(232 168 56 / 0.05), transparent 50%),
    var(--bg-page);
  color: var(--text-secondary);
  line-height: 1.55;
}

html.help-site-nav-ready body.help-site {
  transition: background-color 180ms ease, color 180ms ease;
}

html[data-theme='light'] body.help-site {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgb(47 111 237 / 0.07), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgb(232 168 56 / 0.06), transparent 50%),
    var(--bg-page);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.help-site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-page) 82%, transparent);
  backdrop-filter: blur(12px);
}

.help-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}

.help-site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  text-decoration: none;
}

.help-site-brand:hover {
  text-decoration: none;
}

.help-site-brand__logo {
  display: block;
  width: auto;
  height: 1.35rem;
}

.help-site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.help-site-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--header-icon-bg);
  color: var(--header-icon);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.help-site-icon-btn:hover {
  background: var(--header-icon-bg-hover);
  color: var(--header-icon-hover);
  text-decoration: none;
}

.help-site-icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

html[data-theme='dark'] .help-site-icon-btn__moon,
html:not([data-theme]) .help-site-icon-btn__moon {
  display: none;
}

html[data-theme='light'] .help-site-icon-btn__sun {
  display: none;
}

.help-site-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.help-site-nav {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
  box-shadow: var(--shadow-panel);
}

.help-site-nav__section + .help-site-nav__section {
  margin-top: 1rem;
}

.help-site-nav__heading {
  margin: 0 0 0.4rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.help-site-nav__link {
  display: block;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
}

.help-site-nav__link:hover,
.help-site-nav__link.is-active {
  background: var(--accent-soft);
  color: var(--text-primary);
  text-decoration: none;
}

.help-site-main {
  min-width: 0;
}

.help-site-article {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  box-shadow: var(--shadow-panel);
  font-size: 0.95rem;
}

.help-site-article h1,
.help-site-article h2,
.help-site-article h3 {
  margin: 0.35rem 0 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.help-site-article h1 { font-size: 1.65rem; }
.help-site-article h2 { font-size: 1.15rem; margin-top: 0.75rem; }
.help-site-article h3 { font-size: 1rem; }

.help-site-article p,
.help-site-article ul,
.help-site-article ol {
  margin: 0;
}

.help-site-article ul,
.help-site-article ol {
  padding-left: 1.2rem;
}

.help-site-article code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.help-site-article pre {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  overflow: auto;
}

.help-site-article pre code {
  padding: 0;
  background: transparent;
}

.help-site-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.help-site-article th,
.help-site-article td {
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.help-site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.help-logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  padding: 1rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}

.help-logo-item {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  min-width: 4.75rem;
}

.help-logo-item__img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.22));
  animation: help-logo-float 4.5s ease-in-out infinite;
}

.help-logo-item:nth-child(2) .help-logo-item__img { animation-delay: 0.4s; }
.help-logo-item:nth-child(3) .help-logo-item__img { animation-delay: 0.8s; }
.help-logo-item:nth-child(4) .help-logo-item__img { animation-delay: 1.2s; }
.help-logo-item:nth-child(5) .help-logo-item__img { animation-delay: 1.6s; }

.help-logo-item__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.help-figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.help-figure img {
  max-width: min(100%, 12rem);
  height: auto;
  object-fit: contain;
}

.help-figure--hero img {
  max-width: min(100%, 10rem);
}

.help-figure figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.help-anim {
  margin: 0.25rem 0;
  padding: 1rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-elevated) 80%, transparent), color-mix(in srgb, var(--accent-soft) 45%, transparent));
  overflow: hidden;
}

.help-anim__lane {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.help-anim__node {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  min-width: 4.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.help-anim__node img {
  width: 2.2rem;
  height: 2.2rem;
  object-fit: contain;
}

.help-anim__node--api {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px dashed var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
}

.help-anim__badge {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.help-anim__connector {
  position: relative;
  flex: 1 1 1.75rem;
  min-width: 1.75rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}

.help-anim__dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  animation: help-flow-dot 2.4s linear infinite;
}

.help-anim__dot--delay { animation-delay: 0.8s; }
.help-anim__dot--delay-2 { animation-delay: 1.6s; }

.help-anim--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
}

.help-anim__panel {
  position: relative;
  padding: 0.75rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  overflow: hidden;
}

.help-anim__panel-title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.help-anim__panel-logos {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.help-anim__panel-logos img {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
}

.help-anim__panel-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.help-anim__boundary {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.4rem;
  min-width: 2.75rem;
}

.help-anim__boundary-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-anim__boundary-stream {
  width: 2px;
  height: 4rem;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  animation: help-boundary-pulse 1.8s ease-in-out infinite;
}

.help-anim__pulse {
  position: absolute;
  inset: auto 0.5rem 0.5rem auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  opacity: 0.85;
}

.help-anim__pulse--server {
  background: #e8a838;
  animation: help-pulse 1.6s ease-in-out infinite;
}

.help-anim__pulse--client {
  background: #5b8def;
  animation: help-pulse 1.6s ease-in-out infinite 0.5s;
}

.help-anim--compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.help-anim__compare-col {
  padding: 0.75rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}

.help-anim__compare-col--chosen {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.help-anim__compare-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.help-anim__compare-head img {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
}

.help-anim__compare-col p {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.help-anim__compare-tag {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-anim__compare-tag.is-positive {
  color: var(--accent);
}

.help-anim--pulse-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.help-anim__pulse-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
}

.help-anim__pulse-card img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  z-index: 1;
}

.help-anim__pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  animation: help-ring 2.4s ease-out infinite;
}

.help-anim__pulse-ring--delay { animation-delay: 0.5s; }
.help-anim__pulse-ring--delay-2 { animation-delay: 1s; }

@keyframes help-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes help-flow-dot {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes help-boundary-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.85); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes help-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes help-ring {
  0% { transform: scale(0.65); opacity: 0.85; }
  100% { transform: scale(1.35); opacity: 0; }
}

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

  .help-site-nav {
    position: static;
    max-height: none;
  }

  .help-anim--split,
  .help-anim--compare {
    grid-template-columns: 1fr;
  }

  .help-anim__boundary {
    min-height: 2rem;
    grid-auto-flow: column;
  }

  .help-anim__boundary-stream {
    width: 4rem;
    height: 2px;
  }
}
