:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5c6b7f;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --category-color: var(--primary);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  white-space: nowrap;
}

.logo__icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.nav a {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover,
.nav a.active {
  background: #eff6ff;
  color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: white;
  padding: 3.5rem 1.5rem 4rem;
}

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero p {
  opacity: 0.9;
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  background: white;
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  min-width: 0;
}

.search-box button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.search-box button:hover {
  background: var(--primary-dark);
}

/* Main */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.section__header {
  margin-bottom: 1.75rem;
}

.section__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.section__header p {
  color: var(--text-muted);
}

/* Category tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--tile-color, var(--primary));
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.tile__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.tile h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.tile p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

.tile__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tile-color, var(--primary));
  background: color-mix(in srgb, var(--tile-color, var(--primary)) 12%, white);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.tile__subs {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* SEO tip box */
.seo-box {
  margin-top: 3rem;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.75rem;
}

.seo-box h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.seo-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.seo-box code {
  background: white;
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #1e40af;
}

.seo-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.seo-examples span {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--text-muted);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Category hero */
.category-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--category-color);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.category-hero__icon {
  font-size: 2.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.category-hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.category-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Subcategories filter */
.subcats {
  margin-bottom: 2rem;
}

.subcats__title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.subcats__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subcat-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.subcat-btn:hover {
  border-color: var(--category-color);
  color: var(--category-color);
}

.subcat-btn.active {
  background: var(--category-color);
  border-color: var(--category-color);
  color: white;
}

.subcats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.subcat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.subcat-card:hover,
.subcat-card.active {
  border-color: var(--category-color);
  box-shadow: 0 0 0 1px var(--category-color);
}

.subcat-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.subcat-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Companies */
.companies-block {
  margin-bottom: 2rem;
}

.companies-section__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.companies {
  display: grid;
  gap: 1rem;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: box-shadow 0.2s;
}

.company-card:hover {
  box-shadow: var(--shadow);
}

.company-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.company-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.tag--spec {
  background: color-mix(in srgb, var(--category-color) 14%, white);
  color: var(--category-color);
}

.company-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
}

.company-card__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
}

.company-card__contact a {
  color: var(--primary);
  font-weight: 500;
}

.company-card__contact a:hover {
  text-decoration: underline;
}

.company-card--placeholder {
  border-style: dashed;
  background: #fafbfc;
}

.company-card__contact--empty {
  color: var(--text-muted);
  opacity: 0.7;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Search results */
.search-results {
  display: none;
  margin-bottom: 2rem;
}

.search-results.visible {
  display: block;
}

.search-results h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.footer__brand {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer__nav a {
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  appearance: none;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .header {
    position: sticky;
  }

  .header__inner {
    position: relative;
  }

  .hero {
    padding: 2.5rem 1.25rem 3rem;
  }

  .search-box {
    flex-direction: column;
  }
}
