/* ============================================================
   Facet site chrome: the shared header and footer.

   Sub-pages link this instead of each carrying their own copy.
   Before it existed the nav had drifted into 10 variants and the
   footer into 8 across 20 pages, so any change to either had to be
   made twenty times and never was.

   index.html is deliberately NOT a consumer: it is self-contained by
   design and its nav/footer rules live inline with the rest of its
   system. This file mirrors those rules; when the homepage chrome
   changes, change it here too.

   Scoped to .nav and footer.site only. It sets no page-level styles,
   so a sub-page's own design system is untouched.
   ============================================================ */

:root {
  --chrome-accent: #489c72;
  --chrome-accent-dim: #3f8b64;
  --chrome-nav-h: 68px;
  --chrome-radius: 2px;
  --chrome-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --chrome-ui: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
}

/* ---------- header ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--chrome-nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg, #0a0a0c) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border, #26261f);
}
.nav .inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: var(--container, 1180px);
  margin: 0 auto;
  padding: 0 var(--gutter, 24px);
}
.nav .brand {
  display: flex;
  align-items: center;
  flex: none;
  text-decoration: none;
}
.nav .brand-lockup {
  height: 44px;
  width: auto;
  display: block;
}
.nav .brand-lockup--paper {
  display: none;
}
.nav .brand-lockup--ink {
  display: block;
}
:root[data-theme="dark"] .nav .brand-lockup--ink {
  display: none;
}
:root[data-theme="dark"] .nav .brand-lockup--paper {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .nav .brand-lockup--ink {
    display: none;
  }
  :root:not([data-theme]) .nav .brand-lockup--paper {
    display: block;
  }
}

.nav .links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: auto;
}
.nav .links a {
  font-family: var(--chrome-ui);
  font-size: 14.5px;
  /* No horizontal padding: the 24px gap is the whole spacing, matching the
     homepage nav. Some pages carry an inline padding: 8px 12px from an older
     stylesheet, which added ~216px across nine links and pushed the right-side
     buttons past the container to the viewport edge. This authoritative rule
     loads after those inline styles and overrides them. */
  padding: 0;
  color: var(--text-2, #c9c9c2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.nav .links a:hover {
  color: var(--text-1, #f6f6f4);
}
.nav .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.nav .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border-hi, #3a3a32);
  border-radius: 999px;
  background: transparent;
  color: var(--text-1, #f6f6f4);
  font-family: var(--chrome-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}
.nav .btn:hover {
  border-color: var(--text-3, #9c9c92);
}
.nav .btn.primary {
  background: var(--chrome-accent);
  border-color: var(--chrome-accent);
  color: #08080a;
  font-weight: 600;
}
.nav .btn.primary:hover {
  background: var(--chrome-accent-dim);
  border-color: var(--chrome-accent-dim);
  transform: translateY(-1px);
}
.nav .btn .arrow {
  transition: transform 0.16s ease;
}
.nav .btn:hover .arrow {
  transform: translateX(3px);
}

.nav .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--border-hi, #3a3a32);
  border-radius: var(--chrome-radius);
  background: transparent;
  color: var(--text-2, #c9c9c2);
  cursor: pointer;
}
.nav .theme-toggle:hover {
  color: var(--text-1, #f6f6f4);
}
.nav .theme-toggle svg {
  width: 17px;
  height: 17px;
}
.nav .theme-sun {
  display: none;
}
.nav .theme-moon {
  display: block;
}
:root[data-theme="dark"] .nav .theme-sun {
  display: block;
}
:root[data-theme="dark"] .nav .theme-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .nav .theme-sun {
    display: block;
  }
  :root:not([data-theme]) .nav .theme-moon {
    display: none;
  }
}

.nav .cta-short {
  display: none;
}
@media (max-width: 1120px) {
  .nav .links {
    display: none;
  }
  .nav .inner {
    justify-content: space-between;
  }
  .nav .right {
    margin-left: auto;
  }
}
@media (max-width: 560px) {
  .nav .right .btn:not(.primary) {
    display: none;
  }
}
@media (max-width: 400px) {
  .nav .inner {
    gap: 12px;
    padding: 0 16px;
  }
  .nav .right {
    gap: 8px;
  }
  .nav .cta-long {
    display: none;
  }
  .nav .cta-short {
    display: inline;
  }
  .nav .btn.primary {
    padding: 0 14px;
  }
  .nav .btn .arrow {
    display: none;
  }
  .nav .brand-lockup {
    height: 34px;
  }
  .nav .theme-toggle {
    width: 38px;
    height: 38px;
  }
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border, #26261f);
  padding: 60px 0 38px;
  background: var(--surface, #131313);
}
footer.site .container {
  width: 100%;
  max-width: var(--container, 1180px);
  margin: 0 auto;
  padding: 0 var(--gutter, 24px);
}
footer.site .grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
}
footer.site .lockup {
  margin-bottom: 14px;
}
footer.site .brand-lockup {
  height: 26px;
  width: auto;
  display: block;
}
footer.site .brand-lockup--paper {
  display: none;
}
footer.site .brand-lockup--ink {
  display: block;
}
:root[data-theme="dark"] footer.site .brand-lockup--ink {
  display: none;
}
:root[data-theme="dark"] footer.site .brand-lockup--paper {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) footer.site .brand-lockup--ink {
    display: none;
  }
  :root:not([data-theme]) footer.site .brand-lockup--paper {
    display: block;
  }
}
footer.site .tag-line {
  font-family: var(--chrome-ui);
  font-size: 14.5px;
  color: var(--text-3, #9c9c92);
  line-height: 1.5;
  max-width: 30ch;
}
footer.site .k {
  font-family: var(--chrome-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4, #82827a);
  margin-bottom: 14px;
}
footer.site .col a {
  display: block;
  font-family: var(--chrome-ui);
  font-size: 14.5px;
  color: var(--text-2, #c9c9c2);
  text-decoration: none;
  margin-bottom: 9px;
}
footer.site .col a:hover {
  color: var(--text-1, #f6f6f4);
}
footer.site .fine {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border, #26261f);
  font-family: var(--chrome-mono);
  font-size: 11.5px;
  color: var(--text-4, #82827a);
}
footer.site .fine .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chrome-accent);
  margin-right: 7px;
}
@media (max-width: 900px) {
  footer.site .grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  footer.site .grid {
    grid-template-columns: 1fr;
  }
}
