/* PivotalPoint — shared shell.
   Design tokens, layout grid, header and footer. Page-specific styles stay in
   the page. The header and footer markup that consumes this lives in
   partials/ and is injected at build time by build.py. */

:root {
  --paper: #F7F7F4;
  --ink: #14171A;
  --muted: #5A6066;
  --hairline: #D9D9D3;
  --carmine: #A8212E;
  --max: 1120px;
  --gutter: 24px;
  --sans: 'Switzer', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Fragment Mono', 'SF Mono', Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--carmine); color: var(--paper); }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--carmine); outline-offset: 3px; }

/* ---------- layout ---------- */

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
}

.section-head {
  border-top: 1px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-head h2,
.section-head .count {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.section-head .count { color: var(--muted); }

/* ---------- header ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.wordmark .mark { display: block; color: var(--ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--carmine); }

.nav-links a.is-active { color: var(--ink); }

.nav-links .nav-cta {
  color: var(--paper);
  background: var(--ink);
  padding: 9px 15px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-links .nav-cta:hover,
.nav-links .nav-cta:focus-visible {
  background: var(--carmine);
  color: var(--paper);
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--ink);
  padding: 22px 0 56px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-inner nav { display: flex; flex-wrap: wrap; gap: 22px; }

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-inner a:hover,
.footer-inner a:focus-visible { color: var(--carmine); }

/* ---------- header collapse ----------
   Links drop in order of redundancy: Contact goes first because the CTA does
   its job, then the section links, leaving the mark and the one action. */

@media (max-width: 820px) {
  .nav-links { gap: 18px; font-size: 0.68rem; }
  .nav-links .nav-contact { display: none; }
  .nav-links .nav-cta { padding: 8px 12px; }
  .wordmark { font-size: 0.95rem; }
}

@media (max-width: 600px) {
  .nav-inner { padding: 12px var(--gutter); }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links .nav-cta { padding: 9px 13px; font-size: 0.7rem; }
}

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