:root {
  --bg: #fafafa;
  --bg-1: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #eeeef0;
  --border: rgba(0, 0, 0, 0.06);
  --border-2: rgba(0, 0, 0, 0.1);
  --border-3: rgba(0, 0, 0, 0.14);
  --text-1: #0f0f18;
  --text-2: #555568;
  --text-3: #8e8ea0;
  --accent: #635bff;
  --accent-light: #4f46e5;
  --accent-bg: rgba(99, 91, 255, 0.06);
  --accent-bg2: rgba(99, 91, 255, 0.1);
  --teal: #0d9b7a;
  --teal-bg: rgba(13, 155, 122, 0.06);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.06);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-3);
  text-decoration: none;
  transition: color 150ms;
}

.nav-links a:hover {
  color: var(--text-1);
}

.nav-links a.active {
  color: var(--text-1);
  font-weight: 600;
}

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

.n-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 150ms;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.n-btn.ghost {
  background: transparent;
  color: var(--text-3);
}

.n-btn.ghost:hover {
  color: var(--text-1);
}

.n-btn.primary {
  background: var(--text-1);
  color: #fff;
}

.n-btn.primary:hover {
  opacity: 0.85;
}

.breadcrumb {
  max-width: 1080px;
  margin: 0 auto;
  padding: 76px 40px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
}

.breadcrumb a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 120ms;
}

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

.breadcrumb .sep {
  color: var(--border-3);
}

.breadcrumb .current {
  color: var(--text-2);
  font-weight: 500;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 40px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.article-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--teal-bg);
  color: var(--teal);
}

.article-tag.basics {
  background: var(--accent-bg);
  color: var(--accent);
}

.article-tag.rules {
  background: var(--teal-bg);
  color: var(--teal);
}

.article-tag.money {
  background: var(--amber-bg);
  color: var(--amber);
}

.article-tag.rights {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-2);
}

.article-reading {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
}

.article-reading svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

.article-header h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.12;
  margin-bottom: 0;
}

.prose h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 36px;
  margin-bottom: 12px;
  line-height: 1.2;
  color: var(--text-1);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text-1);
}

.prose p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 14px;
}

.prose strong {
  color: var(--text-1);
  font-weight: 600;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 120ms;
}

.prose .n-btn {
  text-decoration: none;
}

.prose a:hover {
  opacity: 0.7;
}

.prose ul,
.prose ol {
  margin: 8px 0 16px;
  padding-left: 0;
  list-style: none;
}

.prose li {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.65;
  padding: 4px 0 4px 22px;
  position: relative;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bg2);
  border: 1.5px solid var(--accent);
}

.prose blockquote,
.callout {
  margin: 18px 0 20px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 8px 8px 0;
}

.prose blockquote {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.callout p {
  color: var(--text-2);
  font-size: 14px;
  font-style: italic;
  margin-bottom: 0;
  line-height: 1.6;
}

.callout p:last-child {
  margin-bottom: 0;
}

.highlight-box {
  margin: 18px 0 20px;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
}

.highlight-box h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.highlight-box h4 svg {
  width: 14px;
  height: 14px;
  color: var(--amber);
}

.highlight-box p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 0;
}

.sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sb-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.sb-cta {
  position: relative;
  overflow: hidden;
}

.sb-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
}

.sb-cta h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 5px;
}

.sb-cta p {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 14px;
}

.sb-btn {
  display: block;
  width: 100%;
  padding: 9px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-align: center;
  background: var(--text-1);
  color: #fff;
  transition: all 150ms;
  text-decoration: none;
}

.sb-btn:hover {
  opacity: 0.85;
}

.sb-mistakes h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-mistakes h3 svg {
  width: 14px;
  height: 14px;
  color: var(--amber);
}

.mistake-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.mistake-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sb-links h3,
.sb-related h3,
.sb-toc h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 120ms;
}

.sb-link:hover {
  opacity: 0.7;
}

.sb-link svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.related-item {
  display: block;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: opacity 120ms;
}

.related-item:last-child {
  border-bottom: none;
}

.related-item:hover {
  opacity: 0.7;
}

.toc-item {
  display: block;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: all 120ms;
  border-left: 2px solid transparent;
  padding-left: 10px;
}

.toc-item:hover {
  color: var(--text-1);
  border-left-color: var(--border-3);
}

.toc-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

footer {
  border-top: 1px solid var(--border);
  padding: 48px 40px 32px;
  max-width: 1080px;
  margin: 0 auto;
}

.fg {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.fb p {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 240px;
  margin-top: 8px;
}

.fc-t {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.fc a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 7px;
  transition: color 150ms;
}

.fc a:hover {
  color: var(--text-1);
}

.fbot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.fbot p {
  font-size: 11.5px;
  color: var(--text-3);
}

.fbot-l {
  display: flex;
  gap: 14px;
}

.fbot-l a {
  font-size: 11.5px;
  color: var(--text-3);
  text-decoration: none;
}

.fbot-l a:hover {
  color: var(--text-2);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fi {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fd1 {
  animation-delay: 0.05s;
}

.fd2 {
  animation-delay: 0.1s;
}

.fd3 {
  animation-delay: 0.15s;
}

/* Shared mobile menu (header partial) */
.site-nav .site-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: #fff;
  color: var(--text-1);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.site-nav .site-menu-toggle__icon {
  font-size: 16px;
  line-height: 1;
}

.site-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 260;
  visibility: hidden;
  pointer-events: none;
}

.site-mobile-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}

.site-mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-mobile-menu.is-open .site-mobile-menu__backdrop {
  opacity: 1;
}

.site-mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(90vw, 360px);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -14px 0 38px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.site-mobile-menu.is-open .site-mobile-menu__panel {
  transform: translateX(0);
}

.site-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.site-mobile-menu__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background: #fff;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.site-mobile-menu__nav {
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.site-mobile-menu__nav a {
  text-decoration: none;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 650;
  padding: 10px 12px;
  border-radius: 10px;
}

.site-mobile-menu__nav a.active,
.site-mobile-menu__nav a[aria-current="page"] {
  background: var(--bg-2);
}

.site-mobile-menu__actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.site-mobile-menu__actions .n-btn {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
}

body.site-mobile-menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  nav {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  .site-nav .nav-right .n-btn {
    display: none;
  }

  .site-nav .site-menu-toggle {
    display: inline-flex;
  }

  .breadcrumb,
  .page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article {
    order: 1;
    min-width: 0;
  }

  .sidebar {
    position: static;
    top: auto;
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 2px;
  }

  .sb-card {
    padding: 16px;
  }

  .sb-toc {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .sb-toc h3 {
    margin-bottom: 8px;
  }

  .sb-toc .toc-item {
    display: inline-flex;
    align-items: center;
    margin: 0 8px 8px 0;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-2);
  }

  .sb-toc .toc-item.active {
    color: var(--accent);
    border-color: rgba(99, 91, 255, 0.28);
    background: var(--accent-bg);
  }

  footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .fg {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .fg {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
