html {
    font-size: 16px
}

* { 
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


body {
    font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    display: flex;
    align-items: center;
    justify-content: center;
}


article { 
  margin-bottom: 5rem;

p,
dl,
ol,
ul {
    font-size: 1.2rem;
    line-height: 1.7rem;
}

dt:not(:first-child),
li:not(:first-child) {
    margin-top: 0.25rem;
}

li { 
  margin-left: 1rem;
}


h1 {
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
    line-height: 1;
}

h2 {
    font-style: italic;
    font-weight: 400;
    margin-top: 2.1rem;
    margin-bottom: 1.4rem;
    font-size: 2.2rem;
    line-height: 1;
}

h3 {
    font-style: italic;
    font-weight: 400;
    font-size: 1.7rem;
    margin-top: 2rem;
    margin-bottom: 1.4rem;
    line-height: 1;
}

hr {
    display: block;
    height: 1px;
    width: 55%;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

p {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-right: 0;
    vertical-align: baseline;
}
}

article {
  padding: 0 1rem;
  margin-top: 1rem;
}


.center { 
  max-width: 40rem
}

ol, ul { 
  padding-left: 1rem;
}

code { 
  font-size: 0.8rem;
}


/* Links: replicate underline that clears descenders */
a:link,
a:visited {
    color: inherit;
}

.no-tufte-underline:link {
    background: unset;
    text-shadow: unset;
}

a:link, .tufte-underline, .hover-tufte-underline:hover {
    text-decoration: none;
    background: -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(currentColor, currentColor);
    background: linear-gradient(#fffff8, #fffff8), linear-gradient(#fffff8, #fffff8), linear-gradient(currentColor, currentColor);
    -webkit-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    -moz-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    background-repeat: no-repeat, no-repeat, repeat-x;
    text-shadow: 0.03em 0 #fffff8, -0.03em 0 #fffff8, 0 0.03em #fffff8, 0 -0.03em #fffff8, 0.06em 0 #fffff8, -0.06em 0 #fffff8, 0.09em 0 #fffff8, -0.09em 0 #fffff8, 0.12em 0 #fffff8, -0.12em 0 #fffff8, 0.15em 0 #fffff8, -0.15em 0 #fffff8;
    background-position: 0% 93%, 100% 93%, 0% 93%;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    a:link, .tufte-underline, .hover-tufte-underline:hover {
        background-position-y: 87%, 87%, 87%;
    }
}


a:link::selection,
a:link::-moz-selection {
    text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
    background: #b4d5fe;
}

#navbar { 

  ul {
    padding: 0 5rem;
    height: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  li { 
    text-decoration: none;
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
  }

  a { 
    all: unset;
    color: #bbb;
    font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    transition: color 500ms ease-in-out;
  }

  a.active { 
    color: #555;
    font-weight: bold;
  }

  a:hover { 
    cursor: pointer;
    color: black;
  }
}


/* Adds dark mode */
@media (prefers-color-scheme: dark) {
   body { 
    background-color: #151515;
    color: #aaa;
   }

    a:link, .tufte-underline, .hover-tufte-underline:hover {
        text-shadow: 0.03em 0 #151515, -0.03em 0 #151515, 0 0.03em #151515, 0 -0.03em #151515, 0.06em 0 #151515, -0.06em 0 #151515, 0.09em 0 #151515, -0.09em 0 #151515, 0.12em 0 #151515, -0.12em 0 #151515, 0.15em 0 #151515, -0.15em 0 #151515;
    }


    #navbar {
      a.active { 
        color: #ddd;
        font-weight: bold;
      }

      a:hover { 
        color: white;
      }
    }
}

ul.references { 

  margin-bottom: 2rem;

  line-height: 1.4;
  list-style: none;

  li { 
    margin-top: 0.5rem;
  }

  p { 
    font-size: 0.95rem;
  }
  
  li:target { 
    background-color: #f2f6db;
  }
}

blockquote {
  margin-left: 1rem;

  p:first-child{ 
    display: inline;
  }

  p { 
    font-size: 1.4rem;
    font-style: italic;
  }

  .quote-source {
    font-weight: bold;
    margin-top: 0px;
    
  }
  .quote-source::before {
    content: "— ";
  }
}

blockquote::before {
    font-size: 2em;
    color: gray;
    content: "\201C";
}
