:root {
  color-scheme: dark;
  --bg: #030303;
  --text: #f4f4f4;
  --muted: #8f8f94;
  --line: rgba(255, 255, 255, 0.09);
  --panel: rgba(18, 18, 18, 0.82);
  --panel-strong: rgba(15, 15, 15, 0.94);
  --violet: #8b5cf6;
  --blue: #18a7ff;
  --green: #26d07c;
  --pink: #ec4899;
  --yellow: #f5b51b;
  --cyan: #27d6d6;
  --red: #ff453a;
  --orange: #ff7a21;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 55%, rgba(104, 61, 203, 0.22), transparent 11rem),
    #030303;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#field:active {
  cursor: grabbing;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.4rem;
  padding: 0 1.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.brand,
.nav {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 600;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.cmd-symbol {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  font-size: 0.82rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  color: rgba(255, 255, 255, 0.38);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 0.7rem;
}

.nav a:hover,
.search-trigger:hover {
  color: rgba(255, 255, 255, 0.85);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 1.72rem;
  padding: 0 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.55rem;
  color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

kbd {
  border: 0;
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.08rem 0.28rem;
  font-size: 0.74em;
}

.hint {
  position: fixed;
  top: 6.2rem;
  left: 50%;
  z-index: 10;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.filter-panel {
  position: fixed;
  left: 1.35rem;
  bottom: 1.05rem;
  z-index: 20;
  width: min(20.5rem, calc(100vw - 2.7rem));
  padding: 0.85rem 0.7rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.78rem;
  background: rgba(16, 16, 16, 0.82);
  box-shadow: 0 1.6rem 4rem rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.filter-panel h2 {
  margin: 0 0 0.65rem 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.audience-group {
  align-items: center;
  padding-top: 0.1rem;
}

.filter-label {
  color: rgba(255, 255, 255, 0.33);
  font-size: 0.64rem;
  line-height: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.65rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  font-size: 0.7rem;
}

.chip::before {
  content: "";
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 999px;
  background: var(--chip-color, #777);
}

.audience-chip {
  min-height: 1.55rem;
  padding: 0 0.62rem;
  color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.018);
}

.audience-chip::before {
  display: none;
}

.chip.active {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(96, 165, 250, 0.95);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.zoom-controls {
  position: fixed;
  right: 1rem;
  bottom: 4rem;
  z-index: 20;
  display: grid;
  gap: 0.55rem;
}

.zoom-controls button {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(18, 18, 18, 0.82);
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.zoom-controls button:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.bottom-line {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 10;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
}

.command-palette {
  position: fixed;
  top: 10vh;
  left: 50%;
  z-index: 40;
  display: none;
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(28rem, 78vh);
  height: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.85rem;
  background: rgba(24, 24, 25, 0.96);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.command-palette.open,
.scrim.open,
.detail-card.open {
  display: block;
}

.palette-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  height: 3rem;
  padding: 0 0.9rem;
  border-bottom: 0;
}

.palette-search input {
  color: rgba(255, 255, 255, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
}

.palette-search span {
  display: none;
}

.palette-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  caret-color: white;
}

.palette-search input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.palette-search kbd {
  padding: 0.14rem 0.32rem;
  font-size: 0.68rem;
}

.palette-body {
  max-height: min(22rem, calc(78vh - 5.5rem));
  height: auto;
  padding: 0.55rem 0.38rem 0.65rem;
  overflow: auto;
}

.palette-section {
  margin-bottom: 0.55rem;
}

.palette-section h3 {
  margin: 0.45rem 0.62rem 0.32rem;
  color: rgba(255, 255, 255, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 560;
  letter-spacing: 0;
}

.palette-row {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  height: 2.15rem;
  padding: 0 0.68rem;
  border: 0;
  border-radius: 0.6rem;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.palette-row:hover,
.palette-row.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.palette-row .arrow {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.52);
}

.palette-row .name {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
}

.palette-row .diamond {
  width: 0.5rem;
  height: 0.5rem;
  transform: rotate(45deg);
  background: var(--project-color, rgba(255, 255, 255, 0.45));
  box-shadow: 0 0 0.75rem color-mix(in srgb, var(--project-color, #fff) 36%, transparent);
}

.palette-shortcut {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.4);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
}

.palette-shortcut kbd {
  min-width: 1.3rem;
  padding: 0.12rem 0.34rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.palette-footer {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  height: 2.1rem;
  padding: 0 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
}

.detail-card {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  display: none;
  width: min(34rem, calc(100vw - 2rem));
  min-height: 0;
  padding: 1.65rem 1.75rem 1.45rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0.8rem;
  background:
    radial-gradient(circle at 92% 7%, rgba(236, 72, 153, 0.12), transparent 11rem),
    rgba(16, 16, 17, 0.96);
  box-shadow: 0 1.25rem 4.5rem rgba(0, 0, 0, 0.72);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.detail-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.22rem;
  font-weight: 520;
  letter-spacing: 0;
  line-height: 1.1;
}

.detail-head h2 span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 500;
}

.detail-head em {
  padding: 0.16rem 0.42rem;
  border-radius: 0.38rem;
  color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.075);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 520;
}

.detail-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 400;
}

.beta {
  align-self: start;
  margin-top: 0.05rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  color: rgba(255, 192, 77, 0.9);
  background: rgba(255, 122, 33, 0.22);
  font-size: 0.72rem;
  font-weight: 600;
}

.detail-copy {
  max-width: 27rem;
  margin: 1.75rem 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.65;
}

.detail-copy strong {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}

.detail-close {
  margin: 1.9rem 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .topbar {
    height: 4rem;
    padding: 0 1rem;
  }

  .nav {
    gap: 0.8rem;
    font-size: 0.75rem;
  }

  .nav a:nth-of-type(2),
  .nav a:nth-of-type(3) {
    display: none;
  }

  .search-trigger span {
    display: none;
  }

  .hint {
    top: 5rem;
    font-size: 0.68rem;
  }

  .filter-panel {
    bottom: 0.75rem;
  }

  .bottom-line {
    display: none;
  }

  .command-palette {
    top: 8vh;
    width: min(34rem, calc(100vw - 1.25rem));
    max-height: 76vh;
    height: auto;
  }

  .palette-search {
    height: 3rem;
    padding: 0 1rem;
  }

  .palette-search span,
  .palette-search input {
    font-size: 0.86rem;
  }

  .palette-row .name,
  .palette-section h3 {
    font-size: 0.78rem;
  }

  .detail-card {
    top: 50%;
    width: min(31rem, calc(100vw - 1.25rem));
    padding: 1.35rem 1.1rem 1.2rem;
  }

  .detail-head h2 {
    font-size: 1.05rem;
  }

  .detail-copy {
    margin-top: 1.35rem;
    font-size: 0.86rem;
  }
}
