* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0b0b;
  --bg-soft: #141414;
  --border: rgba(255,255,255,0.09);
  --text: #f2f0ec;
  --text-dim: #98938a;
  --text-faint: #59564f;
  --accent: #e8622c;
  --free: #4fae72;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, "SF Mono", Menlo, monospace;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 12px 6px 8px;
}
.logo .mark { flex-shrink: 0; }
.logo .name { color: var(--text-dim); font-weight: 500; }

nav.top {
  display: flex;
  align-items: center;
  gap: 26px;
}
nav.top a.link {
  font-size: 13.5px;
  color: var(--text-dim);
  transition: color 0.15s;
}
nav.top a.link:hover { color: var(--text); }

.notify-wrap { position: relative; }

.btn-solid {
  background: var(--text);
  color: #0b0b0b;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-solid:hover { opacity: 0.88; }
.btn-solid:active { transform: scale(0.97); }

.btn-outline {
  background: transparent;
  color: var(--text);
  padding: 8px 17px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn-outline:hover { border-color: var(--text-faint); background: var(--bg-soft); }
.btn-outline:active { transform: scale(0.97); }
.btn-outline.btn-signed-in { padding: 6px 14px 6px 6px; }

.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: none;
  z-index: 20;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5), 0 4px 12px -4px rgba(232,98,44,0.06);
}
.popover.open { display: block; }
.popover p { font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; line-height: 1.4; }
.popover-row { display: flex; gap: 8px; }
.popover input[type="email"], .popover input[type="url"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.popover input[type="email"]:focus, .popover input[type="url"]:focus { border-color: var(--accent); }
.popover .btn-solid { padding: 9px 14px; border-radius: 8px; white-space: nowrap; }
.popover .success { font-size: 12.5px; color: var(--free); display: none; }
.popover .success.show { display: block; }

.oauth-row { display: flex; flex-direction: column; gap: 8px; }
.btn-oauth {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-oauth:hover { border-color: var(--text-faint); background: var(--bg-soft); }

.btn-signed-in { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

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

main.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 36px;
  text-align: center;
}

h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.sub {
  font-size: 16.5px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 30px;
  text-wrap: balance;
}

.search-wrap {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 19px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}
input#search {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px 14px 46px;
  border-radius: 100px;
  font-size: 14.5px;
  outline: none;
}
input#search:focus { border-color: var(--accent); }
input#search::placeholder { color: var(--text-faint); }

/* ---------- List ---------- */

section.list-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px 100px;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 2px 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.row:hover { background: rgba(255,255,255,0.025); transform: translateX(2px); }
.row:hover .name { color: var(--accent); }
.row:hover .icon { border-color: rgba(232,98,44,0.3); color: var(--accent); }

.rank {
  width: 22px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.row-main { flex: 1; min-width: 0; }
.name { font-size: 14.5px; font-weight: 600; transition: color 0.15s; }
.desc {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.tag.free { color: var(--free); background: rgba(79,174,114,0.12); }
.tag.paid { color: var(--accent); background: rgba(232,98,44,0.12); }

.cat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 96px;
}
.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-faint);
  font-size: 13.5px;
  display: none;
}

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
}

footer a { color: var(--text-dim); transition: color 0.15s; text-decoration: none; }
footer a:hover { color: var(--text); }

.footer-cols {
  display: flex;
  gap: 64px;
  margin-bottom: 40px;
  text-align: left;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.footer-col a { font-size: 13px; cursor: pointer; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: left;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.footer-social {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-social:hover { color: var(--text); border-color: var(--text-faint); }

.footer-disclaimer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .footer-cols { gap: 32px; }
}

@media (max-width: 640px) {
  nav.top a.link { display: none; }
  .cat { display: none; }
  .desc { white-space: normal; }
  .popover { width: 240px; }
}

/* ---------- Detail page ---------- */

.detail-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--text-dim); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.detail-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
}
.detail-icon svg { width: 24px; height: 24px; }

.detail-title-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.detail-tags { display: flex; gap: 8px; flex-shrink: 0; margin-top: 4px; }

.detail-desc {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 560px;
  margin: 18px 0 28px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 28px;
}

.detail-actions { display: flex; gap: 10px; margin-bottom: 40px; }
.btn-visit {
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-visit:hover { opacity: 0.9; }
.btn-visit:active { transform: scale(0.98); }

details.install {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
details.install summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.install summary::-webkit-details-marker { display: none; }
details.install summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-faint);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
details.install[open] summary::after { transform: rotate(45deg); }
details.install p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-top: 14px;
  max-width: 560px;
}

.related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 40px 0 12px;
}
