/**
 * Modern CSS Reset
 * Based on Andy Bell's Modern CSS Reset and Josh Comeau's Custom CSS Reset
 * https://andy-bell.co.uk/a-modern-css-reset/
 * https://www.joshwcomeau.com/css/custom-css-reset/
 */

/* ==========================================
   Box Sizing
   ========================================== */

/* Use a more intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================
   Remove Default Spacing
   ========================================== */

/* Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
}

/* ==========================================
   Root & Body
   ========================================== */

html {
  /* Prevent font size inflation */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  
  /* Smooth scrolling for hash links */
  scroll-behavior: smooth;
}

body {
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Minimum body height */
  min-height: 100vh;
  
  /* Better line heights */
  line-height: 1.5;
}

/* ==========================================
   Typography
   ========================================== */

/* Balance text wrapping on headings */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.2;
}

/* Prevent orphans in paragraphs */
p {
  text-wrap: pretty;
}

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
  font: inherit;
}

/* ==========================================
   Media Elements
   ========================================== */

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* ==========================================
   Lists
   ========================================== */

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* ==========================================
   Interactive Elements
   ========================================== */

/* Remove all animations, transitions and smooth scroll for people who prefer not to see them */
@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;
  }
}

/* Make sure buttons have a pointer cursor */
button,
[type="button"],
[type="reset"],
[type="submit"] {
  cursor: pointer;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  color: inherit;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ==========================================
   Forms
   ========================================== */

/* Remove the inner border and padding in Firefox */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/* Restore the focus styles unset by the previous rule */
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/* Remove the additional :invalid styles in Firefox */
:-moz-ui-invalid {
  box-shadow: none;
}

/* Remove default search input styles */
[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

/* Remove the inner padding in Chrome and Safari on macOS */
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* ==========================================
   Tables
   ========================================== */

/* Collapse border spacing on tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================
   Accessibility
   ========================================== */

/* Create a root stacking context (useful for z-index) */
#root,
#__next {
  isolation: isolate;
}

/* Anything that has been anchored should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}
