/* Baddy shell v1 — left navigation rail + view switching + calmer surfaces.
 * Structure inspired by modern browser video editors (icon rail → drawer
 * panels → canvas); all visuals are Baddy's own. Loads AFTER style.css and
 * deliberately overrides the busiest pieces of the old landing. */

:root {
  --sh-bg: #07090d;
  --sh-rail: #0a0e14;
  --sh-surface: #0d1117;
  --sh-card: #10151c;
  --sh-line: rgba(255, 255, 255, 0.07);
  --sh-text: #e8edf2;
  --sh-muted: #8b96a0;
  --sh-accent: #b7f542;
  --sh-cyan: #46e3ff;
  --sh-radius: 14px;
}

/* ---------- layout: rail + content ---------- */
body.has-rail {
  background: var(--sh-bg);
  padding-left: 76px;
}
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  background: var(--sh-rail);
  border-right: 1px solid var(--sh-line);
  z-index: 60;
}
.rail-brand {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(183, 245, 66, 0.14), rgba(70, 227, 255, 0.1));
  border: 1px solid var(--sh-line);
}
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 62px;
  padding: 9px 0 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sh-muted);
  font: 600 9.5px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.rail-btn .ri {
  font-size: 19px;
  line-height: 1;
}
.rail-btn:hover {
  color: var(--sh-text);
  background: rgba(255, 255, 255, 0.05);
}
.rail-btn.active {
  color: var(--sh-accent);
  background: rgba(183, 245, 66, 0.1);
}
.rail-spacer {
  flex: 1;
}

/* ---------- views ---------- */
.views {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 26px 60px;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.page-head {
  margin: 6px 0 22px;
}
.page-head h1 {
  font: 700 30px/1.15 "Space Grotesk", Inter, sans-serif;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-head h1 .grad {
  background: linear-gradient(90deg, var(--sh-accent), var(--sh-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .sub {
  color: var(--sh-muted);
  font-size: 14.5px;
  max-width: 640px;
  margin: 0;
  text-align: left;
}

/* ---------- calmer create view: retire the old hero chrome ---------- */
body.has-rail nav.old-top,
body.has-rail .hero-media,
body.has-rail .glow {
  display: none !important;
}
body.has-rail .hero {
  padding: 0;
  min-height: 0;
  text-align: left;
}
body.has-rail .drop {
  margin: 0;
  border-radius: var(--sh-radius);
  background: var(--sh-card);
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
}
body.has-rail .drop:hover,
body.has-rail .drop.over {
  border-color: rgba(183, 245, 66, 0.55);
  background: #11181f;
}
body.has-rail .vopts {
  margin: 14px 0 0;
  max-width: none;
  border-radius: var(--sh-radius);
  background: var(--sh-card);
  border: 1px solid var(--sh-line);
}
body.has-rail .drop {
  max-width: none;
}
body.has-rail .chips {
  justify-content: flex-start;
  margin: 16px 0 0;
}
body.has-rail .panel-wrap {
  padding: 0;
  margin: 14px 0 0;
}
body.has-rail .panel {
  border-radius: var(--sh-radius);
  background: var(--sh-card);
  border: 1px solid var(--sh-line);
}
.how-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.how-strip .hs {
  padding: 12px 14px;
  border: 1px solid var(--sh-line);
  border-radius: 12px;
  background: var(--sh-surface);
}
.how-strip b {
  display: block;
  font: 700 12.5px/1.3 Inter, sans-serif;
  color: var(--sh-text);
  margin-bottom: 3px;
}
.how-strip span {
  color: var(--sh-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

/* ---------- library view ---------- */
body.has-rail .queue,
body.has-rail .gallery {
  padding: 0;
  margin: 0 0 26px;
}
body.has-rail .gallery-head h2 {
  font: 700 18px/1.2 "Space Grotesk", Inter, sans-serif;
}
body.has-rail footer {
  border-top: 1px solid var(--sh-line);
  margin-top: 30px;
}

/* ---------- studio chrome refresh (ids untouched) ---------- */
.studio {
  background: var(--sh-bg);
}
.studio .studio-top {
  background: var(--sh-rail);
  border-bottom: 1px solid var(--sh-line);
}
.studio .studio-layers,
.studio .studio-inspector {
  background: var(--sh-surface);
  border-color: var(--sh-line);
}
.studio .rail-title {
  font: 700 10.5px/1 Inter, sans-serif;
  letter-spacing: 0.12em;
  color: var(--sh-muted);
  text-transform: uppercase;
}
.studio .transport,
.studio .timeline-pro {
  background: var(--sh-rail);
  border-top: 1px solid var(--sh-line);
}
.studio .canvas-bar {
  border-bottom: 1px solid var(--sh-line);
}

/* ---------- studio tool rail + drawer (icon → pane, media = 4-up grid) --- */
.studio .studio-workspace {
  grid-template-columns: auto minmax(420px, 1fr) 294px;
}
.studio-side {
  display: flex;
  width: auto;
  padding: 0;
  overflow: hidden;
}
.studio-toolrail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 54px;
  padding: 10px 5px;
  background: var(--sh-rail);
  border-right: 1px solid var(--sh-line);
  flex: 0 0 auto;
}
.st-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sh-muted);
  font: 600 9px/1 Inter, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.st-tool span {
  font-size: 15px;
  line-height: 1;
}
.st-tool:hover {
  color: var(--sh-text);
  background: rgba(255, 255, 255, 0.05);
}
.st-tool.active {
  color: var(--sh-accent);
  background: rgba(183, 245, 66, 0.1);
}
.studio-drawer {
  width: 236px;
  overflow-y: auto;
  padding: 12px;
  transition: width 0.18s ease;
}
.studio-side.media-open .studio-drawer {
  width: 470px;
}
.drawer-pane {
  display: none;
}
.drawer-pane.active {
  display: block;
}

/* Media pane: rally cards as a 4-up thumbnail grid. */
.drawer-pane[data-pane="media"] .rally-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
}
.drawer-pane[data-pane="media"] .rcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line);
}
.drawer-pane[data-pane="media"] .rcard.off {
  opacity: 0.45;
}
.drawer-pane[data-pane="media"] .rcard-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #000;
  pointer-events: none;
}
.drawer-pane[data-pane="media"] .rcard-grip {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.drawer-pane[data-pane="media"] .rcard-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  display: flex;
  gap: 2px;
}
.drawer-pane[data-pane="media"] .rcard-body {
  padding: 6px 7px 7px;
}
.drawer-pane[data-pane="media"] .rcard-note {
  display: none;
}
.drawer-pane[data-pane="media"] .rcard-meta {
  margin-top: 2px;
}
/* Layers/list panes keep the compact list card: hide the thumb there. */
.drawer-pane[data-pane="layers"] .rcard-thumb {
  display: none;
}

/* Compose clip library: 4-up grid too. */
.clip-library-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* ---------- responsive: rail becomes a bottom bar ---------- */
@media (max-width: 840px) {
  body.has-rail {
    padding-left: 0;
    padding-bottom: 66px;
  }
  .rail {
    inset: auto 0 0 0;
    width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 4px 8px;
    border-right: 0;
    border-top: 1px solid var(--sh-line);
  }
  .rail-brand,
  .rail-spacer,
  .rail-btn[data-secondary] {
    display: none;
  }
  .rail-btn {
    width: auto;
    padding: 7px 12px 5px;
  }
  .how-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .views {
    padding: 20px 16px 40px;
  }
}
