/* Squish Labs XPBD — demo page. A soft, rounded, "squishy" aesthetic:
   deep-slate stage, a mint/bubble accent, generous radii and soft shadows. */
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e222e;
  --line: #2a2f3d;
  --text: #e7ebf3;
  --muted: #9aa3b6;
  --accent: #45e0c4;      /* jelly mint */
  --accent-2: #7c8cff;    /* soft indigo */
  --accent-warm: #ff8ab0; /* bubblegum */
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 28px; filter: saturate(1.2); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 750; font-size: 18px; letter-spacing: 0.2px; }
.brand-mark {
  color: var(--bg);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  padding: 1px 7px; border-radius: 7px; font-size: 13px; font-weight: 800;
  vertical-align: middle;
}
.brand-tag { color: var(--muted); font-size: 12.5px; }
.top-links a {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .15s, color .15s;
}
.top-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ── Layout ── */
.layout { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.filter {
  margin: 12px; padding: 9px 12px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; outline: none;
  font-size: 13.5px;
}
.filter:focus { border-color: var(--accent); }
.demo-list { overflow-y: auto; padding: 0 8px 16px; }

.group-label {
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; padding: 14px 12px 6px;
}
.demo-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  color: var(--text); text-decoration: none;
  padding: 8px 12px; margin: 2px 0; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px; line-height: 1.25;
  transition: background .12s, border-color .12s;
}
.demo-item:hover { background: var(--panel-2); }
.demo-item .di-name { font-weight: 600; }
.demo-item .di-blurb { color: var(--muted); font-size: 12px; display: block; margin-top: 1px; }
.demo-item.active {
  background: linear-gradient(120deg, rgba(69,224,196,.14), rgba(124,140,255,.12));
  border-color: var(--accent);
}
.demo-item.active .di-name { color: var(--accent); }

/* ── Stage ── */
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 18px 22px; }
.stage-head { margin-bottom: 12px; }
#demo-title { margin: 0; font-size: 22px; font-weight: 750; }
#demo-blurb { margin: 4px 0 0; color: var(--muted); max-width: 74ch; }

.canvas-wrap {
  position: relative; flex: 1; min-height: 320px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d13;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.02);
}
#squish-canvas { display: block; width: 100%; height: 100%; outline: none; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 40%, rgba(20,24,34,.6), rgba(11,13,19,.92));
  backdrop-filter: blur(2px);
  transition: opacity .3s;
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-card { text-align: center; color: var(--text); max-width: 380px; padding: 20px; }
.overlay-card p { color: var(--muted); }
.overlay-card code {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 6px; color: var(--accent); font-size: 13px;
}
.spinner {
  width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.controls-hint { color: var(--muted); font-size: 12.5px; margin: 12px 2px 0; }
.controls-hint kbd {
  background: var(--panel-2); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-size: 11.5px;
}

.footer {
  border-top: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 12.5px; text-align: center; padding: 10px;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--line); }
  .brand-tag { display: none; }
}
