/* VENDORED — do not edit here. Synced verbatim from CVERInc/demodeck @ fbe18a2.
   This demo dogfoods its own spinoff: the control panel is demodeck's contract
   (.dd-* layout + control kit, retheme via :root --dd-* overrides — accent glows
   auto-follow --dd-accent via color-mix).
   To update, re-copy demodeck.css from upstream and bump the SHA above.
   bleedblend's teal retheme + brand bits live in bleedblend-panel.css. */

/* ===========================================================================
   demodeck — a polished dark "control panel" template for open-source demos.

   A premium header, a two-column layout, and a kit of dark-themed controls:
   segmented buttons, sliders, color fields (picker + hex), toggles, styled
   selects, popovers, a live console terminal, and a copyable code box.

   Pure CSS. Pair with demodeck.js for the interactive behaviors (copy,
   popovers, color sync, console logging) — or wire your own.

   Retheme by overriding the variables in :root below.

   MIT License.
   =========================================================================== */

:root {
  --dd-accent: #8b8bff;
  --dd-accent-hover: #a9a9ff;
  --dd-accent-ink: #14132b;            /* text drawn on top of --dd-accent */
  --dd-bg: #0c0d12;
  --dd-bg-gradient:
    radial-gradient(circle at 12% 18%, rgba(120, 119, 198, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(255, 122, 89, 0.12) 0%, transparent 42%),
    #0c0d12;
  --dd-surface: rgba(255, 255, 255, 0.03);
  --dd-border: rgba(255, 255, 255, 0.08);
  --dd-text: #f2f3f8;
  --dd-text-muted: rgba(242, 243, 248, 0.6);
  --dd-radius: 16px;
  --dd-font: "Plus Jakarta Sans", "Nunito", system-ui, -apple-system, sans-serif;
  --dd-mono: "SFMono-Regular", "Courier New", Courier, monospace;
}

.dd * { box-sizing: border-box; }

/* Apply .dd to <body> (or a wrapper) to opt in to the base page styling. */
body.dd,
.dd-page {
  margin: 0;
  font-family: var(--dd-font);
  background: var(--dd-bg-gradient);
  color: var(--dd-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.dd-header {
  padding: 1.75rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--dd-border);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.dd-logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.dd-logo h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; }

.dd-badge {
  background: linear-gradient(135deg, var(--dd-accent), var(--dd-accent-hover));
  color: var(--dd-accent-ink);
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px color-mix(in srgb, var(--dd-accent) 35%, transparent);
}

.dd-ghlink {
  color: var(--dd-text);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dd-border);
  transition: all 0.2s ease;
}
.dd-ghlink:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--dd-accent); }

/* ── Main two-column layout ──────────────────────────────────────────── */
.dd-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3rem 2.5rem;
  gap: 3.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}
@media (max-width: 1024px) {
  .dd-main { grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem; }
}

/* ── Control panel ───────────────────────────────────────────────────── */
.control-panel {
  background: var(--dd-surface);
  border: 1px solid var(--dd-border);
  border-radius: 22px;
  padding: 2.25rem;
  backdrop-filter: blur(30px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.panel-section { margin-bottom: 1.75rem; }
.panel-section:last-child { margin-bottom: 0; }

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
}

.panel-section h3,
.panel-section-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--dd-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.svg-icon { display: inline-block; vertical-align: middle; }

/* ── Segmented option group (single-select buttons) ──────────────────── */
.option-group {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.option-btn {
  background: transparent;
  border: none;
  color: var(--dd-text-muted);
  padding: 0.55rem 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.option-btn.active {
  background: var(--dd-accent);
  color: var(--dd-accent-ink);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--dd-accent) 30%, transparent);
}
.option-btn:hover:not(.active) { color: var(--dd-text); background: rgba(255, 255, 255, 0.05); }

/* ── Sliders ─────────────────────────────────────────────────────────── */
.slider-container { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.slider-header { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--dd-text-muted); }
.slider-header .val { font-weight: 600; color: var(--dd-accent-hover); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--dd-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: none;
  background: var(--dd-accent); border-radius: 50%; cursor: pointer;
}

/* ── Color preset dots ───────────────────────────────────────────────── */
.color-presets { display: flex; gap: 0.75rem; }
.color-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid transparent; background-origin: border-box;
  cursor: pointer; transition: all 0.2s ease;
}
.color-btn.active { border-color: white; transform: scale(1.1); }

/* ── Toggle switch ───────────────────────────────────────────────────── */
.toggle-container {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dd-border);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem; font-weight: 500;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toggle-label { color: var(--dd-text-muted); font-weight: 600; }

.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
  position: absolute; cursor: pointer; inset: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s; border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.slider-toggle:before {
  position: absolute; content: "";
  height: 14px; width: 14px; left: 2px; bottom: 2px;
  background-color: white; transition: .3s; border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .slider-toggle {
  background-color: var(--dd-accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--dd-accent) 40%, transparent);
}
.switch input:checked + .slider-toggle:before { transform: translateX(20px); }

/* ── Styled select ───────────────────────────────────────────────────── */
.dd-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  padding-right: 32px;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dd-border);
  color: var(--dd-text);
  border-radius: 8px;
  outline: none; cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f2f3f8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.dd-select:hover { background-color: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); }
.dd-select option { background-color: var(--dd-bg); color: var(--dd-text); }

/* ── Live console terminal ───────────────────────────────────────────── */
.live-console {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: var(--dd-mono);
  overflow: hidden;
  margin-top: 0.5rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}
.terminal-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.6rem;
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }
.terminal-title { color: rgba(255, 255, 255, 0.4); font-size: 0.7rem; margin-left: 0.4rem; font-weight: bold; }

.terminal-body {
  padding: 0.6rem;
  height: 120px;
  overflow-y: auto;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #a8ffb2;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

.console-log-line { margin-bottom: 0.25rem; word-break: break-all; opacity: 0.95; }
.console-log-line.system { color: #ffda79; }
.console-log-line.state { color: #8be9fd; }
.console-log-line.error { color: #ff7b7b; }

/* ── Code snippet box ────────────────────────────────────────────────── */
.code-snippet-box {
  background: rgba(12, 13, 16, 0.95);
  border: 1px solid var(--dd-border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.code-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.6rem;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.7rem; color: var(--dd-text-muted);
}
.copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dd-text);
  padding: 0.15rem 0.4rem;
  border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.7rem;
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }
.copy-btn.copied { background: #27c93f; color: white; border-color: #27c93f; }
.code-snippet-box pre { margin: 0; padding: 0.6rem; overflow-x: auto; }
.code-snippet-box code { font-family: var(--dd-mono); font-size: 0.75rem; color: #f1fa8c; }

/* ── Edit button + popover card ──────────────────────────────────────── */
.header-edit-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dd-text-muted);
  font: inherit; font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.65rem; border-radius: 6px; cursor: pointer;
  transition: all 0.2s ease;
}
.header-edit-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--dd-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.header-edit-btn:disabled { opacity: 0.2; cursor: not-allowed; pointer-events: none; }

.popover-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex; flex-direction: column; gap: 0.8rem;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.popover-card.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.popover-row { display: flex; flex-direction: column; gap: 0.35rem; }
.popover-label { font-size: 0.7rem; font-weight: 700; color: var(--dd-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Color field (native picker + hex input) ─────────────────────────── */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-picker-label {
  position: relative; display: inline-block;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
  overflow: hidden; flex-shrink: 0;
}
.color-picker-label:hover { transform: scale(1.08); border-color: rgba(255, 255, 255, 0.6); }
.native-color-picker { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-preview-circle { display: block; width: 100%; height: 100%; border-radius: 50%; transition: background-color 0.2s ease; }

.hex-text-input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--dd-text);
  font-family: var(--dd-mono);
  font-size: 0.8rem; font-weight: 600;
  padding: 0.35rem 0.5rem; outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.hex-text-input:focus { border-color: var(--dd-accent); background: rgba(0, 0, 0, 0.4); }

/* ── Generic text input ──────────────────────────────────────────────── */
.text-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font: inherit; font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--dd-text);
  outline: none;
  transition: all 0.2s;
}
.text-input:focus { border-color: var(--dd-accent); background: rgba(0, 0, 0, 0.4); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.dd-footer {
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  padding: 3.5rem 1.5rem 3rem;
  color: var(--dd-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--dd-border);
  margin-top: 3rem;
}
.footer-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  column-gap: 1rem; row-gap: 0.5rem;
}
.footer-links.secondary { font-size: 0.75rem; }
.footer-links a { color: var(--dd-text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: #ffffff; }
.footer-links.secondary a { color: rgba(242, 243, 248, 0.4); }
.footer-links.secondary a:hover { color: var(--dd-text-muted); }
.footer-separator { color: rgba(242, 243, 248, 0.35); }

.link-underline { position: relative; display: inline-block; }
.link-underline::after {
  content: ""; position: absolute; width: 0; height: 1px; bottom: -2px; left: 0;
  background-color: currentColor; transition: width 250ms ease;
}
.link-underline:hover::after { width: 100%; }
