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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-paper);
  overflow-x: hidden;
}

main {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

section {
  flex: 1 1 auto;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', system-ui, 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

h1 {
  font-size: 29px;
  line-height: 1.14;
}

h2 {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 18px;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 8px;
}

p {
  font-size: 17px;
  line-height: 1.65;
}

p + p {
  margin-top: 12px;
}

a {
  color: var(--color-ember-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-glow);
  outline-offset: 2px;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
}

input {
  font: inherit;
}

code {
  font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  font-size: 15px;
}

@media (min-width: 768px) {
  h1 {
    font-size: 40px;
  }
  h2 {
    font-size: 32px;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 48px;
    line-height: 1.12;
  }
  h2 {
    font-size: 34px;
  }
  h3 {
    font-size: 22px;
  }
}
