:root {
  --white: #fffafa;
  --rich-black: #252525;
  --light-grey: #b3b8bc;
  --red: #e84f64;
  --code: rgba(0, 0, 0, 0.1);
}

/* -- GENERAL STYLES -- */

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2em;
  line-height: 1.4em;
}

section {
  margin-top: 10vh;
}

h1,
h2,
h3 {
  text-align: center;
  line-height: 1.4em;
}

a {
  text-decoration: none;
}

img {
  width: 100%;
  height: auto;
}

/* Code in text */
p > code,
li > code,
dd > code,
td > code,
blockquote > code {
  background: var(--code);
  word-wrap: break-word;
  box-decoration-break: clone;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  font-family: monospace;
}

pre {
  clear: both;
  background: var(--code);
  padding: 0;
  tab-size: 2;
  word-break: normal;
  hyphens: none;
  overflow: hidden;
  font-size: 0.8rem;
  overflow-x: scroll;
  max-width: 100%;
  min-width: 100px;
  line-height: 1em;
}

.red-text {
  color: var(--red);
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.full {
  width: auto;
  height: 100vh;
}

.column {
  columns: 2;
}

.smaller-text {
  font-size: 0.8em;
}

#title {
  border: 5px solid #000000;
  padding: 5vh 5vw;
  text-align: center;
  margin-top: 20vh;
}

/* -- NAV -- */

nav {
  display: flex;
  justify-content: flex-end;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--rich-black);
  z-index: 1;
}

nav ul {
  display: flex;
  margin-right: 3em;
  list-style-type: none;
}

nav ul li {
  display: block;
  padding: 0 1em;
}

nav a {
  color: var(--light-grey);
  text-decoration: none;
}

nav a:hover,
nav a:focus {
  text-decoration: underline;
}

/* -- MAIN GRID -- */

.grid {
  display: grid;
  grid-template-columns:
    [viewport-start] minmax(1em, 1fr)
    [container-start] minmax(0, min(80%, 800px)) [container-end]
    minmax(1em, 1fr) [viewport-end];
}

.item--contained {
  grid-column: container;
}

.item--full {
  grid-column: viewport;
  display: inherit;
  grid-template-columns: inherit;
}

.item--full > * {
  grid-column: container;
}

/* -- WORK CARDS -- */

.cards {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
}

.card {
  display: flex;
  flex-direction: column;
  flex: 1 0 20%;
  min-width: 200px;
  max-width: 300px;
  margin: 0 0 1rem 1rem;
  border: 2px solid black;
}

.card a,
.card a:visited,
.card a:hover,
.card a:active {
  color: inherit;
}

.card:hover,
.card:focus-within {
  border: 2px solid var(--red);
  color: var(--red);
  box-shadow: 1px 1px 8px 1px var(--rich-black);
}

.card_content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
}

.card_text {
  text-align: center;
  max-width: calc(100% - 30px);
  font-weight: 600;
}

.card_description {
  text-align: center;
  padding: 5px 15px;
  border-top: 1px solid var(--dark-grey);
  color: #000000;
}

/* -- FOOTER -- */

footer {
  background-color: var(--rich-black);
  color: var(--white);
  margin-top: 20vh;
}

@media (max-width: 480px) {
  nav {
    align-items: center;
    justify-content: space-around;
  }

  nav ul {
    margin-right: 1.5em;
  }

  nav ul li {
    padding: 0 0.8em;
  }
}

@media (prefers-reduced-motion) {
  html {
    scroll-behavior: auto;
  }
}
