/* Reset, document defaults 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) + var(--space-5));
  scrollbar-width: thin;
  scrollbar-color: var(--color-line) var(--color-bg);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-selection);
  color: var(--color-ink-strong);
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  font-weight: 700;
}

p,
li,
dd {
  text-wrap: pretty;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

:target {
  scroll-margin-top: calc(var(--header-h) + var(--space-5));
}

/* Layout primitives */

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
}

.section + .section {
  padding-top: 0;
}

.measure {
  max-width: var(--measure);
}

.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;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* Type styles */

.t-display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: 700;
}

.t-h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-h1);
  font-weight: 700;
}

.t-h2 {
  font-size: var(--text-h2);
  line-height: 1.1;
  letter-spacing: var(--tracking-h2);
  font-weight: 650;
}

.t-h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-h3);
  font-weight: 600;
}

.t-lead {
  font-size: var(--text-lead);
  line-height: 1.4;
  letter-spacing: var(--tracking-h3);
  font-weight: 450;
}

.t-small {
  font-size: var(--text-small);
  line-height: 1.45;
}

.t-muted {
  color: var(--color-ink-muted);
}

/* The ■ label: mono, preceded by an 8px orange square */
.label {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-label);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink-muted);
}

.label::before {
  content: "";
  flex: none;
  width: var(--square);
  height: var(--square);
  background: var(--color-accent);
}

.label--plain::before {
  content: none;
}

/* Long-form text (project bodies, legal) */
.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-h3);
  font-weight: 600;
  margin-top: var(--space-7);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h2 + * {
  margin-top: var(--space-3);
}

.prose ul {
  padding: 0;
  list-style: none;
}

.prose li {
  position: relative;
  padding-left: var(--space-5);
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--color-ink);
}

.prose a {
  color: var(--color-accent-text);
  text-underline-offset: 3px;
}

.prose strong {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-property: color, background-color, border-color, opacity !important;
  }
}

.nowrap {
  white-space: nowrap;
}
