/* ==========================================================================
   Base
   Minimal reset and base element styling. Depends on tokens.css.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Scrollbar (Firefox): transparent track, brand-purple thumb */
  scrollbar-width: thin;
  scrollbar-color: var(--color-brand) transparent;
}

/* Scrollbar (WebKit): 8px, transparent track, purple pill thumb, lighter on hover */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-brand);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--color-brand), white 22%);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Media defaults */
img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Headings */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: inherit;
}

/* Lists marked as role="list" drop their markers and indentation */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-brand-dark);
}

/* Form controls inherit typography */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

/* Accessible focus outline */
:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen-reader-only helper (visually hidden, still announced) */
.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;
}
