:root {
  --bg: #08111f;
  --bg-accent: #13253f;
  --panel: rgba(10, 18, 33, 0.8);
  --panel-strong: rgba(7, 14, 27, 0.94);
  --line: rgba(162, 201, 255, 0.18);
  --text: #eef5ff;
  --text-muted: #9db4d6;
  --cyan: #78d7ff;
  --cyan-strong: #2fb6f4;
  --lime: #b6ff8e;
  --amber: #ffcb7d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(76, 151, 255, 0.28), transparent 28%),
    radial-gradient(circle at right, rgba(182, 255, 142, 0.12), transparent 22%),
    linear-gradient(160deg, #040914 0%, #091624 58%, #060b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 85%);
}

button,
a,
input,
audio {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--cyan);
}

.app-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.toolbar,
.workspace {
  position: relative;
  z-index: 1;
}

.topbar,
.toolbar,
.surface-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
  border-radius: var(--radius);
}

.topbar h1,
.toolbar h2,
.inspector h3,
.card-title,
.hero-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.topbar h1 {
  font-size: clamp(2rem, 2.6vw, 3.15rem);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 18px;
  color: var(--text-muted);
}

.breadcrumb-link,
.inline-button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  padding: 0;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

.breadcrumb-separator {
  opacity: 0.45;
}

.view-switch {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-button,
.tag-button {
  border: 0;
  color: var(--text);
  background: transparent;
  border-radius: 999px;
  transition: 160ms ease;
}

.view-button {
  padding: 10px 16px;
}

.view-button.is-active,
.tag-button.is-active {
  background: linear-gradient(135deg, rgba(47, 182, 244, 0.96), rgba(120, 215, 255, 0.84));
  color: #00131b;
  font-weight: 700;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border-radius: var(--radius);
}

.toolbar-copy p,
.inspector p,
.empty-state p,
.card-copy,
.muted-copy,
.hero-copy,
.asset-note,
.audio-card p,
.model-preview-hint {
  color: var(--text-muted);
}

.toolbar-copy p,
.inspector p,
.card-copy,
.hero-copy {
  line-height: 1.6;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tag-button {
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr);
  gap: 20px;
}

.surface-panel {
  border-radius: var(--radius);
  overflow: hidden;
}

.surface-panel-main {
  min-height: 72vh;
}

.view-surface {
  min-height: 72vh;
}

.view-surface[hidden] {
  display: none;
}

.browser-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 20px;
}

.browser-hero {
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(120, 215, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(28, 66, 123, 0.85), rgba(13, 25, 45, 0.65)),
    radial-gradient(circle at top right, rgba(182, 255, 142, 0.14), transparent 30%);
}

.hero-title {
  font-size: clamp(1.4rem, 2vw, 2rem);
  margin-bottom: 12px;
}

.browser-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.node-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(162, 201, 255, 0.12);
  background: linear-gradient(180deg, rgba(14, 24, 42, 0.92), rgba(7, 13, 24, 0.96));
  transition: transform 160ms ease, border-color 160ms ease;
}

.node-card:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 215, 255, 0.34);
}

.node-card.is-selected {
  border-color: rgba(182, 255, 142, 0.38);
  box-shadow: 0 0 0 1px rgba(182, 255, 142, 0.14) inset;
}

.card-type {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--amber);
  font-size: 0.8rem;
}

.card-title {
  font-size: 1.15rem;
}

.card-copy {
  margin: 0;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.card-button {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(120, 215, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.card-button.primary {
  background: rgba(47, 182, 244, 0.14);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 64vh;
  padding: 32px;
  text-align: center;
}

.inspector {
  padding: 22px;
  background: var(--panel-strong);
}

.inspector-header,
.inspector-meta {
  display: grid;
  gap: 10px;
}

.inspector-body {
  margin: 18px 0 24px;
  display: grid;
  gap: 16px;
}

.media-preview {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.model-preview-card {
  display: grid;
  gap: 12px;
}

.model-preview-frame {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(120, 215, 255, 0.14);
  background:
    radial-gradient(circle at top, rgba(47, 182, 244, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(11, 22, 38, 0.92), rgba(6, 11, 20, 0.98));
}

.model-preview-frame .a-canvas,
.model-preview-frame a-scene {
  width: 100% !important;
  height: 280px !important;
}

.media-preview img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  display: block;
}

.media-preview figcaption {
  padding: 10px 12px 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.media-preview.is-missing::after {
  content: "Missing image asset";
  display: block;
  padding: 16px;
  color: var(--amber);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-pill,
.asset-note {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.audio-card audio {
  width: 100%;
}

.view-surface-3d {
  position: relative;
  min-height: 72vh;
  background: #050c16;
}

.scene-shell {
  position: relative;
  height: 72vh;
}

.scene-caption {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(162, 201, 255, 0.16);
  background: rgba(5, 13, 24, 0.72);
  backdrop-filter: blur(16px);
}

.scene-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.scene-action-button {
  border: 1px solid rgba(120, 215, 255, 0.26);
  background: rgba(7, 18, 32, 0.82);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  backdrop-filter: blur(14px);
}

.scene-caption h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
}

.scene-caption p:last-child {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .inspector {
    order: -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
  }

  .topbar,
  .toolbar {
    padding: 18px;
  }

  .topbar,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .view-switch {
    width: 100%;
  }

  .view-button {
    flex: 1;
  }
}
