:root {
  --editor-blue: #2d5af7;
  --editor-purple: #8b5cf6;
  --editor-green: #10b981;
  --editor-gold: #ffd26f;
  --editor-bg: #0b0c10;
  --panel-bg: #15171e;
  --border-ui: rgba(255, 255, 255, 0.06);
  --neon-cyan: #00f2ff;
  --text-main: #e8edf7;
  --text-soft: rgba(232, 237, 247, 0.72);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, #111626 0%, #0a0d15 48%, #05070c 100%);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  display: flex;
  height: 100vh;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.orbitron {
  font-family: 'Orbitron', sans-serif;
}

.sidebar-vfx {
  width: 58px;
  background: #090a0e;
  border-right: 1px solid var(--border-ui);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 24px;
  z-index: 20;
  flex-shrink: 0;
}

.app-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--editor-blue), var(--editor-purple));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  box-shadow: 0 10px 24px rgba(45,90,247,.25);
}

.tool-btn {
  color: rgba(255,255,255,.28);
  cursor: pointer;
  transition: all .2s ease;
}

.tool-btn:hover,
.tool-btn.active {
  color: var(--editor-blue);
  transform: translateY(-1px);
}

.tool-bottom {
  margin-top: auto;
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  background: rgba(10,12,18,.88);
  border-bottom: 1px solid var(--border-ui);
}

.title {
  font-size: 0.95rem;
  letter-spacing: .08em;
  color: white;
}

.subtitle {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.top-link {
  color: #9ac8ff;
  text-decoration: none;
}

.top-link:hover {
  color: white;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.86);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #39ff14;
  box-shadow: 0 0 10px rgba(57,255,20,.55);
}

.editor-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-container {
  display: flex;
  gap: 2px;
  background: #000;
  border-bottom: 1px solid var(--border-ui);
  height: 54%;
  min-height: 320px;
}

.viewer-box {
  flex: 1;
  position: relative;
  background: #040506;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.viewer-program {
  border-left: 1px solid rgba(255,255,255,.05);
}

.viewer-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.hud-top,
.hud-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.hud-label {
  font-size: 9px;
  color: rgba(255,255,255,.34);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}

.live-render {
  color: #ff7d7d;
}

.text-cyan {
  color: var(--neon-cyan);
}

.viewer-poster-wrap {
  position: absolute;
  inset: 0;
}

.viewer-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) contrast(1.02);
}

.viewer-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.18);
}

.viewer-fallback svg {
  width: 120px;
  height: 120px;
}

.video-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 14px;
}

.video-stage {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.stage-landscape {
  aspect-ratio: 16 / 9;
  width: 100%;
  align-self: center;
}

.showreel-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  pointer-events: auto;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,.32);
}

.video-overlay {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: auto;
  width: min(420px, calc(100% - 36px));
  z-index: 12;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .28s ease, transform .28s ease;
}

.video-overlay.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.glass-lite {
  background: linear-gradient(180deg, rgba(12,16,25,.78), rgba(10,13,19,.52));
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.video-overlay-card {
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.overlay-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--editor-gold);
  font-size: 0.72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.video-overlay-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.05;
}

.video-overlay-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.55;
}

@keyframes scan-move {
  0% { left: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan);
  z-index: 25;
  pointer-events: none;
  opacity: 0;
}

.viewer-box:hover .scan-line {
  animation: scan-move 3s infinite linear;
}

.timeline-section {
  flex: 1;
  background: var(--editor-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timeline-header {
  min-height: 38px;
  background: #171920;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  font-size: 10px;
  color: rgba(255,255,255,.42);
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn,
.timeline-icon {
  color: rgba(255,255,255,.72);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  cursor: pointer;
}

.icon-btn:hover {
  color: white;
}

.icon-btn svg,
.timeline-icon {
  width: 14px;
  height: 14px;
}

.timeline-time {
  color: white;
  letter-spacing: .12em;
}

.timeline-legend {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
}

.legend-item.blue {
  color: #78a9ff;
}

.legend-item.green {
  color: #70f0ba;
}

.legend-item.purple {
  color: #c0a2ff;
}

.timeline-tracks {
  flex: 1;
  overflow: auto;
  position: relative;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 100% 34px;
}

.track-row {
  display: flex;
  min-height: 34px;
  border-bottom: 1px solid rgba(255,255,255,.03);
}

.track-label {
  width: 70px;
  flex-shrink: 0;
  background: #171920;
  border-right: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.54);
}

.track-lane {
  position: relative;
  flex: 1;
  min-width: 700px;
}

.clip {
  position: absolute;
  top: 5px;
  height: 24px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  color: white;
  box-shadow: inset 2px 0 0 rgba(255,255,255,.28);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.clip:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.clip.blue {
  background: var(--editor-blue);
}

.clip.purple {
  background: var(--editor-purple);
}

.clip.green {
  background: var(--editor-green);
}

.clip.is-active {
  box-shadow:
    inset 2px 0 0 rgba(255,255,255,.35),
    0 0 14px rgba(121, 169, 255, .28);
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: white;
  z-index: 50;
  pointer-events: none;
}

.playhead::after {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid white;
}

.footer-bar {
  min-height: 38px;
  padding: 0 18px;
  background: #090a0e;
  border-top: 1px solid var(--border-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dim {
  color: rgba(255,255,255,.34);
}

.inspector-panel {
  width: 330px;
  background: #15171e;
  border-left: 1px solid var(--border-ui);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inspector-header {
  padding: 16px 18px;
  background: #1a1c23;
  border-bottom: 1px solid #000;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.inspector-scroll {
  flex: 1;
  overflow-y: auto;
}

.info-block {
  padding: 18px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.block-dark {
  background: rgba(0,0,0,.18);
}

.block-accent {
  background: rgba(45,90,247,.08);
}

.mini-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.34);
  font-weight: 700;
  margin-bottom: 8px;
}

.info-block h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: .05em;
}

.info-block p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.info-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.inspector-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--editor-blue), var(--editor-purple));
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.inspector-btn.alt {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.code-box {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.65;
  color: #9ac8ff;
  background: rgba(0,0,0,.35);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
}

.source-overlay {
  position: absolute;
  left: 24px;
  right: auto;
  bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0;
  z-index: 12;
  pointer-events: none;
}

.source-overlay-card {
  max-width: 520px;
  width: min(520px, calc(100vw - 160px));
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}

.source-overlay-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.08;
}

.source-overlay-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.source-overlay .glass-lite {
  max-width: 460px;
  backdrop-filter: blur(10px);
}

@media (max-width: 1100px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar-vfx {
    width: 100%;
    height: 58px;
    flex-direction: row;
    justify-content: center;
    padding: 0 16px;
    margin-bottom: 10px;
  }

  .topbar {
    padding-top: 15px;
    padding-bottom: 15px;
    margin-top: 5px;
  }

  .tool-bottom {
    margin-top: 0;
  }

  .workspace {
    min-height: 0;
  }

  .inspector-panel {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--border-ui);
  }

  .source-overlay {
    left: 18px;
    bottom: 18px;
  }

  .source-overlay-card {
    max-width: 460px;
    width: min(460px, calc(100vw - 120px));
  }
}

@media (max-width: 760px) {
  .topbar,
  .timeline-header,
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .viewer-container {
    flex-direction: column;
    height: auto;
  }

  .viewer-box {
    min-height: 260px;
  }

  .video-frame {
    padding: 10px;
  }

  .video-overlay {
    left: 18px;
    right: 18px;
    width: auto;
    bottom: 16px;
  }

  .video-overlay-card {
    padding: 14px 15px 13px;
  }

  .video-overlay-card h1 {
    font-size: 1.1rem;
  }

  .video-overlay-card p {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .track-label {
    width: 54px;
  }

  .source-overlay {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .source-overlay-card {
    width: 100%;
    max-width: 100%;
    padding: 14px 15px 13px;
  }

  .source-overlay-card h1 {
    font-size: 1.05rem;
    line-height: 1.12;
    margin-bottom: 8px;
  }

  .source-overlay-card p {
    font-size: 0.84rem;
    line-height: 1.4;
  }
}