/* Makueni County eServices landing page */

:root {
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #5b6878;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --blue: #0072bc;
  --blue-deep: #00558c;
  --green: #198754;
  --radius: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Hero (logo, navigation, search) ---------- */

.hero {
  padding-block: 20px clamp(28px, 4vw, 44px);
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(25, 135, 84, 0.1), transparent 60%),
    radial-gradient(800px 420px at 0% 100%, rgba(0, 114, 188, 0.09), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand img {
  width: auto;
  height: 56px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: rgba(15, 27, 45, 0.06);
  color: var(--blue-deep);
}

.site-nav .nav-cta {
  background: var(--blue);
  color: #fff;
}

.site-nav .nav-cta:hover {
  background: var(--blue-deep);
  color: #fff;
}

.hero__content {
  margin-top: clamp(36px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.hero h1 {
  margin-top: 12px;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero h1 span {
  color: var(--blue);
}

.lead {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}

.finder {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin-top: 28px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #d5dde7;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 10px 28px -18px rgba(15, 27, 45, 0.3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 114, 188, 0.16);
}

.search .icon {
  position: absolute;
  left: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 56px 0 50px;
  border: 0;
  border-radius: inherit;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}

.search input::placeholder {
  color: #8592a2;
}

.search kbd {
  position: absolute;
  right: 16px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font: 600 0.75rem/1.4 var(--font);
  pointer-events: none;
}

.search:focus-within kbd {
  display: none;
}

@media (hover: none) {
  .search kbd {
    display: none;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: 600 0.875rem/1.2 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: #c3cfdc;
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.chip__count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.chip[aria-pressed="true"] .chip__count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ---------- Services ---------- */

.services {
  padding-block: 0 72px;
}

.status {
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.875rem;
}

.category {
  margin-top: 28px;
}

.category__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.category__head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.category__head h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.category__head p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: 0 16px 32px -20px rgba(15, 27, 45, 0.35);
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card__icon .icon {
  width: 24px;
  height: 24px;
}

.card__arrow {
  color: #9aa6b4;
  transition: color 0.18s ease, transform 0.18s ease;
}

.card:hover .card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.card h3 {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
}

.card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.card__host {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card__host::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.cat-citizen {
  --accent: #0072bc;
  --accent-soft: #e5f1fa;
  --accent-line: #a9cfea;
}

.cat-business {
  --accent: #b45309;
  --accent-soft: #fdf1e1;
  --accent-line: #f0c998;
}

.cat-land {
  --accent: #198754;
  --accent-soft: #e6f4ec;
  --accent-line: #a6d5bb;
}

.cat-education {
  --accent: #be2a5f;
  --accent-soft: #fce9f0;
  --accent-line: #f0b5ca;
}

.cat-operations {
  --accent: #6d3fc0;
  --accent-soft: #f0eafb;
  --accent-line: #c9b5ee;
}

.empty {
  margin-top: 32px;
  padding: 40px 24px;
  border: 1px dashed #cfd8e3;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.125rem;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 28px;
  background: #0c1a2b;
  color: #b8c4d2;
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Small screens & motion ---------- */

@media (max-width: 640px) {
  .brand img {
    height: 40px;
  }

  .site-nav a {
    padding: 7px 12px;
    font-size: 0.875rem;
  }

  /* One swipeable row of filters instead of several wrapped rows. */
  .chips {
    flex-wrap: nowrap;
    margin-inline: calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .card:hover,
  .card:hover .card__arrow {
    transform: none;
  }
}
