@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { text-decoration: none; }

/* ── VARIABLES ── */
:root {
  --bg:        #0d0d0d;
  --bg-2:      #141414;
  --bg-3:      #1a1a1a;
  --bg-4:      #222222;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --border-3:  rgba(255,255,255,0.18);
  --text-1:    #f0f0f0;
  --text-2:    #888;
  --text-3:    #555;
  --green:     #5db85c;
  --green-dim: #2e5c2d;
  --green-bg:  rgba(93,184,92,0.08);
  --green-bg2: rgba(93,184,92,0.14);
  --font-d:    'Syne', sans-serif;
  --font-b:    'DM Sans', sans-serif;
  --font-m:    'JetBrains Mono', monospace;
  --header-h:  44px;
  --sidebar-w: 220px;
  --content-w: 780px;
  --r:         10px;
}

/* ── BASE ── */
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── GLOBAL HEADER ── */
.global-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  z-index: 100;
}

.gh-logo {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--text-1);
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.gh-logo span { color: var(--green); }

.gh-divider {
  width: 1px;
  height: 18px;
  background: var(--border-2);
  margin: 0 20px;
}

.gh-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.gh-nav-a {
  font-size: 13px;
  color: var(--text-2);
  padding: 5px 11px;
  border-radius: 7px;
  font-weight: 400;
  transition: color 0.15s, background 0.15s;
}

.gh-nav-a:hover { color: var(--text-1); background: var(--bg-3); }
.gh-nav-a.active { color: var(--green); background: var(--green-bg); font-weight: 500; }

.gh-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--font-b);
  transition: border-color 0.15s;
  min-width: 180px;
}

.gh-search:hover { border-color: var(--border-2); }

.kbd {
  margin-left: auto;
  font-family: var(--font-m);
  font-size: 10px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-3);
}

.gh-badge {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

.gh-github {
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: color 0.15s, border-color 0.15s;
}

.gh-github:hover { color: var(--text-1); border-color: var(--border-2); }

/* ── LAYOUT ── */
.page-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.nav-block { padding: 10px 10px 4px; }

.nav-group-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  transition: color 0.12s, background 0.12s;
}

.nav-a:hover { background: var(--bg-3); color: var(--text-1); }

.nav-a.active {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 500;
}

.nav-a svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-a.active svg { opacity: 1; }

.nav-a.sub {
  padding-left: 28px;
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.content-inner {
  max-width: var(--content-w);
  padding: 52px 56px 80px;
}

/* ── TYPOGRAPHY ── */
h1 {
  font-family: var(--font-d);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.05;
  color: var(--text-1);
  margin-bottom: 14px;
}

h1 .accent { color: var(--green); }

h2 {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-1);
  margin: 48px 0 16px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

h3 {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 28px 0 10px;
}

p {
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 16px;
  font-weight: 300;
}

p strong {
  color: var(--text-1);
  font-weight: 500;
}

code {
  font-family: var(--font-m);
  font-size: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 7px;
  color: var(--green);
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.7;
}

/* ── PILLS ── */
.pill-row { display: flex; gap: 7px; margin-bottom: 20px; flex-wrap: wrap; }

.pill {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-m);
  padding: 3px 11px;
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: 0.02em;
}

.pill-g { background: var(--green-bg); color: var(--green); border-color: var(--green-dim); }
.pill-n { background: transparent; color: var(--text-3); border-color: var(--border-2); }

/* ── BUTTONS ── */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

.btn-p {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: var(--green); color: #0d0d0d;
  border: none; border-radius: 8px;
  font-family: var(--font-b); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-p:hover { opacity: 0.88; }

.btn-s {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-2); border-radius: 8px;
  font-family: var(--font-b); font-size: 13px; font-weight: 400;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-s:hover { color: var(--text-1); border-color: var(--border-3); }

/* ── SECTION LABEL ── */
.sec-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 36px;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 16px;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}

.card:hover { border-color: var(--border-2); background: var(--bg-3); }

.card-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.card-icon.g { background: var(--green-bg); }
.card-icon.n { background: var(--bg-3); }
.card-icon svg { width: 14px; height: 14px; }

.card-title {
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 5px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  font-weight: 300;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ── TIMELINE ── */
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 30px;
}

.timeline-line {
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--green-dim) 60%, transparent);
}

.timeline-step {
  position: relative;
  padding: 0 0 24px 0;
}

.timeline-step:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -23px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--green-dim);
  transition: border-color 0.15s;
}

.timeline-step:first-child .timeline-dot {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(93,184,92,0.3);
}

.timeline-step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}

.timeline-step-desc {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 7px;
}

.tag {
  display: inline-block;
  font-family: var(--font-m);
  font-size: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 2px 8px;
  color: var(--text-3);
}

/* ── CALLOUT ── */
.callout {
  border-radius: var(--r);
  padding: 16px 20px;
  border: 1px solid;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-info {
  background: rgba(59,130,246,0.06);
  border-color: rgba(59,130,246,0.2);
}

.callout-warn {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
}

.callout-tip {
  background: var(--green-bg);
  border-color: var(--green-dim);
}

.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.callout-text { font-size: 13px; color: var(--text-2); line-height: 1.65; font-weight: 300; }
.callout-text strong { color: var(--text-1); font-weight: 500; }

/* ── CODE BLOCK WITH LABEL ── */
.code-block { margin: 20px 0; }

.code-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  padding: 8px 16px;
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--text-3);
}

.code-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-dim); }

.code-block pre {
  margin: 0;
  border-radius: 0 0 var(--r) var(--r);
  border-top: none;
}

/* ── TABLE ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}

thead tr {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-2);
}

th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--text-1);
  font-size: 12px;
  letter-spacing: 0.03em;
}

td {
  padding: 10px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-weight: 300;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-2); }

/* ── FOOTER ── */
.page-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-nav {
  display: flex;
  gap: 10px;
}

.footer-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-2);
  min-width: 160px;
  transition: border-color 0.15s;
}

.footer-nav-btn:hover { border-color: var(--border-2); }
.footer-nav-btn.next { text-align: right; }

.fnb-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

.fnb-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
  font-family: var(--font-d);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .content-inner { padding: 36px 24px 60px; }
  h1 { font-size: 32px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .cards-grid { grid-template-columns: 1fr; }
  .gh-nav { display: none; }
  .gh-search { min-width: unset; }
}
