/* styles/reset.css
   Modern CSS reset and small design tokens
   Based on modern-css-reset, Josh Comeau's reset ideas, and common best-practices.
*/

/* Design tokens (minor): tweak to taste */
:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --radius: 8px;
  --content-width: 65ch;
}

/* Box sizing
   Make every element use border-box which is easier to reason about. */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Remove default margins */
:where(html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
  margin: 0;
}

/* Set core root defaults */
html {
  line-height: 1.5; /* better default */
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  block-size: 100%;
}

/* Allow percentage heights */
body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: inherit;
}

/* Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Make form elements inherit font & remove default button styles */
input, button, textarea, select {
  font: inherit;
}

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

/* Anchor defaults */
a {
  color: inherit;
  text-decoration: none;
}

/* Accessibility focus outline (simple, visible) */
:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 2px;
}

/* Remove built-in form validation styles in Firefox */
:-moz-focusring { outline: none; }

/* Hide elements until they are needed */
[hidden] { display: none !important; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* Utility: visually hidden but accessible */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Small sensible defaults for common layout primitives */
.container {
  width: 100%;
  max-width: min(100%, 80rem);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Constrain long text for readability */
.prose {
  max-width: var(--content-width);
}

/* Ensure interactive form controls are reachable on small screens */
button, a[role="button"], input[type="button"], input[type="submit"] {
  touch-action: manipulation;
}

/* Lightweight utilities end */
