/* ==========================================================================
   Base: reset, document typography, links, focus. Element selectors only.
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Headings: softer teal-grey and semibold rather than near-black bold, so pages feel calmer. */
h1,
h2,
h3,
h4 {
  color: var(--color-heading);
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p,
li {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

ul,
ol {
  padding-left: var(--space-5);
}

a {
  color: var(--color-primary-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-5);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.925em;
}

code {
  background: var(--color-surface-sunken);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* After navigation Blazor moves focus to the page's h1 (FocusOnNavigate) so screen readers announce the new page.
   The heading isn't interactive, so it doesn't need a visible focus ring. */
h1:focus {
  outline: none;
}
