/* ==========================================================================
   VITA Demos — Ultra-Minimalist Distill-Inspired Stylesheet
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-hover: #eceef2;

  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.22);

  --ink: #181c22;
  --ink-2: #5c6470;
  --ink-3: #969ea9;

  --accent: #0f5f8c;
  --ok: #197a56;
  --danger: #c0392b;

  --radius: 6px;
  --page-w: 920px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.mono {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Full-Viewport Shared Living Background & Stacking Context
   -------------------------------------------------------------------------- */
#vita-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

#vita-topbar,
.vita-topbar {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Minimal Topbar (No borders, no noise)
   -------------------------------------------------------------------------- */
.vita-topbar-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 18px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vita-brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.vita-brand:hover {
  color: var(--accent);
}

.vita-switcher {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.vita-switcher:hover,
.vita-switcher:focus {
  background: var(--bg-soft);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Page Shell & Shared Icon Buttons / Segmented Groups
   -------------------------------------------------------------------------- */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 20px 24px 56px;
}

.icon-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.icon-btn:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
}

.icon-btn.active {
  background: var(--ink);
  color: #ffffff;
}

.icon-btn.danger {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.08);
}

.icon-btn.danger:hover {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}

.icon-btn.danger.active {
  background: var(--danger);
  color: #ffffff;
}

.icon-btn.ghost {
  background: transparent;
}

.icon-btn.ghost:hover {
  background: var(--bg-soft);
}

.icon-btn.ghost.active {
  background: var(--ink);
  color: #ffffff;
}

.icon-btn.ghost.danger {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.08);
}

.icon-btn.ghost.danger:hover {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}

.seg-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  padding: 2px;
  border-radius: var(--radius);
  gap: 2px;
}

.seg-group .icon-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 7px;
  background: transparent;
}

.seg-group .icon-btn:hover {
  background: var(--bg-hover);
}

.seg-group .icon-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pill-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.pill-btn:hover {
  color: var(--ink);
}

.pill-btn.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.quiet-stat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* Slim Minimal Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

.home-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(24, 28, 34, 0.06);
}

.demo-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.demo-item {
  display: block;
  padding: 10px;
  margin: 0 -10px;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
}

.demo-item:hover {
  background: rgba(24, 28, 34, 0.048);
}

/* --------------------------------------------------------------------------
   Minimal Floating Background Automaton Dock (Bottom-Center)
   -------------------------------------------------------------------------- */
.bg-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(24, 28, 34, 0.09);
  box-shadow: 0 4px 20px rgba(24, 28, 34, 0.06);
  max-width: calc(100vw - 24px);
  transition: background 0.24s ease, box-shadow 0.24s ease;
}

.bg-dock .seg-group {
  border-radius: 999px;
  padding: 2px;
  background: rgba(24, 28, 34, 0.045);
}

.bg-dock .seg-group .icon-btn {
  height: 28px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 999px;
}

.bg-dock .icon-btn.ghost {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border-radius: 999px;
}

.bg-dock .icon-btn svg {
  width: 14px;
  height: 14px;
}

.bg-dock-sep {
  width: 1px;
  height: 14px;
  background: rgba(24, 28, 34, 0.1);
  margin: 0 2px;
  flex-shrink: 0;
}

.bg-dock-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  min-width: 32px;
  text-align: right;
  padding-left: 2px;
  user-select: none;
  cursor: default;
}

@media (max-width: 480px) {
  .bg-dock {
    bottom: 12px;
    padding: 3px 8px 3px 3px;
    gap: 2px;
  }

  .bg-dock .seg-group .icon-btn {
    min-width: 26px;
    padding: 0 5px;
  }
}
