.hub-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 52px) 0 64px;
}

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.hub-header h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--heading);
}

.hub-select {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hub-select:hover,
.hub-select:focus-visible {
  border-color: var(--accent);
  color: var(--heading);
}

.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hub-filter {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hub-filter:hover {
  border-color: var(--line-hover);
  color: var(--heading);
}

.hub-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.hub-search-wrap {
  flex: 1 1 220px;
  max-width: 300px;
}

.hub-search {
  width: 100%;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.15s ease;
}

.hub-search:focus {
  outline: none;
  border-color: var(--accent);
}

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

.demo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.demo-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.demo-tile-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.demo-tile-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.demo-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--field-bg);
  border-bottom: 1px solid var(--line);
}

.demo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.25s ease;
}

.demo-tile:hover .demo-preview img {
  transform: scale(1.025);
}

.demo-tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 17px 12px;
  flex: 1;
}

.demo-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.demo-tile-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.25;
}

.demo-tile-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.demo-tile:hover .demo-tile-meta {
  color: var(--accent-text);
}

.demo-tile-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.demo-tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 17px 15px;
}

.demo-tag {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.demo-tag:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.hub-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 640px) {
  .hub-shell {
    width: calc(100vw - 28px);
  }
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-search-wrap {
    max-width: none;
  }
}
