:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #0063b1;
  --primary-hover: #004e8c;
  --badge-bg: #e0f2fe;
  --badge-text: #0369a1;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 12px 24px rgba(0, 99, 177, 0.12);
}

body.dark {
  --bg: #0b1220;
  --surface: #131c2e;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #24324a;
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --badge-bg: #0c4a6e;
  --badge-text: #bae6fd;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 26px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.nav-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  height: 36px;
  width: auto;
  display: block;
}

.brand-wordmark {
  height: 28px;
  width: auto;
  display: block;
}

body.dark .brand-wordmark {
  filter: brightness(0) invert(1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.theme-btn {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.theme-btn:hover {
  border-color: var(--primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 58px 0 46px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  max-width: 640px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 1.04rem;
}

.search-wrap {
  max-width: 540px;
  margin: 0 auto;
}

.search-wrap input {
  width: 100%;
  padding: 13px 18px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 99, 177, 0.12);
}

/* Tools Grid */
.tools-section {
  padding: 42px 20px 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.35rem;
}

.view-all {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
}

.view-all:hover {
  text-decoration: underline;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.cat-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.card-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

.no-results {
  text-align: center;
  padding: 32px 12px;
  color: var(--muted);
}

.no-results a {
  color: var(--primary);
}

/* Footer */
.site-footer {
  margin-top: 52px;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.86rem;
  }

  .hero {
    padding: 40px 0 34px;
  }
}
