:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(14, 18, 28, 0.92);
  --card: #121826;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f9;
  --muted: #8b97ad;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --we: #1db954;
  --radius: 14px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 2;
}

.bg-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-preview-layer video,
.bg-preview-layer .bg-preview-still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(1.15);
  transform: scale(1.02);
}

.bg-preview-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 18, 0.55) 0%, rgba(8, 11, 18, 0.88) 55%, var(--bg) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 18, 0.72);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.search-wrap {
  flex: 1 1 220px;
  max-width: 420px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 10px 14px 10px 38px;
  color: var(--text);
  outline: none;
}

.search-wrap input:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  opacity: 0.55;
}

main {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-stats div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 120px;
}

.hero-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
}

.hero-stats span {
  font-size: 11px;
  color: var(--muted);
}

.preview-desk {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.preview-desk-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.preview-desk-hd b {
  color: var(--text);
}

.preview-desk-stage {
  position: relative;
  flex: 1;
  min-height: 150px;
  background: #05070c;
}

.preview-desk-stage video,
.preview-desk-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-desk-taskbar {
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-top: 1px solid var(--line);
}

.preview-desk-taskbar i {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}

.filters button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.15s ease;
}

.filters button:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.filters button.is-active {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.1);
}

.grid-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.grid-head h2 {
  margin: 0;
  font-size: 18px;
}

.grid-head span {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: var(--shadow);
}

.card.is-selected {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0a0e16;
  overflow: hidden;
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb .thumb-still {
  position: absolute;
  inset: 0;
}

.thumb .video-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .thumb .video-hover {
  opacity: 1;
}

.thumb-badges {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pill-warn {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.75);
}

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.card-body .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.card-body .meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.card-actions button {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.card-actions button.primary {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0e1420;
  box-shadow: var(--shadow);
}

.modal video {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  background: #000;
}

.modal-content {
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-top h3 {
  margin: 0;
  font-size: 22px;
}

.modal-top button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions a,
.modal-actions button {
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.modal-actions .cta {
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(167, 139, 250, 0.16));
}

#modal-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.note {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 14px;
  max-width: 72ch;
  line-height: 1.5;
}

.site-footer {
  margin: 32px 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer-legal {
  color: var(--text);
  font-weight: 600;
}

.site-footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-links a:hover {
  color: var(--accent);
}