:root {
  --bg: #111315;
  --panel: #0E1218;
  --panel2: #171A1E;
  --text: #F7F5F1;
  --muted: #AEB3B9;
  --border: rgba(255,255,255,0.12);
  --accent: #FF7722;
  --accent-ink: #1B0C03;
  --ok: #4ADE80;
  --code-bg: #0A0D11;
  --font: Arial, Helvetica, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --maxw: 860px;
  --shot-shadow: 0 24px 55px 2px rgba(0,0,0,0.38);
  --sidebar-scrollbar-thumb: #3B4148;
  --sidebar-scrollbar-thumb-hover: #555D66;
}
:root[data-theme="light"] {
  --bg: #F4F1EC;
  --panel: #F5F3EE;
  --panel2: #ECE8E1;
  --text: #17191C;
  --muted: #5B6168;
  --accent: #A63F00;
  --border: rgba(0,0,0,0.1);
  --code-bg: #ECE8E1;
  --shot-shadow: 0 24px 55px 2px rgba(23,25,28,0.18);
  --sidebar-scrollbar-thumb: #C1BAB0;
  --sidebar-scrollbar-thumb-hover: #A79F94;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: 76px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}
.skip-link:focus { transform: translateY(0); }
code, pre {
  font-family: var(--mono);
  font-size: 13px;
}
code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
}
pre code { border: 0; padding: 0; background: none; }

/* ---- header ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: auto; height: 32px; flex: 0 0 auto; }
.brand .name { font-weight: 700; font-size: 15px; letter-spacing: 0.4px; }
.brand .name .accent { color: var(--accent); }
.brand .tag { font-size: 11px; color: var(--muted); margin-left: 6px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions a.home-link { font-size: 13px; color: var(--muted); font-weight: 600; }
.header-actions a.home-link:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  min-width: 38px; height: 38px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  cursor: pointer; font-size: 14px; display:flex; align-items:center; justify-content:center;
}
.nav-toggle {
  display: none;
  width: calc(100% - 32px);
  margin: 14px 16px 0;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle .nav-toggle-icon { font-size: 18px; line-height: 1; }

/* ---- layout ---- */
.layout { display: flex; align-items: flex-start; max-width: 1320px; margin: 0 auto; }
.sidebar {
  width: 250px; flex-shrink: 0;
  padding: 22px 14px 60px 24px;
  position: sticky; top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-scrollbar-thumb) transparent;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--sidebar-scrollbar-thumb);
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--sidebar-scrollbar-thumb-hover); }
.sidebar .nav-heading {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--accent); margin: 18px 0 6px;
}
.sidebar .nav-heading:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.sidebar li a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.sidebar li a.active { background: rgba(255,119,34,0.12); color: var(--accent); font-weight: 700; }
.sidebar .soon-badge {
  font-size: 9px; font-weight: 700; color: var(--muted);
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 6px; white-space: nowrap;
}
.sidebar li a.active .soon-badge { display: none; }

.content {
  flex: 1; min-width: 0;
  padding: 40px 32px 80px;
  max-width: var(--maxw);
}
.content.content-narrow { max-width: 720px; }
.muted { color: var(--muted); }
.content :target { scroll-margin-top: 76px; }
.content h1 { font-size: 32px; font-weight: 700; margin: 0 0 6px; }
.content .lede { color: var(--muted); font-size: 15px; margin: 0 0 32px; }
.content h2 {
  font-size: 20px; font-weight: 700; margin: 40px 0 14px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.content h2:first-of-type { border-top: 0; padding-top: 0; }
.content h3 { font-size: 15.5px; font-weight: 700; margin: 24px 0 8px; }
.content p { margin: 0 0 14px; color: var(--text); }
.content ul, .content ol { margin: 0 0 14px; padding-left: 22px; }
.content li { margin-bottom: 6px; }
.content strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
tr:last-child td { border-bottom: 0; }

.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--panel); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 18px; font-size: 14px;
}
.callout.note { border-left-color: var(--muted); }
.callout strong { color: var(--accent); }

/* Screenshots — uniform framing across every page. The app screenshots are always captured
   in the app's dark theme (its true default). Elevation, not enclosure: no border, no matte
   band — the screenshot's own dark edge against the page plus a generous soft shadow is
   enough definition on its own, so it reads as a card floating just above the page rather
   than a picture boxed into a frame. One class, no per-image markup. Adjust the look
   everywhere at once via the --shot-shadow token above. */
figure.shot {
  margin: 28px 0 30px;
  text-align: center;
}
figure.shot img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shot-shadow);
}
figure.shot figcaption {
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
}

.soon-panel {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px 28px; text-align: center; margin-top: 20px;
  background: var(--panel);
}
.soon-panel .badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--accent); background: rgba(255,119,34,0.12);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.soon-panel p { color: var(--muted); max-width: 440px; margin: 0 auto; }

.button {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius); padding: 9px 18px;
  font-size: 13px; font-weight: 700;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--accent); color: var(--accent-ink); border: 0; }
.button-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

.crosslinks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.project-links {
  margin: 28px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.project-links-title {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
}
.project-links > div { display: flex; flex-wrap: wrap; gap: 8px; }
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.project-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.project-links a span { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 32px; margin-top: 20px;
  color: var(--muted); font-size: 12.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.site-footer a { color: var(--muted); font-weight: 600; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 1024px) {
  .layout { flex-direction: column; }
  .nav-toggle { display: flex; }
  .sidebar {
    display: none;
    position: static;
    width: calc(100% - 32px);
    height: auto;
    max-height: min(68vh, 680px);
    margin: 8px 16px 0;
    padding: 16px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
  }
  .sidebar[data-open="true"] { display: block; }
  .content { padding: 28px 20px 60px; max-width: 100%; }
}

@media (max-width: 640px) {
  .site-header { padding: 10px 14px; gap: 12px; }
  .brand { gap: 8px; }
  .brand img { height: 30px; }
  .brand .tag { display: none; }
  .header-actions { gap: 8px; }
  .header-actions a.home-link {
    max-width: 112px;
    overflow-wrap: anywhere;
    text-align: right;
    line-height: 1.2;
  }
  .content { padding: 24px 16px 52px; }
  .content h1 { font-size: clamp(26px, 9vw, 32px); line-height: 1.2; }
  .site-footer { padding: 20px 16px; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 360px) {
  .site-header { align-items: flex-start; }
  .header-actions { align-items: flex-start; }
  .brand .name { font-size: 13px; }
  .header-actions a.home-link { max-width: 86px; font-size: 11px; }
  .nav-toggle { width: calc(100% - 24px); margin-inline: 12px; }
  .sidebar { width: calc(100% - 24px); margin-inline: 12px; }
  pre { padding: 12px; }
}
