:root {
  --canvas: #000;
  --panel: #050505;
  --line: #1a1a1a;
  --line-strong: #292929;
  --text: #f4f4f4;
  --muted: #888;
  --link: #a2a2a2;
  --max-width: 920px;
  --header-pad: 24px;
  --ease-out: cubic-bezier(.2,.75,.25,1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 8px 10px;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 50px 0 72px;
}

.site-header {
  padding: 0 var(--header-pad);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-family: "Pixelify Sans", "Inter", ui-sans-serif, sans-serif;
  font-size: clamp(25px, 3.2vw, 31px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.wordmark__cross {
  display: inline-block;
  color: #9d9d9d;
  font-weight: 420;
  transform-origin: 50% 51%;
  transition: color 120ms ease, transform 140ms var(--ease-out);
}

.wordmark:hover .wordmark__cross,
.wordmark:focus-visible .wordmark__cross {
  color: #fff;
  transform: rotate(45deg);
}

.descriptor {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 38px;
}

.stack-toggle {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: #030303;
  color: #d8d8d8;
  font-size: 14px;
  letter-spacing: .03em;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 100ms ease, border-color 100ms ease;
}
.stack-toggle:hover,
.stack-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: #fff;
}
.stack-toggle:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.side-switch {
  display: flex;
  gap: 6px;
}

.side-switch__tab {
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: #030303;
  color: #777;
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: .08em;
  padding: 12px 16px;
  transition: color 100ms ease, border-color 100ms ease, background 100ms ease;
}

.side-switch__tab:hover {
  color: #fff;
}

.side-switch__tab[aria-selected="true"] {
  color: #070707;
  background: #f2f2f2;
  border-color: #f2f2f2;
}

.side-switch__tab:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.search {
  display: flex;
  align-items: center;
  width: min(240px, 42vw);
  height: 34px;
  border-bottom: 1px solid var(--line-strong);
  color: #858585;
  transition: border-color 100ms ease, color 100ms ease;
}

.search:focus-within {
  border-color: #d8d8d8;
  color: #fff;
}

.search__icon {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-right: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.search__icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eee;
  font-size: 13px;
}

.search input::placeholder {
  color: #666;
}

.search kbd {
  margin-left: 8px;
  color: #5f5f5f;
  font-family: inherit;
  font-size: 11px;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transition: opacity 90ms ease, transform 90ms ease;
}
.catalog[data-side="skelly"] {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.catalog[data-side="skelly"] .category {
  border-left: 1px solid var(--line);
}
.catalog.is-switching {
  --dir: 1;
  animation: side-enter 240ms var(--ease-out) backwards;
}
/* Grid crossfade on AI<->DESIGN switch. The container dips to near-opaque,
   then the reconciled rows fade in — reads as a morph of the same layout
   rather than a teardown. Search re-renders (no .is-reconciling) stay instant. */
.catalog.is-reconciling {
  opacity: 0.15;
  transform: translateY(4px);
  transition: opacity 110ms ease, transform 110ms ease;
}
.catalog:not(.is-reconciling) {
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
/* changed content (heading / row) crossfades into place */
.category__heading--reconciling,
.resource-link--reconciling {
  animation: content-fade 200ms var(--ease-out);
}
@keyframes content-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.category {
  min-width: 0;
  padding: 24px 23px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #000;
}

.category__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  color: #f7f7f7;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.category__count {
  flex: 0 0 auto;
  color: #4f4f4f;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.resource-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.resource-link {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  color: var(--link);
  font-size: 17px;
  line-height: 1.35;
  text-decoration: none;
  transition: color 100ms ease, transform 70ms ease;
}

.resource-link:hover,
.resource-link:focus-visible {
  color: #fff;
}

.resource-link:hover .resource-name::after,
.resource-link:focus-visible .resource-name::after {
  transform: scaleX(1);
}

.resource-link:active {
  transform: translateY(1px);
}

.resource-link:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.resource-logo {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin-right: 10px;
  object-fit: contain;
  transition: transform 100ms var(--ease-out);
}

.resource-link:hover .resource-logo,
.resource-link:focus-visible .resource-logo {
  transform: translateY(-1px) scale(1.04);
}

.resource-name {
  position: relative;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resource-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 110ms var(--ease-out);
}

/* ── price badges ─────────────────────────────────────────────────────── */
.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 17px;
  height: 17px;
  margin-left: 8px;
  padding: 0 4px;
  border-radius: 3px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
}

.resource-link .price-badge {
  margin-left: auto;
  opacity: 1;
  transform: none;
}

.tier-free,
.tier-low {
  color: #56d36f;
  border: 1px solid rgba(86, 211, 111, .35);
  background: rgba(86, 211, 111, .08);
}

.tier-mid {
  color: #f0a13c;
  border: 1px solid rgba(240, 161, 60, .35);
  background: rgba(240, 161, 60, .08);
}

.tier-high {
  color: #f0645a;
  border: 1px solid rgba(240, 100, 90, .35);
  background: rgba(240, 100, 90, .08);
}

.tier-none {
  min-width: auto;
  color: #8a8a8a;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .03);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.tier-usage {
  min-width: auto;
  color: #8fa3c9;
  border: 1px solid rgba(143, 163, 201, .35);
  background: rgba(143, 163, 201, .08);
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: lowercase;
}

/* ── tooltip ──────────────────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 288px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px;
  border: 1px solid #262626;
  border-radius: 8px;
  background: rgba(8, 8, 8, .96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.tooltip[hidden] {
  display: none;
}

.tooltip__name {
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.tooltip__domain {
  overflow: hidden;
  color: #6f6f6f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip__desc {
  color: #b8b8b8;
  font-size: 12.5px;
  line-height: 1.5;
}

.tooltip__price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.tooltip__pricetext {
  color: #9a9a9a;
  font-size: 12px;
}

.tooltip__cta {
  margin-top: 2px;
  color: #7b7b7b;
  font-size: 11.5px;
  letter-spacing: .02em;
}

/* ── search quick-jump popover ────────────────────────────────────────── */
.jump-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  left: 0;
  width: min(520px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid #262626;
  border-radius: 10px;
  background: rgba(8, 8, 8, .97);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .65), 0 2px 8px rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px);
}

.jump-popover__title {
  margin: 0 0 10px;
  color: #5f5f5f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

.jump-popover__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9d9d9d;
  cursor: pointer;
  font-size: 12.5px;
  text-align: left;
  transition: background 90ms ease, color 90ms ease;
}

.jump-popover__item:hover,
.jump-popover__item:focus-visible {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  outline: none;
}

.jump-popover__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #6f6f6f;
}

.jump-popover__item:hover .jump-popover__icon,
.jump-popover__item:focus-visible .jump-popover__icon {
  color: #d8d8d8;
}

.jump-popover__icon svg {
  width: 100%;
  height: 100%;
}

.jump-popover__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jump-popover__count {
  margin-left: auto;
  color: #4f4f4f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* ── bottom nav (switch side + back to top) ───────────────────────────── */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  padding: 26px 24px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #000;
}

.bottom-nav__switch,
.bottom-nav__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  background: transparent;
  color: #cfcfcf;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  transition: border-color 100ms ease, color 100ms ease, background 100ms ease;
}

.bottom-nav__switch:hover,
.bottom-nav__switch:focus-visible,
.bottom-nav__top:hover,
.bottom-nav__top:focus-visible {
  border-color: #555;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  outline: none;
}

.bottom-nav__switch span,
.bottom-nav__top span {
  color: #6f6f6f;
  font-size: 14px;
}

@media (max-width: 620px) {
  .bottom-nav {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 20px 6px;
  }

  .bottom-nav__switch,
  .bottom-nav__top {
    justify-content: center;
  }
}

.empty-state {
  padding: 80px 24px;
  border: 1px solid var(--line);
  color: #858585;
  font-size: 18px;
  text-align: center;
}

.empty-state strong {
  color: #fff;
  font-weight: 550;
}

.empty-state button {
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid #333;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.empty-state__hint {
  display: block;
  margin: 18px auto 0;
  padding: 9px 14px;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  background: transparent;
  color: #cfcfcf;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 100ms ease, color 100ms ease, background 100ms ease;
}

.empty-state__hint:hover,
.empty-state__hint:focus-visible {
  border-color: #555;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  outline: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 24px 0;
  color: #565656;
  font-size: 14px;
  line-height: 1.5;
}

.footer p {
  margin: 0;
}

.footer a {
  color: #7b7b7b;
  text-underline-offset: 3px;
}

.footer a:hover,
.footer a:focus-visible {
  color: #fff;
}

#visible-count {
  display: inline-block;
  min-width: 2ch;
  color: #8f8f8f;
  font-variant-numeric: tabular-nums;
  transition: opacity 90ms ease, transform 90ms ease;
}

#visible-count.is-changing {
  opacity: .25;
  transform: translateY(-2px);
}

noscript {
  display: block;
  padding: 20px;
  color: #fff;
  text-align: center;
}

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

@media (max-width: 620px) {
  .shell {
    width: 100%;
    padding-top: 34px;
  }

  .site-header {
    padding: 0 20px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-top: 30px;
  }

  .side-switch,
  .search {
    width: 100%;
  }

  .search {
    padding: 0 2px;
  }

  .catalog {
    grid-template-columns: 1fr;
    margin-top: 24px;
    border-left: 0;
  }

  .category {
    padding: 22px 20px 24px;
    border-right: 0;
  }

  .category__heading {
    font-size: 15px;
  }

  .resource-link {
    min-height: 44px;
    font-size: 14px;
  }

  .resource-logo {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
    margin-right: 10px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 20px 0;
  }
}

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