/* Reset, document defaults, and the layout primitives every section uses. */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/*
 * The smooth-scroll script drives window.scrollTo itself. When it is running it
 * sets this flag, because native smooth scrolling and a lerped scroll fight each
 * other and the result stutters.
 */
html.has-smooth-scroll { scroll-behavior: auto; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg, video, canvas { display: block; max-width: 100%; }

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: none; cursor: pointer; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

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

/* Layout primitives ------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: var(--container-narrow); }

.section {
  position: relative;
  z-index: var(--z-content);
  padding-block: var(--space-3xl);
}

.section--tight { padding-block: var(--space-2xl); }

.section__head {
  display: grid;
  gap: var(--space-m);
  margin-bottom: var(--space-2xl);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* The rule that trails every eyebrow, sized to whatever room is left. */
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.eyebrow--plain::after { display: none; }

.title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 22ch;
  text-wrap: balance;
}

.title--wide { max-width: 30ch; }

.lede {
  font-size: var(--step-1);
  color: var(--text-soft);
  max-width: var(--measure);
  line-height: 1.55;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

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

.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: var(--z-overlay);
  padding: var(--space-2xs) var(--space-s);
  background: var(--text);
  color: var(--ink);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* Wide content must scroll inside itself, never push the page sideways. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
