@font-face {
  font-family: "Geist";
  src: url("/catalog-assets/fonts/Geist-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/catalog-assets/fonts/Geist-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/catalog-assets/fonts/Geist-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/catalog-assets/fonts/Geist-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #0c0d0e;
  --panel: #101010;
  --panel-hover: #151515;
  --panel-soft: #101010;
  --border: #242424;
  --border-strong: #2a2a2a;
  --text: #ffffff;
  --muted: #a0a0a0;
  --muted-strong: #d7d7d7;
  --primary: hsl(262 45% 42%);
  --secondary: hsl(73 100% 50%);
  --accent: var(--secondary);
  --accent-soft: hsl(73 100% 50% / 0.08);
  --api: #c7b8ed;
  --api-soft: hsl(262 45% 42% / 0.18);
  --mcp: #d9ff70;
  --mcp-soft: hsl(73 100% 50% / 0.08);
  --green: #72d694;
  --red: #ff9a9a;
  --max-width: 1200px;
  font-family: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #fff; color: #000; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.ambient { display: none; }

.site-footer,
.page {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding-inline: max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(36, 36, 36, 0.82);
  background: rgba(12, 13, 14, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-logo { width: 76px; height: auto; filter: brightness(0) invert(1); }
.brand-product { padding-left: 12px; border-left: 1px solid #333; color: #a0a0a0; }
.brand-product span { margin-right: 7px; color: #555; }

.api-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #111;
  color: var(--muted);
  font-size: 12px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.api-link:hover { border-color: #3a3a3a; background: #151515; color: var(--text); }

.page { position: relative; min-height: calc(100vh - 154px); padding: 92px 0 104px; }
.page::before {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  width: 100vw;
  height: 520px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.12) 70%, transparent);
  pointer-events: none;
  transform: translateX(-50%);
}
.page > * { position: relative; z-index: 1; }

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: end;
  gap: 48px;
  margin-bottom: 76px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

.catalog-hero h1,
.detail-title h1 {
  margin-bottom: 13px;
  font-size: clamp(42px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.catalog-hero-copy {
  max-width: 560px;
  margin-bottom: 0;
  color: #a0a0a0;
  font-size: 18px;
  line-height: 1.55;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background: rgba(17, 17, 17, 0.94);
  color: #8f8f8f;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: #3a3a3a;
  background: #151515;
  box-shadow: none;
}

.search-field svg { flex: 0 0 auto; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: #8f8f8f; }

.catalog-section { margin-top: 54px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.section-heading h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.section-heading span { color: #707070; font-size: 12px; }

.connector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 38px; }

.connector-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  margin: 0 -13px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.connector-card:hover {
  border-color: var(--border);
  background: rgba(16, 16, 16, 0.84);
  transform: translateY(-1px);
}

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

.connector-logo,
.detail-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  border-radius: 15px;
  background: #111;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.connector-logo { width: 54px; height: 54px; }
.connector-logo img { width: 31px; height: 31px; object-fit: contain; }
.connector-logo.app-artwork img { width: 42px; height: 42px; border-radius: 10px; }

.connector-copy { min-width: 0; }
.connector-name { margin: 0 0 5px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.connector-description {
  overflow: hidden;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-api { border-color: hsl(262 45% 58% / 0.28); background: var(--api-soft); color: var(--api); }
.tag-mcp { border-color: hsl(73 100% 50% / 0.2); background: var(--mcp-soft); color: var(--mcp); }
.tag-skills { border-color: rgba(255, 160, 96, 0.28); background: rgba(150, 82, 255, 0.12); color: #f5b77f; }
.tag-configured { border-color: rgba(125, 226, 160, 0.2); background: rgba(125, 226, 160, 0.08); color: var(--green); }
.tag-risk-read { border-color: #333; background: #151515; color: #aaa; }
.tag-risk-write { border-color: hsl(262 45% 58% / 0.28); background: var(--api-soft); color: var(--api); }
.tag-risk-destructive { border-color: rgba(255, 154, 154, 0.22); background: rgba(255, 90, 90, 0.08); color: var(--red); }

.card-meta { display: flex; align-items: center; gap: 10px; color: #696969; font-size: 11px; }
.card-arrow { font-size: 18px; transition: color 160ms ease, transform 160ms ease; }
.connector-card:hover .card-arrow { color: var(--text); transform: translateX(2px); }

.empty-state,
.error-state,
.loading-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state h2,
.error-state h2 { margin-bottom: 8px; font-size: 22px; font-weight: 600; }
.empty-state p,
.error-state p,
.loading-state p { color: var(--muted); }

.spinner {
  width: 25px;
  height: 25px;
  margin-bottom: 14px;
  border: 2px solid #292929;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 52px;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease;
}

.back-link:hover { color: var(--text); }

.detail-header {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--border);
}

.detail-logo { width: 92px; height: 92px; border-radius: 23px; }
.detail-logo img { width: 53px; height: 53px; object-fit: contain; }
.detail-logo.app-artwork img { width: 74px; height: 74px; border-radius: 17px; }
.detail-title h1 { margin-bottom: 14px; font-size: clamp(36px, 5vw, 52px); }
.detail-developer { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.detail-description {
  grid-column: 2;
  max-width: 760px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.62;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 70px;
  margin-top: 54px;
}

.detail-section + .detail-section { margin-top: 54px; }
.detail-section h2 { margin-bottom: 21px; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }

.prompt-list { display: grid; gap: 10px; }
.prompt-card { padding: 17px 19px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); color: #d7d7d7; font-size: 13px; line-height: 1.5; }
.prompt-card::before { content: "“"; margin-right: 4px; color: var(--accent); }

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

.skill-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.skill-mark {
  width: 22px;
  height: 22px;
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
  background: conic-gradient(from 30deg, #f1478d 0 33.333%, #8c3ff5 0 66.666%, #ffb72e 0);
  transform: rotate(30deg);
}

.skill-copy { min-width: 0; }
.skill-name { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.skill-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.skill-version { color: var(--muted); font-size: 11px; white-space: nowrap; }

.tools-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.tools-header h2 { margin: 0; }
.tools-count { color: var(--muted); font-size: 12px; }
.tool-search { margin-bottom: 12px; }

.tool-list { display: grid; gap: 8px; }

.tool-row {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #101010;
}

.tool-row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}

.tool-row summary::-webkit-details-marker { display: none; }
.tool-row[open] summary { border-bottom: 1px solid var(--border); background: #151515; }
.tool-name { overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; color: #ddd; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tool-body { padding: 16px 17px; }
.tool-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.tool-tags { display: flex; gap: 6px; align-items: center; }

.info-card {
  position: sticky;
  top: 88px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 16, 16, 0.94);
}

.info-card h2 { margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.info-list { display: grid; gap: 16px; margin: 0; }
.info-row { display: grid; grid-template-columns: 82px 1fr; gap: 12px; font-size: 12px; line-height: 1.4; }
.info-row dt { color: #737373; }
.info-row dd { overflow: hidden; margin: 0; color: #d1d1d1; text-overflow: ellipsis; }
.info-row a:hover { text-decoration: underline; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: #707070;
  font-size: 11px;
}

.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: #8f8f8f; }
.footer-brand img { width: 66px; height: auto; filter: brightness(0) invert(1); opacity: 0.74; }
.footer-brand span { padding-left: 10px; border-left: 1px solid #333; }

.footer-actions { display: flex; align-items: center; gap: 20px; }

.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 40px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
}

.theme-toggle button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  outline: 0;
  background: transparent;
  color: #a0a0a0;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.theme-toggle button:hover { color: #fff; }
.theme-toggle button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.1); color: #fff; }
.theme-toggle button:focus-visible { box-shadow: inset 0 0 0 1px #707070; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

html[data-theme="light"] {
  --background: #f0f0f0;
  --panel: #ffffff;
  --panel-hover: #f8f8f8;
  --panel-soft: #ffffff;
  --border: #d9d9d9;
  --border-strong: #cccccc;
  --text: #000000;
  --muted: #71717a;
  --muted-strong: #333333;
  --api: #5f4694;
  --api-soft: hsl(262 45% 42% / 0.09);
  --mcp: #4d6600;
  --mcp-soft: hsl(73 100% 38% / 0.1);
  --green: #18794e;
  --red: #c73737;
}

html[data-theme="light"] .site-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
  background: rgba(240, 240, 240, 0.84);
}

html[data-theme="light"] .brand-logo,
html[data-theme="light"] .footer-brand img { filter: none; }
html[data-theme="light"] .brand-product,
html[data-theme="light"] .footer-brand span { border-color: #cfcfcf; color: #666; }
html[data-theme="light"] .brand-product span { color: #aaa; }
html[data-theme="light"] .api-link { border-color: #d2d2d2; background: rgba(255, 255, 255, 0.84); color: #666; }
html[data-theme="light"] .api-link:hover { border-color: #bdbdbd; background: #fff; color: #000; }
html[data-theme="light"] .page::before {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.055) 1px, transparent 1px);
}
html[data-theme="light"] .catalog-hero-copy { color: #666; }
html[data-theme="light"] .search-field { border-color: #ccc; background: rgba(255, 255, 255, 0.92); color: #747474; }
html[data-theme="light"] .search-field:focus-within { border-color: #999; background: #fff; }
html[data-theme="light"] .search-field input::placeholder { color: #777; }
html[data-theme="light"] .section-heading { border-bottom-color: rgba(0, 0, 0, 0.1); }
html[data-theme="light"] .section-heading span { color: #888; }
html[data-theme="light"] .connector-card:hover { border-color: #d9d9d9; background: rgba(255, 255, 255, 0.88); }
html[data-theme="light"] .connector-logo,
html[data-theme="light"] .detail-logo { border-color: #d7d7d7; background: #fff; box-shadow: inset 0 1px rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .card-meta { color: #888; }
html[data-theme="light"] .tag-skills { border-color: #e8c69f; background: #fff3e6; color: #94541f; }
html[data-theme="light"] .tag-risk-read { border-color: #d7d7d7; background: #eee; color: #555; }
html[data-theme="light"] .tag-risk-destructive { color: var(--red); }
html[data-theme="light"] .spinner { border-color: #d3d3d3; border-top-color: var(--secondary); }
html[data-theme="light"] .prompt-card,
html[data-theme="light"] .tool-row,
html[data-theme="light"] .info-card { background: #fff; }
html[data-theme="light"] .prompt-card { color: #333; }
html[data-theme="light"] .tool-row[open] summary { background: #f7f7f7; }
html[data-theme="light"] .tool-name { color: #333; }
html[data-theme="light"] .info-row dt { color: #777; }
html[data-theme="light"] .info-row dd { color: #333; }
html[data-theme="light"] .site-footer { color: #777; }
html[data-theme="light"] .footer-brand { color: #666; }
html[data-theme="light"] .theme-toggle { border-color: rgba(0, 0, 0, 0.1); background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] .theme-toggle button { color: #7e7f84; }
html[data-theme="light"] .theme-toggle button:hover { color: #000; }
html[data-theme="light"] .theme-toggle button[aria-pressed="true"] { background: #f0f0f0; color: #000; }

@media (max-width: 780px) {
  .catalog-hero { grid-template-columns: 1fr; align-items: start; gap: 30px; }
  .connector-grid { grid-template-columns: 1fr; gap: 5px; }
  .detail-layout { grid-template-columns: 1fr; gap: 46px; }
  .info-card { position: static; }
}

@media (max-width: 540px) {
  .site-footer, .page { width: min(calc(100% - 30px), var(--max-width)); }
  .site-header { min-height: 60px; padding-inline: 15px; }
  .brand-product { display: none; }
  .page { padding-top: 50px; }
  .catalog-hero { margin-bottom: 50px; }
  .catalog-hero h1 { font-size: 42px; }
  .connector-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 13px; }
  .connector-logo { width: 48px; height: 48px; border-radius: 13px; }
  .connector-logo img { width: 28px; height: 28px; }
  .connector-logo.app-artwork img { width: 38px; height: 38px; border-radius: 9px; }
  .card-meta > span:first-child { display: none; }
  .detail-header { grid-template-columns: 68px minmax(0, 1fr); gap: 18px; }
  .detail-logo { width: 68px; height: 68px; border-radius: 18px; }
  .detail-logo img { width: 39px; height: 39px; }
  .detail-logo.app-artwork img { width: 54px; height: 54px; border-radius: 13px; }
  .detail-title h1 { font-size: 35px; }
  .detail-description { grid-column: 1 / -1; margin-top: 8px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .footer-actions { width: 100%; align-items: flex-start; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
