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

:root {
  --bg:          #0D0D0D;
  --surface:     #1A1A1A;
  --border:      #2A2A2A;
  --border-hover:#3D3D3D;
  --text:        #E8E8E8;
  --text-muted:  #6B6B6B;
  --accent:      #5B8CFF;
  --accent-dim:  rgba(91, 140, 255, 0.12);
  --font-mono:   'JetBrains Mono', monospace;
  --font-sans:   'Inter', sans-serif;
  --radius:      8px;
  --transition:  160ms ease;
}

html, body {
  height: 100%;
}

html.light {
  --bg:          #F5F5F5;
  --surface:     #FFFFFF;
  --border:      #E0E0E0;
  --border-hover:#C0C0C0;
  --text:        #1A1A1A;
  --text-muted:  #888888;
  --accent-dim:  rgba(91, 140, 255, 0.10);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.theme-toggle{
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  z-index: 200;

  & svg{
    width: 16px;
    height: 16px;
    fill: var(--text);
    transition: fill var(--transition);
  }
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px 56px;
  gap: 32px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}

.logo .accent {
  color: var(--accent);
}

/* ─── Search ────────────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
  font-family: var(--font-mono);
  line-height: 1;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 14px 100px 14px 44px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--accent);
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.search-input:focus ~ .search-hint {
  opacity: 1;
}

/* ─── Autocomplete ──────────────────────────────────────────── */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  overflow: hidden;
  z-index: 100;
  display: none;
}

.autocomplete-list.visible {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-mono);
  font-size: 13px;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.autocomplete-item .item-category {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  font-family: var(--font-sans);
}

/* ─── Content ───────────────────────────────────────────────── */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ─── Category ──────────────────────────────────────────────── */
.category-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt {
  color: var(--accent);
  font-size: 14px;
}

/* ─── Tools grid ────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* ─── Tool card ─────────────────────────────────────────────── */
.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.tool-card:hover {
  border-color: var(--border-hover);
  background: #1F1F1F;
  transform: translateY(-1px);
}

.tool-card:hover .tool-name {
  color: var(--accent);
}

.tool-icon {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 6px;
  flex-shrink: 0;
}

.tool-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}

.tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero {
    padding: 48px 16px 40px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}