/* Minimal reset + typographic defaults. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, dl, dd, figure, blockquote,
pre, fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

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

:focus-visible {
  outline: 2px solid var(--sg-hero-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Document */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--sg-nav-height) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--sg-white);
  color: var(--sg-ink);
  font-family: var(--sg-font-body);
  font-size: var(--sg-size-body);
  font-weight: var(--sg-w-regular);
  line-height: var(--sg-lh-relaxed);
  min-height: 100vh;
}

/* Default heading register */
h1, h2, h3, h4, h5, h6 {
  color: var(--sg-ink);
  font-family: var(--sg-font-display);
  font-weight: var(--sg-w-bold);
  line-height: var(--sg-lh-tight);
}

h1 {
  font-size: var(--sg-size-h1);
  font-weight: var(--sg-w-black);
  letter-spacing: var(--sg-ls-display);
  line-height: var(--sg-lh-display);
}

h2 {
  font-size: var(--sg-size-h2);
  letter-spacing: var(--sg-ls-tight);
  line-height: var(--sg-lh-tight);
}

h3 {
  font-size: var(--sg-size-h3);
  letter-spacing: var(--sg-ls-snug);
}

h4 {
  font-size: var(--sg-size-h4);
}

p {
  color: var(--sg-steel);
  line-height: var(--sg-lh-relaxed);
}

a:hover {
  text-decoration: underline;
}

/* Selection */
::selection {
  background-color: var(--sg-hero-blue);
  color: var(--sg-white);
}

/* Visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link. Fully off-screen until focused. The previous -40px wasn't
   enough because the element is ~43px tall, so ~3px of the dark
   background was peeking out as a "black bar" in the top-left. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: calc(var(--sg-z-nav) + 1);
  padding: 8px 16px;
  background: var(--sg-ink);
  color: var(--sg-white);
  border-radius: var(--sg-radius-md);
  font-weight: var(--sg-w-semibold);
  transition: top var(--sg-duration) var(--sg-ease);
}

.skip-link:focus {
  top: 16px;
}
