:root { color-scheme: dark; }
* { box-sizing: border-box; }
html { background: #05070a; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #0b3d44 0%, #071018 55%, #05070a 100%);
  color: #e8f6f7;
  -webkit-tap-highlight-color: transparent;
}
a { color: #9be7ea; }
.wrap {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 28px 20px 60px;
}
header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  flex-shrink: 0;
  pointer-events: none;
}
h1 { margin: 0; font-size: 1.45rem; letter-spacing: 0.02em; user-select: none; -webkit-user-select: none; }
.sub { margin: 4px 0 0; color: #a7c4c8; font-size: 0.92rem; user-select: none; -webkit-user-select: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: #018084;
  color: white;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition:
    background-color 0.18s ease,
    transform 0.22s cubic-bezier(.16,1,.3,1),
    box-shadow 0.22s ease;
}
.btn:hover { background: #01989d; box-shadow: 0 8px 22px rgba(1,128,132,0.32); }
.btn:active { transform: scale(0.965); }
.btn.copied { background: #0d6b45; }
.btn.copied:hover { background: #0f7d51; }
.btn.ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8f6f7;
}
.btn.ghost:hover { background: rgba(255,255,255,0.1); }
.btn.disabled {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #7fa0a5;
  cursor: not-allowed;
  pointer-events: none;
}
.repo-wrap { position: relative; display: inline-flex; }
.btn .caret {
  font-size: 0.68em;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.32s cubic-bezier(.16,1,.3,1), opacity 0.2s ease;
}
.btn[aria-expanded="true"] .caret { transform: rotate(180deg); opacity: 1; }
.repo-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 212px;
  max-width: min(300px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px;
  background: rgba(9, 18, 24, 0.94);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px) scale(0.95);
  transform-origin: top right;
  transition:
    opacity 0.16s ease,
    transform 0.3s cubic-bezier(.16,1,.3,1),
    visibility 0s linear 0.3s;
}
.repo-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.2s ease 0.04s,
    transform 0.45s cubic-bezier(.16,1,.3,1),
    visibility 0s;
}
.repo-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  overflow: hidden;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  color: #e8f6f7;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-7px);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.24s ease,
    transform 0.38s cubic-bezier(.16,1,.3,1);
  transition-delay: 0s, 0s, 0s, 0s;
}
.repo-menu.open .repo-item {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s, 0s, var(--d, 0ms), var(--d, 0ms);
}
/* Stagger without inline styles (required for a strict style-src) */
.repo-menu.open .repo-item:nth-child(2) { transition-delay: 0s, 0s, 45ms, 45ms; }
.repo-menu.open .repo-item:nth-child(3) { transition-delay: 0s, 0s, 90ms, 90ms; }
.repo-menu.open .repo-item:nth-child(4) { transition-delay: 0s, 0s, 135ms, 135ms; }
.repo-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 50%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #9be7ea;
  transition: top 0.26s cubic-bezier(.16,1,.3,1), bottom 0.26s cubic-bezier(.16,1,.3,1);
}
.repo-item:hover, .repo-item:focus-visible {
  background: rgba(1,128,132,0.3);
  outline: none;
}
.repo-item:hover::before,
.repo-item:focus-visible::before { top: 7px; bottom: 7px; }
.repo-item:active { background: rgba(1,128,132,0.45); }
.repo-item.copied { background: #0d6b45; }
.repo-item.copied::before { top: 7px; bottom: 7px; background: #7dffc4; }
.repo-item .repo-tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9be7ea;
  background: rgba(1,128,132,0.2);
  border: 1px solid rgba(1,128,132,0.4);
  border-radius: 999px;
  padding: 4px 9px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.24s cubic-bezier(.16,1,.3,1);
}
.repo-item:hover .repo-tag { background: rgba(1,128,132,0.42); color: #c9f7f9; }
.repo-item.copied .repo-tag {
  color: #d7ffe9;
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.07);
}
@media (prefers-reduced-motion: reduce) {
  .repo-menu, .repo-item, .repo-item::before,
  .repo-item .repo-tag, .btn, .btn .caret { transition-duration: 0.01ms !important; }
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.search {
  flex: 1;
  min-width: 220px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e8f6f7;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
}
.search:focus { border-color: #018084; box-shadow: 0 0 0 3px rgba(1,128,132,0.25); }
.count { color: #7fa0a5; font-size: 0.9rem; white-space: nowrap; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  content-visibility: auto;
  contain: layout paint style;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(1,128,132,0.55);
  background: rgba(255,255,255,0.06);
}
.card-top { display: flex; gap: 12px; align-items: center; }
.card-name-wrap { min-width: 0; }
.icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { margin: 4px 0 0; color: #a7c4c8; font-size: 0.86rem; }
.tweak {
  display: inline-block;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(1,128,132,0.18);
  border: 1px solid rgba(1,128,132,0.35);
  color: #9be7ea;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
}
.tweak.empty {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #7fa0a5;
}
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: #a7c4c8;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 18px;
}
.empty-state.full { grid-column: 1 / -1; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a7c4c8;
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.back:hover { color: #9be7ea; }
.detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.detail-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
}
.detail h2 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  line-height: 1.2;
}
.detail .dev { color: #a7c4c8; margin: 0 0 16px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cfe8ea;
  font-size: 0.85rem;
}
.info {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 14px;
  margin: 0 0 20px;
  font-size: 0.95rem;
}
.info dt { color: #7fa0a5; }
.info dd {
  margin: 0;
  word-break: break-word;
  color: #e8f6f7;
}
.dl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.json-link {
  font-size: 0.88rem;
  color: #7fa0a5;
  text-decoration: none;
}
.json-link:hover { color: #9be7ea; }
.hidden { display: none !important; }
@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .detail-icon { width: 160px; }
  .info { grid-template-columns: 1fr; gap: 4px; }
  .info dt { margin-top: 8px; }
  header { align-items: flex-start; flex-direction: column; }
  .repo-menu { right: auto; left: 0; }
}
