:root {
  color-scheme: dark;
  --bg: #09090b;
  --card: #0e0e11;
  --card-hover: #121216;
  --panel: #101013;
  --panel-2: #151519;
  --tile: #f4f1ea;
  --tile-ink: #141417;
  --tile-ring: rgba(255, 255, 255, 0.06);
  --ink: #f2efe9;
  --ink-2: #b9b6bf;
  --muted: #96939e;
  --dim: #7b7984;
  --line: #1f1f25;
  --line-strong: #35353d;
  --accent: #ff5c35;
  --accent-dim: rgba(255, 92, 53, 0.14);
  --on-accent: #0b0b0d;
  --glow: rgba(255, 92, 53, 0.07);
  --hover: rgba(255, 255, 255, 0.035);
  --hover-strong: rgba(255, 255, 255, 0.06);
  --card-shadow: none;
  --pop-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --scrim: rgba(0, 0, 0, 0.55);
  --green: #7bd8a4;
  --violet: #b9a6ff;
  --blue: #7db8ff;
  --amber: #f2bb6d;
  --coral: #ff8a7a;
  --yellow: #f4d06f;
  --teal: #67d7c7;
  --cyan: #75d5e8;
  --neutral: #a8a29e;
  --orange: #ff8a5c;
  --radius: 12px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ed;
  --card: #fffdf9;
  --card-hover: #ffffff;
  --panel: #f2eee5;
  --panel-2: #ebe5da;
  --tile: #f1ece3;
  --tile-ink: #17141a;
  --tile-ring: rgba(23, 20, 26, 0.08);
  --ink: #17141a;
  --ink-2: #4c4852;
  --muted: #6e6974;
  --dim: #8a8591;
  --line: #e4dfd4;
  --line-strong: #cfc8ba;
  --accent: #d9481f;
  --accent-dim: rgba(217, 72, 31, 0.1);
  --on-accent: #fff8f3;
  --glow: rgba(217, 72, 31, 0.06);
  --hover: rgba(23, 20, 26, 0.04);
  --hover-strong: rgba(23, 20, 26, 0.07);
  --card-shadow: 0 1px 2px rgba(23, 20, 26, 0.04);
  --pop-shadow: 0 22px 60px rgba(23, 20, 26, 0.16);
  --scrim: rgba(23, 20, 26, 0.35);
  --green: #1a8a5a;
  --violet: #6b4fd8;
  --blue: #1f6feb;
  --amber: #b26b00;
  --coral: #d24b57;
  --yellow: #a37a00;
  --teal: #0f766e;
  --cyan: #0e7490;
  --neutral: #78716c;
  --orange: #d9481f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 84% -10%, var(--glow), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 12px var(--font-mono);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--tile);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}

.mark svg {
  width: 16px;
  height: 16px;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font: 11px var(--font-mono);
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.gh svg {
  width: 14px;
  height: 14px;
}

.gh:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--panel);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 64px;
  padding-bottom: 42px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font: 10.5px var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.asterisk {
  color: var(--accent);
  font-size: 15px;
  line-height: 0;
  transform: translateY(2px);
}

.hero h1 {
  max-width: 900px;
  margin: 20px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.4vw, 68px);
  font-weight: 600;
  line-height: 0.97;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 620px;
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  color: var(--dim);
  font: 10.5px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta i {
  font-style: normal;
  color: var(--line-strong);
}

.meta b {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-bottom: 88px;
}

.rail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  padding: 20px 0 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.rail::-webkit-scrollbar {
  width: 4px;
}

.rail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rail-head svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: none;
}

.rail-total {
  margin-left: auto;
  color: var(--dim);
  font: 10.5px var(--font-mono);
}

.rail-label {
  margin: 0 0 10px;
  padding: 0 8px;
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.role::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.14s ease;
}

.role svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--dim);
  transition: color 0.14s ease;
}

.role-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.role-count {
  color: var(--dim);
  font: 10.5px var(--font-mono);
}

.role:hover {
  background: var(--hover);
  color: var(--ink);
}

.role:hover svg {
  color: var(--muted);
}

.role[aria-pressed="true"] {
  background: var(--panel-2);
  color: var(--ink);
}

.role[aria-pressed="true"]::before {
  opacity: 1;
}

.role[aria-pressed="true"] svg,
.role[aria-pressed="true"] .role-count {
  color: var(--accent);
}

.rail-types {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.type-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.type-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.type-btn[data-type="all"] {
  grid-column: 1 / -1;
}

.tdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  flex: none;
}

.type-btn[data-type="skill"] .tdot {
  background: var(--green);
}

.type-btn[data-type="subagent"] .tdot {
  background: var(--violet);
}

.type-btn[data-type="mcp"] .tdot {
  background: var(--blue);
}

.type-btn[data-type="tool"] .tdot {
  background: var(--amber);
}

.type-btn[data-type="all"] .tdot {
  background: var(--accent);
}

.tcount {
  margin-left: auto;
  color: var(--dim);
  font: 10px var(--font-mono);
}

.type-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.type-btn[aria-pressed="true"] {
  background: var(--panel-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.rail-note {
  margin: 24px 0 0;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 10.5px/1.65 var(--font-mono);
}

/* ---------- Toolbar ---------- */

.catalog {
  min-width: 0;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.toolbar-info {
  min-width: 0;
}

.catalog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.result-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0 0;
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reset {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.reset::before {
  content: "·";
  margin-right: 6px;
  color: var(--line-strong);
}

.reset:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 350px;
  max-width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search > svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
  flex: none;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search input::placeholder {
  color: var(--dim);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font: 10px var(--font-mono);
  flex: none;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  flex: none;
}

.search-clear svg {
  width: 12px;
  height: 12px;
}

.search-clear:hover {
  background: var(--hover-strong);
  color: var(--ink);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ---------- Grid + cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 218px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 7px;
  border-radius: 13px;
  background: var(--tile);
  overflow: hidden;
  flex: none;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
}

.tile img.avatar {
  object-fit: cover;
}

.tile .monogram {
  color: var(--tile-ink);
  font: 600 13px var(--font-mono);
  letter-spacing: 0.02em;
}

.tile.is-fallback::after {
  content: attr(data-initials);
  color: var(--tile-ink);
  font: 600 13px var(--font-mono);
  letter-spacing: 0.02em;
}

.code {
  padding-top: 3px;
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.08em;
  transition: color 0.15s ease;
}

.card:hover .code {
  color: var(--accent);
}

.card-title {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.012em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-desc {
  display: -webkit-box;
  flex: 1;
  margin: 0 0 15px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font: 10px var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  flex: none;
}

.type-skill .dot {
  background: var(--green);
}

.type-subagent .dot {
  background: var(--violet);
}

.type-mcp .dot {
  background: var(--blue);
}

.type-tool .dot {
  background: var(--amber);
}

.owner {
  max-width: 104px;
  margin-left: auto;
  overflow: hidden;
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.01em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.go {
  display: grid;
  place-items: center;
  color: var(--dim);
  flex: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.go svg {
  width: 12px;
  height: 12px;
}

.card:hover .go {
  color: var(--accent);
  transform: translate(1px, -1px);
}

/* ---------- Empty / footer ---------- */

.empty {
  margin-top: 20px;
  padding: 76px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.empty-mark {
  color: var(--accent);
  font: 500 42px/1 var(--font-mono);
}

.empty h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty p {
  margin: 0 auto 22px;
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink);
  font: 11px var(--font-mono);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 44px;
  border-top: 1px solid var(--line);
}

.foot-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 540px;
}

.mark-small {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.mark-small svg {
  width: 13px;
  height: 13px;
}

.foot-left p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.65;
}

.foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font: 10.5px var(--font-mono);
  white-space: nowrap;
}

.foot-right a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-right a:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 13px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .grid.is-first .card {
    animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 16ms);
  }

  @keyframes card-in {
    from {
      opacity: 0;
      translate: 0 7px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Responsive ---------- */

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

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 28px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search {
    width: 300px;
  }
}

@media (max-width: 940px) {
  .wrap {
    padding: 0 22px;
  }

  .hero {
    padding-top: 44px;
    padding-bottom: 30px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 64px;
  }

  .rail {
    position: static;
    max-height: none;
    padding: 14px 0 2px;
    overflow: visible;
    border-bottom: 1px solid var(--line);
  }

  .rail-head {
    padding: 0 0 10px;
  }

  .role-list {
    flex-direction: row;
    gap: 6px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .role-list::-webkit-scrollbar {
    display: none;
  }

  .role {
    width: auto;
    flex: none;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
  }

  .role::before {
    display: none;
  }

  .role svg {
    display: none;
  }

  .role[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-dim);
  }

  .rail-types {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 0;
  }

  .rail-types .rail-label {
    display: none;
  }

  .type-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .type-list::-webkit-scrollbar {
    display: none;
  }

  .type-btn {
    flex: none;
  }

  .type-btn .tcount {
    display: none;
  }

  .type-btn[data-type="all"] {
    grid-column: auto;
  }

  .rail-note {
    display: none;
  }

  .toolbar {
    padding: 14px 0;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 16px;
  }
}

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

@media (max-width: 760px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .search kbd {
    display: none;
  }
}

@media (min-width: 941px) and (max-height: 800px) {
  .rail {
    padding-top: 12px;
  }

  .rail-note {
    display: none;
  }
}

@media (max-width: 380px) {
  .type-list {
    gap: 4px;
  }

  .type-btn {
    padding: 7px 6px;
    font-size: 11px;
  }
}

@media (max-width: 540px) {
  .wrap {
    padding: 0 16px;
  }

  .head-inner {
    height: 58px;
  }

  .gh span {
    display: none;
  }

  .gh {
    padding: 8px;
  }

  .hero {
    padding-top: 36px;
    padding-bottom: 26px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 48px);
  }

  .lede {
    font-size: 13.5px;
  }

  .meta {
    gap: 8px;
    font-size: 9.5px;
  }

  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .card {
    min-height: 0;
    padding: 16px;
  }

  .card-desc {
    -webkit-line-clamp: 4;
  }

  .site-foot {
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
  }

  .foot-right {
    white-space: normal;
  }
}


/* ---------- V2: domains, filters, themes, GitHub ---------- */

.card {
  box-shadow: var(--card-shadow);
}

.tile {
  box-shadow: inset 0 0 0 1px var(--tile-ring);
}

.go {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.card:hover .go {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.type-more {
  margin-left: 2px;
  color: var(--dim);
}

.role.is-empty .role-name {
  color: var(--dim);
}

.role.is-empty .role-count {
  opacity: 0.75;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--hover);
}

.lang-btn {
  font: 10.5px var(--font-mono);
  letter-spacing: 0.08em;
}

.theme-toggle .icon {
  width: 15px;
  height: 15px;
}

.theme-toggle .sun {
  display: none;
}

.theme-toggle .moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

.gh-wrap {
  position: relative;
}

.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  font: 10.5px var(--font-mono);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.gh-btn:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.gh-btn > svg:first-child {
  width: 14px;
  height: 14px;
  flex: none;
}

.gh-btn .chev {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  flex: none;
}

.gh-count {
  font: 10px var(--font-mono);
  opacity: 0.8;
}

.gh-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: 330px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--pop-shadow);
}

.gh-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 22px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--card);
  transform: rotate(45deg);
}

.gh-pop-kicker {
  margin: 0;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gh-pop-title {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.gh-pop-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.gh-stats {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}

.gh-stats > div {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.gh-stats b {
  display: block;
  color: var(--ink);
  font: 15px var(--font-display);
  font-weight: 600;
}

.gh-stats span {
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gh-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 11px var(--font-mono);
  text-decoration: none;
}

.gh-cta svg {
  width: 14px;
  height: 14px;
}

.gh-cta:hover {
  filter: brightness(1.06);
}

.gh-pop-links {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.gh-pop-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font: 10.5px var(--font-mono);
  text-decoration: none;
}

.gh-pop-links a:hover {
  color: var(--accent);
}

.domains {
  padding-top: 2px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.domains-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.domains-label {
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.domains-total {
  color: var(--dim);
  font: 10px var(--font-mono);
}

.domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 11.5px var(--font-body);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.domain-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--hover);
}

.domain-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--ink);
}

.domain-chip[aria-pressed="true"] .domain-count {
  color: var(--accent);
}

.domain-name {
  white-space: nowrap;
}

.domain-count {
  color: var(--dim);
  font: 10px var(--font-mono);
}

.rail-heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rail-heading #rail-domain {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.rail-sub {
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.05em;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filter-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  font: 11px var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-open > svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.filter-open:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-open[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 9px var(--font-mono);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 0 2px;
}

.active-label {
  margin-right: 2px;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-2);
  font: 10px var(--font-mono);
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.filter-chip .dot {
  width: 5px;
  height: 5px;
}

.filter-chip .x {
  margin-left: 2px;
  color: var(--dim);
}

.filter-chip:hover .x {
  color: var(--accent);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  color: var(--on-accent);
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.foot-star {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--dim);
  font: 10.5px var(--font-mono);
}

.foot-star svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex: none;
}

.foot-star a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-star a:hover {
  border-color: var(--accent);
}

body.is-locked {
  overflow: hidden;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: 430px;
  max-width: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line-strong);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.drawer.is-open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  margin: 0 0 4px;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.drawer-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--hover);
}

.drawer-close svg {
  width: 14px;
  height: 14px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.filter-section + .filter-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.filter-section h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 11px var(--font-body);
  cursor: pointer;
}

.type-chip .tcount {
  color: var(--dim);
  font: 9.5px var(--font-mono);
}

.type-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.type-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--ink);
}

.type-chip[aria-pressed="true"] .tcount {
  color: var(--accent);
}

.facet-list {
  display: grid;
  gap: 10px;
}

.facet-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facet-field select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink);
  font: 12px var(--font-body);
  cursor: pointer;
}

.facet-field select:hover {
  border-color: var(--line-strong);
}

.facet-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

@media (max-width: 940px) {
  .domains {
    padding-top: 0;
    padding-bottom: 18px;
  }

  .domain-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .domain-list::-webkit-scrollbar {
    display: none;
  }

  .domain-chip {
    flex: none;
  }

  .rail-head {
    display: none;
  }
}

@media (max-width: 760px) {
  .toolbar-actions {
    flex-direction: row;
    align-items: center;
  }

  .search {
    flex: 1;
    width: auto;
  }

  .filter-open {
    width: 42px;
    padding: 0;
    justify-content: center;
    gap: 6px;
    flex: none;
  }

  .filter-open > span[data-i18n="filters"] {
    display: none;
  }
}

@media (max-width: 540px) {
  .head-actions {
    gap: 6px;
  }

  .hero {
    padding-top: 30px;
    padding-bottom: 22px;
  }

  .hero h1 {
    margin-top: 16px;
    margin-bottom: 16px;
  }

  .meta {
    margin-top: 20px;
  }

  .meta-updated {
    display: none;
  }

  .gh-btn {
    padding: 0 8px;
  }

  .gh-btn-label {
    display: none;
  }

  .gh-popover {
    position: fixed;
    top: 64px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }

  .gh-popover::before {
    display: none;
  }

  .drawer {
    width: 100%;
    border-left: 0;
  }

  .drawer-head,
  .drawer-body,
  .drawer-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 360px) {
  .wordmark {
    display: none;
  }
}

/* ---------- Resource detail dialog ---------- */

.card {
  width: 100%;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.resource-modal {
  position: fixed;
  z-index: 110;
  top: 50%;
  left: 50%;
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 22px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--pop-shadow);
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.resource-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.resource-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.resource-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 34px;
}

.resource-icon-wrap {
  display: block;
  flex: none;
}

.resource-icon-wrap .tile {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.resource-heading {
  min-width: 0;
}

.resource-owner {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.05em;
}

.resource-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.resource-desc {
  margin: 16px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.resource-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.resource-types .type {
  font-size: 10px;
}

.resource-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 10px;
}

.resource-cat {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: 9.5px var(--font-mono);
}

.resource-stats {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.resource-stats > div {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.resource-stats b {
  display: block;
  color: var(--ink);
  font: 17px var(--font-display);
  font-weight: 600;
}

.resource-stats span {
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-usage {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.resource-usage h3 {
  margin: 0 0 7px;
  color: var(--dim);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.resource-usage p {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.resource-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  color: var(--accent);
  font: 10.5px var(--font-mono);
  text-decoration: none;
}

.resource-guide:hover {
  border-color: var(--accent);
}

.resource-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.resource-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.resource-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 540px) {
  .resource-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
    padding: 18px;
  }

  .resource-head {
    gap: 12px;
  }

  .resource-icon-wrap .tile {
    width: 50px;
    height: 50px;
  }

  .resource-title {
    font-size: 20px;
  }

  .resource-actions {
    flex-direction: column;
  }

  .resource-link {
    justify-content: center;
  }
}

/* ---------- Grouped specialties (Video & Film Production) ---------- */

.role-group {
  margin-top: 2px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 11px var(--font-mono);
  text-align: left;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.group-head:hover {
  background: var(--hover);
  color: var(--ink);
}

.group-head .chev {
  width: 11px;
  height: 11px;
  color: var(--dim);
  flex: none;
  transition: transform 0.14s ease, color 0.14s ease;
}

.group-head[aria-expanded="true"] .chev {
  color: var(--accent);
  transform: rotate(90deg);
}

.group-head:hover .chev {
  color: var(--muted);
}

.role-group.has-active .group-head {
  color: var(--ink);
}

.role-group.has-active .group-head .chev {
  color: var(--accent);
}

.group-name {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.group-count {
  color: var(--dim);
  font: 9.5px var(--font-mono);
  flex: none;
}

.group-items {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.role-group.is-open .group-items {
  display: flex;
}

@media (min-width: 941px) {
  .group-items .role {
    padding-left: 24px;
  }
}

@media (max-width: 940px) {
  .role-group,
  .role-group .group-items {
    display: contents;
  }

  .group-head {
    display: none;
  }
}

/* ---------- Simulated presence ---------- */

.presence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.presence b {
  color: var(--ink-2);
  font-weight: 500;
}

.presence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
  animation: presence-pulse 2.4s ease-in-out infinite;
}

.presence-sep {
  color: var(--line-strong);
}

@keyframes presence-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .presence-dot {
    animation: none;
  }
}
