/* ==========================================================================
   VIA Studio — public demo (read-only)
   Cinematic ultra-dark agency aesthetic. Mirrors the showcase palette.
   ========================================================================== */

:root {
  --bg: #000;
  --ink: #fff;
  --mute: #8a8a93;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.05);
  --magenta: #ff0080;
  --blue: #0066ff;
  --grad: linear-gradient(90deg, var(--magenta), var(--blue));

  --bar-h: 60px;
  --banner-h: 36px;
  --strip-h: 168px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  overflow: hidden;
  height: 100%;
}
body {
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 0, 128, 0.10), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(0, 102, 255, 0.08), transparent 60%);
  background-attachment: fixed;
  display: grid;
  grid-template-rows: var(--banner-h) var(--bar-h) 1fr var(--strip-h);
  height: 100vh;
}
::selection { background: var(--magenta); color: #fff; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ----- DEMO BANNER ----- */
#demo-banner {
  height: var(--banner-h);
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(255, 0, 128, 0.18), rgba(0, 102, 255, 0.18));
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.92);
  position: relative; z-index: 30;
}
#demo-banner .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
}
#demo-banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
#demo-banner strong { font-weight: 600; color: #fff; }

/* ----- TOP BAR ----- */
.topbar {
  height: var(--bar-h);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad);
  font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 15px; letter-spacing: -0.04em;
  color: #000;
  box-shadow: 0 0 24px rgba(255, 0, 128, 0.4);
}
.brand .proj-name {
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  color: #fff;
}
.brand .proj-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  color: var(--mute); margin-top: 2px;
}

.tabs { display: flex; gap: 4px; justify-self: center; }
.tab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: lowercase;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.tab:hover { color: #fff; }
.tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.actions { display: flex; gap: 8px; justify-self: end; }
.ab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 12.5px;
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease;
}
.ab svg { width: 14px; height: 14px; }
.ab:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.07); }
.ab.primary {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 8px 28px -10px rgba(255, 0, 128, 0.55);
}
.ab.primary:hover { box-shadow: 0 8px 28px -10px rgba(255, 0, 128, 0.85); }

/* ----- WORKSPACE (3-col) ----- */
.workspace {
  display: grid;
  grid-template-columns: 200px 1fr 320px;
  min-height: 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 0 1fr 280px; }
  .rail { display: none; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .inspector { display: none; }
}

/* ----- LEFT RAIL ----- */
.rail {
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.6);
  padding: 18px 12px;
  overflow-y: auto;
}
.rail-section { margin-bottom: 22px; }
.rail-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
  padding: 0 4px 8px;
}
.rail-item, .rail-mod {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  color: #cfcfd6;
  font-family: 'Space Grotesk', sans-serif; font-size: 12.5px; font-weight: 500;
  margin-bottom: 5px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.rail-item:hover { border-color: rgba(255, 255, 255, 0.25); color: #fff; background: rgba(255, 255, 255, 0.05); }
.rail-mod { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.04em; color: #cfcfd6; cursor: default; }

.ri-d { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ri-d.mag { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.ri-d.blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.ri-d.w { background: #fff; }

/* ----- STAGE / CANVAS ----- */
.stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.025), transparent 70%),
    #050505;
  position: relative;
  overflow: hidden;
}
.stage-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}
.stage-lbl {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
}
.stage-ctrls {
  display: inline-flex; gap: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--mute);
}
.stage-ctrls span { display: inline-flex; align-items: center; gap: 6px; }
.stage-ctrls .zoom { color: #fff; }

.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.mag { background: var(--magenta); }
.dot.blue { background: var(--blue); }
.dot.w { background: #fff; }

.canvas {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
svg.flow {
  width: 100%; height: 100%;
  display: block;
}

/* nodes (interactive) */
.flow .node { cursor: pointer; }
.flow .node-rect { transition: filter 200ms ease, stroke-width 160ms ease; }
.flow .node:hover .node-rect { filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.18)); }
.flow .node.is-selected .node-rect {
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 18px rgba(255, 0, 128, 0.55));
}
.flow .port { transition: r 140ms ease; }
.flow .node:hover .port { r: 7; }

@media (prefers-reduced-motion: no-preference) {
  .flow .node-rect.live { filter: drop-shadow(0 0 14px var(--magenta)); }
  .flow path.dash { stroke-dasharray: 6 8; animation: dash 1.6s linear infinite; }
  @keyframes dash { to { stroke-dashoffset: -28; } }
  .pulse { animation: pulse 2.6s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .flow path.dash { stroke-dasharray: none; animation: none; }
}

.stage-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.6);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--mute); letter-spacing: 0.06em;
}
.sf-item { display: inline-flex; align-items: center; gap: 6px; }
.sf-spacer { flex: 1; }
.sf-hint { color: rgba(255, 255, 255, 0.55); }

/* ----- INSPECTOR ----- */
.inspector {
  border-left: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.7);
  padding: 18px 18px 24px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 16px;
}
.ins-head { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.ins-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 8px;
}
.ins-title {
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 19px;
  letter-spacing: -0.01em;
  color: #fff;
}
.ins-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--mute);
}
.ins-section { display: flex; flex-direction: column; gap: 6px; }
.ins-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
}
.ins-val { font-size: 13px; color: #fff; line-height: 1.5; }
.ins-val.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #e2e2ea;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ins-val.small { font-size: 10.5px; padding: 6px 8px; }
.ins-params {
  display: grid; gap: 4px;
  border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}
.ip-row {
  display: flex; justify-content: space-between; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
}
.ip-row span:first-child { color: var(--mute); letter-spacing: 0.04em; }
.ip-row span:last-child { color: #fff; }
.ins-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #fff;
}
.ins-actions { display: flex; gap: 8px; margin-top: 6px; }
.ib {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease;
}
.ib:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); }
.ib.ghost { background: transparent; }

.ins-hint {
  margin-top: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.06em; text-align: center;
  padding-top: 8px;
}

/* ----- BOTTOM STORYBOARD STRIP ----- */
.strip-wrap {
  height: var(--strip-h);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.85);
  padding: 10px 18px 14px;
  display: flex; flex-direction: column;
  gap: 8px;
  /* ensure it sits above the dcta footer */
  margin-bottom: 0;
}
.strip-head {
  display: flex; align-items: center; justify-content: space-between;
}
.sh-lbl, .sh-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute);
}
.sh-lbl { color: #fff; }

.strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}
@media (max-width: 1000px) { .strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px)  { .strip { grid-template-columns: repeat(2, 1fr); } }

.frame {
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: flex-end;
  padding: 8px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.frame:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.35); }
.frame.is-active {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta), 0 8px 28px -10px rgba(255, 0, 128, 0.5);
}
.frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}
.frame .num {
  position: absolute; top: 6px; left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; color: #fff; letter-spacing: 0.14em;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px; border-radius: 3px;
  z-index: 2;
}
.frame .lbl {
  position: relative; z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: #fff; letter-spacing: 0.04em;
}
.frame .glyph {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.85); z-index: 1;
}
.frame .glyph svg { width: 50%; height: 50%; opacity: 0.55; }

.frame.f1 { background: linear-gradient(135deg, #1a0033, #330066, #5500aa); }
.frame.f2 { background: radial-gradient(circle at 30% 30%, #ff0080, #330033 70%); }
.frame.f3 { background: linear-gradient(45deg, #001a4d, #0066ff, #00ccff); }
.frame.f4 { background: linear-gradient(135deg, #0a0a0a 0%, #330000 50%, #ff0080 110%); }
.frame.f5 { background: radial-gradient(circle at 70% 30%, #0066ff, #000a3a 70%); }
.frame.f6 { background: linear-gradient(225deg, #ff0080 0%, #5500aa 50%, #0066ff 100%); }

/* ----- TOAST ----- */
#toast {
  position: fixed;
  left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--strip-h) + 60px);
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em;
  color: #fff;
  opacity: 0; pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9991;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
#toast.is-on {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ----- nudge dcta footer up so it doesn't cover the strip ----- */
/* dcta-footer is fixed; the strip is the bottom row, so the dcta footer
   already sits at the very bottom — that's fine, it's a thin sales bar. */
