:root {
  --bg: #0e1116;
  --panel: #161b22;
  --border: #2a2f3a;
  --text: #e5e7eb;
  --muted: #9aa3af;
  --accent: #3ba7ff;
  --warning: #eab308;
  --danger: #ef4444;
  --info-bg: rgba(59,167,255,0.1);
  --danger-bg: rgba(239,68,68,0.1);
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ================= SIDEBAR (DESKTOP) ================= */
nav {
  width: 270px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  padding-top: 80px;
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Grows to push LEGAL to the bottom */
.nav-main {
  flex: 1 1 auto;
}

/* ================= MAIN ================= */
main {
  flex: 1;
  padding: 40px;
  max-width: 960px;
  margin-top: 56px;
  margin-left: 270px; /* Offset for fixed sidebar */
}

h1 {
  font-size: 40px;
  margin-bottom: 24px;
}

h3 {
  font-size: 28px;
  margin-top: 36px;
  margin-bottom: 12px;
}

p,
li {
  line-height: 1.7;
  color: var(--muted);
  font-size: large;
}

ul,
ol {
  margin-left: 20px;
}

/* ================= IMAGES ================= */
figure {
  margin: 28px 0;
}

figure img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ================= CODE ================= */
code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

/* ================= HINTS ================= */
.hint {
  margin: 28px 0;
  padding: 16px 18px;
  border-left: 4px solid;
  border-radius: 8px;
}

.hint.info {
  background: var(--info-bg);
  border-color: var(--accent);
}

.hint.danger {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.hint a {
  color: var(--accent);
  text-decoration: none;
}

.hint a:hover {
  text-decoration: underline;
}

/* ================= TOPBAR ================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0b0f14;
  border-bottom: 1px solid #1f2630;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.title {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.topbar-right {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #cbd5f5;
  border: 1px solid #2a2f3a;
  background: transparent;
  text-decoration: none;
}

.btn:hover {
  background: #1f2630;
  color: #ffffff;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* ================= SIDEBAR NAVIGATION ================= */
.nav-group {
  margin-bottom: 24px;
}

.nav-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 2px 0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover {
  background: #1f2630;
  color: var(--text);
}

.nav-link.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  font-weight: 500;
}

/* ================= MOBILE ================= */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  nav {
    position: fixed;
    top: 56px;
    left: -270px;
    width: 270px;
    height: calc(100vh - 56px);
    z-index: 999;
    padding: 24px;
    padding-top: 40px;
    overflow-y: auto;
    background: var(--panel);
    border-right: 1px solid var(--border);
    transition: left 0.25s ease;
    display: none;
  }

  nav.open {
    left: 0;
    display: flex;
  }

  /* Fix: no empty gap on mobile */
  .nav-main {
    flex: unset;
  }

  main {
    margin-left: 0;
    padding: 24px;
    max-width: 100%;
  }

  .topbar-right {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .title {
    font-size: 14px;
    white-space: nowrap;
  }
}
/* ================= OVERLAY-STYLE SIDEBAR SCROLLBAR ================= */

/* Chrome, Edge, Safari */
nav::-webkit-scrollbar {
  width: 6px;
}

nav::-webkit-scrollbar-track {
  background: transparent; /* NO track */
}

nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.7); /* pure black feel */
  border-radius: 10px;
}

nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Firefox (best possible approximation) */
nav {
  scrollbar-width: thin;
  scrollbar-color: #000000 transparent;
}

.locked-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  user-select: none;
}

.check-icon {
  width: 18px;
  height: 18px;
  background: #3ba7ff;          /* blue */
  color: #ffffff;               /* white tick */
  border-radius: 4px;            /* square with slight rounding */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.check-text {
  color: #e5e7eb;
}
/* ================= HINT / CALLOUTS ================= */

.hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.hint-icon {
  font-size: 16px;
  line-height: 1.2;
  margin-top: 2px;
}

/* Danger variant */
.hint.danger {
  background: rgba(239, 68, 68, 0.12);   /* dark red tint */
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.hint.danger code {
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

/* Info variant */
.hint.info {
  background: rgba(59, 167, 255, 0.12);   /* blue tint */
  border: 1px solid rgba(59, 167, 255, 0.35);
  color: #bfdbfe;
}

.hint.info code {
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}
/* ================= CARDS ================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.card strong {
  display: block;
  margin-bottom: 8px;
}

.card a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.card a:hover {
  text-decoration: underline;
}