:root {
  --black: #0a0a0a;
  --black-elevated: #141414;
  --black-card: #161616;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.14);
  --blue: #1a3a6b;
  --cream: #f7f4ef;
  --muted: #a3a3a3;
  --muted-2: #777777;
  --white: #ffffff;
  --danger: #c62828;
  --success: #2e7d32;
  --max: 1120px;
  --radius: 10px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: Arial, Helvetica, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
}

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

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 10, 0.88);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--white);
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.search-wrap {
  position: relative;
  margin-left: auto;
  width: min(280px, 100%);
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--black-elevated);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.55rem 0.8rem 0.55rem 2.1rem;
  outline: none;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.search-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.search-wrap::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23777777' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--black-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.search-results.open {
  display: block;
}

.search-results a {
  display: block;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--cream);
  font-size: 0.9rem;
}

.search-results a:last-child {
  border-bottom: 0;
}

.search-results a:hover {
  background: var(--gold-soft);
  color: var(--gold);
}

.search-results .empty {
  padding: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--white);
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.hero-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--white);
  font-weight: 400;
}

.hero-card ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-card li + li {
  margin-top: 0.35rem;
}

.hero-card a {
  color: var(--gold);
}

/* Sections */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.section-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

.section-intro h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--white);
}

.section-intro h2 span {
  color: var(--gold);
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Network grid */
.network-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.network-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.55rem;
  border-radius: 8px;
  color: var(--cream);
  transition: background 0.15s ease, color 0.15s ease;
}

.network-item:hover {
  background: var(--gold-soft);
  color: var(--white);
}

.network-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--black-elevated);
  border: 1px solid var(--border);
}

.network-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.network-item span {
  font-size: 0.95rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

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

.card {
  display: block;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.card:hover {
  border-color: var(--gold);
  background: #181818;
  transform: translateY(-1px);
}

.card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 0.85rem;
  color: var(--gold);
}

.card-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--white);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
}

.link-list a {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

.link-list a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.site-footer h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer a {
  color: var(--gold);
}

.footer-meta {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-2);
  font-size: 0.82rem;
}

/* Article layout */
.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: #0c0c0c;
  padding: 1.5rem 1rem 2.5rem;
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: none;
  overflow: visible;
}

.sidebar-group + .sidebar-group {
  margin-top: 0.35rem;
}

.sidebar-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.sidebar-trigger:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.sidebar-trigger::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.sidebar-group.open .sidebar-trigger::after {
  transform: rotate(-135deg);
  translate: 0 2px;
}

.sidebar-panel {
  display: none;
  padding: 0.15rem 0 0.45rem;
}

.sidebar-group.open .sidebar-panel {
  display: block;
}

.sidebar a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar a.active {
  color: var(--gold);
  background: var(--gold-soft);
}

.article {
  padding: 2.25rem 2.5rem 4rem;
  max-width: 760px;
}

.article-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

.article h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--white);
}

.article h2 {
  margin: 2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--white);
}

.article h3 {
  margin: 1.5rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--cream);
}

.article p,
.article li {
  color: var(--muted);
}

.article p {
  margin: 0 0 1rem;
}

.article ul,
.article ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

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

.article strong {
  color: var(--cream);
  font-weight: 600;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
}

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

.article th {
  background: var(--black-elevated);
  color: var(--white);
  font-weight: 600;
}

.article td {
  color: var(--muted);
}

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  background: var(--black-elevated);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.callout strong {
  color: var(--gold);
}

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

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.85rem 1rem 0.85rem 3rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--black-card);
}

.steps li + li {
  margin-top: 0.55rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.9rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.article-nav a {
  color: var(--muted);
  font-size: 0.9rem;
}

.article-nav a:hover {
  color: var(--gold);
}

.article-nav .next {
  margin-left: auto;
  text-align: right;
}

.mobile-nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--black-elevated);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

@media (max-width: 960px) {
  .hero-grid,
  .section-layout,
  .footer-grid,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .network-grid,
  .card-grid,
  .card-grid.three,
  .link-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .sidebar.open {
    display: block;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    margin: 1rem 0 0;
  }

  .article {
    padding: 1.5rem 1.25rem 3rem;
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  .search-wrap {
    width: 100%;
    margin-left: 0;
  }
}
