:root {
  --bg: #f6f8fb;
  --bg-elevated: #ffffff;
  --bg-muted: #eef2f7;
  --text: #1a2332;
  --text-muted: #5b6b7f;
  --border: #d7dee8;
  --accent: #0b6bcb;
  --accent-hover: #085496;
  --accent-soft: #e8f1fb;
  --success: #1f8a4c;
  --danger: #c0392b;
  --header-bg: #0f1b2d;
  --header-text: #f3f6fb;
  --code-bg: #0f1b2d;
  --code-text: #e8eef7;
  --shadow: 0 10px 30px rgba(15, 27, 45, 0.08);
  --radius: 12px;
  --max: 1120px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

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

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

code,
pre {
  font-family: var(--mono);
  font-size: 0.92em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand:hover {
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: inherit;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(243, 246, 251, 0.86);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch a {
  padding: 0.25rem 0.7rem;
  color: rgba(243, 246, 251, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
}

.lang-switch a.is-active,
.lang-switch a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(11, 107, 203, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(31, 138, 76, 0.18), transparent 50%),
    linear-gradient(160deg, #0f1b2d 0%, #16253c 45%, #1a314f 100%);
  color: #f5f8fc;
  padding: 4.5rem 0 4rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero .lead {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  color: rgba(245, 248, 252, 0.82);
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 251, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.section {
  padding: 3.25rem 0;
}

.section-muted {
  background: var(--bg-muted);
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.01em;
}

.section .section-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  max-width: 46rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.card a.stretched {
  color: inherit;
  text-decoration: none;
  display: block;
}

.card a.stretched:hover h3 {
  color: var(--accent);
}

.feature-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.arch-components {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.arch-components .card {
  text-align: center;
}

.arch-components code {
  display: inline-block;
  margin: 0.5rem 0;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.shot img {
  display: block;
  width: 100%;
}

.shot figcaption {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.site-footer {
  background: var(--header-bg);
  color: rgba(243, 246, 251, 0.8);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer a {
  color: #fff;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
}

/* Docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 0 3rem;
}

.docs-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.docs-sidebar h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.docs-sidebar h4:first-child {
  margin-top: 0;
}

.docs-sidebar a {
  display: block;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.docs-sidebar a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.docs-sidebar a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 2.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.docs-content h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}

.docs-content h2 {
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.35rem;
}

.docs-content h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.docs-content h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.1rem;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  color: var(--text);
}

.docs-content li + li {
  margin-top: 0.35rem;
}

.docs-content .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.9rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

.callout.warn {
  border-left-color: #c47b16;
  background: #fff6e8;
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-muted);
}

table.table-compare {
  font-size: 0.88rem;
  min-width: 920px;
}

table.table-compare th,
table.table-compare td {
  padding: 0.45rem 0.55rem;
}

table.table-compare thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-muted);
}

table.table-compare tbody th,
table.table-compare thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-elevated);
  min-width: 11rem;
  max-width: 14rem;
  box-shadow: 1px 0 0 var(--border);
}

table.table-compare thead th:first-child {
  z-index: 3;
  background: var(--bg-muted);
}

table.table-compare tbody tr:nth-child(even) th,
table.table-compare tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg-muted) 55%, var(--bg-elevated));
}

table.table-compare tbody tr:nth-child(even) th {
  background: color-mix(in srgb, var(--bg-muted) 70%, var(--bg-elevated));
}

.cmp {
  display: inline-block;
  font-weight: 600;
  font-size: 0.82em;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.cmp.yes {
  color: #0f5c32;
  background: #e5f6ec;
}

.cmp.partial {
  color: #7a4d00;
  background: #fff1d6;
}

.cmp.no {
  color: #8a2430;
  background: #fde8eb;
}

.cmp.paid {
  color: #1a4f8a;
  background: #e7f0fb;
}

.pre-wrap {
  position: relative;
  margin: 1rem 0;
}

.pre-wrap pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.5;
}

.pre-wrap .copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.pre-wrap .copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mermaid {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.page-nav a {
  font-weight: 600;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.steps li {
  position: relative;
  padding: 0.85rem 0.85rem 0.85rem 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 0.75rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 960px) {
  .grid-3,
  .arch-components {
    grid-template-columns: 1fr;
  }

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

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

  .docs-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 1rem;
  }

  .site-header .container {
    flex-wrap: wrap;
  }

  .site-nav.is-open {
    display: flex;
  }

  .docs-content {
    padding: 1.2rem;
  }
}
