/* ===== Base / reset ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.55;
  color: #0f172a;
  background: #ffffff;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ===== Theme tokens ===== */
:root{
  --sidebar-w: 320px;

  --border: #e2e8f0;
  --muted: #64748b;
  --bg-soft: #f8fafc;
  --bg-code: #0b1220;
  --fg-code: #e2e8f0;

  --radius: 12px;
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.08);
}

/* ===== Layout: sidebar full left column ===== */
.layout{
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: #ffffff;
  overflow: auto;
}

.sidebar__inner{
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
}
.brand:hover{ background: var(--bg-soft); text-decoration: none; }

.brand__logo{
  height: 44px;          /* groter logo */
  width: auto;
  display: block;
}

.brand__stack{ display: flex; flex-direction: column; line-height: 1.15; }
.brand__title{
  font-weight: 750;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: #0f172a;
}
.brand__subtitle{
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar__search input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  outline: none;
}
.sidebar__search input:focus{
  border-color: #94a3b8;
  background: #ffffff;
}

.nav{ display: flex; flex-direction: column; gap: 14px; }
.nav__section{ display:flex; flex-direction: column; gap: 6px; }
.nav__title{
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.nav__subtitle{
  font-size: 12px;
  font-weight: 750;
  color: #334155;
  margin: 8px 0 2px;
}
.nav__link{
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: #0f172a;
}
.nav__link:hover{
  background: var(--bg-soft);
  text-decoration: none;
}
.nav__link--sub{
  padding-left: 22px;
  color: #334155;
  font-size: 13.5px;
}
.nav__subgroup{
  padding-left: 6px;
  border-left: 2px solid #eef2f7;
  margin-left: 6px;
}

.sidebar__footer{
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sidebar__hint{
  font-size: 12.5px;
  color: var(--muted);
}

/* ===== Content ===== */
.content{
  background: linear-gradient(#ffffff, #ffffff 65%, #fbfdff);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
}

.topbar__left{ display:flex; align-items:center; gap: 12px; }
.topbar__right{ display:flex; align-items:center; gap: 12px; }

.topbar__link{
  font-size: 14px;
  color: #0f172a;
  padding: 8px 10px;
  border-radius: 10px;
}
.topbar__link:hover{
  background: var(--bg-soft);
  text-decoration: none;
}
.topbar__link--primary{
  border: 1px solid var(--border);
}

.topbar__crumbs{ color: #334155; font-size: 14px; }
.crumb{ color: #334155; }

/* Document body */
.doc{
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

h1{
  font-size: 32px;
  line-height: 1.15;
  margin: 10px 0 10px;
  letter-spacing: -0.02em;
}
h2{
  font-size: 22px;
  margin: 26px 0 10px;
  letter-spacing: -0.01em;
}
h3{
  font-size: 16px;
  margin: 16px 0 8px;
}

.lead{
  font-size: 16px;
  color: #0f172a;
  margin: 0 0 12px;
}

p{ margin: 0 0 12px; color: #0f172a; }
ul, ol{ margin: 0 0 12px 20px; }
li{ margin: 6px 0; }

.callout{
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(2,6,23,0.03);
  margin: 14px 0;
}

pre{
  margin: 12px 0 16px;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: var(--bg-code);
  color: var(--fg-code);
  overflow: auto;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.08);
}
pre code{ color: inherit; }

code{
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95em;
}
pre code{
  background: transparent;
  border: none;
  padding: 0;
}

.table{
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table th, .table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th{
  text-align: left;
  background: var(--bg-soft);
  font-size: 13px;
  color: #334155;
}
.table tr:last-child td{ border-bottom: none; }

.changelog{
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.changelog li{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin: 10px 0;
}
.tag{
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.doc__footer{
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

/* ===== Burger + Mobile behavior (CSS-only) ===== */
.nav-toggle { display: none; }

.burger{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: none;            /* desktop: hidden */
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
.burger:hover{ background: var(--bg-soft); text-decoration: none; }
.burger span{
  display: block;
  width: 18px;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
}

/* Mobile: sidebar off-canvas */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }

  .burger{ display: inline-flex; }

  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    width: min(var(--sidebar-w), 88vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow);
    z-index: 60;
  }

  /* show sidebar when checkbox checked */
  .nav-toggle:checked ~ .layout .sidebar{
    transform: translateX(0);
  }

  .topbar__right{ display: none; }
}
