:root {
  --bg: #070a12;
  --panel: #0d1322;
  --panel-strong: #121a2c;
  --text: #eef4ff;
  --muted: #9aa8bd;
  --line: rgba(148, 163, 184, 0.18);
  --blue: #4f8cff;
  --violet: #9b6cff;
  --green: #2dd4a3;
  --amber: #f8c14a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 140, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(45, 212, 163, 0.12), transparent 28rem),
    linear-gradient(180deg, #090d18 0%, #070a12 52%, #080b12 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  background: rgba(7, 10, 18, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.92), rgba(45, 212, 163, 0.82));
  color: #05101c;
  font-weight: 900;
}

.brand h1,
.overview h2,
.section-heading h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 0.28rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 26, 44, 0.74);
  color: #dbeafe;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.25rem rgba(45, 212, 163, 0.16);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 3rem);
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 0.75fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.overview-copy,
.stats-grid,
.controls,
.content-shell {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, rgba(18, 26, 44, 0.88), rgba(13, 19, 34, 0.78));
  box-shadow: var(--shadow);
}

.overview-copy {
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

.overview-copy::after {
  content: "";
  position: absolute;
  inset: auto -8rem -9rem auto;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.32), transparent 62%);
}

.overview-copy h2 {
  max-width: 48rem;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.96;
}

.overview-copy p:last-child {
  max-width: 44rem;
  margin: 1.2rem 0 0;
  color: #c8d3e4;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
}

.stat {
  min-height: 8.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(7, 10, 18, 0.46);
}

.stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.4rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(7, 10, 18, 0.64);
}

.search-wrap span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 800;
}

.chip.is-active {
  border-color: rgba(79, 140, 255, 0.65);
  background: rgba(79, 140, 255, 0.18);
  color: #eff6ff;
}

.chip.utility {
  margin-left: auto;
}

.chip.utility + .chip.utility {
  margin-left: 0;
}

.content-shell {
  padding: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 0.5rem 0.25rem 1rem;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.category-break {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding: 0.8rem 0.25rem 0.2rem;
  border-top: 1px solid var(--line);
}

.category-break:first-child {
  margin-top: 0;
  border-top: 0;
}

.category-break h3 {
  margin: 0;
  font-size: 1rem;
}

.category-break p {
  margin: 0.28rem 0 0;
  color: var(--muted);
}

.project-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 23rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(8, 13, 24, 0.82);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(14, 21, 36, 0.95);
  outline: none;
}

.project-card.is-dragging {
  opacity: 0.42;
}

.project-card.drag-over {
  border-color: var(--amber);
}

.banner {
  width: 100%;
  aspect-ratio: 16 / 4.9;
  object-fit: cover;
  background: #111827;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.card-topline,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.label {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 900;
}

.label.private {
  color: #bfdbfe;
  background: rgba(79, 140, 255, 0.16);
}

.label.public {
  color: #bbf7d0;
  background: rgba(45, 212, 163, 0.14);
}

.project-card h3 {
  margin: 0;
  font-size: 1.16rem;
}

.project-card p {
  margin: 0;
  color: #b7c4d8;
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.34rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: #dbe4f0;
  font-size: 0.76rem;
  font-weight: 800;
}

.reorder-tools {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: calc(100% - 1.5rem);
}

.drag-handle,
.order-button {
  min-height: 2rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.55rem;
  background: rgba(7, 10, 18, 0.72);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.order-button {
  cursor: pointer;
}

.order-button:hover,
.order-button:focus-visible {
  border-color: rgba(248, 193, 74, 0.75);
  outline: none;
}

body.reorder-on .reorder-tools {
  display: flex;
}

body.reorder-on .project-card {
  cursor: grab;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  justify-content: flex-end;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(10px);
}

.drawer.is-open {
  display: flex;
}

.drawer-panel {
  width: min(34rem, 100%);
  min-height: 100%;
  background: #0b1020;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow-y: auto;
}

.icon-button {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-height: 2.4rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(7, 10, 18, 0.7);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
}

.drawer-banner {
  width: 100%;
  aspect-ratio: 16 / 5.2;
  object-fit: cover;
  background: #111827;
}

.drawer-body {
  display: grid;
  gap: 1.25rem;
  padding: 1.4rem;
}

.drawer-body h2,
.drawer-body h3,
.drawer-body p {
  margin: 0;
}

.drawer-body p {
  color: #c6d3e4;
  line-height: 1.65;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.meta-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(148, 163, 184, 0.08);
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-item strong {
  display: block;
  margin-top: 0.25rem;
}

@media (max-width: 1100px) {
  .overview,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview,
  .project-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .overview-copy {
    min-height: 24rem;
  }

  .chip.utility {
    margin-left: 0;
  }
}
