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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-standard);
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
}

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

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

button {
  cursor: pointer;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

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

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

[tabindex="-1"]:focus {
  outline: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-heading);
  line-height: var(--line-height-heading);
}

h1 {
  font-size: clamp(2.25rem, 8vw, var(--font-size-4xl));
  letter-spacing: -0.03em;
  max-width: var(--measure-heading);
}

h2 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: -0.02em;
  max-width: var(--measure-heading);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1rem;
}

p {
  max-width: var(--measure-body);
  margin: 0;
}


/* Base element normalization */
ul,
ol {
  margin-block: 0;
}

button {
  border: 0;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

::selection {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}


/* Text safety */
button,
input,
textarea,
select,
a,
h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}
