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

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

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

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

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

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

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

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* 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;
}

/* 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;
}

/* Compositions */
/*
WRAPPER COMPOSITION
A common wrapper/container
*/
.wrapper {
  margin-inline: auto;
  max-width: clamp(16rem, var(--wrapper-max-width, 100vw), 80rem);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
}

/*
FLOW COMPOSITION
Like the Every Layout stack: https://every-layout.dev/layouts/stack/
Info about this implementation: https://piccalil.li/quick-tip/flow-utility/
*/
.flow > * + * {
  margin-top: var(--flow-space, 1em);
}

/*
REPEL
A little layout that pushes items away from each other where
there is space in the viewport and stacks on small viewports

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-s-m)): This defines the space
between each item.

--repel-vertical-alignment How items should align vertically.
Can be any acceptable flexbox alignment value.
*/
.repel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: var(--repel-vertical-alignment, center);
  gap: var(--gutter, var(--space-s-m));
}

/*
VISUALLY HIDDEN UTILITY
Info: https://piccalil.li/quick-tip/visually-hidden/
*/
.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

/* Styles start */
:root {
  --color-bg: #000;
  --color-text: #fff;
  --color-primary: #2fcc71;
  --font-primary:
    -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui,
    helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica,
    arial, sans-serif;
  --gutter: 1.5rem;
  --gutter-xs: 0.35rem;
  --gutter-s: 0.8rem;
  --gutter-m: 2rem;
  --gutter-l: 4rem;
  --wrapper-max-width: 50rem;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  line-height: 1.4;
  font-size: 1.25rem;
  padding-block: var(--gutter-m);
}

article {
  margin-block-start: var(--gutter-l);
}

dl {
  --flow-space: var(--gutter-m);

  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--gutter-s) var(--gutter-xs);
}

dt {
  font-weight: bold;
  color: var(--color-primary);
}

footer {
  font-size: 0.85rem;
  margin-block-start: var(--gutter-l);
}

.button {
  --button-bg: var(--color-primary);
  --button-color: var(--color-bg);
  --button-hover-bg: var(--color-bg);
  --button-hover-color: #ffffff;
  --button-border-width: 3px;
  --button-border-style: solid;
  --button-border-color: var(--color-primary);
  --button-radius: 0.25em;

  display: inline-flex;
  align-items: center;
  gap: var(--button-gap, 0.5em);
  padding: var(--button-padding, 0.5em 1.2em);

  background: var(--button-bg);
  color: var(--button-color);

  border-width: var(--button-border-width);
  border-style: var(--button-border-style);
  border-color: var(--button-border-color);
  border-radius: var(--button-radius);

  text-decoration: none;
  font-weight: var(--button-font-weight, 700);
  font-size: var(--button-font-size, 1em);
  letter-spacing: 0.05ch;
  font-family: sans-serif;
  line-height: 1.1; /* Set or buttons will be different sizes (<a>/<button>) */

  cursor: pointer;
}

.button:hover {
  background: var(--button-hover-bg);
  color: var(--button-hover-color);
}

.button:focus {
  outline-width: var(--button-outline-width, var(--button-border-width));
  outline-style: var(--button-outline-style, var(--button-border-style));
  outline-color: var(--button-outline-color, var(--button-border-color));
  outline-offset: var(
    --button-outline-offset,
    calc(var(--button-border-width) * 2)
  );
}

.button:active {
  transform: scale(99%);
}


::selection {
  background: var(--color-primary);
  color: var(--color-bg);
}
