:root {
  --bg-page: #f7f7f8;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-code: #f4f6f9;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text-main: #18181b;
  --text-muted: #52525b;
  --text-faint: #71717a;
  --accent: #049EF4;
  --accent-soft: rgba(4, 158, 244, 0.10);
  --accent-border: rgba(4, 158, 244, 0.35);
  --sidebar-w: 280px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --logo-filter: none;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 22px rgba(4, 158, 244, 0.11), 0 2px 6px rgba(0, 0, 0, 0.05);
}

html.dark {
  --bg-page: #111215;
  --bg-sidebar: #16181d;
  --bg-card: #1b1e24;
  --bg-subtle: #22262e;
  --bg-code: #111318;
  --border: #272b34;
  --border-strong: #373d49;
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --accent: #049EF4;
  --accent-soft: rgba(4, 158, 244, 0.15);
  --accent-border: rgba(4, 158, 244, 0.45);
  --logo-filter: invert(0.94) hue-rotate(180deg);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(4, 158, 244, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.viewer-open {
  overflow: hidden;
}

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

code, kbd {
  font-family: var(--font-mono);
}

/* Two-pane threejs.org layout */
#layout {
  display: flex;
  min-height: 100vh;
}

#mobile-bar {
  display: none;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sidebar-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  filter: var(--logo-filter);
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-5deg) scale(1.04);
}

.brand-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.tagline {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

html:not(.dark) .sun-icon { display: none; }
html.dark .moon-icon { display: none; }

/* Minimal Quick-Start Box */
.quickstart-box {
  margin: 12px 14px 10px;
  padding: 10px 11px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quickstart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.qs-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
}

.qs-line {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.qs-line code {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.75px;
}

.c-accent {
  color: var(--accent);
  font-weight: 500;
}

.copy-row {
  padding: 4px 6px;
  margin: 0 -4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.copy-row:hover {
  background: var(--accent-soft);
}

.copy-glyph {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.copy-row:hover .copy-glyph {
  color: var(--accent);
}

.qs-keyrow {
  padding-top: 3px;
  border-top: 1px dashed var(--border);
  justify-content: flex-start;
  font-size: 11px;
  color: var(--text-muted);
}

.qs-keyrow kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.qs-arrow {
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Search Bar */
.search-wrap {
  position: relative;
  margin: 2px 14px 10px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

#search-input {
  width: 100%;
  height: 33px;
  padding: 0 30px 0 31px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#search-input:focus {
  border-color: var(--accent);
  background: var(--bg-sidebar);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.slash-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  pointer-events: none;
}

#search-input:focus ~ .slash-hint {
  display: none;
}

.clear-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

/* Sidebar Scroll & Category Pills */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 14px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.filter-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 4px 2px 7px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.cat-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

.cat-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.cat-pill.active .cat-count {
  color: var(--accent);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* Compact threejs.org-style index links in sidebar */
.sidebar-index {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.idx-group-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  margin: 8px 2px 3px;
  font-weight: 500;
}

.idx-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3.5px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idx-link:hover {
  color: var(--accent);
  background: var(--bg-subtle);
}

.idx-link.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}

.idx-ext {
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 4px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer a:hover,
.link-btn:hover {
  color: var(--accent);
}

.link-btn {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Right Main Content Area */
#content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 20px 28px 56px;
  min-width: 0;
}

.content-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.bc-root {
  color: var(--text-faint);
}

.bc-sep {
  color: var(--border-strong);
}

.bc-active {
  color: var(--accent);
  font-weight: 500;
}

.count-pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.action-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-soft);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Catalog Sections & Grid */
.catalog-section {
  margin-bottom: 38px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-heading p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-heading code {
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--accent);
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.scene-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}

.scene-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0b101d;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.scene-card:hover .card-thumb img {
  transform: scale(1.045);
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(12, 16, 26, 0.78);
  backdrop-filter: blur(8px);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card-badge.hosted {
  color: #38bdf8;
  border-color: rgba(4, 158, 244, 0.45);
}

.card-play-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(4, 158, 244, 0.92);
  color: #fff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.scene-card:hover .card-play-pill {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-card:hover .card-title {
  color: var(--accent);
}

.card-cat {
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.card-slug {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-mini-btn {
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.card-mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.card-links {
  display: inline-flex;
  gap: 5px;
}

.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   Full-Viewport Live Three.js WebGL Previewer Overlay
   ========================================================= */
#viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050811;
}

#viewer-overlay[hidden] {
  display: none !important;
}

#viewer-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#viewer-canvas-wrap:active {
  cursor: grabbing;
}

#viewer-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

#viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(5, 8, 17, 0.72);
  backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  z-index: 105;
}

#viewer-loading[hidden] {
  display: none !important;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(4, 158, 244, 0.25);
  border-top-color: #049EF4;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.viewer-toast {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(4, 158, 244, 0.4);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}

.viewer-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.viewer-top-controls {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 120;
}

.v-icon-btn,
.v-close-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 26, 0.76);
  backdrop-filter: blur(14px);
  color: #f4f4f5;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.v-icon-btn:hover,
.v-close-btn:hover {
  background: rgba(4, 158, 244, 0.28);
  border-color: rgba(4, 158, 244, 0.65);
}

/* Floating Corner Pill */
.viewer-pill {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: min(560px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(11, 15, 25, 0.80);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  color: #f4f4f5;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 120;
}

.vp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.vp-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #049EF4;
  box-shadow: 0 0 10px #049EF4;
}

#vp-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.vp-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.vp-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-mode-btn {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
}

.vp-mode-btn.active {
  border-color: rgba(4, 158, 244, 0.65);
  background: rgba(4, 158, 244, 0.22);
  color: #7dd3fc;
}

.vp-raw-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7dd3fc;
}

.vp-raw-link:hover {
  text-decoration: underline;
}

.vp-desc {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.4;
}

.vp-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.72);
  border: 1px solid rgba(4, 158, 244, 0.32);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vp-cmd-row:hover {
  border-color: #049EF4;
  background: rgba(4, 158, 244, 0.12);
}

#vp-cmd-text {
  font-size: 11.5px;
  color: #e0f2fe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-copy-btn {
  padding: 3px 9px;
  border-radius: 5px;
  background: #049EF4;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.vp-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.vp-presets {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.vp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.vp-chip:hover {
  background: rgba(4, 158, 244, 0.25);
  border-color: rgba(4, 158, 244, 0.55);
}

.vp-chip kbd {
  font-size: 10px;
  color: #7dd3fc;
}

.vp-hints {
  font-size: 11px;
  color: rgba(203, 213, 225, 0.72);
}

.vp-hints code {
  color: #93c5fd;
  font-size: 10.5px;
}

/* Copy Toast */
.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #18181b;
  color: #fff;
  border: 1px solid rgba(4, 158, 244, 0.5);
  font-family: var(--font-mono);
  font-size: 11.5px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsive Layout */
@media (max-width: 860px) {
  #mobile-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 55;
  }

  #menu-toggle {
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px;
  }

  .brand-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
  }

  #sidebar {
    top: 48px;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.2);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #content {
    margin-left: 0;
    padding: 66px 16px 40px;
  }

  .scene-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
}

/* ── terminal pass: mono, hairlines, square corners, no glow ── */
:root {
  --bg-page: #f5f5f3; --bg-sidebar: #f5f5f3; --bg-card: #f5f5f3; --bg-subtle: #ebebe8; --bg-code: #ebebe8;
  --border: #111; --border-strong: #111; --text-main: #111; --text-muted: #444; --text-faint: #777;
  --accent: #111; --accent-soft: transparent; --accent-border: #111;
  --font-sans: var(--font-mono);
  --shadow-card: none; --shadow-hover: none;
}
html.dark {
  --bg-page: #0a0c10; --bg-sidebar: #0a0c10; --bg-card: #0a0c10; --bg-subtle: #111318; --bg-code: #0e1014;
  --border: #222; --border-strong: #333; --text-main: #e4e4e7; --text-muted: #a1a1aa; --text-faint: #71717a;
  --accent: #e4e4e7; --accent-soft: transparent; --accent-border: #555;
  --logo-filter: invert(1);
}
html, body, button, input, select, textarea { font-family: var(--font-mono) !important; }
*, *::before, *::after { border-radius: 0 !important; box-shadow: none !important; text-shadow: none !important; }
[class*="card"]:hover, [class*="pill"]:hover { transform: none !important; }
.vp-dot, .spinner::after { display: none !important; }
[style*="gradient"], [class*="gradient"] { background-image: none !important; }
a:hover { text-decoration: underline; }

/* ── hero ── */
#hero { position: relative; border: 1px solid var(--border); margin-bottom: 40px; overflow: hidden; min-height: 340px; display: flex; align-items: center; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--bg-page) 0%, color-mix(in srgb, var(--bg-page) 80%, transparent) 45%, transparent 100%) !important; }
.hero-inner { position: relative; z-index: 1; display: flex; gap: 40px; align-items: center; padding: 48px 44px; }
.hero-logo { width: 168px; height: 168px; flex: none; color: var(--text-main); }
.hero-logo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.6,0,.2,1) forwards; }
.hero-logo path:nth-child(2) { animation-delay: .15s } .hero-logo path:nth-child(3) { animation-delay: .35s }
.hero-logo path:nth-child(4) { animation-delay: .45s } .hero-logo path:nth-child(5) { animation-delay: .6s }
.hero-logo path:nth-child(6) { animation-delay: .7s } .hero-logo path:nth-child(7) { animation-delay: .75s }
.hero-logo path:nth-child(n+8) { animation-delay: .9s }
.hero-fill { opacity: 0; animation: fadein .3s 1.4s forwards; }
.hero-logo:hover .hero-fill circle { animation: blink .25s; transform-origin: 163px 98px; }
@keyframes draw { to { stroke-dashoffset: 0 } }
@keyframes fadein { to { opacity: 1 } }
@keyframes blink { 50% { transform: scaleY(.1) } }
.hero-text h1 { font-size: 44px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; margin-bottom: 14px; }
.caret { animation: caret 1s steps(1) infinite; color: var(--text-faint); }
@keyframes caret { 50% { opacity: 0 } }
.hero-text > p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.hero-steps { list-style: none; border: 1px solid var(--border); background: var(--bg-page); max-width: 560px; }
.hero-steps li { display: grid; grid-template-columns: 34px 190px 1fr; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; }
.hero-steps li + li { border-top: 1px solid var(--border); }
.hero-steps li.copy-row { cursor: pointer; }
.hero-steps li.copy-row:hover { background: var(--bg-subtle); }
.hero-steps .n { color: var(--text-faint); }
.hero-steps .d { color: var(--text-muted); }
.hero-steps code { color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-steps kbd { border: 1px solid var(--border-strong); padding: 0 4px; font-size: 11px; }
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; align-items: flex-start; padding: 32px 20px; gap: 20px; }
  .hero-logo { width: 96px; height: 96px; }
  .hero-steps li { grid-template-columns: 28px 1fr; }
  .hero-steps .d { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-logo path { animation-duration: 0s; animation-delay: 0s !important; } .caret { animation: none; } }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.card-badge { display: none !important; }
#hero .hero-steps li { padding: 10px 14px !important; margin: 0 !important; grid-template-columns: 34px 130px 1fr; }
.quickstart-box { display: none !important; }
