/* ============================================================
   Findyourdata Service — shared stylesheet
   Pure CSS, no framework. Color tokens live on :root.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef2f9;
  --text: #1b2333;
  --text-muted: #5b6577;
  --border: #dce2ee;
  --primary: #1f5eff;
  --primary-dark: #1546c7;
  --primary-soft: #e6edff;
  --accent: #0fa37f;
  --accent-soft: #e2f7f0;
  --warn: #d97706;
  --danger: #c62828;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.06), 0 6px 20px rgba(20, 30, 60, 0.06);
  --shadow-hover: 0 4px 10px rgba(20, 30, 60, 0.10), 0 14px 32px rgba(20, 30, 60, 0.10);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1200px;
}

/* Dark mode follows the OS preference */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #171d2b;
    --surface-alt: #1f2736;
    --text: #e8ecf4;
    --text-muted: #9aa5b9;
    --border: #2a3345;
    --primary: #5b8cff;
    --primary-dark: #7ea3ff;
    --primary-soft: #1c2a4d;
    --accent: #2fc79f;
    --accent-soft: #123a30;
    --danger: #ff7b7b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 2px; }
@media (prefers-color-scheme: dark) { mark { background: #5a4a00; } }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.section { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.section-head p { margin: 4px 0 0; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-align: center;
  border-radius: 10px; padding: 9px 14px; font-size: .92rem; font-weight: 600;
  border: 1px solid transparent; transition: all .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn-link { background: none; border: none; color: var(--primary); font-weight: 500; padding: 4px 6px; font-size: .95rem; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 1rem; font-weight: 800;
}
.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: var(--text-muted); font-weight: 500; padding: 8px 12px;
  border-radius: var(--radius-sm); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); font-size: 1.1rem;
}

/* ---------- Hero (home) & page hero (inner pages) ---------- */
.hero, .page-hero {
  background:
    radial-gradient(900px 300px at 10% -20%, var(--primary-soft), transparent 70%),
    radial-gradient(700px 260px at 95% 0%, var(--accent-soft), transparent 70%);
}
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--text-muted); font-size: 1.12rem; max-width: 640px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 32px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.5rem; color: var(--text); }
.stat span { font-size: .85rem; color: var(--text-muted); }

.page-hero { padding: 44px 0 32px; }
.page-hero h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 6px 0 8px; letter-spacing: -0.02em; line-height: 1.15; }
.page-hero p { margin: 0; color: var(--text-muted); font-size: 1.05rem; max-width: 640px; }
.breadcrumb { font-size: .88rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
  margin-top: -20px;
  position: relative;
}
.toolbar-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1 1 260px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.search-wrap input {
  width: 100%; padding: 11px 38px 11px 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-alt); color: var(--text); font-size: 1rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); font-size: 1.1rem;
  padding: 4px 8px; border-radius: 6px; display: none;
}
.search-clear.show { display: inline-block; }
.search-clear:hover { background: var(--border); color: var(--text); }

.select-wrap { display: flex; align-items: center; gap: 8px; }
.select-wrap label { font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.select-wrap select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-alt); color: var(--text); font-family: inherit; font-size: .95rem;
}
.select-wrap select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); padding: 7px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .count { opacity: .7; margin-left: 4px; font-weight: 400; }

.results-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin: 22px 0 14px; color: var(--text-muted); font-size: .95rem;
}

/* ---------- Service grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.grid + .grid, .grid-bottom { margin-bottom: 60px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: fadeUp .3s ease both;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); text-decoration: none; }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap; letter-spacing: .01em;
  text-decoration: none;
}
a.badge:hover { text-decoration: none; filter: brightness(.95); }
/* Category color coding (default first, named categories override) */
.badge { background: var(--surface-alt); color: var(--text-muted); }
.badge[data-cat="IT & Technology"]       { background: var(--primary-soft); color: var(--primary-dark); }
.badge[data-cat="Data & Analytics"]      { background: var(--accent-soft); color: var(--accent); }
.badge[data-cat="Security & Compliance"] { background: #fdecec; color: #b42323; }
.badge[data-cat="Consulting"]            { background: #fff4e0; color: #a35a00; }
.badge[data-cat="Marketing"]             { background: #f3e8ff; color: #6b21a8; }
@media (prefers-color-scheme: dark) {
  .badge[data-cat="Security & Compliance"] { background: #3d1a1a; color: #ff8a8a; }
  .badge[data-cat="Consulting"]            { background: #3a2a10; color: #ffc46b; }
  .badge[data-cat="Marketing"]             { background: #2d1b45; color: #d5aaff; }
}

.card-desc { margin: 0; color: var(--text-muted); font-size: .95rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: .9rem; }
.card-meta div { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.card-meta svg { width: 16px; height: 16px; flex-shrink: 0; }
.card-meta strong { color: var(--text); font-weight: 600; }
.rating { color: var(--warn); letter-spacing: 1px; }
.card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.card-actions .btn { flex: 1; }

/* Empty state */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted);
}
.empty strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 6px; }

/* ---------- Category cards (home + categories page) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; color: var(--text); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.cat-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.cat-card .cat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; font-weight: 700;
}
.cat-card h3 { margin: 6px 0 0; font-size: 1.08rem; }
.cat-card p { margin: 0; color: var(--text-muted); font-size: .92rem; flex: 1; }
.cat-card .cat-count { font-size: .85rem; color: var(--primary); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: var(--radius); padding: 40px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin: 8px 0 60px;
}
.cta h2 { margin: 0 0 6px; font-size: 1.5rem; }
.cta p { margin: 0; opacity: .92; }
.cta .btn { background: #fff; color: var(--primary-dark); }
.cta .btn:hover { background: #f0f3ff; }

/* ---------- Service detail page ---------- */
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; padding: 36px 0 64px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.25rem; }
.panel h3 { margin: 20px 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.panel p { margin: 0 0 10px; color: var(--text-muted); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: .82rem; color: var(--text-muted); }
.tag:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: .95rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.sticky { position: sticky; top: 84px; }
.panel .btn { width: 100%; margin-top: 8px; }
.price-big { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }

/* ---------- Contact page ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; padding: 36px 0 64px; }
.contact h2 { margin: 0 0 10px; font-size: 1.5rem; letter-spacing: -0.01em; }
.contact p { color: var(--text-muted); margin: 0 0 16px; }
.contact-info { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: var(--text-muted); }
.contact-info li { display: flex; gap: 10px; align-items: flex-start; }
.contact-info svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.contact-info strong { color: var(--text); }

.form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  display: grid; gap: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input, .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-alt); color: var(--text); font-family: inherit; font-size: .95rem;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.field .error { color: var(--danger); font-size: .82rem; display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field.invalid .error { display: block; }
.form-status {
  display: none; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.form-status.show { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 28px 0; color: var(--text-muted); font-size: .9rem;
}
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }

/* Back-to-top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px;
  border-radius: 50%; border: none; background: var(--primary); color: #fff;
  box-shadow: var(--shadow-hover); font-size: 1.2rem; opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive breakpoints ---------- */
@media (max-width: 900px) {
  .contact, .detail { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 720px) {
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 10px 20px 14px; gap: 2px;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-block; }
  .hero { padding: 48px 0 40px; }
  .form-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
  .cta { padding: 28px 22px; }
}
@media (max-width: 420px) {
  .container { padding: 0 16px; }
  .stats { gap: 16px; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
