/* 3737 North Capital — base styles, typography and layout primitives. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; height: auto; }
img { font-style: italic; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--track-heading);
  color: var(--text);
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }
ul, ol { margin: 0; padding: 0; }
[role="list"] { list-style: none; }
figure, blockquote { margin: 0; }
address { font-style: normal; }
strong { font-weight: 600; }

a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--slate); transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease); }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

::selection { background: var(--ink); color: var(--chart); }

/* ---------- Type styles ---------- */
.display, .h1, .h2, .h3, .h4 { font-family: var(--font-sans); font-weight: 600; color: var(--text); text-wrap: balance; }
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
}
.h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: var(--track-display); }
.h2 { font-size: var(--fs-h2); line-height: 1.06; letter-spacing: -0.035em; }
.h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.02em; }
.h4 { font-size: var(--fs-h4); line-height: 1.35; letter-spacing: -0.01em; }

/* Thin accent inside a headline — Onest 200, as CAPITAL is set in the logo. One phrase, sparingly. */
.display .thin, .h1 .thin, .h2 .thin, .h3 .thin {
  font-weight: 200;
  letter-spacing: -0.035em;
  color: var(--slate);
}

.lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--text); max-width: 40rem; letter-spacing: -0.01em; }
.body-2 { color: var(--text-2); }
.small { font-size: var(--fs-small); }
.muted { color: var(--text-2); }
.measure { max-width: var(--measure); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* Labels: Geist Mono, the way a survey map annotates */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-2);
  line-height: 1.4;
}
/* A bearing: coordinate + section name, e.g. 37°38′ N · Philosophy */
.label .bearing { color: var(--text); }
/* The north mark: a small red triangle — the needle's tip */
.label--north::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.75rem;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.prose p, .prose ul, .prose ol { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { margin-top: 2em; font-size: var(--fs-h4); line-height: 1.35; letter-spacing: -0.01em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--slate); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }
.section + .section { padding-top: 0; }

/* Section head: bearing label in the left rail, headline and intro to the right */
.section-head { margin-bottom: var(--s-6); row-gap: var(--s-3); }
.section-head__label { grid-column: 1 / span 3; padding-top: 0.75em; }
.section-head__body { grid-column: 4 / span 8; }
.section-head__body > * + * { margin-top: var(--s-3); }

.stack > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-5); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--chart);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus, .skip-link:hover { top: 1rem; color: var(--chart); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Entrance animation (JS adds .js to <html>) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal].is-instant { transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
