@import url('https://rsms.me/inter/inter.css');

:root {
    --main-bg-color: #fcfffc;
    --alt-bg-color: #B0F2CD;
    --highlight-color: #d3f1e8;
    --main-text-color: black;
    --alt-text-color: darkslategray;
    --accent: #055829;
    --link-color: rgb(15, 91, 48);
    --link-color-opaque: rgba(15, 91, 48, 0.2);
}

::selection {
    background-color: var(--highlight-color);
}

html {
    font-size: 100%;
}

body {
    margin: 0 auto;
    width: 85%;
    max-width: 60rem;
    line-height: 1.5;
    padding: 4rem 1rem;
    color: var(--main-text-color);
    background-color: var(--main-bg-color);
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
}

nav ul, footer ul {
    padding: 0;
    list-style: none;
    font-weight: bold;
}

nav ul li, footer ul li {
    display: inline;
    margin-right: 2rem;
}

h1 {
    font-size: 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
}

article {
    padding: 0;
    position: relative;
}

article.tufte {
    margin: 0;
    width: 60%;
}

article.center {
    margin: 0 auto;
    width: 70%;
}

img {
    max-width: 100%;
}

.sidenote, .marginnote {
    float: right;
    clear: right;
    margin-right: -60%;
    width: 50%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
}

blockquote {
    border-left: 4px solid var(--accent);
    padding: 0 15px;
    color: var(--alt-text-color);
    margin-inline-start: 0rem;
    margin-inline-end: 0rem;
}

blockquote> :first-child {
    margin-top: 0;
}

blockquote> :last-child {
    margin-bottom: 0;
}

code {
    margin: 0 2px;
    padding: 0 5px;
    white-space: nowrap;
    border: 1px solid #eaeaea;
    background-color: white;
    border-radius: 3px;
    font-size: 1.2em;
}

pre {
    overflow: auto;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    margin: 0;
    padding: 0;
    white-space: pre;
    border: none;
    background: transparent;
    background-color: transparent;
    border: none;
}

.highlight pre {
    border: 1px solid #cccccc;
    border-left: 2px solid var(--accent);
    overflow: auto;
    padding: 6px 10px;
    border-radius: 3px;
}

dt {
    font-weight: bold;
}

dd {
    font-style: italic;
}

table {
    width: 50%;
    border-collapse: collapse;
    margin: 0 auto;
}

th {
    border-bottom: 2px solid var(--accent);
}

/* CSS for link hovering */

a, a:link, a:visited {
    color: var(--link-color);
    position: relative;
    z-index: 1;
    text-decoration: none;
    -webkit-transition: all 0.4s;
    -moz-transition: all 0.4s;
    -o-transition: all 0.4s;
    transition: all 0.4s;
}

a:active {
    color: var(--main-bg-color);
    background-color: var(--accent);
    text-decoration: none;
}

a::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--link-color-opaque);
    transform-origin: bottom center;
    transform: scaleY(0.1);
    transition: all 0.2s ease-in-out;
}

a:hover::before {
    z-index: -1;
    transform: scaleY(1);
    background-color: var(--link-color-opaque);
}

@media screen and (max-width: 500px) {
  .sidenote, .marginnote {
    visibility: hidden;
    display: none;
  }

  body {
    width: 90%;
    padding: 1rem;
  }

  article.tufte, article.center {
    width: 90%;
    margin: 0 auto;
  }

  nav ul {
    text-align: center;
  }
  nav ul li {
    display: inline-block;
    margin: 0 1rem;
  }
}
