/* ── Reset & Vars ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --surface: #1e1e2e;
  --surface2: #252538;
  --border: #2a2a3d;
  --border-light: #3a3a52;
  --text: #e4e4f0;
  --text-muted: #8888a4;
  --text-dim: #5a5a74;
  --accent: #0ea5e9;
  --accent2: #38bdf8;
  --accent-glow: rgba(14, 165, 233, 0.15);
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #a78bfa;
  --pink: #ec4899;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--surface); padding: 0.15em 0.4em; border-radius: 4px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 700px; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.nav-icon { color: var(--accent); font-size: 1.3rem; }
.nav-dot { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; max-width: 700px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

/* ── Search ── */
.search-box {
  position: relative;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-box input::placeholder { color: var(--text-dim); }

/* ── Stats ── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-stats .stat span { color: var(--text); font-weight: 700; }
.stat-sep { color: var(--text-dim); }

/* ── Sections ── */
.section { padding: 3rem 0; }
.section-alt { background: var(--bg2); }

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-header h2 { font-size: 1.3rem; font-weight: 700; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.section-title svg { color: var(--orange); }

.section-desc {
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ── Category Pills ── */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.pill-btn:hover { border-color: var(--border-light); color: var(--text); }
.pill-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pill-count {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}
.pill-btn.active .pill-count { background: rgba(255,255,255,0.25); }

/* ── Site Grid ── */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.site-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}
.site-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.site-card.featured-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(245, 158, 11, 0.04) 100%);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.card-info { flex: 1; min-width: 0; }
.card-name {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-name a { color: var(--text); text-decoration: none; }
.card-name a:hover { color: var(--accent); text-decoration: none; }

.featured-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--orange) 0%, #d97706 100%);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-url {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.tool-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent2);
  white-space: nowrap;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.card-category {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.card-visit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.card-visit:hover { text-decoration: underline; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.empty-state svg { margin-bottom: 1rem; opacity: 0.5; }
.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.text-btn:hover { text-decoration: underline; }

/* ── Load more ── */
.load-more-wrap { text-align: center; padding: 2rem 0; }
.load-more-btn {
  padding: 0.6rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Submit Form ── */
.submit-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.label-hint { font-weight: 400; color: var(--text-dim); font-size: 0.8rem; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Tools input ── */
.tools-input-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.tool-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.5rem;
  align-items: center;
}
.tool-row input {
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  outline: none;
}
.tool-row input.tool-desc { font-family: var(--font); }
.tool-row input:focus { border-color: var(--accent); }
.tool-remove {
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-remove:hover { border-color: var(--red); color: var(--red); }

.submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.submit-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
}
.submit-msg.success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--green); }
.submit-msg.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--red); }

/* ── About ── */
.about-content p { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.7; }
.about-content strong { color: var(--text); }

.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.about-card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.about-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.about-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

.about-note {
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* ── Footer ── */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { font-weight: 700; font-size: 0.9rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-dim); font-size: 0.82rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.7rem 1.2rem;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  animation: slideIn 0.25s ease;
}
.toast.success { border-color: rgba(34, 197, 94, 0.4); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); }
.toast.fade-out { opacity: 0; transition: opacity 0.3s; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .site-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .about-cards { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
