:root {
  --bg: #eef4ff;
  --bg-soft: #f8fbff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: #eef2f8;
  --ink: #343839;
  --muted: #586270;
  --line: rgba(52, 56, 57, 0.14);
  --primary: #3c65f8;
  --primary-strong: #3750ff;
  --secondary: #62d367;
  --accent: #f35f20;
  --accent-soft: rgba(243, 95, 32, 0.12);
  --shadow: 0 24px 60px rgba(60, 101, 248, 0.1);
  --radius: 24px;
  --radius-sm: 16px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.site-shell {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(60, 101, 248, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(98, 211, 103, 0.16), transparent 24rem),
    radial-gradient(circle at 65% 0%, rgba(243, 95, 32, 0.14), transparent 22rem),
    linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
}

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

a:hover {
  color: var(--primary-strong);
}

.site-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 42, 54, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 54, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 88%);
}

.container {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(47, 57, 68, 0.08);
  backdrop-filter: blur(14px);
  background: rgba(247, 251, 255, 0.88);
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 80px;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(60, 101, 248, 0.12);
  border-radius: 999px;
  background: rgba(60, 101, 248, 0.06);
}

.lang-switch a {
  min-width: 46px;
  padding: 6px 10px;
  text-align: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lang-switch a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.lang-switch a.is-active {
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(60, 101, 248, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(60, 101, 248, 0.12), rgba(98, 211, 103, 0.12));
  border: 1px solid rgba(60, 101, 248, 0.12);
  box-shadow: 0 12px 24px rgba(60, 101, 248, 0.12);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy small {
  color: var(--muted);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.site-nav a,
.nav-menu summary {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a.is-active,
.nav-menu summary:hover,
.nav-menu[open] summary {
  color: var(--ink);
  background: rgba(60, 101, 248, 0.1);
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease;
}

.nav-menu[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.nav-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 156px;
  padding: 8px;
  border: 1px solid rgba(60, 101, 248, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(36, 51, 89, 0.14);
}

.nav-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.site-main {
  padding: 40px 0 72px;
}

.panel,
.doc-article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.94));
  box-shadow: var(--shadow);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-bottom: 22px;
}

.hero-main,
.page-intro,
.panel-section {
  padding: 32px;
}

.hero-side {
  display: grid;
  gap: 18px;
}

.eyebrow,
.panel-label {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary-strong);
  background: rgba(60, 101, 248, 0.08);
}

.hero-main h1,
.page-intro h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-copy,
.intro-copy,
.section-copy,
.card-copy,
.note-copy {
  color: var(--muted);
  line-height: 1.8;
}

.hero-copy p,
.intro-copy p,
.section-copy p,
.card-copy p,
.note-copy p {
  margin: 0;
}

.hero-copy {
  max-width: 60ch;
  margin-top: 18px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 24px rgba(60, 101, 248, 0.22);
}

.button-primary:hover {
  color: white;
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tag-row li {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(60, 101, 248, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.code-panel,
.note-panel {
  padding: 24px;
}

.code-panel pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 18px;
  background: #16212d;
  color: #edf4ff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-panel code,
.doc-article code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
}

.note-panel h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary), var(--accent));
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.35rem;
  line-height: 1.2;
}

.content-section + .content-section {
  margin-top: 24px;
}

.content-section:not(.panel-section) {
  margin-top: 24px;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
}

.section-copy {
  margin-top: 8px;
  max-width: 68ch;
}

.card-grid {
  display: grid;
  gap: 16px;
}

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

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

.section-columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card,
.quick-card,
.link-list-card {
  padding: 22px;
}

.info-card h3,
.quick-card strong,
.link-list-card h3 {
  display: block;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.06rem;
}

.quick-card {
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(60, 101, 248, 0.24);
}

.stack-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.8;
  color: var(--muted);
}

.stack-list li + li {
  margin-top: 10px;
}

.stack-list span {
  color: var(--muted);
}

.doc-article {
  max-width: 860px;
  padding: 34px;
}

.article-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.article-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(60, 101, 248, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 18px rgba(60, 101, 248, 0.06);
}

.article-language-switch span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-language-switch a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(60, 101, 248, 0.08);
  border: 1px solid rgba(60, 101, 248, 0.08);
}

.article-language-switch a:hover {
  color: var(--ink);
  background: rgba(60, 101, 248, 0.12);
}

.article-language-switch a small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.article-language-switch a strong {
  color: var(--primary-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.structured-article {
  margin-top: 28px;
}

.doc-article > :first-child {
  margin-top: 0;
}

.doc-article h1,
.doc-article h2,
.doc-article h3,
.doc-article h4 {
  scroll-margin-top: 110px;
  line-height: 1.15;
}

.doc-article h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.doc-article h2 {
  font-size: 1.7rem;
  margin-top: 2.2rem;
}

.doc-article h3 {
  font-size: 1.24rem;
  margin-top: 1.6rem;
}

.doc-article p,
.doc-article li {
  color: var(--muted);
  line-height: 1.9;
}

.doc-article strong {
  color: var(--ink);
}

.doc-article pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 18px;
  background: #16212d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf4ff;
}

.doc-article :not(pre) > code {
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(60, 101, 248, 0.08);
  color: var(--primary-strong);
}

.doc-article blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 14px 14px 0;
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow: hidden;
}

.doc-article th,
.doc-article td {
  padding: 12px 14px;
  border: 1px solid rgba(47, 57, 68, 0.12);
  text-align: left;
}

.doc-article th {
  background: rgba(60, 101, 248, 0.08);
  color: var(--ink);
}

.doc-article hr {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid rgba(47, 57, 68, 0.12);
}

.site-footer {
  border-top: 1px solid rgba(47, 57, 68, 0.08);
  background: rgba(241, 247, 255, 0.9);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  padding: 28px 0 44px;
}

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: var(--muted);
  line-height: 1.8;
}

.site-footer ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 980px) {
  .hero-shell,
  .footer-grid,
  .stats-grid,
  .section-columns-2,
  .section-columns-3,
  .section-columns-4 {
    grid-template-columns: 1fr;
  }

  .header-shell {
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-start {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-main {
    padding-top: 28px;
  }
}

@media (max-width: 640px) {
  .hero-main,
  .page-intro,
  .panel-section,
  .doc-article,
  .code-panel,
  .note-panel,
  .info-card,
  .quick-card,
  .link-list-card,
  .stat-card {
    padding: 22px;
  }

  .site-nav {
    gap: 8px;
  }

  .site-nav a,
  .nav-menu summary {
    padding: 8px 12px;
  }

  .nav-menu-panel {
    right: auto;
    left: 0;
  }
}
