/* TrackIQ — shared site styles (homepage + MCP) */

:root {
  /* Palettes */
  --bg: #FBF9F4;
  --bg-alt: #F3EFE6;
  --surface: #FFFFFF;
  --ink: #0E1116;
  --ink-2: #2A2F38;
  --muted: #6E7582;
  --hair: #E9E4D8;
  --hair-strong: #D9D2BF;

  --accent: #2563EB;
  --accent-ink: #1E3A8A;
  --accent-soft: #E4ECFF;
  --accent-pale: #F2F6FF;

  /* MCP accent — teal, used sparingly on /mcp surfaces */
  --teal: #0D9488;
  --teal-ink: #0B6F65;
  --teal-soft: #D1F1ED;
  --teal-pale: #ECF8F6;

  --amber: #D4A017;
  --rust:  #B8542A;
  --moss:  #4A6B3A;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16,18,24,.04), 0 1px 0 rgba(16,18,24,.02);
  --shadow-md: 0 10px 30px -12px rgba(16,18,24,.18), 0 2px 6px rgba(16,18,24,.05);
  --shadow-xl: 0 40px 60px -20px rgba(16,18,24,.22), 0 10px 20px -10px rgba(16,18,24,.10);

  --container: 1240px;
  --gutter: 28px;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Inter", sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

/* Subtle paper grain */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* === Typography === */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; display: inline-block; width: 22px; height: 1px;
  background: var(--ink); opacity: .7;
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.teal { color: var(--teal-ink); }
.eyebrow.teal::before { background: var(--teal); opacity: 1; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 500; }
h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(46px, 6.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
h1 em { font-style: italic; color: var(--accent-ink); }
h1.teal em { color: var(--teal-ink); }

h2.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h2.display em { font-style: italic; color: var(--accent-ink); }
h2.display.teal em { color: var(--teal-ink); }

h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 500; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.small { font-size: 14px; color: var(--muted); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 500; font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 6px 18px -6px rgba(16,18,24,.35);
}
.btn-primary:hover { background: #000; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hair-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn-link {
  color: var(--ink);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.btn-arrow::after { content: "→"; font-weight: 400; transition: transform .2s; }
.btn-arrow:hover::after { transform: translateX(3px); }

/* === Nav === */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--hair); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  gap: 28px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.logo b { color: var(--accent); font-weight: 500; }
.logo-mcp {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
}
.logo-mcp-suffix {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--teal-ink);
  background: var(--teal-pale);
  padding: 3px 7px;
  border-radius: 4px;
  font-weight: 500;
}
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-size: 14.5px; color: var(--ink-2);
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 500; }
.nav-cta { display: flex; gap: 10px; align-items: center; }

.nav-new-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  background: var(--teal);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
}

/* MCP subnav (under main nav on /mcp/* pages) */
.subnav {
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
}
.subnav-inner {
  display: flex; gap: 4px; align-items: center;
  padding: 12px 0;
  overflow-x: auto;
}
.subnav-inner a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.subnav-inner a:hover { color: var(--ink); background: var(--bg-alt); }
.subnav-inner a.active {
  background: var(--teal-pale);
  color: var(--teal-ink);
}
.subnav-mcp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 18px;
  margin-right: 6px;
  border-right: 1px solid var(--hair);
}

/* === Footer === */
footer.site-footer {
  border-top: 1px solid var(--hair);
  padding: 72px 0 48px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .logo { font-size: 18px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 30ch; margin-top: 14px; }
.footer-col h5 {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px; font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--ink-2); }
.footer-col a:hover { color: var(--ink); }
.footer-col a .pill {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .1em; background: var(--teal); color: #fff;
  padding: 1px 5px; border-radius: 3px; margin-left: 6px;
}
.footer-bottom {
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 13px;
}
.footer-badges {
  margin-top: 20px;
  display: flex; gap: 12px; align-items: center;
  color: var(--muted); font-size: 12px;
  font-family: var(--font-mono);
}
.footer-badges span {
  padding: 4px 10px; border: 1px solid var(--hair); border-radius: 4px;
}

section { padding: 100px 0; }
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: end; margin-bottom: 56px;
}
.section-head .eyebrow { margin-bottom: 18px; }
.section-head-single { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head-single .eyebrow { justify-content: center; margin-bottom: 20px; }
.section-head-single .eyebrow::before { display: none; }

@media (max-width: 1024px) {
  .section-head { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  section { padding: 64px 0; }
}
