:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #17191f;
  --panel-2: #20232b;
  --text: #eef1f7;
  --muted: #a8b0c0;
  --line: #2c313d;
  --accent: #5dd6b1;
  --accent-2: #8aa5ff;
  --accent-cyan: #4dd4d4;
  --danger: #ff7d7d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, rgba(93, 214, 177, 0.12), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(138, 165, 255, 0.11), transparent 26rem), var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(16, 17, 20, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
}

.brand img {
  width: 32px;
  height: 32px;
}

.language-switch {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 31, 0.82);
}

.language-switch button {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.84rem;
  transition: all 0.2s;
}

.language-switch button:hover {
  color: var(--text);
}

.language-switch button.active {
  background: var(--accent);
  color: #07110e;
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

section {
  margin-top: 2rem;
}

section:first-child {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.8rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

h4 {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

code {
  color: #d7fff1;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
  word-break: break-word;
}

pre {
  position: relative;
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid #303643;
  border-radius: 8px;
  background: #0d0f14;
  padding: 0.9rem 3rem 0.9rem 0.9rem;
}

pre code {
  display: block;
  white-space: pre;
  line-height: 1.5;
}

.copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  min-width: 32px;
  min-height: 30px;
  padding: 0 0.6rem;
  border: 1px solid #3a4050;
  border-radius: 6px;
  background: #1c2029;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.copy:hover {
  color: var(--text);
  background: #252931;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.2rem;
  border: 1px solid rgba(93, 214, 177, 0.3);
  border-radius: 8px;
  background: var(--accent);
  color: #07110e;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.button:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(93, 214, 177, 0.3);
}

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

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.client-selector {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 25, 31, 0.5);
}

.client-selector h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.client-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.client-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.client-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.client-btn.active {
  border-color: var(--accent);
  background: rgba(93, 214, 177, 0.15);
  color: var(--accent);
}

.client-content {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 25, 31, 0.7);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.note {
  color: var(--muted);
  border-left: 3px solid var(--accent-2);
  padding-left: 0.9rem;
  font-size: 0.95rem;
}

.quick-ref {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(32, 35, 43, 0.5);
}

.ref-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 31, 0.7);
}

ul.compact {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

ul.compact li {
  margin-top: 0.4rem;
}

ul.compact li strong {
  color: var(--text);
}

@media (max-width: 900px) {
  main {
    width: calc(100% - 1.5rem);
  }

  .topbar {
    gap: 1rem;
  }

  .hero {
    padding: 1.5rem 0 1rem;
  }

  h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .client-buttons {
    justify-content: center;
  }

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

  pre {
    padding: 0.9rem 0.9rem 3rem 0.9rem;
  }

  .copy {
    position: static;
    display: block;
    margin: 0.8rem 0 0 0;
    width: 100%;
  }
}

@media (max-width: 600px) {
  main {
    width: calc(100% - 1rem);
  }

  .button {
    width: 100%;
  }

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