@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2230;
  --border:      #2d3348;
  --border-dim:  #21262d;
  --text:        #cdd9e5;
  --text-2:      #768390;
  --accent:      #0ea5e9;
  --accent-dim:  rgba(14,165,233,.09);
  --accent-text: #38bdf8;
  --tip:         #a371f7;
  --tip-dim:     rgba(163,113,247,.09);
  --warn:        #e3a008;
  --warn-dim:    rgba(227,160,8,.09);
  --danger:      #f85149;
  --danger-dim:  rgba(248,81,73,.09);
  --code-bg:     #161b22;
  --font:        'Poppins', system-ui, -apple-system, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w:   272px;
  --toc-w:       228px;
  --radius:      6px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

/* ─── Left Sidebar ───────────────────────────────────────── */
#sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border-dim);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 60;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 7px;
  flex-shrink: 0;
}

.logo-name    { font-size: .9rem; font-weight: 700; color: var(--text); display: block; letter-spacing: -.15px; }
.logo-version { font-size: .67rem; color: var(--text-2); display: block; margin-top: 2px; font-weight: 400; }

.sidebar-nav { padding: 10px 0 28px; flex: 1; overflow-y: auto; }

.nav-group        { margin-bottom: 6px; }
.nav-group-label  {
  font-size: .61rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-2); padding: 12px 20px 4px;
}

.nav-link {
  display: block;
  padding: 6px 20px 6px 16px;
  font-size: .84rem; font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s;
}

.nav-link:hover           { color: var(--text); background: var(--surface-2); }
.nav-link.current-page    { color: var(--text); font-weight: 500; }
.nav-link.active          { color: var(--accent-text); border-left-color: var(--accent); background: var(--accent-dim); font-weight: 500; }

/* ─── Main Area ─────────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Right TOC ─────────────────────────────────────────── */
#toc {
  position: fixed;
  right: 0; top: 0;
  width: var(--toc-w);
  height: 100vh;
  overflow-y: auto;
  padding: 36px 18px 24px 20px;
  border-left: 1px solid var(--border-dim);
  display: none;
  background: var(--bg);
  flex-shrink: 0;
}

@media (min-width: 1360px) {
  #toc    { display: block; }
  #main   { margin-right: var(--toc-w); }
}

.toc-label {
  font-size: .61rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-2); margin-bottom: 12px;
}

.toc-nav { display: flex; flex-direction: column; gap: 1px; }

.toc-nav a {
  display: block;
  font-size: .78rem; color: var(--text-2);
  text-decoration: none;
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--border-dim);
  line-height: 1.5;
  transition: color .12s, border-color .12s;
}

.toc-nav a:hover { color: var(--text); border-left-color: var(--border); }
.toc-nav a.active { color: var(--accent-text); border-left-color: var(--accent); font-weight: 500; }

/* ─── Page Header ───────────────────────────────────────── */
.page-header {
  padding: 44px 64px 32px;
  border-bottom: 1px solid var(--border-dim);
}

.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: .74rem; color: var(--text-2);
  margin-bottom: 18px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb-sep { color: var(--border); font-size: .8rem; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.page-header h1 {
  font-size: 2rem; font-weight: 700;
  color: var(--text); letter-spacing: -.5px; line-height: 1.2;
  margin-bottom: 12px;
}

.page-header p {
  font-size: .97rem; color: var(--text-2);
  max-width: 600px; line-height: 1.8; margin: 0;
}

/* ─── Content ───────────────────────────────────────────── */
.content {
  padding: 44px 64px 56px;
  flex: 1;
}

/* ─── Headings ──────────────────────────────────────────── */
section { margin-bottom: 52px; }

h2 {
  font-size: 1.2rem; font-weight: 600;
  color: var(--text); letter-spacing: -.2px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dim);
  scroll-margin-top: 24px;
}

h3 {
  font-size: .97rem; font-weight: 600;
  color: var(--text); margin: 26px 0 11px;
  scroll-margin-top: 24px;
}
h3:first-child { margin-top: 0; }

h4 {
  font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-2); margin: 20px 0 9px;
}

p { color: var(--text-2); margin-bottom: 14px; line-height: 1.8; }
p:last-child { margin-bottom: 0; }
strong  { color: var(--text); font-weight: 600; }
a       { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol  { padding-left: 1.4em; color: var(--text-2); }
li      { margin-bottom: 4px; line-height: 1.8; }

/* ─── Code ──────────────────────────────────────────────── */
code {
  font-family: var(--mono); font-size: .79em;
  background: var(--code-bg);
  border: 1px solid var(--border-dim);
  border-radius: 4px; padding: 2px 6px;
  color: #e6edf3;
}

pre {
  font-family: var(--mono); font-size: .82rem;
  background: var(--code-bg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto;
  margin-bottom: 16px; line-height: 1.65;
}

pre code { background: none; border: none; padding: 0; font-size: inherit; color: #e6edf3; }

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-bottom: 20px; }

table {
  width: 100%; border-collapse: collapse;
  font-size: .86rem;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius); overflow: hidden;
}

thead th {
  background: var(--surface-2); padding: 10px 16px;
  text-align: left; font-size: .69rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-2); border-bottom: 1px solid var(--border-dim);
}

tbody tr { border-bottom: 1px solid var(--border-dim); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 10px 16px; color: var(--text-2); vertical-align: top; }
tbody td:first-child { color: var(--text); }

/* ─── Asides (PaperMC-inspired callouts) ─────────────────── */
.aside {
  border-left: 3px solid;
  padding: 14px 18px 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}

.aside-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 8px;
}

.aside p { margin: 0; font-size: .875rem; line-height: 1.7; }
.aside a { font-weight: 500; }

.aside-note   { border-color: var(--accent); background: var(--accent-dim); }
.aside-note   .aside-title { color: var(--accent-text); }
.aside-note   p { color: #93c5fd; }
.aside-note   a { color: var(--accent-text); }

.aside-tip    { border-color: var(--tip); background: var(--tip-dim); }
.aside-tip    .aside-title { color: #c084fc; }
.aside-tip    p { color: #d8b4fe; }

.aside-caution { border-color: var(--warn); background: var(--warn-dim); }
.aside-caution .aside-title { color: #fbbf24; }
.aside-caution p { color: #fde68a; }
.aside-caution a { color: #fbbf24; }

.aside-danger  { border-color: var(--danger); background: var(--danger-dim); }
.aside-danger  .aside-title { color: #fca5a5; }
.aside-danger  p { color: #fecaca; }

/* ─── Command blocks ─────────────────────────────────────── */
.cmd {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 22px;
}

.cmd-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-dim);
  padding: 10px 16px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

.cmd-title {
  font-family: var(--mono); font-size: .81rem;
  font-weight: 500; color: var(--text);
}

.badge {
  font-size: .63rem; font-weight: 600;
  letter-spacing: .3px; padding: 2px 7px;
  border-radius: 3px; white-space: nowrap;
  font-family: var(--font);
}
.badge-mod  { background: rgba(14,165,233,.12); color: var(--accent-text); border: 1px solid rgba(14,165,233,.22); }
.badge-perm { background: rgba(227,160,8,.1);   color: #fbbf24; border: 1px solid rgba(227,160,8,.2); }

.cmd-body       { padding: 16px; }
.cmd-body .desc { font-size: .875rem; margin-bottom: 12px; }
.cmd-body pre   { margin-bottom: 0; }

/* ─── Steps ─────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; padding: 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 48px;
}

.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: .74rem; font-weight: 700;
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}

.steps li::after {
  content: '';
  position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 1px; background: var(--border-dim);
}
.steps li:last-child::after { display: none; }

.step-title { font-size: .92rem; font-weight: 600; color: var(--text); line-height: 28px; margin-bottom: 4px; }
.steps li p { font-size: .875rem; }

/* ─── Feature grid ──────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px; margin-bottom: 24px;
}

.feature {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  transition: border-color .15s;
}
.feature:hover { border-color: var(--border); }

.feature-title { font-size: .87rem; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.feature-desc  { font-size: .81rem; color: var(--text-2); line-height: 1.65; margin: 0; }
.feature .mod-badge { display: block; margin-top: 9px; }

/* ─── Debug pages ───────────────────────────────────────── */
.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px; margin-bottom: 16px;
}

.debug-page {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface);
}

.dp-num   { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent-text); margin-bottom: 3px; }
.dp-title { font-size: .87rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.debug-page ul { list-style: none; padding: 0; }
.debug-page ul li { font-size: .77rem; color: var(--text-2); padding: 2px 0; line-height: 1.5; }
.debug-page ul li::before { content: '–'; color: var(--border); margin-right: 7px; }

/* ─── Config blocks ─────────────────────────────────────── */
.config-block {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
}

.config-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-dim);
  padding: 9px 16px;
  font-family: var(--mono); font-size: .77rem;
  color: var(--text-2);
}
.config-header strong { color: var(--text); font-weight: 500; }
.config-block pre { border: none; border-radius: 0; margin: 0; }

/* ─── Inline badges ─────────────────────────────────────── */
.mod-badge {
  display: inline-block; font-size: .63rem;
  font-weight: 600; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 3px;
  background: rgba(14,165,233,.1);
  color: var(--accent-text);
  border: 1px solid rgba(14,165,233,.22);
  font-family: var(--font);
}

.tag { display: inline-block; font-size: .63rem; font-weight: 600; padding: 1px 5px; border-radius: 3px; vertical-align: middle; margin-left: 3px; }
.tag-op { background: rgba(227,160,8,.1); color: #fbbf24; border: 1px solid rgba(227,160,8,.2); }

.rk { font-family: var(--mono); color: var(--text); font-size: .82rem; font-weight: 500; }

/* ─── Quick links ───────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-top: 10px;
}

.quick-link {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 15px 17px;
  text-decoration: none;
  background: var(--surface);
  display: block;
  transition: border-color .15s;
}
.quick-link:hover { border-color: var(--accent); text-decoration: none; }

.ql-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--text-2); display: block; margin-bottom: 5px; }
.ql-title { font-size: .9rem; font-weight: 600; color: var(--text); display: block; }
.ql-desc  { font-size: .79rem; color: var(--text-2); display: block; margin-top: 3px; }

/* ─── HR ────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border-dim); margin: 36px 0; }

/* ─── Footer ────────────────────────────────────────────── */
.page-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-dim);
  padding: 20px 64px;
  display: flex; align-items: center;
  justify-content: space-between;
  font-size: .8rem; color: var(--text-2);
  flex-wrap: wrap; gap: 10px;
}
.page-footer a { color: var(--text-2); text-decoration: none; }
.page-footer a:hover { color: var(--accent-text); }

/* ─── Language toggle ────────────────────────────────────── */
.lang-toggle {
  padding: 14px 16px;
  border-top: 1px solid var(--border-dim);
  display: flex; align-items: center;
  gap: 6px; flex-shrink: 0;
}

.lang-toggle-label {
  font-size: .6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-2); flex: 1;
}

.lang-btn {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: .72rem; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: all .12s; line-height: 1.5;
}
.lang-btn.active { background: var(--accent-dim); color: var(--accent-text); border-color: rgba(14,165,233,.3); }
.lang-btn:hover:not(.active) { color: var(--text); border-color: var(--border); background: var(--surface-2); }

/* ─── Footer meta (Discord + counter) ───────────────────── */
.footer-meta { display: flex; align-items: center; gap: 14px; }

.discord-link {
  display: flex; align-items: center; gap: 5px;
  color: var(--text-2); text-decoration: none;
  font-size: .78rem; transition: color .12s;
}
.discord-link:hover { color: #5865F2; text-decoration: none; }
.discord-link svg { width: 15px; height: 15px; flex-shrink: 0; }

.view-counter { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--text-2); }
.view-counter svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { display: none; }
  #main    { margin-left: 0; }
  .page-header, .content { padding-left: 22px; padding-right: 22px; }
  .page-footer { padding-left: 22px; padding-right: 22px; }
}
