/* Varmine base layer: modern reset, base typography, and element defaults.
   References design tokens declared in tokens.css. Loaded after tokens.css
   and before layout/components so element defaults can be overridden later. */

/* ---------------------------------------------------------------------------
   Modern reset
--------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Guard against any element forcing side-scroll across 320..1920px. */
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: var(--font-body);
  font-size: var(--type-body);
  color: var(--color-ink);
  background-color: var(--color-bg);
}

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

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

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

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

address {
  font-style: normal;
}

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

/* Honour reduced-motion for native smooth scrolling as well. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------------------
   Base typography
--------------------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
}

h1 {
  font-size: var(--type-hero);
}

h2 {
  font-size: var(--type-section);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

p {
  max-width: 65ch;
}

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

small,
.caption {
  font-size: var(--type-caption);
  color: var(--color-muted);
}

/* Utility: visually hidden but available to assistive tech. */
.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;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-ink);
  color: var(--color-inverse-ink);
  border-radius: 4px;
}

.skip-link:focus {
  top: var(--space-4);
}
