
:root {
  --bg: #ffffff;
  --text: #000;
  --shadow: #d4d4d4;
  --success: #aee6b0;
  --error: #ffc2d8;
  --spacing: 1rem;
  --border-width: 1px;
  --border-radius: 0.5rem;
  --container-width: 800px;
}

/* 
 * A slightly modified version of Andy Bell's "A (more) Modern CSS Reset"
 * https://piccalil.li/blog/a-more-modern-css-reset/ 
*/

/* 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;
  background-color: var(--bg);
  color: var(--text);
}

/* 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,
video {
  max-width: 100%;
  height: auto; /* Maintain aspect ratio */
  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;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/AtkinsonHyperlegibleNextVF-Variable.woff2")
    format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("/assets/fonts/SortsMillGoudy-Regular.woff2") format("woff2");
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-weight: 400;
  font-size: 125%;
}

strong {
  font-weight: 600;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Sorts Mill Goudy", system-ui, serif;
  letter-spacing: -0.06em;
}

h1 {
  font-size: 4.5rem;
  text-align: center;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 2rem;
}

@media (width < 800px) {
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 2rem;
  }
  header a {
    font-size: 1rem;
  }
}

main {
  margin-bottom: var(--spacing);
}

main * + * {
  margin-top: 1em;
  margin-bottom: 0;
}

.page-container {
  min-height: 100vh;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--spacing);
  display: flex;
  flex-direction: column;
}

.title {
  border-bottom: var(--border-width) solid var(--text);
  padding-bottom: 2rem;
  & + * {
    margin-top: var(--spacing);
  }
}

header {
  border-bottom: var(--border-width) solid var(--text);
  ul {
    display: flex;
    gap: var(--spacing);
    justify-content: space-between;
    align-content: end;
    padding-inline: var(--spacing);
  }
  li {
    text-align: center;
  }
  a {
    text-decoration: none;

    &[aria-current="page"]::after {
      content: "•";
      display: block;
      text-align: center;
      margin-top: -0.75em;
      margin-bottom: -1em;
    }

    &[aria-current="true"]::after {
      content: "◦";
      display: block;
      text-align: center;
      margin-top: -0.75em;
      margin-bottom: -1em;
    }
  }
}

footer {
  border-top: var(--border-width) solid var(--text);
  text-align: center;
  margin-top: auto;
  padding: var(--spacing);
}

/* same width as var(--container-width) */
@media (width > 800px) {
  .card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing);
    .card + .card {
      margin: 0;
    }
    .card:last-child {
      grid-column: 1 / 3;
    }
  }
}

.card {
  border-radius: var(--border-radius);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0px 0px 15px var(--shadow);
  * {
    margin: 0;
  }
  li {
    margin-top: 0.5em;
  }
  li::marker {
    content: "- ";
  }
}

.button {
  color: currentColor;
  display: block;
  text-transform: uppercase;
  text-align: center;
  font-weight: 600;
}

form {
  width: 100%;
  margin: calc(var(--spacing) * 3) auto;
  :is(label, input, textarea) {
    display: block;
    width: 100%;
  }
  label {
    font-weight: 600;
  }
  input,
  textarea {
    margin-top: 0;
  }
  .button {
    border: 0;
    background-color: var(--text);
    color: var(--bg);
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition:
      background-color 100ms,
      color 100ms;
    &:hover {
      background-color: var(--shadow);
      color: var(--text);
    }
  }
}

[data-status]:not([data-status=""]) {
  margin-inline: auto;
  padding: var(--spacing);
  border-radius: var(--border-radius);

  @media (width > 800px) {
    text-align: center;
  }

  &[data-status="success"] {
    background-color: var(--success);
  }

  &[data-status="error"] {
    background-color: var(--error);
  }
}

