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

:root {
  --bg: #0f1117;
  --surface: #181b23;
  --surface2: #1f2330;
  --border: #2a2f3e;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --text: #e2e8f0;
  --muted: #64748b;
  --radius: 14px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Header ── */
header {
  padding: 48px 40px 36px;
  max-width: 960px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo h1 span { color: var(--accent2); }

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-left: 52px;
}

/* ── Search ── */
.search-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 14px 24px;
  width: 100%;
  max-width: 620px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.search-box svg { flex-shrink: 0; color: var(--muted); }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  width: 100%;
}

.search-box input::placeholder { color: var(--muted); }

/* ── Search dropdown ── */
.search-dropdown {
  position: absolute;
  top: calc(100% - 28px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: none;
  z-index: 100;
  max-height: 420px;
  overflow-y: auto;
}

.search-dropdown.open { display: block; }

.sd-group {
  padding: 10px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border-top: 1px solid var(--border);
}

.sd-group:first-child { border-top: none; }

.sd-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid rgba(42, 47, 62, 0.5);
  transition: background 0.12s;
  gap: 10px;
}

.sd-item:last-child { border-bottom: none; }
.sd-item:hover,
.sd-item.active { background: var(--surface2); }

.sd-title { flex: 1; }

/* ── Main ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── Category ── */
.category {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.breadcrumb .crumb      { color: var(--muted); }
.breadcrumb .sep        { color: var(--border); }
.breadcrumb .crumb-active { color: var(--accent2); }

.cat-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

.divider {
  height: 1px;
  background: var(--border);
  flex: 1;
}

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.18s;
}

.card:hover {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card:hover::before { opacity: 1; }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--icon-bg, rgba(108, 99, 255, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--tag-bg, rgba(108, 99, 255, 0.15));
  color: var(--tag-color, var(--accent2));
  font-weight: 500;
}

.card-arrow {
  color: var(--muted);
  font-size: 16px;
  transition: transform 0.18s, color 0.18s;
}

.card:hover .card-arrow {
  transform: translateX(3px);
  color: var(--card-accent, var(--accent));
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ── Coming soon ── */
.card.soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.card.soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}
.card.soon::before { display: none; }

.soon-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(100,116,139,0.15);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
  header,
  .search-wrap,
  main { padding-left: 20px; padding-right: 20px; }
  header { padding-top: 32px; }
  .cards { grid-template-columns: 1fr; }
}
