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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-body);
  background: var(--color-bg);
  text-rendering: optimizelegibility;
  -webkit-font-smoothing: antialiased;
}

body.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.loading {
  overflow: hidden;
}

body.no-anim * {
  transition-duration: 0ms !important;
  animation-duration: 0ms !important;
}

main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(108 60 251 / 0.65);
  outline: 3px solid color-mix(in srgb, var(--color-primary) 65%, white);
  outline-offset: 2px;
}

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

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

svg {
  height: auto;
}

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

/* Overflow guards for long content */
:where(p, h1, h2, h3, h4, h5, h6, .prose) {
  overflow-wrap: anywhere;
}
