:root {
  color-scheme: dark;
  --bg: #151a22;
  --window: #313946;
  --title: #3b4452;
  --panel: #252c35;
  --panel-soft: #2d3541;
  --panel-strong: #1f252d;
  --editor: #171d24;
  --editor-soft: #202730;
  --text: #eef4fb;
  --muted: #aab5c1;
  --dim: #75808d;
  --line: rgba(205, 216, 226, 0.14);
  --line-strong: rgba(205, 216, 226, 0.24);
  --accent: #7db6ff;
  --accent-soft: rgba(125, 182, 255, 0.14);
  --green: #7fd88a;
  --red: #ff7777;
  --orange: #ffc266;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 182, 255, 0.16), transparent 28rem),
    linear-gradient(180deg, #202734 0%, #11161d 54%, #0b0f14 100%);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.demo-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 22, 29, 0.84);
  padding: 0.72rem 4vw;
  backdrop-filter: blur(18px);
}

.brand,
.demo-header nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  font-weight: 820;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: linear-gradient(135deg, #202833, #5f738c);
  font-size: 0.78rem;
}

.demo-header nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 740;
  text-decoration: none;
}

.demo-header nav a:hover,
.demo-header nav a:focus-visible {
  color: var(--text);
}

.demo-shell {
  padding: clamp(1rem, 3vw, 2rem) 4vw 4rem;
}

.demo-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: end;
  max-width: 1440px;
  margin: 0 auto 1rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.3rem, 5.2vw, 5.2rem);
  line-height: 0.94;
}

.demo-intro p:not(.eyebrow) {
  max-width: 780px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.52;
}

.demo-cues {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  max-width: 420px;
}

.demo-cues span,
.tabs button,
.sidebar-switcher button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 0.34rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 760;
}

.app-window {
  position: relative;
  overflow: hidden;
  max-width: 1440px;
  min-height: 760px;
  margin: 0 auto;
  border: 1px solid rgba(205, 216, 226, 0.24);
  border-radius: 14px;
  background: var(--window);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.window-titlebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #424b59, var(--title));
  padding: 0.62rem 0.78rem;
}

.traffic-lights {
  display: flex;
  gap: 0.42rem;
}

.traffic-lights span {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
}

.traffic-lights span:nth-child(1) {
  background: #ff5f57;
}

.traffic-lights span:nth-child(2) {
  background: #ffbd2e;
}

.traffic-lights span:nth-child(3) {
  background: #28c840;
}

.window-title {
  display: flex;
  gap: 0.55rem;
  min-width: 0;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.window-title strong {
  color: var(--text);
}

.toolbar-actions {
  display: flex;
  gap: 0.45rem;
}

.toolbar-actions button,
.panel-close {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 760;
}

.toolbar-actions button:hover,
.toolbar-actions button:focus-visible,
.panel-close:hover,
.panel-close:focus-visible {
  border-color: rgba(125, 182, 255, 0.44);
  background: rgba(125, 182, 255, 0.13);
}

.workspace {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  min-height: 704px;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #39424f, #303944);
  padding: 0.72rem;
}

.sidebar-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.sidebar-switcher button {
  width: 100%;
  border-radius: 8px;
}

.sidebar-switcher button.is-active,
.tabs button.is-active {
  border-color: rgba(125, 182, 255, 0.42);
  background: var(--accent-soft);
  color: #dcecff;
}

.search-field {
  display: grid;
  gap: 0.36rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.search-field input,
.command-palette input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 0.55rem 0.62rem;
}

.file-list {
  display: grid;
  gap: 0.14rem;
  margin-top: 0.72rem;
}

.file-button {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.44rem;
  text-align: left;
}

.file-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-button small {
  color: rgba(170, 181, 193, 0.68);
}

.file-button .file-icon {
  color: #57a9ff;
}

.file-button.is-active {
  border-color: rgba(125, 182, 255, 0.32);
  background: rgba(125, 182, 255, 0.18);
  color: #e8f2ff;
}

.editor-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  background: var(--editor);
}

.tabs {
  display: flex;
  gap: 0.38rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #252d36, #202730);
  padding: 0.58rem 0.72rem;
}

.tabs button {
  display: inline-flex;
  max-width: 220px;
  align-items: center;
  border-radius: 8px;
  white-space: nowrap;
}

.editor-pane {
  min-width: 0;
}

.editor-pane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--editor-soft);
  padding: 0.58rem 0.86rem;
  color: var(--muted);
}

.editor-pane header span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-canvas {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 566px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 68px 68px,
    var(--editor);
}

.line-numbers {
  min-width: 3.4rem;
  margin: 0;
  border-right: 1px solid var(--line);
  padding: 1rem 0.6rem 1rem 0;
  color: var(--dim);
  font: 0.88rem/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  list-style: none;
  text-align: right;
  user-select: none;
}

.editor-pane pre {
  min-width: 0;
  min-height: 566px;
  margin: 0;
  overflow: auto;
  padding: 1rem 1.1rem;
  color: #dce8ef;
  font: 0.9rem/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid var(--line);
  background: #3a4350;
  padding: 0.42rem 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.bottom-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 274px;
  z-index: 5;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 48%;
  border-top: 1px solid var(--line-strong);
  background: rgba(31, 37, 45, 0.98);
  box-shadow: 0 -22px 48px rgba(0, 0, 0, 0.24);
  transform: translateY(calc(100% - 2.65rem));
  transition: transform 180ms ease;
}

.bottom-panel.is-open {
  transform: translateY(0);
}

.bottom-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.62rem;
}

.panel-tabs {
  display: flex;
  gap: 0.4rem;
}

.panel-tabs button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 0.36rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 760;
}

.panel-tabs button.is-active {
  border-color: rgba(125, 182, 255, 0.42);
  background: var(--accent-soft);
  color: var(--text);
}

.panel-content {
  min-height: 210px;
  overflow: auto;
  padding: 0.72rem;
}

.git-panel,
.terminal-panel {
  display: grid;
  gap: 0.56rem;
}

.git-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0.58rem 0.65rem;
}

.git-row b,
.terminal-panel b {
  color: var(--text);
}

.git-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.badge {
  border-radius: 999px;
  background: rgba(125, 182, 255, 0.14);
  color: #dcecff;
  padding: 0.14rem 0.42rem;
  font-size: 0.74rem;
  font-weight: 820;
}

.terminal-panel pre {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111820;
  color: #dce8ef;
  padding: 0.8rem;
  font: 0.86rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: auto;
}

.command-palette {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  background: rgba(7, 10, 14, 0.42);
  padding-top: 8vh;
}

.command-palette[hidden] {
  display: none;
}

.palette-card {
  width: min(620px, calc(100% - 2rem));
  border: 1px solid rgba(205, 216, 226, 0.24);
  border-radius: 12px;
  background: rgba(42, 50, 61, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  padding: 0.9rem;
}

.palette-card label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.command-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.command-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.56rem 0.65rem;
}

.command-item small {
  color: var(--muted);
}

.noscript-note {
  max-width: 1440px;
  margin: 1rem auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 1rem;
}

@media (max-width: 940px) {
  .demo-header,
  .demo-intro,
  .window-titlebar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .demo-header,
  .demo-header nav,
  .toolbar-actions,
  .status-bar {
    flex-wrap: wrap;
  }

  .demo-intro {
    align-items: start;
  }

  .demo-cues {
    justify-content: flex-start;
  }

  .app-window,
  .workspace,
  .editor-canvas,
  .editor-pane pre {
    min-height: 0;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bottom-panel {
    position: static;
    max-height: none;
    transform: none;
  }

  .bottom-panel:not(.is-open) .panel-content {
    display: none;
  }
}

@media (max-width: 620px) {
  .demo-header {
    align-items: flex-start;
    padding-inline: 1rem;
  }

  .demo-shell {
    padding-inline: 0.75rem;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .window-titlebar {
    gap: 0.65rem;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .line-numbers {
    min-width: 2.7rem;
    padding-right: 0.45rem;
  }

  .editor-pane pre {
    font-size: 0.82rem;
    padding-inline: 0.75rem;
  }

  .status-bar {
    justify-content: flex-start;
    gap: 0.6rem;
  }
}
