:root {
  --bg: #0f1110;
  --bg-elevated: #1a1d1b;
  --text: #e8ebe6;
  --muted: #9aa199;
  --accent: #971493;
  --accent-2: #3a2fb8;
  --nav-h: 3.25rem;
}

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

html {
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(151, 20, 147, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(58, 47, 184, 0.15), transparent);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(151, 20, 147, 0.25);
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.35rem 0;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu-link {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.menu-link:hover {
  color: var(--text);
  background: rgba(151, 20, 147, 0.12);
}

.menu-link.is-active {
  color: var(--text);
  background: rgba(151, 20, 147, 0.22);
}

.menu-link-ext {
  margin-left: auto;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

article h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

article .lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

article h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid rgba(151, 20, 147, 0.35);
}

article h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
  font-weight: 600;
}

article ol.steps {
  list-style: none;
  counter-reset: pcstep;
  padding-left: 0;
  margin: 0 0 1.25rem;
}

article ol.steps > li {
  counter-increment: pcstep;
  margin: 0 0 1rem;
  padding-left: 2.85rem;
  position: relative;
  color: var(--muted);
}

article ol.steps > li::before {
  content: counter(pcstep);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

article p {
  margin: 0 0 1rem;
  color: var(--muted);
}

article a {
  color: #c77fd4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

article a:hover {
  color: #e5b8ed;
}

article ul,
article ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--muted);
}

article li {
  margin-bottom: 0.35rem;
}

.figure {
  margin: 1.75rem 0;
  text-align: center;
}

.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(151, 20, 147, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-radius: 0.65rem;
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent);
}

.callout dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.callout dt:first-child {
  margin-top: 0;
}

.callout dd {
  margin: 0.15rem 0 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

.back-home {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .nav-inner {
    padding: 0 1.5rem;
  }

  .wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
