/* @level scene */
/*
 * scene.css — the page's layout grid: topbar + sidebar + main.
 *
 * Loaded by index.html directly (NOT via bridge.loadStyle) so the
 * grid renders before JS executes — no FOUC, no reflow when
 * organisms mount.
 *
 * 16m: introduced when the body went from a vertical stack to a
 * two-column grid. The slot classes are scene-level chrome; the
 * organisms that mount into them own their own appearance.
 */

body {
  margin: 0;
  /* The DEFAULT is now the humanist sans — prose + labels read as design, not code. The technical bits
   * (dial values, ports, clock, counts) re-declare --m-font-mono so they stay precise. */
  font-family: var(--m-font-sans);
  font-size: var(--m-size-font-md);
  -webkit-font-smoothing: antialiased;        /* crisper sans on macOS (no layout change) */
  -moz-osx-font-smoothing: grayscale;
  background: var(--m-surface-base);
  color: var(--m-content-secondary);
  display: grid;
  grid-template-columns: 220px 1fr;   /* nav arc: tighter sidebar — the compact tiles don't need 280px */
  grid-template-rows: auto 1fr;
  grid-template-areas: "topbar topbar" "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* Hamburger toggle (scene.js): the palette sidebar is visible by DEFAULT; collapsing it — only on an
   explicit hamburger click, never auto-hidden — drops its column to 0 and hides it, handing the full
   width to the canvas. A second click restores it. */
/* Collapsing the palette keeps ONLY its hamburger visible (so it can always be reopened — Ross): the search
   + the tile list hide, and the sidebar narrows to fit just the hamburger. The canvas takes the rest. */
body.palette-hidden { grid-template-columns: auto 1fr; }
body.palette-hidden .page-sidebar { overflow: visible; padding: var(--m-size-space-2); }
body.palette-hidden .palette-search-wrap,
body.palette-hidden #palette { display: none; }

.page-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--m-size-space-3);
  padding: var(--m-size-space-2) var(--m-size-space-4);
  border-bottom: 1px solid var(--m-border-default);
}
/* The audio/stats + Save/Open controls, pinned to the right. The Save/Open PROGRESS is the first
   child (left of [audio]); growing it widens this group leftward (right edge fixed) so the buttons
   never shift. The Project Name field stays at the far left of the topbar. */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--m-size-space-3);
}

.page-sidebar {
  grid-area: sidebar;
  overflow-y: auto;
  padding: var(--m-size-space-3);
  border-right: 1px solid var(--m-border-default);
}

.page-main {
  grid-area: main;
  overflow-y: auto;
  padding: var(--m-size-space-3) var(--m-size-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--m-size-space-3);
}

/* ── Scrollbars (16n) ──────────────────────────────────────────
 *
 * One scrollbar style across the app — quiet, thin, drawn from
 * the design tokens so it stays coherent across themes. The
 * standard `scrollbar-*` properties cover Firefox and modern
 * Chromium; the `::-webkit-scrollbar` pseudo-elements cover
 * older Chromium and Safari. The `*` selector cascades into
 * every scrollable element (sidebar, main, log, palette grid,
 * any future surface) without each having to opt in.
 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--m-border-emphasis) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--m-border-default);
  border-radius: var(--m-size-radius-sm);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--m-border-emphasis);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
