/* =============================================================
   Klerix — Design System
   Pure CSS. No frameworks. No gradients. No shadows.
   ============================================================= */

:root {
  /* Color */
  --ink: #0A0A0B;
  --graphite: #1F2024;
  --carbon: #4A4B50;
  --mist: #8A8B90;
  --line: #E2E1DC;
  --line-soft: #ECEAE3;
  --paper: #F4F1EA;
  --snow: #FFFFFF;
  --clay: #C2522D;
  --clay-ink: #7A2F18;
  --clay-soft: #F1DCCF;
  --forest: #1F5A45;
  --forest-soft: #DCE7E1;
  --amber: #9A6B14;
  --crimson: #8C2B22;

  /* Type */
  --font-sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing (4px scale) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px; --s-11: 80px; --s-12: 96px;
  --s-13: 128px; --s-14: 160px;

  /* Radius */
  --r-0: 0px;
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-pill: 999px;

  /* Layout */
  --container: 1280px;
  --container-narrow: 880px;
  --gutter: 32px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 120ms;
  --t-med: 200ms;
  --t-slow: 320ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container.narrow { max-width: var(--container-narrow); }

.section { padding: var(--s-12) 0; }
.section.tight { padding: var(--s-10) 0; }
.section.airy { padding: var(--s-14) 0 var(--s-13); }
.section--paper { background: var(--paper); }
.section--snow { background: var(--paper); border-top: 0; border-bottom: 0; }
.section--ink  { background: var(--ink); color: var(--paper); }
.section--ink .section-eyebrow,
.section--ink .lede { color: var(--mist); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--paper); }

.grid { display: grid; gap: var(--s-7); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .section { padding: var(--s-10) 0; }
  .section.airy { padding: var(--s-11) 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
  color: var(--ink);
}
h1, .display { font-size: clamp(40px, 6vw, 80px); line-height: 1.02; font-weight: 600; letter-spacing: -0.035em; }
h2, .display-2 { font-size: clamp(32px, 4vw, 56px); line-height: 1.05; letter-spacing: -0.03em; }
h3 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; }
h4 { font-size: 20px; line-height: 1.3; }
h5 { font-size: 16px; line-height: 1.4; }
p  { margin: 0 0 var(--s-4); }
.lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--carbon); max-width: 60ch; }
.kicker { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; color: var(--graphite); }
.eyebrow, .section-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--carbon);
  margin-bottom: var(--s-5);
}
.eyebrow::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; background: var(--clay); border-radius: var(--r-pill);
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: -0.01em; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; }
.muted { color: var(--carbon); }
.dim { color: var(--mist); }
.accent { color: var(--clay-ink); }
.tabular { font-variant-numeric: tabular-nums; }

a.link { color: var(--ink); border-bottom: 1px solid var(--ink); transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
a.link:hover { color: var(--clay-ink); border-bottom-color: var(--clay-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--ink);
  border-radius: var(--r-2);
  background: var(--ink); color: var(--paper);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--graphite); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--clay { background: var(--clay); border-color: var(--clay); color: var(--snow); }
.btn--clay:hover { background: var(--clay-ink); border-color: var(--clay-ink); }
.btn--lg { padding: 16px 22px; font-size: 15px; }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.btn .arrow { transition: transform var(--t-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-7);
}
.card--bare { background: transparent; border: 1px solid var(--line); }
.card--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card--ink h3, .card--ink h4 { color: var(--paper); }
.card--clay { background: var(--clay-soft); border-color: var(--clay-soft); }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }

/* Pills / Badges / Tags */
.pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--snow);
  color: var(--carbon);
}
.pill--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill--clay { background: var(--clay-soft); color: var(--clay-ink); border-color: var(--clay-soft); }
.pill--forest { background: var(--forest-soft); color: var(--forest); border-color: var(--forest-soft); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--clay); }
.dot--forest { background: var(--forest); }
.dot--amber { background: var(--amber); }
.dot--crimson { background: var(--crimson); }
.dot--mist { background: var(--mist); }

.badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--carbon);
  background: var(--paper);
}

/* ---------- Top bar / Nav ---------- */
.topbar {
  background: var(--ink); color: var(--paper);
  font-size: 12px; font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
}
.topbar a { color: var(--paper); border-bottom: 1px solid transparent; }
.topbar a:hover { border-bottom-color: var(--paper); }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(8px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav-left { display: flex; align-items: center; gap: var(--s-9); }
.nav-links { display: flex; align-items: center; gap: var(--s-7); }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--carbon);
  letter-spacing: -0.005em;
  transition: color var(--t-fast) var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: var(--s-3); }
.nav-toggle { display: none; }

.logo {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-sans); font-weight: 600;
  font-size: 18px; letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-img {
  display: block; height: 24px; width: auto;
}
/* Recolor the brand wordmark to paper/light on dark surfaces */
.footer .logo-img,
.logo[style*="--paper"] .logo-img {
  filter: brightness(0) invert(1);
}
.logo-mark {
  width: 22px; height: 22px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
}
.logo-mark span { background: var(--ink); }
.logo-mark span:nth-child(2),
.logo-mark span:nth-child(4),
.logo-mark span:nth-child(8) { background: var(--clay); }
.logo-mark span:nth-child(6) { background: transparent; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-2);
  }
  .nav-right .btn { display: none; }
  .nav.is-open .nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: var(--s-5) var(--gutter);
    gap: var(--s-4);
  }
  .nav.is-open .nav-links a { padding: var(--s-2) 0; border-bottom: 1px solid var(--line-soft); }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--s-12) 0 var(--s-12);
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: var(--s-6); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: var(--s-8);
  color: var(--carbon); font-size: 13px; font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.hero-meta b { color: var(--ink); font-weight: 500; }

/* ---------- Logo wall ---------- */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.logo-wall .lw {
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-7) var(--s-4);
  font-family: var(--font-sans); font-weight: 600;
  letter-spacing: -0.02em; font-size: 18px;
  color: var(--carbon);
  border-right: 1px solid var(--line);
}
.logo-wall .lw:last-child { border-right: 0; }
@media (max-width: 960px) {
  .logo-wall { grid-template-columns: repeat(2, 1fr); }
  .logo-wall .lw { border-bottom: 1px solid var(--line); }
  .logo-wall .lw:nth-child(2n) { border-right: 0; }
}

/* ---------- Metric blocks ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-3);
  background: var(--snow);
  overflow: hidden;
}
.metric { padding: var(--s-7); border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-num { font-family: var(--font-sans); font-size: clamp(36px, 4.5vw, 56px); font-weight: 600; letter-spacing: -0.035em; color: var(--ink); line-height: 1; }
.metric-num .unit { font-size: 0.5em; color: var(--carbon); font-weight: 500; margin-left: 4px; }
.metric-label { margin-top: var(--s-3); font-size: 13px; color: var(--carbon); }
@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- Feature grid / Bento ---------- */
.feature {
  padding: var(--s-7);
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.feature h3 { font-size: 22px; margin: 0; }
.feature p { margin: 0; color: var(--carbon); }
.feature .icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-2);
}

.bento {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(160px, auto);
}
.bento .b { background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-7); display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-4); }
.bento .b--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bento .b--clay { background: var(--clay-soft); border-color: var(--clay-soft); }
.bento .b-3 { grid-column: span 3; }
.bento .b-4 { grid-column: span 4; }
.bento .b-2 { grid-column: span 2; }
.bento .b-6 { grid-column: span 6; }
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr; }
  .bento .b-2, .bento .b-3, .bento .b-4, .bento .b-6 { grid-column: span 1; }
}

/* ---------- Section header ---------- */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-9);
  align-items: end; margin-bottom: var(--s-10);
}
.section-head h2 { margin: 0; }
@media (max-width: 960px) {
  .section-head { grid-template-columns: 1fr; gap: var(--s-5); margin-bottom: var(--s-8); }
}

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding: var(--s-12) 0 var(--s-7); }
.footer h5 { color: var(--paper); font-size: 12px; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); margin: 0 0 var(--s-5); }
.footer a { color: var(--paper); display: inline-block; padding: 6px 0; font-size: 14px; color: rgba(244, 241, 234, 0.78); }
.footer a:hover { color: var(--snow); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: var(--s-9); }
.footer-brand { max-width: 28ch; }
.footer-brand p { color: rgba(244, 241, 234, 0.6); font-size: 14px; }
.footer-col { display: flex; flex-direction: column; }
.footer-bottom {
  margin-top: var(--s-10); padding-top: var(--s-6);
  border-top: 1px solid rgba(244, 241, 234, 0.12);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4);
  font-size: 12px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(244, 241, 234, 0.5);
}
.footer-bottom a { color: rgba(244, 241, 234, 0.5); padding: 0; }
.footer-bottom a:hover { color: var(--snow); }
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: span 2; }
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label { font-size: 13px; font-weight: 500; color: var(--graphite); }
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--snow);
  color: var(--ink);
  font-size: 14px;
  transition: border-color var(--t-fast) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--ink); outline-offset: 2px;
  border-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; font-family: var(--font-body); }
.field .hint { font-size: 12px; color: var(--mist); }
.form-grid { display: grid; gap: var(--s-5); }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .form-grid.cols-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: var(--s-4) var(--s-4); text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-weight: 500; font-size: 13px; color: var(--carbon); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.table tr:last-child td { border-bottom: 0; }

/* Comparison table */
.compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden;
}
.compare th, .compare td { padding: var(--s-5) var(--s-5); text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.compare thead th { background: var(--paper); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--carbon); }
.compare th + th, .compare td + td { border-left: 1px solid var(--line); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare .check { color: var(--forest); font-weight: 600; }
.compare .x { color: var(--mist); }

/* ---------- Pricing ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.tier { background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-8); display: flex; flex-direction: column; gap: var(--s-5); }
.tier--feature { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tier--feature h3, .tier--feature .price { color: var(--paper); }
.tier--feature .tier-list li::before { background: var(--clay); }
.tier h3 { font-size: 22px; margin: 0; }
.tier .price { font-size: 44px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.tier .price small { font-size: 14px; font-weight: 500; color: var(--carbon); margin-left: 6px; }
.tier--feature .price small { color: var(--mist); }
.tier-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.tier-list li { font-size: 14px; padding-left: 22px; position: relative; color: var(--carbon); }
.tier--feature .tier-list li { color: rgba(244, 241, 234, 0.78); }
.tier-list li::before {
  content: ""; width: 8px; height: 8px; background: var(--ink); border-radius: var(--r-pill);
  position: absolute; left: 4px; top: 8px;
}
@media (max-width: 960px) { .tiers { grid-template-columns: 1fr; } }

/* ---------- FAQ accordion ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-6) 0; text-align: left;
  font-size: 18px; font-weight: 500; color: var(--ink);
  font-family: var(--font-sans); letter-spacing: -0.01em;
}
.faq-q .plus { width: 20px; height: 20px; position: relative; flex: none; }
.faq-q .plus::before, .faq-q .plus::after {
  content: ""; position: absolute; background: var(--ink);
  transition: transform var(--t-med) var(--ease);
}
.faq-q .plus::before { top: 9px; left: 0; right: 0; height: 1.5px; }
.faq-q .plus::after  { left: 9px; top: 0; bottom: 0; width: 1.5px; }
.faq-item.is-open .plus::after { transform: scaleY(0); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height var(--t-slow) var(--ease);
}
.faq-item.is-open .faq-a { max-height: 600px; }
.faq-a-inner { padding: 0 0 var(--s-6); color: var(--carbon); max-width: 70ch; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-7); flex-wrap: wrap; }
.tab {
  padding: var(--s-3) var(--s-4);
  font-size: 14px; font-weight: 500; color: var(--carbon);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Workflow diagram ---------- */
.workflow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-4);
  align-items: stretch;
}
.workflow .step {
  background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  position: relative;
}
.workflow .step .n {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--mist); text-transform: uppercase;
}
.workflow .step h4 { margin: 0; font-size: 16px; }
.workflow .step p { font-size: 13px; color: var(--carbon); margin: 0; }
.workflow .step::after {
  content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--mist);
}
.workflow .step:last-child::after { content: none; }
@media (max-width: 960px) {
  .workflow { grid-template-columns: 1fr; }
  .workflow .step::after { content: "↓"; right: 50%; top: auto; bottom: -22px; transform: translateX(50%); }
}

/* ---------- Audit trail timeline ---------- */
.trail { display: flex; flex-direction: column; gap: 0; font-family: var(--font-mono); font-size: 13px; }
.trail .row { display: grid; grid-template-columns: 110px 110px 1fr 80px; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.trail .ts { color: var(--mist); }
.trail .step-name { color: var(--ink); }
.trail .target { color: var(--carbon); }
.trail .ok { color: var(--forest); text-align: right; }
.trail .warn { color: var(--amber); text-align: right; }
.trail .row:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .trail .row { grid-template-columns: 90px 1fr 70px; }
  .trail .target { display: none; }
}

/* ---------- Code block ---------- */
.code {
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  padding: var(--s-6);
  border-radius: var(--r-3);
  overflow-x: auto;
  border: 1px solid var(--ink);
}
.code .c-key { color: #E0B777; }
.code .c-str { color: #C5D4A8; }
.code .c-com { color: #8A8B90; font-style: italic; }
.code .c-fn { color: #C2522D; }
.code .c-num { color: #E0B777; }

/* ---------- Testimonial ---------- */
.quote {
  background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--s-9);
}
.quote blockquote {
  margin: 0;
  font-family: var(--font-serif); font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.3; color: var(--ink); font-style: italic;
  letter-spacing: -0.01em;
}
.quote cite { display: block; margin-top: var(--s-6); font-style: normal; font-size: 14px; color: var(--carbon); }
.quote cite b { color: var(--ink); font-weight: 500; }

/* ---------- Side-by-side prose ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-10); align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; gap: var(--s-7); } }

/* ---------- CTA block ---------- */
.cta {
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-3);
  padding: var(--s-11);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-9);
  align-items: end;
}
.cta h2 { color: var(--paper); margin: 0; }
.cta .lede { color: rgba(244, 241, 234, 0.7); margin: 0; }
.cta .actions { display: flex; gap: var(--s-3); justify-content: flex-end; flex-wrap: wrap; }
.cta .btn--secondary { color: var(--paper); border-color: var(--paper); }
.cta .btn--secondary:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 960px) { .cta { grid-template-columns: 1fr; padding: var(--s-8); } .cta .actions { justify-content: flex-start; } }

/* ---------- Page header ---------- */
.page-head {
  padding: var(--s-12) 0 var(--s-10);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { max-width: 22ch; }
.page-head .lede { margin-top: var(--s-5); }

/* ---------- Sidebar nav (docs) ---------- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--s-10); padding: var(--s-10) 0; }
.docs-side { position: sticky; top: 100px; align-self: start; }
.docs-side h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); margin: var(--s-6) 0 var(--s-3); }
.docs-side a {
  display: block; padding: 6px 0; font-size: 14px; color: var(--carbon);
  border-left: 2px solid transparent; padding-left: var(--s-3); margin-left: -10px;
}
.docs-side a:hover { color: var(--ink); }
.docs-side a.is-active { color: var(--ink); border-left-color: var(--ink); }
.docs-main h2 { margin-top: var(--s-9); }
.docs-main h2:first-child { margin-top: 0; }
.docs-main p, .docs-main ul, .docs-main ol { max-width: 70ch; color: var(--carbon); }
.docs-main ul { padding-left: 20px; }
.docs-main code { font-family: var(--font-mono); font-size: 0.9em; background: var(--paper); padding: 2px 6px; border-radius: var(--r-1); border: 1px solid var(--line); }
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; gap: var(--s-7); }
  .docs-side { position: static; }
}

/* ---------- Auth (login / signup) ---------- */
.auth-shell {
  min-height: calc(100vh - 68px);
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-form { padding: var(--s-12); display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.auth-aside { background: var(--ink); color: var(--paper); padding: var(--s-12); display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: var(--paper); }
.auth-aside .lede { color: rgba(244, 241, 234, 0.7); }
@media (max-width: 960px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Dashboard preview ---------- */
.dash {
  background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden;
  display: grid; grid-template-columns: 220px 1fr;
}
.dash-side { background: var(--paper); border-right: 1px solid var(--line); padding: var(--s-5); }
.dash-side h6 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); margin: var(--s-5) 0 var(--s-2); }
.dash-side a { display: block; padding: 6px 8px; font-size: 13px; color: var(--carbon); border-radius: var(--r-1); }
.dash-side a.is-active { background: var(--ink); color: var(--paper); }
.dash-main { padding: var(--s-7); display: flex; flex-direction: column; gap: var(--s-5); }
.dash-stat { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-2); }
.dash-stat .s { padding: var(--s-5); border-right: 1px solid var(--line); }
.dash-stat .s:last-child { border-right: 0; }
.dash-stat .s .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.dash-stat .s .l { font-size: 12px; color: var(--carbon); margin-top: 4px; }
@media (max-width: 720px) { .dash { grid-template-columns: 1fr; } .dash-side { display: none; } .dash-stat { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Integrations grid ---------- */
.int-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--snow);
}
.int {
  padding: var(--s-7);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.int:nth-child(4n) { border-right: 0; }
.int-name { font-weight: 500; font-size: 16px; }
.int-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); }
@media (max-width: 960px) { .int-grid { grid-template-columns: repeat(2, 1fr); } .int:nth-child(4n) { border-right: 1px solid var(--line); } .int:nth-child(2n) { border-right: 0; } }

/* ---------- Job listing ---------- */
.job { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--s-5); padding: var(--s-6) 0; border-bottom: 1px solid var(--line); align-items: center; }
.job h4 { margin: 0; font-size: 18px; }
.job .meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--carbon); }
@media (max-width: 720px) { .job { grid-template-columns: 1fr; gap: var(--s-2); } }

/* ---------- Changelog ---------- */
.change { display: grid; grid-template-columns: 200px 1fr; gap: var(--s-7); padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.change .v { font-family: var(--font-mono); font-size: 13px; color: var(--carbon); letter-spacing: 0.04em; }
.change .v b { display: block; color: var(--ink); font-size: 18px; font-family: var(--font-sans); letter-spacing: -0.02em; margin-bottom: 4px; }
.change h3 { margin-top: 0; }
.change ul { padding-left: 20px; color: var(--carbon); }
@media (max-width: 720px) { .change { grid-template-columns: 1fr; gap: var(--s-3); } }

/* ---------- Blog ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-7); }
.post { display: flex; flex-direction: column; gap: var(--s-3); border-top: 1px solid var(--ink); padding-top: var(--s-5); }
.post .post-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--carbon); display: flex; gap: var(--s-3); }
.post h3 { margin: 0; font-size: 22px; line-height: 1.25; }
.post p { color: var(--carbon); margin: 0; }
.post a.read { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--ink); align-self: flex-start; }
@media (max-width: 960px) { .posts { grid-template-columns: 1fr; } }

/* ---------- Customer cards ---------- */
.case { background: var(--snow); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-9); display: flex; flex-direction: column; gap: var(--s-5); }
.case .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.case .stat-row .v { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.case .stat-row .l { font-size: 12px; color: var(--carbon); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); margin-top: 4px; }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack.lg { gap: var(--s-6); }
.mt-0 { margin-top: 0; } .mt-3 { margin-top: var(--s-3); } .mt-5 { margin-top: var(--s-5); } .mt-7 { margin-top: var(--s-7); } .mt-9 { margin-top: var(--s-9); }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: var(--s-10) 0; }
.no-wrap { white-space: nowrap; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Nav dropdowns ---------- */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-item .nav-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--carbon);
  letter-spacing: -0.005em;
  transition: color var(--t-fast) var(--ease);
}
.nav-item .nav-trigger .caret {
  font-size: 10px; color: var(--mist);
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-item:hover .nav-trigger,
.nav-item .nav-trigger:focus-visible,
.nav-item.is-open .nav-trigger { color: var(--ink); }
.nav-item:hover .nav-trigger .caret,
.nav-item.is-open .nav-trigger .caret { color: var(--ink); transform: rotate(180deg); }
.nav-item .nav-trigger.is-active { color: var(--ink); }

.nav-menu {
  position: absolute;
  top: calc(100% + 10px); left: -16px;
  min-width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-3);
  display: grid; gap: 2px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
  z-index: 60;
}
.nav-menu--wide { min-width: 360px; }
.nav-item:hover .nav-menu,
.nav-item.is-open .nav-menu,
.nav-item:focus-within .nav-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
}
/* Hover bridge so menu doesn't close on the gap */
.nav-item::after {
  content: ""; position: absolute; left: 0; right: 0;
  top: 100%; height: 14px;
}
.nav-menu a {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--r-1);
  color: var(--ink);
  transition: background var(--t-fast) var(--ease);
}
.nav-menu a:hover { background: var(--line-soft); }
.nav-menu .nav-menu-head {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carbon);
  padding: 6px var(--s-3) 10px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  margin-bottom: 4px;
}
.nav-menu .nav-menu-head:hover { background: transparent; color: var(--ink); }
.nav-menu .nm-text { display: grid; gap: 2px; }
.nav-menu .nm-text b { font-size: 14px; font-weight: 600; color: var(--ink); }
.nav-menu .nm-text em { font-style: normal; font-size: 12.5px; color: var(--carbon); }

/* Product mark used in dropdown */
.nm-logo {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  background-color: var(--ink);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 62%;
  position: relative;
}
.nm-logo::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
}

@media (max-width: 960px) {
  .nav-item, .nav-item .nav-trigger { display: block; width: 100%; }
  .nav-item .nav-trigger { padding: var(--s-2) 0; }
  .nav-menu {
    position: static; opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; box-shadow: none; border: 0; padding: 0 0 var(--s-4) var(--s-4);
    background: transparent; min-width: 0;
    display: none;
  }
  .nav-item.is-open .nav-menu { display: grid; }
  .nav-item::after { display: none; }
  .nav-item .nav-trigger .caret { float: right; }
}

/* ---------- Product feature pages (logos &amp; hero marks) ---------- */
.product-mark {
  width: 88px; height: 88px;
  border-radius: 20px;
  background-color: var(--ink);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 56%;
  position: relative;
  overflow: hidden;
}
.product-mark::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}
.product-mark > span { display: none; }

.product-card {
  display: grid; gap: var(--s-5);
  padding: var(--s-7);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.product-card:hover { border-color: var(--ink); }
.product-card .pc-head { display: flex; align-items: center; gap: var(--s-5); }
.product-card .pc-mark {
  flex: none; width: 56px; height: 56px; border-radius: 14px;
  background-color: var(--ink);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 58%;
  font-size: 0;
}

/* Shared SVG marks across all three sizes ---------------------- */
.nm-logo--atlas, .product-mark--atlas, .pc-mark--atlas {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F4F1EA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='16' cy='16' r='10'/><path d='M6 16h20'/><path d='M16 6c3.5 3 3.5 17 0 20'/><path d='M16 6c-3.5 3-3.5 17 0 20'/></svg>");
}
.nm-logo--sentinel, .product-mark--sentinel, .pc-mark--sentinel {
  background-color: var(--forest);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F4F1EA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 4l10 4v8c0 6-4 10-10 12-6-2-10-6-10-12V8l10-4z'/><path d='M11 16l4 4 7-8'/></svg>");
}
.nm-logo--forge, .product-mark--forge, .pc-mark--forge {
  background-color: var(--clay);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F4F1EA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='8' r='3' fill='%23F4F1EA'/><circle cx='24' cy='8' r='3'/><circle cx='8' cy='24' r='3'/><circle cx='24' cy='24' r='3' fill='%23F4F1EA'/><path d='M11 8h10M8 11v10M24 11v10M11 24h10'/></svg>");
}
.nm-logo--pulse, .product-mark--pulse, .pc-mark--pulse {
  background-color: var(--amber);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F4F1EA' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 17h5l3-9 5 18 3-11 2 5h8'/></svg>");
}
.nm-logo--vault, .product-mark--vault, .pc-mark--vault {
  background-color: var(--graphite);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F4F1EA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='6' y='14' width='20' height='14' rx='2'/><path d='M10 14V9a6 6 0 0112 0v5'/><circle cx='16' cy='20' r='1.8' fill='%23F4F1EA'/><path d='M16 21.5v2.5'/></svg>");
}
.product-card h3 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.product-card .pc-tag {
  font-size: 12px; font-family: var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--carbon);
}
.product-card ul { margin: 0; padding-left: var(--s-5); color: var(--carbon); }
.product-card ul li { margin: 4px 0; }
.product-card .pc-cta {
  font-size: 13px; font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink); align-self: flex-start;
}

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