/**
 * CompCode design system — the site's shared chrome.
 *
 * Before this file the site ran two design systems in production. The teal /
 * Inter system on the homepage, pricing, blog, use-cases and comparisons; and
 * an older blue (#3b82f6) / system-ui system on docs, about, changelog,
 * privacy, terms and security. Since /docs sits in the primary nav, clicking
 * it from the homepage landed the visitor on what looked like a different,
 * older product. This file is the single source for tokens, reset, header,
 * footer, tags and buttons so that can't drift apart again.
 *
 * Scope: shared chrome only. Page-specific layout (article grid, TOC, pricing
 * table, docs sidebar) stays with its page or template.
 *
 * Loaded as /assets/compcode.css. The marketing site has no build step, so
 * this is a plain stylesheet with no preprocessing.
 */

/* ── reset ─────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 151, 178, 0.28);
  color: #fff;
}

/* ── tokens ────────────────────────────────────────────────────────────── */

:root {
  --bg: #0d0e10;
  --bg-1: #111214;
  --bg-2: #16181b;
  --bg-3: #1c1f23;

  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);

  --teal-100: #c2eef5;
  --teal-200: #7ad8e6;
  --teal-300: #2bb8cf;
  --teal: #0097b2;
  --teal-600: #0a7e95;
  --teal-glow: rgba(0, 151, 178, 0.18);

  --fg: #ececee;
  --fg-2: #c8c9cd;
  --fg-3: #8a8c92;
  --fg-4: #5e6068;
  --fg-5: #3e4046;

  /* Accents used by type tags and comparison art. Named by role, not hue, so
     a page never reaches for a raw hex. */
  --accent-warn: #fbb168;
  --accent-ok: #86efac;
  --accent-alt: #c4b5fd;
  --accent-info: #93c5fd;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 64px;
  --container: 1200px;
}

/* ── base ──────────────────────────────────────────────────────────────── */

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: "cv11", "ss01";
  line-height: 1.6;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

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

.mono {
  font-family: var(--mono);
  font-feature-settings: "zero", "ss01";
}

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

/* ── header ────────────────────────────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(13, 14, 16, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.logo-mark::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #fff;
  opacity: 0.95;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 50%, 50% 100%, 0 100%);
}

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

.nav a {
  font-size: 13.5px;
  color: var(--fg-3);
  font-weight: 450;
  transition: color 0.15s;
}

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

.nav a[aria-current="page"] {
  color: var(--fg);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fg);
  color: #0d0e10 !important;
  padding: 7px 14px;
  border-radius: 7px;
  font-weight: 550 !important;
  font-size: 13px !important;
  transition: background 0.15s;
}

.nav-cta:hover {
  background: #fff;
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: #fff;
  color: #0d0e10;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
  background: var(--teal-100);
}

.btn-secondary {
  background: var(--bg-2);
  color: var(--fg);
  border-color: var(--line-2);
}

.btn-secondary:hover {
  border-color: var(--teal-600);
  background: var(--bg-3);
}

/* ── type tags ─────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--fg-3);
  background: var(--bg-1);
}

.tag-post {
  border-color: rgba(122, 216, 230, 0.3);
  color: var(--teal-200);
  background: rgba(0, 151, 178, 0.08);
}

.tag-comparison {
  border-color: rgba(251, 146, 60, 0.3);
  color: var(--accent-warn);
  background: rgba(251, 146, 60, 0.07);
}

.tag-category {
  border-color: rgba(168, 139, 250, 0.3);
  color: var(--accent-alt);
  background: rgba(168, 139, 250, 0.07);
}

.tag-report {
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--accent-ok);
  background: rgba(74, 222, 128, 0.07);
}

.tag-case-study {
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--accent-info);
  background: rgba(96, 165, 250, 0.07);
}

.tag-use-case {
  border-color: rgba(122, 216, 230, 0.3);
  color: var(--teal-200);
  background: rgba(0, 151, 178, 0.08);
}

/* ── eyebrow ───────────────────────────────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--teal-200);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.eyebrow .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-300);
  box-shadow: 0 0 10px var(--teal-300);
}

/* ── footer ────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 56px;
  margin-bottom: 48px;
}

.footer-brand-block .logo {
  margin-bottom: 16px;
}

.footer-tag {
  font-size: 13.5px;
  color: var(--fg-3);
  margin-bottom: 20px;
  max-width: 28ch;
  line-height: 1.5;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-3);
}

.footer-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-300);
  box-shadow: 0 0 8px var(--teal-300);
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--fg-3);
  margin-bottom: 10px;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--fg-5);
  flex-wrap: wrap;
  gap: 12px;
}

/* ── responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nav {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .container,
  .header-inner {
    padding: 0 20px;
  }
}

/* Respect a reduced-motion preference: every transition here is decorative. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
