/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}
*:focus-visible {
  --outline-size: max(2px, 0.15em);
  --outline-color: var(--clr-primary-20);
  --outline-style: solid;
  --outline-width: 2px;
  outline: var(--outline-width, var(--outline-size)) var(--outline-style)
    var(--outline-color);
  outline-offset: var(--outline-offset, var(--outline-size));
  border: 2px solid var(--clr-primary-100);
}

html {
  height: 100vh;
  background-color: var(--clr-white);
  color-scheme: light;
  accent-color: var(--clr-primary-100);
  /* Prevent font size inflation */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
  background-color: var(--clr-white);
  padding-bottom: 3rem;
  font-size-adjust: from-font;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
  padding: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul,
ol {
  list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
label {
  line-height: 1.1;
}

input {
  line-height: 1.5;
  color: var(--clr-neutral-160);
}

input::placeholder {
  text-align: start;
}
input::placeholder-shown {
  color: var(--clr-neutral-160);
}

a[role='button'] {
  cursor: pointer;
}

/* [dir='rtl'] input {
	margin-inline-end: 1.25rem;
} */
[dir='rtl'] input {
  text-align: end;
}

[dir='rtl'] input::placeholder {
  text-align: end;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: pretty;
}

p,
ul,
ol,
li {
  line-height: 1.5;
  text-wrap: pretty;
  word-break: break-word;
}

h4 {
  font-size: var(--step-2);
}

/* Button Default */
button {
  display: inline-flex;
  background-color: transparent;
  border: none;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

a {
  /* Relatively sized thickness and offset */
  text-decoration-thickness: max(0.08em, 1px);
  text-underline-offset: 0.15em;
  align-items: center;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: var(--clr-secondary-140);
  cursor: pointer;
  &:hover {
    background-color: var(--clr-secondary-5);
    text-decoration: none;
    cursor: pointer;
    transition-duration: var(--transition-duration);
  }
}

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

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

/*Code elements */
:is(code, kbd, samp) {
  font-family: var(--ff-mono);
  hyphens: none;
  tab-size: 2;
  text-align: left;
  word-spacing: normal;
  word-wrap: normal;
  box-decoration-break: clone;
  font-weight: var(--font-medium);
}

td pre,
td code {
  word-break: break-all;
  font-size: var(--step-0);
  width: fit-content;
}
pre:has(code),
kbd {
  display: block;
  white-space: pre-wrap;
  background-color: var(--clr-neutral-5);
  border: 1px solid var(--clr-neutral-160);
  padding: 0.5rem;
  align-items: flex-start;
  border-radius: 0.25rem;
  width: auto;
  overflow-wrap: break-word;
}

kbd {
  display: inline;
  padding: 0.25rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
    0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
}

@supports not (font-size-adjust: from-font) {
  :is(code, kbd, samp) {
    font-size: 0.8em;
  }
}
/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

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

@-ms-viewport {
  width: device-width;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
  }
}

/* Dark Mode Setting */
/* @media (prefers-color-scheme: dark) {
	html {
		background-color: var(--clr-neutral-160);
		color: var(--clr-white);
		border-color: var(--clr-secondary-10);
	}
	a {
		color: var(--clr-white);
	}
} */
